diff options
author | athenian200 <athenian200@outlook.com> | 2020-09-03 18:55:28 -0500 |
---|---|---|
committer | athenian200 <athenian200@outlook.com> | 2020-09-03 18:55:28 -0500 |
commit | 6b2c3b61b1c338ddec723482bd2c83427ef2e431 (patch) | |
tree | bd30f18df9a1d98b88a24c5e9482551ec84ff8ec /layout/base/nsCSSFrameConstructor.cpp | |
parent | 0ac50227e22599b62ddfb1e4a889032837925178 (diff) | |
download | UXP-6b2c3b61b1c338ddec723482bd2c83427ef2e431.tar UXP-6b2c3b61b1c338ddec723482bd2c83427ef2e431.tar.gz UXP-6b2c3b61b1c338ddec723482bd2c83427ef2e431.tar.lz UXP-6b2c3b61b1c338ddec723482bd2c83427ef2e431.tar.xz UXP-6b2c3b61b1c338ddec723482bd2c83427ef2e431.zip |
Issue #1641 - Implement CSS flow-root keyword
This is just a clean port of 1322191 and follow-up 1325970. It really seems to add create a new way to access existing code relating to block formatting and floating elements rather than implementing new functionality, and it is mercifully straightforwards.
Diffstat (limited to 'layout/base/nsCSSFrameConstructor.cpp')
-rw-r--r-- | layout/base/nsCSSFrameConstructor.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index fc458b5eb..21068b673 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -2618,7 +2618,8 @@ nsCSSFrameConstructor::ConstructDocElementFrame(Element* aDocEle newFrame = frameItems.FirstChild(); NS_ASSERTION(frameItems.OnlyChild(), "multiple root element frames"); } else { - MOZ_ASSERT(display->mDisplay == StyleDisplay::Block, + MOZ_ASSERT(display->mDisplay == StyleDisplay::Block || + display->mDisplay == StyleDisplay::FlowRoot, "Unhandled display type for root element"); contentFrame = NS_NewBlockFormattingContext(mPresShell, styleContext); nsFrameItems frameItems; @@ -4741,6 +4742,7 @@ nsCSSFrameConstructor::FindDisplayData(const nsStyleDisplay* aDisplay, static const FrameConstructionDataByDisplay sDisplayData[] = { FCDATA_FOR_DISPLAY(StyleDisplay::None, UNREACHABLE_FCDATA()), FCDATA_FOR_DISPLAY(StyleDisplay::Block, UNREACHABLE_FCDATA()), + FCDATA_FOR_DISPLAY(StyleDisplay::FlowRoot, UNREACHABLE_FCDATA()), // To keep the hash table small don't add inline frames (they're // typically things like FONT and B), because we can quickly // find them if we need to. @@ -4926,7 +4928,7 @@ nsCSSFrameConstructor::ConstructNonScrollableBlockWithConstructor( StyleDisplay::InlineBlock == aDisplay->mDisplay || clipPaginatedOverflow) && !aParentFrame->IsSVGText()) { - flags = NS_BLOCK_FLOAT_MGR | NS_BLOCK_MARGIN_ROOT; + flags = NS_BLOCK_FORMATTING_CONTEXT_STATE_BITS; if (clipPaginatedOverflow) { flags |= NS_BLOCK_CLIP_PAGINATED_OVERFLOW; } @@ -5119,7 +5121,7 @@ nsCSSFrameConstructor::FlushAccumulatedBlock(nsFrameConstructorState& aState, // is not a suitable block. nsContainerFrame* blockFrame = NS_NewMathMLmathBlockFrame(mPresShell, blockContext); - blockFrame->AddStateBits(NS_BLOCK_FLOAT_MGR | NS_BLOCK_MARGIN_ROOT); + blockFrame->AddStateBits(NS_BLOCK_FORMATTING_CONTEXT_STATE_BITS); InitAndRestoreFrame(aState, aContent, aParentFrame, blockFrame); ReparentFrames(this, blockFrame, aBlockItems); |