Title: [252829] trunk/Source/WebCore
Revision
252829
Author
[email protected]
Date
2019-11-23 05:33:49 -0800 (Sat, 23 Nov 2019)

Log Message

[LFC][IFC] Remove unnecessary Line::hasContent() calls in LineLayout::placeInlineItem
https://bugs.webkit.org/show_bug.cgi?id=204540
<rdar://problem/57443500>

Reviewed by Antti Koivisto.

LineLayout::placeInlineItem is hot. This shaves off ~3% on line-layout-simple.html

* layout/inlineformatting/InlineLineLayout.cpp:
(WebCore::Layout::LineLayout::placeInlineItem):
* page/FrameView.cpp:
(WebCore::FrameView::paintContents):
* page/FrameViewLayoutContext.cpp:
(WebCore::FrameViewLayoutContext::layoutUsingFormattingContext):
(WebCore::FrameViewLayoutContext::layout):
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::attachToRenderElementInternal):
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateRendererStyle):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (252828 => 252829)


--- trunk/Source/WebCore/ChangeLog	2019-11-23 10:19:42 UTC (rev 252828)
+++ trunk/Source/WebCore/ChangeLog	2019-11-23 13:33:49 UTC (rev 252829)
@@ -1,3 +1,25 @@
+2019-11-23  Zalan Bujtas  <[email protected]>
+
+        [LFC][IFC] Remove unnecessary Line::hasContent() calls in LineLayout::placeInlineItem
+        https://bugs.webkit.org/show_bug.cgi?id=204540
+        <rdar://problem/57443500>
+
+        Reviewed by Antti Koivisto.
+
+        LineLayout::placeInlineItem is hot. This shaves off ~3% on line-layout-simple.html 
+
+        * layout/inlineformatting/InlineLineLayout.cpp:
+        (WebCore::Layout::LineLayout::placeInlineItem):
+        * page/FrameView.cpp:
+        (WebCore::FrameView::paintContents):
+        * page/FrameViewLayoutContext.cpp:
+        (WebCore::FrameViewLayoutContext::layoutUsingFormattingContext):
+        (WebCore::FrameViewLayoutContext::layout):
+        * rendering/updating/RenderTreeBuilder.cpp:
+        (WebCore::RenderTreeBuilder::attachToRenderElementInternal):
+        * rendering/updating/RenderTreeUpdater.cpp:
+        (WebCore::RenderTreeUpdater::updateRendererStyle):
+
 2019-11-23  Antti Koivisto  <[email protected]>
 
         Media queries in img sizes attribute don't evaluate dynamically

Modified: trunk/Source/WebCore/layout/inlineformatting/InlineLineLayout.cpp (252828 => 252829)


--- trunk/Source/WebCore/layout/inlineformatting/InlineLineLayout.cpp	2019-11-23 10:19:42 UTC (rev 252828)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineLineLayout.cpp	2019-11-23 13:33:49 UTC (rev 252829)
@@ -166,7 +166,6 @@
 {
     auto currentLogicalRight = m_line.lineBox().logicalRight();
     auto itemLogicalWidth = inlineItemWidth(formattingContext(), inlineItem, currentLogicalRight);
-    auto lineIsConsideredEmpty = !m_line.hasContent() && !m_lineHasIntrusiveFloat;
 
     // Floats are special, they are intrusive but they don't really participate in the line layout context.
     if (inlineItem.isFloat()) {
@@ -178,6 +177,7 @@
             if (processUncommittedContent() == IsEndOfLine::Yes)
                 return IsEndOfLine::Yes;
         }
+        auto lineIsConsideredEmpty = !m_line.hasContent() && !m_lineHasIntrusiveFloat;
         if (LineBreaker().shouldWrapFloatBox(itemLogicalWidth, m_line.availableWidth() + m_line.trailingTrimmableWidth(), lineIsConsideredEmpty))
             return IsEndOfLine::Yes;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to