Title: [256499] trunk/Source/WebCore
Revision
256499
Author
[email protected]
Date
2020-02-12 18:47:01 -0800 (Wed, 12 Feb 2020)

Log Message

[LFC][IFC] Remove LineLayoutContext::m_partialTrailingTextItem
https://bugs.webkit.org/show_bug.cgi?id=207670
<rdar://problem/59405854>

Reviewed by Antti Koivisto.

LineBuilder::Run does not hold a reference to these InlineItems anymore.

* layout/inlineformatting/LineLayoutContext.cpp:
(WebCore::Layout::LineLayoutContext::layoutLine):
(WebCore::Layout::LineLayoutContext::commitPartialContent):
* layout/inlineformatting/LineLayoutContext.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (256498 => 256499)


--- trunk/Source/WebCore/ChangeLog	2020-02-13 02:30:05 UTC (rev 256498)
+++ trunk/Source/WebCore/ChangeLog	2020-02-13 02:47:01 UTC (rev 256499)
@@ -1,3 +1,18 @@
+2020-02-12  Zalan Bujtas  <[email protected]>
+
+        [LFC][IFC] Remove LineLayoutContext::m_partialTrailingTextItem
+        https://bugs.webkit.org/show_bug.cgi?id=207670
+        <rdar://problem/59405854>
+
+        Reviewed by Antti Koivisto.
+
+        LineBuilder::Run does not hold a reference to these InlineItems anymore.
+
+        * layout/inlineformatting/LineLayoutContext.cpp:
+        (WebCore::Layout::LineLayoutContext::layoutLine):
+        (WebCore::Layout::LineLayoutContext::commitPartialContent):
+        * layout/inlineformatting/LineLayoutContext.h:
+
 2020-02-12  Pavel Feldman  <[email protected]>
 
         Web Inspector: encode binary web socket frames using base64

Modified: trunk/Source/WebCore/layout/inlineformatting/LineLayoutContext.cpp (256498 => 256499)


--- trunk/Source/WebCore/layout/inlineformatting/LineLayoutContext.cpp	2020-02-13 02:30:05 UTC (rev 256498)
+++ trunk/Source/WebCore/layout/inlineformatting/LineLayoutContext.cpp	2020-02-13 02:47:01 UTC (rev 256499)
@@ -254,12 +254,8 @@
 
 LineLayoutContext::LineContent LineLayoutContext::layoutLine(LineBuilder& line, const InlineItemRange layoutRange, Optional<unsigned> partialLeadingContentLength)
 {
-    auto reset = [&] {
-        ASSERT(m_floats.isEmpty());
-        m_partialTrailingTextItem = { };
-        m_partialLeadingTextItem = { };
-    };
-    reset();
+    ASSERT(m_floats.isEmpty());
+    m_partialLeadingTextItem = { };
     auto lineBreaker = LineBreaker { };
     auto currentItemIndex = layoutRange.start;
     unsigned committedInlineItemCount = 0;
@@ -463,10 +459,8 @@
             // Create and commit partial trailing item.
             if (auto partialRun = partialTrailingContent.partialRun) {
                 auto& trailingInlineTextItem = downcast<InlineTextItem>(runs[partialTrailingContent.trailingRunIndex].inlineItem);
-                // FIXME: LineBuilder should not hold on to the InlineItem.
-                ASSERT(!m_partialTrailingTextItem);
-                m_partialTrailingTextItem = trailingInlineTextItem.left(partialRun->length);
-                line.appendPartialTrailingTextItem(*m_partialTrailingTextItem, partialRun->logicalWidth, partialRun->needsHyphen);
+                auto partialTrailingTextItem = trailingInlineTextItem.left(partialRun->length);
+                line.appendPartialTrailingTextItem(partialTrailingTextItem, partialRun->logicalWidth, partialRun->needsHyphen);
                 return;
             }
             // The partial run is the last content to commit.

Modified: trunk/Source/WebCore/layout/inlineformatting/LineLayoutContext.h (256498 => 256499)


--- trunk/Source/WebCore/layout/inlineformatting/LineLayoutContext.h	2020-02-13 02:30:05 UTC (rev 256498)
+++ trunk/Source/WebCore/layout/inlineformatting/LineLayoutContext.h	2020-02-13 02:47:01 UTC (rev 256499)
@@ -82,7 +82,6 @@
     const InlineItems& m_inlineItems;
     FloatList m_floats;
     Optional<InlineTextItem> m_partialLeadingTextItem;
-    Optional<InlineTextItem> m_partialTrailingTextItem;
     unsigned m_successiveHyphenatedLineCount { 0 };
 };
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to