Title: [234834] trunk/Source/WebCore
Revision
234834
Author
[email protected]
Date
2018-08-13 18:47:32 -0700 (Mon, 13 Aug 2018)

Log Message

[LFC][Floating] Do not confuse clear with clearance.
https://bugs.webkit.org/show_bug.cgi?id=188541

Reviewed by Simon Fraser.

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:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (234833 => 234834)


--- trunk/Source/WebCore/ChangeLog	2018-08-14 00:59:40 UTC (rev 234833)
+++ trunk/Source/WebCore/ChangeLog	2018-08-14 01:47:32 UTC (rev 234834)
@@ -1,3 +1,25 @@
+2018-08-13  Zalan Bujtas  <[email protected]>
+
+        [LFC][Floating] Do not confuse clear with clearance.
+        https://bugs.webkit.org/show_bug.cgi?id=188541
+
+        Reviewed by Simon Fraser.
+
+        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  James Savage  <[email protected]>
 
         [iOS] Crash at -[UIViewController _presentViewController:withAnimationController:completion:]

Modified: trunk/Source/WebCore/layout/FloatingContext.cpp (234833 => 234834)


--- trunk/Source/WebCore/layout/FloatingContext.cpp	2018-08-14 00:59:40 UTC (rev 234833)
+++ trunk/Source/WebCore/layout/FloatingContext.cpp	2018-08-14 01:47:32 UTC (rev 234834)
@@ -133,7 +133,7 @@
 
 std::optional<LayoutUnit> FloatingContext::verticalPositionWithClearance(const Box& layoutBox) const
 {
-    ASSERT(layoutBox.hasClearance());
+    ASSERT(layoutBox.hasFloatClear());
     ASSERT(layoutBox.isBlockLevelBox());
 
     if (m_floatingState.isEmpty())

Modified: trunk/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp (234833 => 234834)


--- trunk/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp	2018-08-14 00:59:40 UTC (rev 234833)
+++ trunk/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp	2018-08-14 01:47:32 UTC (rev 234834)
@@ -112,8 +112,8 @@
             ASSERT(!layoutBox.establishesFormattingContext());
             computeHeightAndMargin(layoutContext, layoutBox, displayBox);
             // Finalize position with clearance.
-            if (layoutBox.hasClearance())
-                computeVerticalPositionWithClearance(floatingContext, layoutBox, displayBox);
+            if (layoutBox.hasFloatClear())
+                computeVerticalPositionForFloatClear(floatingContext, layoutBox, displayBox);
             if (!is<Container>(layoutBox))
                 continue;
             auto& container = downcast<Container>(layoutBox);
@@ -163,9 +163,9 @@
     floatingContext.floatingState().append(layoutBox);
 }
 
-void BlockFormattingContext::computeVerticalPositionWithClearance(const FloatingContext& floatingContext, const Box& layoutBox, Display::Box& displayBox) const
+void BlockFormattingContext::computeVerticalPositionForFloatClear(const FloatingContext& floatingContext, const Box& layoutBox, Display::Box& displayBox) const
 {
-    ASSERT(layoutBox.hasClearance());
+    ASSERT(layoutBox.hasFloatClear());
     if (auto verticalPositionWithClearance = floatingContext.verticalPositionWithClearance(layoutBox))
         displayBox.setTop(*verticalPositionWithClearance);
 }

Modified: trunk/Source/WebCore/layout/blockformatting/BlockFormattingContext.h (234833 => 234834)


--- trunk/Source/WebCore/layout/blockformatting/BlockFormattingContext.h	2018-08-14 00:59:40 UTC (rev 234833)
+++ trunk/Source/WebCore/layout/blockformatting/BlockFormattingContext.h	2018-08-14 01:47:32 UTC (rev 234834)
@@ -57,7 +57,7 @@
 
     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 computeVerticalPositionForFloatClear(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;

Modified: trunk/Source/WebCore/layout/layouttree/LayoutBox.cpp (234833 => 234834)


--- trunk/Source/WebCore/layout/layouttree/LayoutBox.cpp	2018-08-14 00:59:40 UTC (rev 234833)
+++ trunk/Source/WebCore/layout/layouttree/LayoutBox.cpp	2018-08-14 01:47:32 UTC (rev 234834)
@@ -114,7 +114,7 @@
     return m_style.floating() == Float::Right;
 }
 
-bool Box::hasClearance() const
+bool Box::hasFloatClear() const
 {
     return m_style.clear() != Clear::None;
 }

Modified: trunk/Source/WebCore/layout/layouttree/LayoutBox.h (234833 => 234834)


--- trunk/Source/WebCore/layout/layouttree/LayoutBox.h	2018-08-14 00:59:40 UTC (rev 234833)
+++ trunk/Source/WebCore/layout/layouttree/LayoutBox.h	2018-08-14 01:47:32 UTC (rev 234834)
@@ -62,7 +62,7 @@
     bool isFloatingPositioned() const;
     bool isLeftFloatingPositioned() const;
     bool isRightFloatingPositioned() const;
-    bool hasClearance() const;
+    bool hasFloatClear() const;
 
     bool isFloatingOrOutOfFlowPositioned() const { return isFloatingPositioned() || isOutOfFlowPositioned(); }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to