Changeset 247153 in webkit


Ignore:
Timestamp:
Jul 5, 2019 7:24:23 AM (5 years ago)
Author:
Alan Bujtas
Message:

[LFC][IFC] Inline runs should be relative to the line's top/left initially
https://bugs.webkit.org/show_bug.cgi?id=199157
<rdar://problem/52053415>

Reviewed by Antti Koivisto.

Let's construct the runs relative to the line's top/left and convert them relative to the formatting root's border box top/left
when the line is being closed. When the line moves (floats etc) we don't have to move each runs individually.

  • layout/inlineformatting/InlineLine.cpp:

(WebCore::Layout::Line::close):
(WebCore::Layout::Line::moveLogicalLeft):
(WebCore::Layout::Line::appendInlineContainerStart):
(WebCore::Layout::Line::appendTextContent):
(WebCore::Layout::Line::appendNonReplacedInlineBox):
(WebCore::Layout::Line::appendHardLineBreak):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r247152 r247153  
     12019-07-05  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC][IFC] Inline runs should be relative to the line's top/left initially
     4        https://bugs.webkit.org/show_bug.cgi?id=199157
     5        <rdar://problem/52053415>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        Let's construct the runs relative to the line's top/left and convert them relative to the formatting root's border box top/left
     10        when the line is being closed. When the line moves (floats etc) we don't have to move each runs individually.
     11
     12        * layout/inlineformatting/InlineLine.cpp:
     13        (WebCore::Layout::Line::close):
     14        (WebCore::Layout::Line::moveLogicalLeft):
     15        (WebCore::Layout::Line::appendInlineContainerStart):
     16        (WebCore::Layout::Line::appendTextContent):
     17        (WebCore::Layout::Line::appendNonReplacedInlineBox):
     18        (WebCore::Layout::Line::appendHardLineBreak):
     19
    1202019-07-05  Antti Koivisto  <antti@apple.com>
    221
  • trunk/Source/WebCore/layout/inlineformatting/InlineLine.cpp

    r247151 r247153  
    141141            }
    142142            run->logicalRect.setTop(logicalTop);
     143            // Convert runs from relative to the line top/left to the formatting root's border box top/left.
     144            run->logicalRect.moveVertically(this->logicalTop());
     145            run->logicalRect.moveHorizontally(this->logicalLeft());
    143146        }
    144147    }
     
    168171    m_logicalTopLeft.move(delta, 0);
    169172    m_lineLogicalWidth -= delta;
    170     for (auto& run : m_content->runs())
    171         run->logicalRect.moveHorizontally(delta);
    172173}
    173174
     
    212213{
    213214    auto logicalRect = Display::Rect { };
    214     logicalRect.setLeft(contentLogicalRight());
     215    logicalRect.setLeft(contentLogicalWidth());
    215216    logicalRect.setWidth(logicalWidth);
    216217
     
    265266   
    266267    auto logicalRect = Display::Rect { };
    267     logicalRect.setLeft(contentLogicalRight());
     268    logicalRect.setLeft(contentLogicalWidth());
    268269    logicalRect.setWidth(logicalWidth);
    269270    if (!m_skipVerticalAligment) {
     
    288289    auto logicalRect = Display::Rect { };
    289290
    290     logicalRect.setLeft(contentLogicalRight() + horizontalMargin.start);
     291    logicalRect.setLeft(contentLogicalWidth() + horizontalMargin.start);
    291292    logicalRect.setWidth(logicalWidth);
    292293    if (!m_skipVerticalAligment) {
     
    309310{
    310311    auto logicalRect = Display::Rect { };
    311     logicalRect.setLeft(contentLogicalRight());
     312    logicalRect.setLeft(contentLogicalWidth());
    312313    logicalRect.setWidth({ });
    313314    if (!m_skipVerticalAligment) {
Note: See TracChangeset for help on using the changeset viewer.