Title: [283902] trunk/Source/WebCore
Revision
283902
Author
[email protected]
Date
2021-10-11 09:54:18 -0700 (Mon, 11 Oct 2021)

Log Message

[LFC][Integration] Use inline box isFirstBox/isLastBox bits in iterator
https://bugs.webkit.org/show_bug.cgi?id=231513

Reviewed by Alan Bujtas.

* layout/integration/InlineIteratorBoxModernPath.h:
(WebCore::InlineIterator::BoxModernPath::traverseNextInlineBox):
(WebCore::InlineIterator::BoxModernPath::traversePreviousInlineBox):

Avoid always traversing to the end.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (283901 => 283902)


--- trunk/Source/WebCore/ChangeLog	2021-10-11 16:36:27 UTC (rev 283901)
+++ trunk/Source/WebCore/ChangeLog	2021-10-11 16:54:18 UTC (rev 283902)
@@ -1,3 +1,16 @@
+2021-10-11  Antti Koivisto  <[email protected]>
+
+        [LFC][Integration] Use inline box isFirstBox/isLastBox bits in iterator
+        https://bugs.webkit.org/show_bug.cgi?id=231513
+
+        Reviewed by Alan Bujtas.
+
+        * layout/integration/InlineIteratorBoxModernPath.h:
+        (WebCore::InlineIterator::BoxModernPath::traverseNextInlineBox):
+        (WebCore::InlineIterator::BoxModernPath::traversePreviousInlineBox):
+
+        Avoid always traversing to the end.
+
 2021-10-11  Wenson Hsieh  <[email protected]>
 
         Export some display list item methods for use in WebKit2

Modified: trunk/Source/WebCore/layout/integration/InlineIteratorBoxModernPath.h (283901 => 283902)


--- trunk/Source/WebCore/layout/integration/InlineIteratorBoxModernPath.h	2021-10-11 16:36:27 UTC (rev 283901)
+++ trunk/Source/WebCore/layout/integration/InlineIteratorBoxModernPath.h	2021-10-11 16:54:18 UTC (rev 283902)
@@ -180,7 +180,11 @@
     {
         ASSERT(box().isInlineBox());
 
-        // FIXME: This always searches to the end.
+        if (box().isLastBox()) {
+            setAtEnd();
+            return;
+        }
+
         auto& layoutBox = box().layoutBox();
         do {
             traverseNextBox();
@@ -193,7 +197,11 @@
     {
         ASSERT(box().isInlineBox());
 
-        // FIXME: This always searches to the beginning.
+        if (box().isFirstBox()) {
+            setAtEnd();
+            return;
+        }
+
         auto& layoutBox = box().layoutBox();
         do {
             traversePreviousBox();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to