WebKit Bugzilla
Attachment 347060 Details for
Bug 188541
: [LFC][Floating] Do not confuse clear with clearance.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-188541-20180813182850.patch (text/plain), 5.93 KB, created by
zalan
on 2018-08-13 18:28:51 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2018-08-13 18:28:51 PDT
Size:
5.93 KB
patch
obsolete
>Subversion Revision: 234800 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 53b6825c468dc7d339856a618733fcc8d71af123..75fa841db018857375f942975765bcb92ee8e0fc 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,25 @@ >+2018-08-13 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC][Floating] Do not confuse clear with clearance. >+ https://bugs.webkit.org/show_bug.cgi?id=188541 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ clear -> CSS property. >+ clearance -> the offset required to avoid floats when clear is present. >+ >+ * layout/FloatingContext.cpp: >+ (WebCore::Layout::FloatingContext::verticalPositionWithClearance const): >+ * layout/blockformatting/BlockFormattingContext.cpp: >+ (WebCore::Layout::BlockFormattingContext::layout const): >+ (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForClear const): >+ (WebCore::Layout::BlockFormattingContext::computeVerticalPositionWithClearance const): Deleted. >+ * layout/blockformatting/BlockFormattingContext.h: >+ * layout/layouttree/LayoutBox.cpp: >+ (WebCore::Layout::Box::hasClear const): >+ (WebCore::Layout::Box::hasClearance const): Deleted. >+ * layout/layouttree/LayoutBox.h: >+ > 2018-08-13 Zalan Bujtas <zalan@apple.com> > > [LFC][Floating] Add basic clearance support >diff --git a/Source/WebCore/layout/FloatingContext.cpp b/Source/WebCore/layout/FloatingContext.cpp >index 390b858df12e2b5e83c7d3726dd332cd1c8bcc12..5126cc259428902a2d8599399ab1fdc70b5dfef3 100644 >--- a/Source/WebCore/layout/FloatingContext.cpp >+++ b/Source/WebCore/layout/FloatingContext.cpp >@@ -133,7 +133,7 @@ Position FloatingContext::positionForFloat(const Box& layoutBox) const > > std::optional<LayoutUnit> FloatingContext::verticalPositionWithClearance(const Box& layoutBox) const > { >- ASSERT(layoutBox.hasClearance()); >+ ASSERT(layoutBox.hasClear()); > ASSERT(layoutBox.isBlockLevelBox()); > > if (m_floatingState.isEmpty()) >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp b/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >index b82ec058629a3e797bd412f221524b36084f0ce9..10cbddb86762d0f7375111a272df038170914f30 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >@@ -112,8 +112,8 @@ void BlockFormattingContext::layout(LayoutContext& layoutContext, FormattingStat > ASSERT(!layoutBox.establishesFormattingContext()); > computeHeightAndMargin(layoutContext, layoutBox, displayBox); > // Finalize position with clearance. >- if (layoutBox.hasClearance()) >- computeVerticalPositionWithClearance(floatingContext, layoutBox, displayBox); >+ if (layoutBox.hasClear()) >+ computeVerticalPositionForClear(floatingContext, layoutBox, displayBox); > if (!is<Container>(layoutBox)) > continue; > auto& container = downcast<Container>(layoutBox); >@@ -163,9 +163,9 @@ void BlockFormattingContext::computeFloatingPosition(FloatingContext& floatingCo > floatingContext.floatingState().append(layoutBox); > } > >-void BlockFormattingContext::computeVerticalPositionWithClearance(const FloatingContext& floatingContext, const Box& layoutBox, Display::Box& displayBox) const >+void BlockFormattingContext::computeVerticalPositionForClear(const FloatingContext& floatingContext, const Box& layoutBox, Display::Box& displayBox) const > { >- ASSERT(layoutBox.hasClearance()); >+ ASSERT(layoutBox.hasClear()); > if (auto verticalPositionWithClearance = floatingContext.verticalPositionWithClearance(layoutBox)) > displayBox.setTop(*verticalPositionWithClearance); > } >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContext.h b/Source/WebCore/layout/blockformatting/BlockFormattingContext.h >index 41af11878e400c2b203b767608d66081ba8c8199..289c732ba3c64b51f3937f809a96f4d622e5d69b 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContext.h >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContext.h >@@ -57,7 +57,7 @@ private: > > void computeStaticPosition(LayoutContext&, const Box&, Display::Box&) const override; > void computeFloatingPosition(FloatingContext&, const Box&, Display::Box&) const; >- void computeVerticalPositionWithClearance(const FloatingContext&, const Box&, Display::Box&) const; >+ void computeVerticalPositionForClear(const FloatingContext&, const Box&, Display::Box&) const; > void computeInFlowPositionedPosition(LayoutContext&, const Box&, Display::Box&) const override; > void computeInFlowWidthAndMargin(LayoutContext&, const Box&, Display::Box&) const; > void computeInFlowHeightAndMargin(LayoutContext&, const Box&, Display::Box&) const; >diff --git a/Source/WebCore/layout/layouttree/LayoutBox.cpp b/Source/WebCore/layout/layouttree/LayoutBox.cpp >index 3bd0328c3dfcf5214553be0acc3cca3ad9eaa546..abe0ced2c8c47ef8d947796bfc7d0c86cdc7d4dc 100644 >--- a/Source/WebCore/layout/layouttree/LayoutBox.cpp >+++ b/Source/WebCore/layout/layouttree/LayoutBox.cpp >@@ -114,7 +114,7 @@ bool Box::isRightFloatingPositioned() const > return m_style.floating() == Float::Right; > } > >-bool Box::hasClearance() const >+bool Box::hasClear() const > { > return m_style.clear() != Clear::None; > } >diff --git a/Source/WebCore/layout/layouttree/LayoutBox.h b/Source/WebCore/layout/layouttree/LayoutBox.h >index 21dc657c69ce768c554d5cc13b7759cc76f7002b..807abb8ec05381e57f75fd92aa6afd9010613d13 100644 >--- a/Source/WebCore/layout/layouttree/LayoutBox.h >+++ b/Source/WebCore/layout/layouttree/LayoutBox.h >@@ -62,7 +62,7 @@ public: > bool isFloatingPositioned() const; > bool isLeftFloatingPositioned() const; > bool isRightFloatingPositioned() const; >- bool hasClearance() const; >+ bool hasClear() 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
Flags:
simon.fraser
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188541
: 347060