Title: [264395] trunk/Source/WebCore
Revision
264395
Author
[email protected]
Date
2020-07-15 06:58:39 -0700 (Wed, 15 Jul 2020)

Log Message

[LFC][IFC] Remove Display::LineBox::isConsideredEmpty
https://bugs.webkit.org/show_bug.cgi?id=214335

Reviewed by Antti Koivisto.

Display classes should not have layout related bits.

* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough const):
* layout/displaytree/DisplayLineBox.h:
(WebCore::Display::LineBox::baselineOffset const):
(WebCore::Display::LineBox::LineBox):
(WebCore::Display::LineBox::isConsideredEmpty const): Deleted.
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::setDisplayBoxesForLine):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (264394 => 264395)


--- trunk/Source/WebCore/ChangeLog	2020-07-15 13:48:26 UTC (rev 264394)
+++ trunk/Source/WebCore/ChangeLog	2020-07-15 13:58:39 UTC (rev 264395)
@@ -1,3 +1,21 @@
+2020-07-15  Zalan Bujtas  <[email protected]>
+
+        [LFC][IFC] Remove Display::LineBox::isConsideredEmpty
+        https://bugs.webkit.org/show_bug.cgi?id=214335
+
+        Reviewed by Antti Koivisto.
+
+        Display classes should not have layout related bits.
+
+        * layout/blockformatting/BlockMarginCollapse.cpp:
+        (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough const):
+        * layout/displaytree/DisplayLineBox.h:
+        (WebCore::Display::LineBox::baselineOffset const):
+        (WebCore::Display::LineBox::LineBox):
+        (WebCore::Display::LineBox::isConsideredEmpty const): Deleted.
+        * layout/inlineformatting/InlineFormattingContext.cpp:
+        (WebCore::Layout::InlineFormattingContext::setDisplayBoxesForLine):
+
 2020-07-15  Alicia Boya GarcĂ­a  <[email protected]>
 
         [MSE][GStreamer] Break circular reference between SourceBufferPrivateGStreamer and AppendPipeline

Modified: trunk/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp (264394 => 264395)


--- trunk/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp	2020-07-15 13:48:26 UTC (rev 264394)
+++ trunk/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp	2020-07-15 13:58:39 UTC (rev 264395)
@@ -407,12 +407,8 @@
 
             auto isConsideredEmpty = [&] {
                 auto& formattingState = layoutState.establishedInlineFormattingState(containerBox);
-                if (auto* inlineContent = formattingState.displayInlineContent()) {
-                    for (auto& lineBox : inlineContent->lineBoxes) {
-                        if (!lineBox.isConsideredEmpty())
-                            return false;
-                    }
-                }
+                if (auto* inlineContent = formattingState.displayInlineContent(); inlineContent && !inlineContent->lineBoxes.isEmpty())
+                    return false;
                 // Any float box in this formatting context prevents collapsing through.
                 auto& floats = formattingState.floatingState().floats();
                 for (auto& floatItem : floats) {

Modified: trunk/Source/WebCore/layout/displaytree/DisplayLineBox.h (264394 => 264395)


--- trunk/Source/WebCore/layout/displaytree/DisplayLineBox.h	2020-07-15 13:48:26 UTC (rev 264394)
+++ trunk/Source/WebCore/layout/displaytree/DisplayLineBox.h	2020-07-15 13:58:39 UTC (rev 264395)
@@ -47,7 +47,7 @@
         InlineLayoutUnit m_descent { 0 };
     };
 
-    LineBox(const InlineRect&, const InlineRect& scrollableOverflow, const InlineRect& inkOverflow, const Baseline&, InlineLayoutUnit baselineOffset, bool isConsideredEmpty);
+    LineBox(const InlineRect&, const InlineRect& scrollableOverflow, const InlineRect& inkOverflow, const Baseline&, InlineLayoutUnit baselineOffset);
 
     const InlineRect& rect() const { return m_rect; }
     const InlineRect& scrollableOverflow() const { return m_scrollableOverflow; }
@@ -80,7 +80,6 @@
     //   v
     // -------------------       line bottom       -------------------
     InlineLayoutUnit baselineOffset() const { return m_baselineOffset; }
-    bool isConsideredEmpty() const { return m_isConsideredEmpty; }
 
 private:
     InlineRect m_rect;
@@ -88,16 +87,14 @@
     InlineRect m_inkOverflow;
     Baseline m_baseline;
     InlineLayoutUnit m_baselineOffset { 0 };
-    bool m_isConsideredEmpty { true };
 };
 
-inline LineBox::LineBox(const InlineRect& rect, const InlineRect& scrollableOverflow, const InlineRect& inkOverflow, const Baseline& baseline, InlineLayoutUnit baselineOffset, bool isConsideredEmpty)
+inline LineBox::LineBox(const InlineRect& rect, const InlineRect& scrollableOverflow, const InlineRect& inkOverflow, const Baseline& baseline, InlineLayoutUnit baselineOffset)
     : m_rect(rect)
     , m_scrollableOverflow(scrollableOverflow)
     , m_inkOverflow(inkOverflow)
     , m_baseline(baseline)
     , m_baselineOffset(baselineOffset)
-    , m_isConsideredEmpty(isConsideredEmpty)
 {
 }
 

Modified: trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp (264394 => 264395)


--- trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp	2020-07-15 13:48:26 UTC (rev 264394)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp	2020-07-15 13:58:39 UTC (rev 264395)
@@ -570,7 +570,7 @@
     }
     // FIXME: This is where the logical to physical translate should happen.
     auto& baseline = lineBox.baseline();
-    inlineContent.lineBoxes.append({ lineBox.logicalRect(), lineBox.scrollableOverflow(), lineInkOverflow, { baseline.ascent(), baseline.descent() }, lineBox.baselineOffset(), lineBox.isConsideredEmpty() });
+    inlineContent.lineBoxes.append({ lineBox.logicalRect(), lineBox.scrollableOverflow(), lineInkOverflow, { baseline.ascent(), baseline.descent() }, lineBox.baselineOffset() });
 }
 
 void InlineFormattingContext::invalidateFormattingState(const InvalidationState&)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to