WebKit Bugzilla
Attachment 360438 Details for
Bug 193954
: [LFC][BFC] Do not ignore next sibling box while laying out BFC.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
Patch.txt (text/plain), 7.09 KB, created by
zalan
on 2019-01-28 21:44:14 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2019-01-28 21:44:14 PST
Size:
7.09 KB
patch
obsolete
>diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 893fa7ca6c9..e06958a4035 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,20 @@ >+2019-01-28 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC][BFC] Do not ignore next sibling box while laying out BFC. >+ https://bugs.webkit.org/show_bug.cgi?id=193954 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ When a block box has no child (<img style="display: block">), we should not ignore the next sibling (move the container check to the function to keep layout logic simple) >+ Also inFlowNonReplacedWidthAndMargin() is called through inFlowReplacedWidthAndMargin() to compute margins. >+ >+ * layout/blockformatting/BlockFormattingContext.cpp: >+ (WebCore::Layout::BlockFormattingContext::layout const): >+ (WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren const): >+ * layout/blockformatting/BlockFormattingContext.h: >+ * layout/blockformatting/BlockFormattingContextGeometry.cpp: >+ (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin): >+ > 2019-01-28 Zalan Bujtas <zalan@apple.com> > > [LFC][BFC][MarginCollapsing] Anonymous block container's margin before does not collapse with previous inflow sibling margin after. >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp b/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >index b1a9685af8d..958ed3574cf 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >@@ -105,12 +105,9 @@ void BlockFormattingContext::layout() const > // Formatting root boxes are special-cased and they don't come here. > ASSERT(!layoutBox.establishesFormattingContext()); > computeHeightAndMargin(layoutBox); >- if (!is<Container>(layoutBox)) >- continue; >- auto& container = downcast<Container>(layoutBox); > // Move in-flow positioned children to their final position. >- placeInFlowPositionedChildren(container); >- if (auto* nextSibling = container.nextInFlowOrFloatingSibling()) { >+ placeInFlowPositionedChildren(layoutBox); >+ if (auto* nextSibling = layoutBox.nextInFlowOrFloatingSibling()) { > layoutQueue.append(nextSibling); > break; > } >@@ -147,18 +144,22 @@ void BlockFormattingContext::layoutFormattingContextRoot(FloatingContext& floati > formattingContext->layoutOutOfFlowDescendants(layoutBox); > } > >-void BlockFormattingContext::placeInFlowPositionedChildren(const Container& container) const >+void BlockFormattingContext::placeInFlowPositionedChildren(const Box& layoutBox) const > { >- LOG_WITH_STREAM(FormattingContextLayout, stream << "Start: move in-flow positioned children -> parent: " << &container); >- for (auto& layoutBox : childrenOfType<Box>(container)) { >- if (!layoutBox.isInFlowPositioned()) >+ if (!is<Container>(layoutBox)) >+ return; >+ >+ LOG_WITH_STREAM(FormattingContextLayout, stream << "Start: move in-flow positioned children -> parent: " << &layoutBox); >+ auto& container = downcast<Container>(layoutBox); >+ for (auto& childBox : childrenOfType<Box>(container)) { >+ if (!childBox.isInFlowPositioned()) > continue; > >- auto computeInFlowPositionedPosition = [&](auto& layoutBox) { >+ auto computeInFlowPositionedPosition = [&]() { > auto& layoutState = this->layoutState(); >- auto positionOffset = Geometry::inFlowPositionedPositionOffset(layoutState, layoutBox); >+ auto positionOffset = Geometry::inFlowPositionedPositionOffset(layoutState, childBox); > >- auto& displayBox = layoutState.displayBoxForLayoutBox(layoutBox); >+ auto& displayBox = layoutState.displayBoxForLayoutBox(childBox); > auto topLeft = displayBox.topLeft(); > > topLeft.move(positionOffset); >@@ -166,9 +167,9 @@ void BlockFormattingContext::placeInFlowPositionedChildren(const Container& cont > displayBox.setTopLeft(topLeft); > }; > >- computeInFlowPositionedPosition(layoutBox); >+ computeInFlowPositionedPosition(); > } >- LOG_WITH_STREAM(FormattingContextLayout, stream << "End: move in-flow positioned children -> parent: " << &container); >+ LOG_WITH_STREAM(FormattingContextLayout, stream << "End: move in-flow positioned children -> parent: " << &layoutBox); > } > > void BlockFormattingContext::computeStaticPosition(const FloatingContext& floatingContext, const Box& layoutBox) const >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContext.h b/Source/WebCore/layout/blockformatting/BlockFormattingContext.h >index 3e99c42b98b..f4cc701f5c4 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContext.h >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContext.h >@@ -53,7 +53,7 @@ public: > > private: > void layoutFormattingContextRoot(FloatingContext&, const Box&) const; >- void placeInFlowPositionedChildren(const Container&) const; >+ void placeInFlowPositionedChildren(const Box&) const; > > void computeWidthAndMargin(const Box&) const; > void computeHeightAndMargin(const Box&) const; >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp b/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >index 6484ded84ce..05f07a6cfc3 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >@@ -109,7 +109,7 @@ HeightAndMargin BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMarg > > WidthAndMargin BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin(const LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedWidth) > { >- ASSERT(layoutBox.isInFlow() && !layoutBox.replaced()); >+ ASSERT(layoutBox.isInFlow()); > > auto compute = [&]() { > >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index f1d60cdee74..b7aa1b27381 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,12 @@ >+2019-01-28 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC][BFC] Do not ignore next sibling box while laying out BFC. >+ https://bugs.webkit.org/show_bug.cgi?id=193954 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * LayoutReloaded/misc/LFC-passing-tests.txt: >+ > 2019-01-28 Chris Dumez <cdumez@apple.com> > > Regression(PSON) Crash under WebPageProxy::didStartProgress() >diff --git a/Tools/LayoutReloaded/misc/LFC-passing-tests.txt b/Tools/LayoutReloaded/misc/LFC-passing-tests.txt >index 135934ee823..af555da0039 100644 >--- a/Tools/LayoutReloaded/misc/LFC-passing-tests.txt >+++ b/Tools/LayoutReloaded/misc/LFC-passing-tests.txt >@@ -148,6 +148,7 @@ fast/block/margin-collapse/040.html > fast/block/margin-collapse/043.html > fast/block/margin-collapse/044.html > fast/block/margin-collapse/063.html >+fast/block/margin-collapse/100.html > fast/block/margin-collapse/collapsed-through-child-simple.html > fast/block/positioning/003.html > fast/block/positioning/004.html
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 193954
: 360438