Title: [271058] trunk/Source/WebCore
Revision
271058
Author
[email protected]
Date
2020-12-22 11:02:43 -0800 (Tue, 22 Dec 2020)

Log Message

[LFC][IFC] Add fast path for the most common "inline level box is the child of the root inline box" case
https://bugs.webkit.org/show_bug.cgi?id=220089
<rdar://problem/72590141>

Reviewed by Simon Fraser.

* layout/inlineformatting/InlineFormattingState.h:
(WebCore::Layout::InlineFormattingState::addLineRun):
* layout/inlineformatting/InlineLineBox.cpp:
(WebCore::Layout::LineBox::logicalMarginRectForInlineLevelBox const):
* layout/inlineformatting/InlineLineBox.h:
(WebCore::Layout::LineBox::inlineLevelBoxList const):
(WebCore::Layout::LineBox::containsInlineLevelBox const): Deleted.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (271057 => 271058)


--- trunk/Source/WebCore/ChangeLog	2020-12-22 18:40:15 UTC (rev 271057)
+++ trunk/Source/WebCore/ChangeLog	2020-12-22 19:02:43 UTC (rev 271058)
@@ -1,3 +1,19 @@
+2020-12-22  Zalan Bujtas  <[email protected]>
+
+        [LFC][IFC] Add fast path for the most common "inline level box is the child of the root inline box" case
+        https://bugs.webkit.org/show_bug.cgi?id=220089
+        <rdar://problem/72590141>
+
+        Reviewed by Simon Fraser.
+
+        * layout/inlineformatting/InlineFormattingState.h:
+        (WebCore::Layout::InlineFormattingState::addLineRun):
+        * layout/inlineformatting/InlineLineBox.cpp:
+        (WebCore::Layout::LineBox::logicalMarginRectForInlineLevelBox const):
+        * layout/inlineformatting/InlineLineBox.h:
+        (WebCore::Layout::LineBox::inlineLevelBoxList const):
+        (WebCore::Layout::LineBox::containsInlineLevelBox const): Deleted.
+
 2020-12-22  Ryan Haddad  <[email protected]>
 
         Unreviewed, fix the build with recent SDKs.

Modified: trunk/Source/WebCore/layout/inlineformatting/InlineFormattingState.h (271057 => 271058)


--- trunk/Source/WebCore/layout/inlineformatting/InlineFormattingState.h	2020-12-22 18:40:15 UTC (rev 271057)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineFormattingState.h	2020-12-22 19:02:43 UTC (rev 271058)
@@ -62,7 +62,7 @@
 
     const InlineLineRuns& lineRuns() const { return m_lineRuns; }
     InlineLineRuns& lineRuns() { return m_lineRuns; }
-    void addLineRun(const LineRun& run) { m_lineRuns.append(run); }
+    void addLineRun(LineRun&& run) { m_lineRuns.append(WTFMove(run)); }
 
     void setClearGapAfterLastLine(InlineLayoutUnit verticalGap);
     InlineLayoutUnit clearGapAfterLastLine() const { return m_clearGapAfterLastLine; }

Modified: trunk/Source/WebCore/layout/inlineformatting/InlineLineBox.cpp (271057 => 271058)


--- trunk/Source/WebCore/layout/inlineformatting/InlineLineBox.cpp	2020-12-22 18:40:15 UTC (rev 271057)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineLineBox.cpp	2020-12-22 19:02:43 UTC (rev 271058)
@@ -118,10 +118,15 @@
 {
     auto logicalRect = [&] {
         auto* inlineBox = &inlineLevelBoxForLayoutBox(layoutBox);
+        auto inlineBoxLogicalRect = inlineBox->logicalRect();
         if (inlineBox->hasLineBoxRelativeAlignment())
-            return inlineBox->logicalRect();
+            return inlineBoxLogicalRect;
 
-        auto inlineBoxLogicalRect = inlineBox->logicalRect();
+        if (&layoutBox.parent() == &m_rootInlineBox->layoutBox()) {
+            inlineBoxLogicalRect.moveVertically(m_rootInlineBox->logicalTop());
+            return inlineBoxLogicalRect;
+        }
+
         auto inlineBoxAbsolutelogicalTop = inlineBoxLogicalRect.top();
         while (inlineBox != m_rootInlineBox.get() && !inlineBox->hasLineBoxRelativeAlignment()) {
             inlineBox = &inlineLevelBoxForLayoutBox(inlineBox->layoutBox().parent());

Modified: trunk/Source/WebCore/layout/inlineformatting/InlineLineBox.h (271057 => 271058)


--- trunk/Source/WebCore/layout/inlineformatting/InlineLineBox.h	2020-12-22 18:40:15 UTC (rev 271057)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineLineBox.h	2020-12-22 19:02:43 UTC (rev 271058)
@@ -148,7 +148,6 @@
     InlineRect logicalMarginRectForInlineLevelBox(const Box&, const BoxGeometry&) const;
 
     auto inlineLevelBoxList() const { return m_inlineLevelBoxRectMap.values(); }
-    bool containsInlineLevelBox(const Box& layoutBox) const { return m_inlineLevelBoxRectMap.contains(&layoutBox); }
 
     const InlineLevelBox& rootInlineBox() const { return *m_rootInlineBox; }
     using InlineLevelBoxList = Vector<std::unique_ptr<InlineLevelBox>>;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to