Backed out 2 changesets (bug 1815552) for causing Bp-hybrid bustages at ComputedStyle.h on a CLOSED TREE
Backed out changeset da0f9295df91 (bug 1815552) Backed out changeset cda1ee891058 (bug 1815552)
This commit is contained in:
@@ -2080,10 +2080,11 @@ nsIFrame* nsCSSFrameConstructor::ConstructTable(nsFrameConstructorState& aState,
|
||||
|
||||
// Process children
|
||||
nsFrameConstructorSaveState absoluteSaveState;
|
||||
const nsStyleDisplay* display = outerComputedStyle->StyleDisplay();
|
||||
|
||||
// Mark the table frame as an absolute container if needed
|
||||
newFrame->AddStateBits(NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN);
|
||||
if (newFrame->IsAbsPosContainingBlock()) {
|
||||
if (display->IsAbsPosContainingBlock(newFrame)) {
|
||||
aState.PushAbsoluteContainingBlock(newFrame, newFrame, absoluteSaveState);
|
||||
}
|
||||
|
||||
@@ -2116,14 +2117,21 @@ nsIFrame* nsCSSFrameConstructor::ConstructTable(nsFrameConstructorState& aState,
|
||||
return newFrame;
|
||||
}
|
||||
|
||||
static void MakeTablePartAbsoluteContainingBlock(
|
||||
nsFrameConstructorState& aState, nsFrameConstructorSaveState& aAbsSaveState,
|
||||
nsContainerFrame* aFrame) {
|
||||
static void MakeTablePartAbsoluteContainingBlockIfNeeded(
|
||||
nsFrameConstructorState& aState, const nsStyleDisplay* aDisplay,
|
||||
nsFrameConstructorSaveState& aAbsSaveState, nsContainerFrame* aFrame) {
|
||||
// If we're positioned, then we need to become an absolute containing block
|
||||
// for any absolutely positioned children.
|
||||
aFrame->AddStateBits(NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN);
|
||||
if (aFrame->IsAbsPosContainingBlock()) {
|
||||
// for any absolutely positioned children and register for post-reflow fixup.
|
||||
//
|
||||
// Note that usually if a frame type can be an absolute containing block, we
|
||||
// always set NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN, whether it actually is or
|
||||
// not. However, in this case flag serves the additional purpose of indicating
|
||||
// that the frame was registered with its table frame. This allows us to avoid
|
||||
// the overhead of unregistering the frame in most cases.
|
||||
if (aDisplay->IsAbsPosContainingBlock(aFrame)) {
|
||||
aFrame->AddStateBits(NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN);
|
||||
aState.PushAbsoluteContainingBlock(aFrame, aFrame, aAbsSaveState);
|
||||
nsTableFrame::RegisterPositionedTablePart(aFrame);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2154,7 +2162,8 @@ nsIFrame* nsCSSFrameConstructor::ConstructTableRowOrRowGroup(
|
||||
InitAndRestoreFrame(aState, content, aParentFrame, newFrame);
|
||||
|
||||
nsFrameConstructorSaveState absoluteSaveState;
|
||||
MakeTablePartAbsoluteContainingBlock(aState, absoluteSaveState, newFrame);
|
||||
MakeTablePartAbsoluteContainingBlockIfNeeded(aState, aDisplay,
|
||||
absoluteSaveState, newFrame);
|
||||
|
||||
nsFrameConstructorSaveState floatSaveState;
|
||||
aState.MaybePushFloatContainingBlock(newFrame, floatSaveState);
|
||||
@@ -2253,7 +2262,8 @@ nsIFrame* nsCSSFrameConstructor::ConstructTableCell(
|
||||
InitAndRestoreFrame(aState, content, newFrame, cellInnerFrame);
|
||||
|
||||
nsFrameConstructorSaveState absoluteSaveState;
|
||||
MakeTablePartAbsoluteContainingBlock(aState, absoluteSaveState, newFrame);
|
||||
MakeTablePartAbsoluteContainingBlockIfNeeded(aState, aDisplay,
|
||||
absoluteSaveState, newFrame);
|
||||
|
||||
nsFrameConstructorSaveState floatSaveState;
|
||||
aState.MaybePushFloatContainingBlock(cellInnerFrame, floatSaveState);
|
||||
@@ -2509,7 +2519,7 @@ nsIFrame* nsCSSFrameConstructor::ConstructDocElementFrame(
|
||||
processChildren = true;
|
||||
|
||||
contentFrame->AddStateBits(NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN);
|
||||
if (contentFrame->IsAbsPosContainingBlock()) {
|
||||
if (display->IsAbsPosContainingBlock(contentFrame)) {
|
||||
state.PushAbsoluteContainingBlock(contentFrame, contentFrame,
|
||||
absoluteSaveState);
|
||||
}
|
||||
@@ -2546,7 +2556,8 @@ nsIFrame* nsCSSFrameConstructor::ConstructDocElementFrame(
|
||||
state, aDocElement,
|
||||
state.GetGeometricParent(*display, mDocElementContainingBlock),
|
||||
mDocElementContainingBlock, computedStyle, &contentFrame, frameList,
|
||||
contentFrame->IsAbsPosContainingBlock() ? contentFrame : nullptr);
|
||||
display->IsAbsPosContainingBlock(contentFrame) ? contentFrame
|
||||
: nullptr);
|
||||
}
|
||||
|
||||
MOZ_ASSERT(frameList.FirstChild());
|
||||
@@ -3295,7 +3306,7 @@ nsIFrame* nsCSSFrameConstructor::ConstructBlockRubyFrame(
|
||||
|
||||
nsFrameConstructorSaveState absoluteSaveState;
|
||||
blockFrame->AddStateBits(NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN);
|
||||
if (newFrame->IsAbsPosContainingBlock()) {
|
||||
if (aStyleDisplay->IsAbsPosContainingBlock(newFrame)) {
|
||||
aState.PushAbsoluteContainingBlock(blockFrame, blockFrame,
|
||||
absoluteSaveState);
|
||||
}
|
||||
@@ -3828,7 +3839,8 @@ void nsCSSFrameConstructor::ConstructFrameFromItemInternal(
|
||||
|
||||
// Now figure out whether newFrame or outerFrame should be the
|
||||
// absolute container.
|
||||
if (outerFrame->IsAbsPosContainingBlock()) {
|
||||
auto outerDisplay = outerStyle->StyleDisplay();
|
||||
if (outerDisplay->IsAbsPosContainingBlock(outerFrame)) {
|
||||
maybeAbsoluteContainingBlock = outerFrame;
|
||||
maybeAbsoluteContainingBlockStyleFrame = outerFrame;
|
||||
innerFrame->AddStateBits(NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN);
|
||||
@@ -4570,9 +4582,10 @@ nsIFrame* nsCSSFrameConstructor::ConstructScrollableBlock(
|
||||
aState.AddChild(newFrame, aFrameList, content, aParentFrame);
|
||||
|
||||
nsFrameList blockList;
|
||||
ConstructBlock(aState, content, newFrame, newFrame, scrolledContentStyle,
|
||||
&scrolledFrame, blockList,
|
||||
newFrame->IsAbsPosContainingBlock() ? newFrame : nullptr);
|
||||
ConstructBlock(
|
||||
aState, content, newFrame, newFrame, scrolledContentStyle, &scrolledFrame,
|
||||
blockList,
|
||||
aDisplay->IsAbsPosContainingBlock(newFrame) ? newFrame : nullptr);
|
||||
|
||||
MOZ_ASSERT(blockList.OnlyChild() == scrolledFrame,
|
||||
"Scrollframe's frameList should be exactly the scrolled frame!");
|
||||
@@ -4606,10 +4619,11 @@ nsIFrame* nsCSSFrameConstructor::ConstructNonScrollableBlock(
|
||||
|
||||
nsContainerFrame* newFrame = NS_NewBlockFrame(mPresShell, computedStyle);
|
||||
newFrame->AddStateBits(flags);
|
||||
ConstructBlock(aState, aItem.mContent,
|
||||
aState.GetGeometricParent(*aDisplay, aParentFrame),
|
||||
aParentFrame, computedStyle, &newFrame, aFrameList,
|
||||
newFrame->IsAbsPosContainingBlock() ? newFrame : nullptr);
|
||||
ConstructBlock(
|
||||
aState, aItem.mContent,
|
||||
aState.GetGeometricParent(*aDisplay, aParentFrame), aParentFrame,
|
||||
computedStyle, &newFrame, aFrameList,
|
||||
aDisplay->IsAbsPosContainingBlock(newFrame) ? newFrame : nullptr);
|
||||
return newFrame;
|
||||
}
|
||||
|
||||
@@ -7880,8 +7894,9 @@ nsIFrame* nsCSSFrameConstructor::CreateContinuingTableFrame(
|
||||
headerFooterFrame->Init(headerFooter, newFrame, nullptr);
|
||||
|
||||
nsFrameConstructorSaveState absoluteSaveState;
|
||||
MakeTablePartAbsoluteContainingBlock(state, absoluteSaveState,
|
||||
headerFooterFrame);
|
||||
MakeTablePartAbsoluteContainingBlockIfNeeded(
|
||||
state, headerFooterComputedStyle->StyleDisplay(), absoluteSaveState,
|
||||
headerFooterFrame);
|
||||
|
||||
nsFrameConstructorSaveState floatSaveState;
|
||||
state.MaybePushFloatContainingBlock(headerFooterFrame, floatSaveState);
|
||||
@@ -7954,10 +7969,16 @@ nsIFrame* nsCSSFrameConstructor::CreateContinuingFrame(
|
||||
} else if (LayoutFrameType::TableRowGroup == frameType) {
|
||||
newFrame = NS_NewTableRowGroupFrame(mPresShell, computedStyle);
|
||||
newFrame->Init(content, aParentFrame, aFrame);
|
||||
if (newFrame->HasAnyStateBits(NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN)) {
|
||||
nsTableFrame::RegisterPositionedTablePart(newFrame);
|
||||
}
|
||||
} else if (LayoutFrameType::TableRow == frameType) {
|
||||
nsTableRowFrame* rowFrame = NS_NewTableRowFrame(mPresShell, computedStyle);
|
||||
|
||||
rowFrame->Init(content, aParentFrame, aFrame);
|
||||
if (rowFrame->HasAnyStateBits(NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN)) {
|
||||
nsTableFrame::RegisterPositionedTablePart(rowFrame);
|
||||
}
|
||||
|
||||
// Create a continuing frame for each table cell frame
|
||||
nsFrameList newChildList;
|
||||
@@ -7986,6 +8007,9 @@ nsIFrame* nsCSSFrameConstructor::CreateContinuingFrame(
|
||||
NS_NewTableCellFrame(mPresShell, computedStyle, tableFrame);
|
||||
|
||||
cellFrame->Init(content, aParentFrame, aFrame);
|
||||
if (cellFrame->HasAnyStateBits(NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN)) {
|
||||
nsTableFrame::RegisterPositionedTablePart(cellFrame);
|
||||
}
|
||||
|
||||
// Create a continuing area frame
|
||||
nsIFrame* blockFrame = aFrame->PrincipalChildList().FirstChild();
|
||||
|
||||
Reference in New Issue
Block a user