⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 252776 in webkit


Ignore:
Timestamp:
Nov 22, 2019, 8:37:12 AM (7 years ago)
Author:
Alan Bujtas
Message:

[LFC][IFC] Line::inlineItemContentHeight should only call FormattingContext::geometryForBox when needed
https://bugs.webkit.org/show_bug.cgi?id=204516
<rdar://problem/57429153>

Reviewed by Antti Koivisto.

Line::inlineItemContentHeight is hot and geometryForBox() is a hash lookup. Let's not call it unless we need to.

  • layout/inlineformatting/InlineLine.cpp:

(WebCore::Layout::Line::inlineItemContentHeight const):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r252768 r252776  
     12019-11-22  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC][IFC] Line::inlineItemContentHeight should only call FormattingContext::geometryForBox when needed
     4        https://bugs.webkit.org/show_bug.cgi?id=204516
     5        <rdar://problem/57429153>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        Line::inlineItemContentHeight is hot and geometryForBox() is a hash lookup. Let's not call it unless we need to.
     10
     11        * layout/inlineformatting/InlineLine.cpp:
     12        (WebCore::Layout::Line::inlineItemContentHeight const):
     13
    1142019-11-22  Carlos Garcia Campos  <cgarcia@igalia.com>
    215
  • trunk/Source/WebCore/layout/inlineformatting/InlineLine.cpp

    r252750 r252776  
    693693        return fontMetrics.height();
    694694
     695    if (inlineItem.isContainerStart() || inlineItem.isContainerEnd())
     696        return fontMetrics.height();
     697
    695698    auto& layoutBox = inlineItem.layoutBox();
    696699    auto& boxGeometry = formattingContext().geometryForBox(layoutBox);
    697 
    698700    if (layoutBox.replaced() || layoutBox.isFloatingPositioned())
    699701        return boxGeometry.contentBoxHeight();
    700 
    701     if (inlineItem.isContainerStart() || inlineItem.isContainerEnd())
    702         return fontMetrics.height();
    703702
    704703    // Non-replaced inline box (e.g. inline-block). It looks a bit misleading but their margin box is considered the content height here.
Note: See TracChangeset for help on using the changeset viewer.