Changeset 270128 in webkit


Ignore:
Timestamp:
Nov 20, 2020 12:54:25 PM (3 years ago)
Author:
Alan Bujtas
Message:

[LFC][Integration] Rename LineIteratorLegacy::logicalLeft/right to contentLeft/right
https://bugs.webkit.org/show_bug.cgi?id=219215

Reviewed by Antti Koivisto.

These functions are supposed to return the position where the content starts/ends inside the line box (see text-alignment as an example
where the line's logical left edge is not where content starts).

(WebCore::VisiblePosition::absoluteSelectionBoundsForLine const):

  • layout/integration/LayoutIntegrationLineIterator.h:

(WebCore::LayoutIntegration::PathLine::selectionRect const):
(WebCore::LayoutIntegration::PathLine::contentLogicalLeft const):
(WebCore::LayoutIntegration::PathLine::contentLogicalRight const):
(WebCore::LayoutIntegration::PathLine::logicalLeft const): Deleted.
(WebCore::LayoutIntegration::PathLine::logicalRight const): Deleted.

  • layout/integration/LayoutIntegrationLineIteratorLegacyPath.h:

(WebCore::LayoutIntegration::LineIteratorLegacyPath::contentLogicalLeft const):
(WebCore::LayoutIntegration::LineIteratorLegacyPath::contentLogicalRight const):
(WebCore::LayoutIntegration::LineIteratorLegacyPath::logicalLeft const): Deleted.
(WebCore::LayoutIntegration::LineIteratorLegacyPath::logicalRight const): Deleted.

  • layout/integration/LayoutIntegrationLineIteratorModernPath.h:

(WebCore::LayoutIntegration::LineIteratorModernPath::contentLogicalLeft const):
(WebCore::LayoutIntegration::LineIteratorModernPath::contentLogicalRight const):
(WebCore::LayoutIntegration::LineIteratorModernPath::logicalLeft const): Deleted.
(WebCore::LayoutIntegration::LineIteratorModernPath::logicalRight const): Deleted.

  • rendering/RenderLineBreak.cpp:

(WebCore::RenderLineBreak::localCaretRect const):
(WebCore::RenderLineBreak::collectSelectionRects):

Location:
trunk/Source/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r270127 r270128  
     12020-11-20  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC][Integration] Rename LineIteratorLegacy::logicalLeft/right to contentLeft/right
     4        https://bugs.webkit.org/show_bug.cgi?id=219215
     5
     6        Reviewed by Antti Koivisto.
     7
     8        These functions are supposed to return the position where the content starts/ends inside the line box (see text-alignment as an example
     9        where the line's logical left edge is not where content starts).
     10
     11        (WebCore::VisiblePosition::absoluteSelectionBoundsForLine const):
     12        * layout/integration/LayoutIntegrationLineIterator.h:
     13        (WebCore::LayoutIntegration::PathLine::selectionRect const):
     14        (WebCore::LayoutIntegration::PathLine::contentLogicalLeft const):
     15        (WebCore::LayoutIntegration::PathLine::contentLogicalRight const):
     16        (WebCore::LayoutIntegration::PathLine::logicalLeft const): Deleted.
     17        (WebCore::LayoutIntegration::PathLine::logicalRight const): Deleted.
     18        * layout/integration/LayoutIntegrationLineIteratorLegacyPath.h:
     19        (WebCore::LayoutIntegration::LineIteratorLegacyPath::contentLogicalLeft const):
     20        (WebCore::LayoutIntegration::LineIteratorLegacyPath::contentLogicalRight const):
     21        (WebCore::LayoutIntegration::LineIteratorLegacyPath::logicalLeft const): Deleted.
     22        (WebCore::LayoutIntegration::LineIteratorLegacyPath::logicalRight const): Deleted.
     23        * layout/integration/LayoutIntegrationLineIteratorModernPath.h:
     24        (WebCore::LayoutIntegration::LineIteratorModernPath::contentLogicalLeft const):
     25        (WebCore::LayoutIntegration::LineIteratorModernPath::contentLogicalRight const):
     26        (WebCore::LayoutIntegration::LineIteratorModernPath::logicalLeft const): Deleted.
     27        (WebCore::LayoutIntegration::LineIteratorModernPath::logicalRight const): Deleted.
     28        * rendering/RenderLineBreak.cpp:
     29        (WebCore::RenderLineBreak::localCaretRect const):
     30        (WebCore::RenderLineBreak::collectSelectionRects):
     31
    1322020-11-20  Chris Dumez  <cdumez@apple.com>
    233
  • trunk/Source/WebCore/editing/VisiblePosition.cpp

    r269747 r270128  
    661661
    662662    auto line = run.line();
    663     auto localRect = FloatRect { FloatPoint { line->logicalLeft(), line->selectionTop() }, FloatPoint { line->logicalRight(), line->selectionBottom() } };
     663    auto localRect = FloatRect { FloatPoint { line->contentLogicalLeft(), line->selectionTop() }, FloatPoint { line->contentLogicalRight(), line->selectionBottom() } };
    664664    if (!line->isHorizontal())
    665665        localRect = localRect.transposedRect();
  • trunk/Source/WebCore/layout/integration/LayoutIntegrationLineIterator.h

    r269916 r270128  
    6262
    6363    float y() const;
    64     float logicalLeft() const;
    65     float logicalRight() const;
     64    float contentLogicalLeft() const;
     65    float contentLogicalRight() const;
    6666    float logicalHeight() const;
    6767
     
    181181inline LayoutRect PathLine::selectionRect() const
    182182{
    183     return { LayoutPoint { logicalLeft(), selectionTop() }, LayoutPoint { logicalRight(), selectionBottom() } };
     183    return { LayoutPoint { contentLogicalLeft(), selectionTop() }, LayoutPoint { contentLogicalRight(), selectionBottom() } };
    184184}
    185185
     
    191191}
    192192
    193 inline float PathLine::logicalLeft() const
    194 {
    195     return WTF::switchOn(m_pathVariant, [](const auto& path) {
    196         return path.logicalLeft();
    197     });
    198 }
    199 
    200 inline float PathLine::logicalRight() const
    201 {
    202     return WTF::switchOn(m_pathVariant, [](const auto& path) {
    203         return path.logicalRight();
     193inline float PathLine::contentLogicalLeft() const
     194{
     195    return WTF::switchOn(m_pathVariant, [](const auto& path) {
     196        return path.contentLogicalLeft();
     197    });
     198}
     199
     200inline float PathLine::contentLogicalRight() const
     201{
     202    return WTF::switchOn(m_pathVariant, [](const auto& path) {
     203        return path.contentLogicalRight();
    204204    });
    205205}
  • trunk/Source/WebCore/layout/integration/LayoutIntegrationLineIteratorLegacyPath.h

    r269916 r270128  
    5454
    5555    float y() const { return m_rootInlineBox->y(); }
    56     float logicalLeft() const { return m_rootInlineBox->logicalLeft(); }
    57     float logicalRight() const { return m_rootInlineBox->logicalRight(); }
     56    float contentLogicalLeft() const { return m_rootInlineBox->logicalLeft(); }
     57    float contentLogicalRight() const { return m_rootInlineBox->logicalRight(); }
    5858    float logicalHeight() const { return m_rootInlineBox->logicalHeight(); }
    5959    bool isHorizontal() const { return m_rootInlineBox->isHorizontal(); }
  • trunk/Source/WebCore/layout/integration/LayoutIntegrationLineIteratorModernPath.h

    r270110 r270128  
    6060    LayoutUnit selectionBottom() const { return bottom(); }
    6161
    62     float logicalLeft() const { return line().rect().x() + line().horizontalAlignmentOffset(); }
    63     float logicalRight() const { return logicalLeft() + line().lineBoxWidth(); }
     62    float contentLogicalLeft() const { return line().rect().x() + line().horizontalAlignmentOffset(); }
     63    float contentLogicalRight() const { return contentLogicalLeft() + line().rect().width(); }
    6464    float y() const { return lineBoxTop(); }
    6565    float logicalHeight() const { return line().rect().height(); }
  • trunk/Source/WebCore/rendering/RenderLineBreak.cpp

    r269693 r270128  
    168168
    169169    auto line = runAndOffset.run.line();
    170     return line->containingBlock().computeCaretRect(line->selectionRect(), line->logicalLeft(), caretWidth, caretRectMode);
     170    return line->containingBlock().computeCaretRect(line->selectionRect(), line->contentLogicalLeft(), caretWidth, caretRectMode);
    171171}
    172172
     
    215215
    216216    auto line = LayoutIntegration::LineIterator(&rootBox);
    217     LayoutRect rect = rootBox.blockFlow().computeCaretRect(line->selectionRect(), line->logicalLeft(), 0);
     217    LayoutRect rect = rootBox.blockFlow().computeCaretRect(line->selectionRect(), line->contentLogicalLeft(), 0);
    218218
    219219    if (rootBox.isFirstAfterPageBreak()) {
Note: See TracChangeset for help on using the changeset viewer.