WebKit Bugzilla
Attachment 372188 Details for
Bug 198886
: [LFC][BFC] Fix available width for float avoiders.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-198886-20190615015348.patch (text/plain), 24.99 KB, created by
zalan
on 2019-06-15 01:53:50 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2019-06-15 01:53:50 PDT
Size:
24.99 KB
patch
obsolete
>Subversion Revision: 246456 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 6d8c0ebac6bc643c59c5dca7ab6989b39c39b6c8..2ea2c3a2bb717731eaf337aea39c74d5b79778ac 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,48 @@ >+2019-06-15 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC][BFC] Fix available width for non-floating positioned float avoiders. >+ https://bugs.webkit.org/show_bug.cgi?id=198886 >+ <rdar://problem/51773643> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Normally the available width for an in-flow block level box is the width of the containing block's content box. >+ However a non-floating positioned float avoider box might be constrained by existing floats. >+ The idea here is that we pre-compute(estimate) the vertical position and check the current floating context for >+ left and right floats. These floats contrain the available width and this computed value should be used instead of the containing block's >+ content box's width whe calculating the used width for width: auto. >+ >+ * layout/FormattingContext.cpp: >+ (WebCore::Layout::mapHorizontalPositionToAncestor): >+ (WebCore::Layout::FormattingContext::mapLeftToAncestor): >+ (WebCore::Layout::FormattingContext::mapRightToAncestor): >+ (WebCore::Layout::FormattingContext::mapPointToAncestor): >+ (WebCore::Layout::FormattingContext::mapCoordinateToAncestor): Deleted. >+ * layout/FormattingContext.h: >+ * layout/blockformatting/BlockFormattingContext.cpp: >+ (WebCore::Layout::BlockFormattingContext::usedAvailableWidthForFloatAvoider const): >+ (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const): >+ (WebCore::Layout::BlockFormattingContext::computeStaticVerticalPosition const): >+ (WebCore::Layout::BlockFormattingContext::computeStaticHorizontalPosition const): >+ (WebCore::Layout::BlockFormattingContext::computeStaticPosition const): >+ (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFormattingRoot const): >+ (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const): >+ * layout/blockformatting/BlockFormattingContext.h: >+ (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin): >+ * layout/blockformatting/BlockFormattingContextGeometry.cpp: >+ (WebCore::Layout::BlockFormattingContext::Geometry::staticVerticalPosition): >+ (WebCore::Layout::BlockFormattingContext::Geometry::staticHorizontalPosition): >+ (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition): >+ * layout/floats/FloatingState.cpp: >+ (WebCore::Layout::FloatingState::constraints const): >+ * layout/layouttree/LayoutBlockContainer.cpp: >+ (WebCore::Layout::BlockContainer::establishesInlineFormattingContextOnly const): >+ * layout/layouttree/LayoutBlockContainer.h: >+ * layout/layouttree/LayoutBox.cpp: >+ (WebCore::Layout::Box::isFloatAvoider const): >+ * layout/layouttree/LayoutBox.h: >+ (WebCore::Layout::Box::establishesInlineFormattingContextOnly const): >+ > 2019-06-15 Zalan Bujtas <zalan@apple.com> > > [LFC][MarginCollapsing] Collapsed through margin values preserve quirk state. >diff --git a/Source/WebCore/layout/FormattingContext.cpp b/Source/WebCore/layout/FormattingContext.cpp >index a1ec4a15bc6e26594d0053c83bc165efa74a15d6..1731ddbacc5557df33261ec61b95b3b52c2c59ee 100644 >--- a/Source/WebCore/layout/FormattingContext.cpp >+++ b/Source/WebCore/layout/FormattingContext.cpp >@@ -165,6 +165,30 @@ void FormattingContext::layoutOutOfFlowDescendants(const Box& layoutBox) const > LOG_WITH_STREAM(FormattingContextLayout, stream << "End: layout out-of-flow descendants -> context: " << &layoutState << " root: " << &root()); > } > >+static LayoutUnit mapHorizontalPositionToAncestor(const LayoutState& layoutState, LayoutUnit horizontalPosition, const Container& containingBlock, const Container& ancestor) >+{ >+ // "horizontalPosition" is in the coordinate system of the "containingBlock". -> map from containingBlock to ancestor. >+ if (&containingBlock == &ancestor) >+ return horizontalPosition; >+ ASSERT(containingBlock.isDescendantOf(ancestor)); >+ for (auto* container = &containingBlock; container && container != &ancestor; container = container->containingBlock()) >+ horizontalPosition += layoutState.displayBoxForLayoutBox(*container).left(); >+ return horizontalPosition; >+} >+ >+// FIXME turn these into templates. >+LayoutUnit FormattingContext::mapLeftToAncestor(const LayoutState& layoutState, const Box& layoutBox, const Container& ancestor) >+{ >+ ASSERT(layoutBox.containingBlock()); >+ return mapHorizontalPositionToAncestor(layoutState, layoutState.displayBoxForLayoutBox(layoutBox).left(), *layoutBox.containingBlock(), ancestor); >+} >+ >+LayoutUnit FormattingContext::mapRightToAncestor(const LayoutState& layoutState, const Box& layoutBox, const Container& ancestor) >+{ >+ ASSERT(layoutBox.containingBlock()); >+ return mapHorizontalPositionToAncestor(layoutState, layoutState.displayBoxForLayoutBox(layoutBox).right(), *layoutBox.containingBlock(), ancestor); >+} >+ > Display::Box FormattingContext::mapBoxToAncestor(const LayoutState& layoutState, const Box& layoutBox, const Container& ancestor) > { > ASSERT(layoutBox.isDescendantOf(ancestor)); >@@ -196,7 +220,7 @@ LayoutUnit FormattingContext::mapTopToAncestor(const LayoutState& layoutState, c > return top; > } > >-Point FormattingContext::mapCoordinateToAncestor(const LayoutState& layoutState, Point position, const Container& containingBlock, const Container& ancestor) >+Point FormattingContext::mapPointToAncestor(const LayoutState& layoutState, Point position, const Container& containingBlock, const Container& ancestor) > { > auto mappedPosition = position; > auto* container = &containingBlock; >diff --git a/Source/WebCore/layout/FormattingContext.h b/Source/WebCore/layout/FormattingContext.h >index 1c1367241abe22b1acdbef3e1d2098cd07c169c0..85781199697dd491e2d7e4cc1855877ca3be682e 100644 >--- a/Source/WebCore/layout/FormattingContext.h >+++ b/Source/WebCore/layout/FormattingContext.h >@@ -60,7 +60,9 @@ public: > > static Display::Box mapBoxToAncestor(const LayoutState&, const Box&, const Container& ancestor); > static LayoutUnit mapTopToAncestor(const LayoutState&, const Box&, const Container& ancestor); >- static Point mapCoordinateToAncestor(const LayoutState&, Point, const Container& containingBlock, const Container& ancestor); >+ static LayoutUnit mapLeftToAncestor(const LayoutState&, const Box&, const Container& ancestor); >+ static LayoutUnit mapRightToAncestor(const LayoutState&, const Box&, const Container& ancestor); >+ static Point mapPointToAncestor(const LayoutState&, Point, const Container& containingBlock, const Container& ancestor); > > protected: > using LayoutQueue = Vector<const Box*>; >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp b/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >index 74e0bada5b4056c6ff92468afbc786898c069cc2..13d636c27f8bfb2d7f8e7dd85ef65f27e04ffbbc 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >@@ -118,13 +118,51 @@ void BlockFormattingContext::layout() const > LOG_WITH_STREAM(FormattingContextLayout, stream << "[End] -> block formatting context -> formatting root(" << &root() << ")"); > } > >+Optional<LayoutUnit> BlockFormattingContext::usedAvailableWidthForFloatAvoider(const FloatingContext& floatingContext, const Box& layoutBox) const >+{ >+ // Normally the available width for an in-flow block level box is the width of the containing block's content box. >+ // However (and please tell me where it is in the spec) non-floating positioned float avoider block level boxes are constrained by existing floats. >+ if (!layoutBox.isFloatAvoider() || layoutBox.isFloatingPositioned()) >+ return { }; >+ auto& floatingState = floatingContext.floatingState(); >+ if (floatingState.isEmpty()) >+ return { }; >+ // Vertical static position is not computed yet, so let's just estimate it for now. >+ auto& formattingRoot = downcast<Container>(root()); >+ auto verticalPosition = FormattingContext::mapTopToAncestor(layoutState(), layoutBox, formattingRoot); >+ auto constraints = floatingState.constraints({ verticalPosition }, formattingRoot); >+ if (!constraints.left && !constraints.right) >+ return { }; >+ auto& containingBlock = downcast<Container>(*layoutBox.containingBlock()); >+ auto& containingBlockDisplayBox = layoutState().displayBoxForLayoutBox(containingBlock); >+ auto availableWidth = containingBlockDisplayBox.contentBoxWidth(); >+ >+ LayoutUnit containingBlockLeft; >+ LayoutUnit containingBlockRight = containingBlockDisplayBox.right(); >+ if (&containingBlock != &formattingRoot) { >+ // Move containing block left/right to the root's coordinate system. >+ containingBlockLeft = FormattingContext::mapLeftToAncestor(layoutState(), containingBlock, formattingRoot); >+ containingBlockRight = FormattingContext::mapRightToAncestor(layoutState(), containingBlock, formattingRoot); >+ } >+ auto containingBlockContentBoxLeft = containingBlockLeft + containingBlockDisplayBox.borderLeft() + containingBlockDisplayBox.paddingLeft().valueOr(0); >+ auto containingBlockContentBoxRight = containingBlockRight - containingBlockDisplayBox.borderRight() + containingBlockDisplayBox.paddingRight().valueOr(0); >+ >+ // Shrink the available space if the floats are actually intruding at this vertical position. >+ availableWidth -= (std::max<LayoutUnit>(0, constraints.left.valueOr(PositionInContextRoot { 0 }) - containingBlockContentBoxLeft) >+ + std::max<LayoutUnit>(0, containingBlockContentBoxRight - constraints.right.valueOr(PositionInContextRoot { containingBlockContentBoxRight }))); >+ return availableWidth; >+} >+ > void BlockFormattingContext::layoutFormattingContextRoot(FloatingContext& floatingContext, const Box& layoutBox) const > { >+ ASSERT(layoutBox.establishesFormattingContext()); > // Start laying out this formatting root in the formatting contenxt it lives in. > LOG_WITH_STREAM(FormattingContextLayout, stream << "[Compute] -> [Position][Border][Padding][Width][Margin] -> for layoutBox(" << &layoutBox << ")"); > computeBorderAndPadding(layoutBox); >- computeWidthAndMargin(layoutBox); >- computeStaticPosition(floatingContext, layoutBox); >+ computeStaticVerticalPosition(floatingContext, layoutBox); >+ >+ computeWidthAndMargin(layoutBox, usedAvailableWidthForFloatAvoider(floatingContext, layoutBox)); >+ computeStaticHorizontalPosition(layoutBox); > // Swich over to the new formatting context (the one that the root creates). > auto formattingContext = layoutState().createFormattingContext(layoutBox); > formattingContext->layout(); >@@ -172,16 +210,27 @@ void BlockFormattingContext::placeInFlowPositionedChildren(const Box& layoutBox) > LOG_WITH_STREAM(FormattingContextLayout, stream << "End: move in-flow positioned children -> parent: " << &layoutBox); > } > >-void BlockFormattingContext::computeStaticPosition(const FloatingContext& floatingContext, const Box& layoutBox) const >+void BlockFormattingContext::computeStaticVerticalPosition(const FloatingContext& floatingContext, const Box& layoutBox) const > { > auto& layoutState = this->layoutState(); >- layoutState.displayBoxForLayoutBox(layoutBox).setTopLeft(Geometry::staticPosition(layoutState, layoutBox)); >+ layoutState.displayBoxForLayoutBox(layoutBox).setTop(Geometry::staticVerticalPosition(layoutState, layoutBox)); > if (layoutBox.hasFloatClear()) > computeEstimatedVerticalPositionForFloatClear(floatingContext, layoutBox); > else if (layoutBox.establishesFormattingContext()) > computeEstimatedVerticalPositionForFormattingRoot(layoutBox); > } > >+void BlockFormattingContext::computeStaticHorizontalPosition(const Box& layoutBox) const >+{ >+ layoutState().displayBoxForLayoutBox(layoutBox).setLeft(Geometry::staticHorizontalPosition(layoutState(), layoutBox)); >+} >+ >+void BlockFormattingContext::computeStaticPosition(const FloatingContext& floatingContext, const Box& layoutBox) const >+{ >+ computeStaticVerticalPosition(floatingContext, layoutBox); >+ computeStaticHorizontalPosition(layoutBox); >+} >+ > void BlockFormattingContext::computeEstimatedVerticalPosition(const Box& layoutBox) const > { > auto& layoutState = this->layoutState(); >@@ -226,13 +275,17 @@ void BlockFormattingContext::computeEstimatedVerticalPositionForFormattingRoot(c > ASSERT(layoutBox.establishesFormattingContext()); > ASSERT(!layoutBox.hasFloatClear()); > >- auto avoidsFloats = layoutBox.isFloatingPositioned() || layoutBox.establishesBlockFormattingContext(); >- if (avoidsFloats) >+ if (layoutBox.isFloatingPositioned()) { > computeEstimatedVerticalPositionForAncestors(layoutBox); >+ return; >+ } >+ >+ computeEstimatedVerticalPosition(layoutBox); >+ computeEstimatedVerticalPositionForAncestors(layoutBox); > > // If the inline formatting root is also the root for the floats (happens when the root box also establishes a block formatting context) > // the floats are in the coordinate system of this root. No need to find the final vertical position. >- auto inlineContextInheritsFloats = layoutBox.establishesInlineFormattingContext() && !layoutBox.establishesBlockFormattingContext(); >+ auto inlineContextInheritsFloats = layoutBox.establishesInlineFormattingContextOnly(); > if (inlineContextInheritsFloats) { > computeEstimatedVerticalPosition(layoutBox); > computeEstimatedVerticalPositionForAncestors(layoutBox); >@@ -295,13 +348,18 @@ void BlockFormattingContext::computePositionToAvoidFloats(const FloatingContext& > layoutState.displayBoxForLayoutBox(layoutBox).setTopLeft(*adjustedPosition); > } > >-void BlockFormattingContext::computeWidthAndMargin(const Box& layoutBox) const >+void BlockFormattingContext::computeWidthAndMargin(const Box& layoutBox, Optional<LayoutUnit> usedAvailableWidth) const > { > auto& layoutState = this->layoutState(); >- auto containingBlockWidth = layoutState.displayBoxForLayoutBox(*layoutBox.containingBlock()).contentBoxWidth(); >+ >+ LayoutUnit availableWidth; >+ if (usedAvailableWidth) >+ availableWidth = *usedAvailableWidth; >+ else >+ availableWidth = layoutState.displayBoxForLayoutBox(*layoutBox.containingBlock()).contentBoxWidth(); > > auto compute = [&](Optional<LayoutUnit> usedWidth) -> WidthAndMargin { >- auto usedValues = UsedHorizontalValues { containingBlockWidth, usedWidth, { } }; >+ auto usedValues = UsedHorizontalValues { availableWidth, usedWidth, { } }; > if (layoutBox.isInFlow()) > return Geometry::inFlowWidthAndMargin(layoutState, layoutBox, usedValues); > >@@ -314,13 +372,13 @@ void BlockFormattingContext::computeWidthAndMargin(const Box& layoutBox) const > > auto widthAndMargin = compute({ }); > >- if (auto maxWidth = Geometry::computedValueIfNotAuto(layoutBox.style().logicalMaxWidth(), containingBlockWidth)) { >+ if (auto maxWidth = Geometry::computedValueIfNotAuto(layoutBox.style().logicalMaxWidth(), availableWidth)) { > auto maxWidthAndMargin = compute(maxWidth); > if (widthAndMargin.width > maxWidthAndMargin.width) > widthAndMargin = maxWidthAndMargin; > } > >- auto minWidth = Geometry::computedValueIfNotAuto(layoutBox.style().logicalMinWidth(), containingBlockWidth).valueOr(0); >+ auto minWidth = Geometry::computedValueIfNotAuto(layoutBox.style().logicalMinWidth(), availableWidth).valueOr(0); > auto minWidthAndMargin = compute(minWidth); > if (widthAndMargin.width < minWidthAndMargin.width) > widthAndMargin = minWidthAndMargin; >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContext.h b/Source/WebCore/layout/blockformatting/BlockFormattingContext.h >index cb21f9f34ee6a852cd833bd30d9a0e643a2d49d5..5e3adf3166411fabc68fd07a1e8f4ec154baf09a 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContext.h >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContext.h >@@ -55,9 +55,11 @@ private: > void layoutFormattingContextRoot(FloatingContext&, const Box&) const; > void placeInFlowPositionedChildren(const Box&) const; > >- void computeWidthAndMargin(const Box&) const; >+ void computeWidthAndMargin(const Box&, Optional<LayoutUnit> usedAvailableWidth = { }) const; > void computeHeightAndMargin(const Box&) const; > >+ void computeStaticHorizontalPosition(const Box&) const; >+ void computeStaticVerticalPosition(const FloatingContext&, const Box&) const; > void computeStaticPosition(const FloatingContext&, const Box&) const; > void computeFloatingPosition(const FloatingContext&, const Box&) const; > void computePositionToAvoidFloats(const FloatingContext&, const Box&) const; >@@ -77,6 +79,8 @@ private: > static WidthAndMargin inFlowWidthAndMargin(const LayoutState&, const Box&, UsedHorizontalValues); > > static Point staticPosition(const LayoutState&, const Box&); >+ static LayoutUnit staticVerticalPosition(const LayoutState&, const Box&); >+ static LayoutUnit staticHorizontalPosition(const LayoutState&, const Box&); > > static bool intrinsicWidthConstraintsNeedChildrenWidth(const Box&); > static IntrinsicWidthConstraints intrinsicWidthConstraints(const LayoutState&, const Box&); >@@ -131,6 +135,7 @@ private: > void setEstimatedMarginBefore(const Box&, const EstimatedMarginBefore&) const; > void removeEstimatedMarginBefore(const Box& layoutBox) const { m_estimatedMarginBeforeList.remove(&layoutBox); } > bool hasEstimatedMarginBefore(const Box&) const; >+ Optional<LayoutUnit> usedAvailableWidthForFloatAvoider(const FloatingContext&, const Box&) const; > #ifndef NDEBUG > EstimatedMarginBefore estimatedMarginBefore(const Box& layoutBox) const { return m_estimatedMarginBeforeList.get(&layoutBox); } > bool hasPrecomputedMarginBefore(const Box&) const; >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp b/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >index ae1a21edb8c52d3b61c1508331cc30d8664be1af..127a7ff587a16bbb1a58d747f9354cf47532dec7 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >@@ -222,25 +222,29 @@ WidthAndMargin BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin(co > return { *usedValues.width, nonReplacedWidthAndMargin.usedMargin, nonReplacedWidthAndMargin.computedMargin }; > } > >-Point BlockFormattingContext::Geometry::staticPosition(const LayoutState& layoutState, const Box& layoutBox) >+LayoutUnit BlockFormattingContext::Geometry::staticVerticalPosition(const LayoutState& layoutState, const Box& layoutBox) > { > // https://www.w3.org/TR/CSS22/visuren.html#block-formatting > // In a block formatting context, boxes are laid out one after the other, vertically, beginning at the top of a containing block. > // The vertical distance between two sibling boxes is determined by the 'margin' properties. > // Vertical margins between adjacent block-level boxes in a block formatting context collapse. >- // In a block formatting context, each box's left outer edge touches the left edge of the containing block (for right-to-left formatting, right edges touch). >- >- LayoutUnit top; >- auto& containingBlockDisplayBox = layoutState.displayBoxForLayoutBox(*layoutBox.containingBlock()); > if (auto* previousInFlowSibling = layoutBox.previousInFlowSibling()) { > auto& previousInFlowDisplayBox = layoutState.displayBoxForLayoutBox(*previousInFlowSibling); >- top = previousInFlowDisplayBox.bottom() + previousInFlowDisplayBox.marginAfter(); >- } else >- top = containingBlockDisplayBox.contentBoxTop(); >+ return previousInFlowDisplayBox.bottom() + previousInFlowDisplayBox.marginAfter(); >+ } >+ return layoutState.displayBoxForLayoutBox(*layoutBox.containingBlock()).contentBoxTop(); >+} >+ >+LayoutUnit BlockFormattingContext::Geometry::staticHorizontalPosition(const LayoutState& layoutState, const Box& layoutBox) >+{ >+ // https://www.w3.org/TR/CSS22/visuren.html#block-formatting >+ // In a block formatting context, each box's left outer edge touches the left edge of the containing block (for right-to-left formatting, right edges touch). >+ return layoutState.displayBoxForLayoutBox(*layoutBox.containingBlock()).contentBoxLeft() + layoutState.displayBoxForLayoutBox(layoutBox).marginStart(); >+} > >- auto left = containingBlockDisplayBox.contentBoxLeft() + layoutState.displayBoxForLayoutBox(layoutBox).marginStart(); >- LOG_WITH_STREAM(FormattingContextLayout, stream << "[Position] -> static -> top(" << top << "px) left(" << left << "px) layoutBox(" << &layoutBox << ")"); >- return { left, top }; >+Point BlockFormattingContext::Geometry::staticPosition(const LayoutState& layoutState, const Box& layoutBox) >+{ >+ return { staticHorizontalPosition(layoutState, layoutBox), staticVerticalPosition(layoutState, layoutBox) }; > } > > HeightAndMargin BlockFormattingContext::Geometry::inFlowHeightAndMargin(const LayoutState& layoutState, const Box& layoutBox, UsedVerticalValues usedValues) >diff --git a/Source/WebCore/layout/floats/FloatingState.cpp b/Source/WebCore/layout/floats/FloatingState.cpp >index ab81002738781b2fbed20009acdba27f4c21383f..7651ec696c6de27606b4d9916840e33c89c0c611 100644 >--- a/Source/WebCore/layout/floats/FloatingState.cpp >+++ b/Source/WebCore/layout/floats/FloatingState.cpp >@@ -121,7 +121,7 @@ FloatingState::Constraints FloatingState::constraints(PositionInContextRoot vert > auto adjustedPosition = Point { 0, verticalPosition }; > > if (coordinateMappingIsRequired) >- adjustedPosition = FormattingContext::mapCoordinateToAncestor(m_layoutState, adjustedPosition, downcast<Container>(formattingContextRoot), downcast<Container>(root())); >+ adjustedPosition = FormattingContext::mapPointToAncestor(m_layoutState, adjustedPosition, downcast<Container>(formattingContextRoot), downcast<Container>(root())); > > Constraints constraints; > for (int index = m_floats.size() - 1; index >= 0; --index) { >diff --git a/Source/WebCore/layout/layouttree/LayoutBlockContainer.cpp b/Source/WebCore/layout/layouttree/LayoutBlockContainer.cpp >index 4cb28472e2ad05dcc691b427acf61d63798865b1..8f8ecca4616d72ff728f03aaa977d5f8758eb8fc 100644 >--- a/Source/WebCore/layout/layouttree/LayoutBlockContainer.cpp >+++ b/Source/WebCore/layout/layouttree/LayoutBlockContainer.cpp >@@ -53,6 +53,11 @@ bool BlockContainer::establishesInlineFormattingContext() const > return false; > } > >+bool BlockContainer::establishesInlineFormattingContextOnly() const >+{ >+ return establishesInlineFormattingContext() && !establishesBlockFormattingContext(); >+} >+ > } > } > >diff --git a/Source/WebCore/layout/layouttree/LayoutBlockContainer.h b/Source/WebCore/layout/layouttree/LayoutBlockContainer.h >index 612a951a602b14b4371447f49cce3806481c0a19..a77f4fcd8f28d4cce88b195f346880a5b3fecb4f 100644 >--- a/Source/WebCore/layout/layouttree/LayoutBlockContainer.h >+++ b/Source/WebCore/layout/layouttree/LayoutBlockContainer.h >@@ -42,7 +42,7 @@ public: > BlockContainer(Optional<ElementAttributes>, RenderStyle&&, BaseTypeFlags = BlockContainerFlag); > > bool establishesInlineFormattingContext() const final; >- >+ bool establishesInlineFormattingContextOnly() const final; > }; > > } >diff --git a/Source/WebCore/layout/layouttree/LayoutBox.cpp b/Source/WebCore/layout/layouttree/LayoutBox.cpp >index 15a11d91ccf820dd49940d15deb01f33da03fa22..01198314b711a8b55a84d0948c5e5fbc42d02827 100644 >--- a/Source/WebCore/layout/layouttree/LayoutBox.cpp >+++ b/Source/WebCore/layout/layouttree/LayoutBox.cpp >@@ -134,6 +134,11 @@ bool Box::hasFloatClear() const > return m_style.clear() != Clear::None; > } > >+bool Box::isFloatAvoider() const >+{ >+ return establishesBlockFormattingContext() || isFloatingPositioned(); >+} >+ > const Container* Box::containingBlock() const > { > // The containing block in which the root element lives is a rectangle called the initial containing block. >diff --git a/Source/WebCore/layout/layouttree/LayoutBox.h b/Source/WebCore/layout/layouttree/LayoutBox.h >index ad2d3f87b8bbafdc443bb8376887a5d0fc6dfbd7..5606e21a39d6acf737bd329b8559c96835066b89 100644 >--- a/Source/WebCore/layout/layouttree/LayoutBox.h >+++ b/Source/WebCore/layout/layouttree/LayoutBox.h >@@ -78,6 +78,7 @@ public: > bool establishesBlockFormattingContext() const; > bool establishesBlockFormattingContextOnly() const; > virtual bool establishesInlineFormattingContext() const { return false; } >+ virtual bool establishesInlineFormattingContextOnly() const { return false; } > > bool isInFlow() const { return !isFloatingOrOutOfFlowPositioned(); } > bool isPositioned() const { return isInFlowPositioned() || isOutOfFlowPositioned(); } >@@ -91,6 +92,7 @@ public: > bool isLeftFloatingPositioned() const; > bool isRightFloatingPositioned() const; > bool hasFloatClear() const; >+ bool isFloatAvoider() const; > > bool isFloatingOrOutOfFlowPositioned() const { return isFloatingPositioned() || isOutOfFlowPositioned(); } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 198886
:
372188
|
372190
|
372196