Title: [272115] trunk/Source/WebCore
Revision
272115
Author
[email protected]
Date
2021-01-30 04:44:06 -0800 (Sat, 30 Jan 2021)

Log Message

[LFC][IFC] Remove redundant LineBoxBuilder::isRootLayoutBox function
https://bugs.webkit.org/show_bug.cgi?id=221170

Reviewed by Antti Koivisto.

* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::LineBoxBuilder::isRootLayoutBox const): Change the name to include "layoutBox" to not confuse it with inline boxes.
(WebCore::Layout::LineBoxBuilder::setVerticalGeometryForInlineBox const):
(WebCore::Layout::LineBoxBuilder::constructInlineLevelBoxes):
(WebCore::Layout::LineBoxBuilder::isRootInlineBox const): Deleted.
(WebCore::Layout::LineBoxBuilder::isRootBox const): Deleted.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (272114 => 272115)


--- trunk/Source/WebCore/ChangeLog	2021-01-30 08:53:10 UTC (rev 272114)
+++ trunk/Source/WebCore/ChangeLog	2021-01-30 12:44:06 UTC (rev 272115)
@@ -1,3 +1,17 @@
+2021-01-30  Zalan Bujtas  <[email protected]>
+
+        [LFC][IFC] Remove redundant LineBoxBuilder::isRootLayoutBox function
+        https://bugs.webkit.org/show_bug.cgi?id=221170
+
+        Reviewed by Antti Koivisto.
+
+        * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
+        (WebCore::Layout::LineBoxBuilder::isRootLayoutBox const): Change the name to include "layoutBox" to not confuse it with inline boxes.
+        (WebCore::Layout::LineBoxBuilder::setVerticalGeometryForInlineBox const):
+        (WebCore::Layout::LineBoxBuilder::constructInlineLevelBoxes):
+        (WebCore::Layout::LineBoxBuilder::isRootInlineBox const): Deleted.
+        (WebCore::Layout::LineBoxBuilder::isRootBox const): Deleted.
+
 2021-01-30  Ryosuke Niwa  <[email protected]>
 
         StaticRange should keep its start and end containers alive

Modified: trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContextGeometry.cpp (272114 => 272115)


--- trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContextGeometry.cpp	2021-01-30 08:53:10 UTC (rev 272114)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContextGeometry.cpp	2021-01-30 12:44:06 UTC (rev 272115)
@@ -53,8 +53,7 @@
     const Box& rootBox() const { return formattingContext().root(); }
     LayoutState& layoutState() const { return formattingContext().layoutState(); }
 
-    bool isRootInlineBox(const LineBox::InlineLevelBox& inlineLevelBox) const { return &inlineLevelBox.layoutBox() == &rootBox(); }
-    bool isRootBox(const ContainerBox& containerBox) const { return &containerBox == &rootBox(); }
+    bool isRootLayoutBox(const ContainerBox& containerBox) const { return &containerBox == &rootBox(); }
 
 private:
     const InlineFormattingContext& m_inlineFormattingContext;
@@ -186,7 +185,7 @@
     if (lineHeight.isNegative()) {
         // If line-height computes to normal and either text-edge is leading or this is the root inline box,
         // the font’s line gap metric may also be incorporated into A and D by adding half to each side as half-leading.
-        auto shouldLineGapStretchInlineLevelBox = isRootInlineBox(inlineLevelBox) || inlineLevelBox.isLineBreakBox();
+        auto shouldLineGapStretchInlineLevelBox = inlineLevelBox.isRootInlineBox() || inlineLevelBox.isLineBreakBox();
         if (shouldLineGapStretchInlineLevelBox) {
             auto halfLineGap = (fontMetrics.lineSpacing() - logicalHeight) / 2;
             ascent += halfLineGap;
@@ -237,13 +236,13 @@
         // <span>normally the inline box closing forms a continuous content</span>
         // <span>unless it's forced to the next line<br></span>
         auto firstRunNeedsInlineBox = firstRun.isInlineBoxEnd();
-        if (!firstRunNeedsInlineBox && isRootBox(firstRunParentLayoutBox))
+        if (!firstRunNeedsInlineBox && isRootLayoutBox(firstRunParentLayoutBox))
             return;
         Vector<const Box*> layoutBoxesWithoutInlineBoxes;
         if (firstRunNeedsInlineBox)
             layoutBoxesWithoutInlineBoxes.append(&firstRun.layoutBox());
         auto* ancestor = &firstRunParentLayoutBox;
-        while (!isRootBox(*ancestor)) {
+        while (!isRootLayoutBox(*ancestor)) {
             layoutBoxesWithoutInlineBoxes.append(ancestor);
             ancestor = &ancestor->parent();
         }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to