Bug 860370 - Undo functionality change from bug 848973. r=roc

This commit is contained in:
Cameron McCormack 2013-04-11 18:40:12 +10:00
parent 32a375aae4
commit e7b3448f80
4 changed files with 16 additions and 1 deletions

View File

@ -3565,6 +3565,7 @@ nsCSSFrameConstructor::ConstructFrameFromItemInternal(FrameConstructionItem& aIt
// If we need to create a block formatting context to wrap our
// kids, do it now.
const nsStyleDisplay* maybeAbsoluteContainingBlockDisplay = display;
nsIFrame* maybeAbsoluteContainingBlock = newFrame;
nsIFrame* possiblyLeafFrame = newFrame;
if (bits & FCDATA_CREATE_BLOCK_WRAPPER_FOR_ALL_KIDS) {
@ -3584,6 +3585,7 @@ nsCSSFrameConstructor::ConstructFrameFromItemInternal(FrameConstructionItem& aIt
// positioned, otherwise the former.
const nsStyleDisplay* blockDisplay = blockContext->StyleDisplay();
if (blockDisplay->IsPositioned(blockFrame)) {
maybeAbsoluteContainingBlockDisplay = blockDisplay;
maybeAbsoluteContainingBlock = blockFrame;
}
@ -3616,7 +3618,11 @@ nsCSSFrameConstructor::ConstructFrameFromItemInternal(FrameConstructionItem& aIt
} else if (!(bits & FCDATA_SKIP_ABSPOS_PUSH)) {
nsIFrame* cb = maybeAbsoluteContainingBlock;
cb->AddStateBits(NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN);
if (cb->IsPositioned()) {
if ((maybeAbsoluteContainingBlockDisplay->IsAbsolutelyPositionedStyle() ||
maybeAbsoluteContainingBlockDisplay->IsRelativelyPositionedStyle() ||
(maybeAbsoluteContainingBlockDisplay->HasTransformStyle() &&
cb->IsFrameOfType(nsIFrame::eSupportsCSSTransforms))) &&
!cb->IsSVGText()) {
aState.PushAbsoluteContainingBlock(cb, absoluteSaveState);
}
}

View File

@ -0,0 +1,4 @@
<!DOCTYPE html>
<div style="overflow: auto; position: static; width: 200px; height: 200px; display: -moz-box">
<input type="button" value="Hello" style="position: absolute; width: 100%; height: 100%">
</div>

View File

@ -0,0 +1,4 @@
<!DOCTYPE html>
<div style="overflow: auto; position: relative; width: 200px; height: 200px; display: -moz-box">
<input type="button" value="Hello" style="position: absolute; width: 100%; height: 100%">
</div>

View File

@ -1754,3 +1754,4 @@ skip-if(B2G) == 818276-1.html 818276-1-ref.html
== 848421-1.html 848421-1-ref.html
test-pref(layout.css.flexbox.enabled,true) == 849407-1.html 849407-1-ref.html
== 858803-1.html 858803-1-ref.html
!= 860370.html 860370-notref.html