Changeset 270128 in webkit
- Timestamp:
- Nov 20, 2020 12:54:25 PM (3 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r270127 r270128 1 2020-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 1 32 2020-11-20 Chris Dumez <cdumez@apple.com> 2 33 -
trunk/Source/WebCore/editing/VisiblePosition.cpp
r269747 r270128 661 661 662 662 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() } }; 664 664 if (!line->isHorizontal()) 665 665 localRect = localRect.transposedRect(); -
trunk/Source/WebCore/layout/integration/LayoutIntegrationLineIterator.h
r269916 r270128 62 62 63 63 float y() const; 64 float logicalLeft() const;65 float logicalRight() const;64 float contentLogicalLeft() const; 65 float contentLogicalRight() const; 66 66 float logicalHeight() const; 67 67 … … 181 181 inline LayoutRect PathLine::selectionRect() const 182 182 { 183 return { LayoutPoint { logicalLeft(), selectionTop() }, LayoutPoint { logicalRight(), selectionBottom() } };183 return { LayoutPoint { contentLogicalLeft(), selectionTop() }, LayoutPoint { contentLogicalRight(), selectionBottom() } }; 184 184 } 185 185 … … 191 191 } 192 192 193 inline float PathLine:: logicalLeft() const194 { 195 return WTF::switchOn(m_pathVariant, [](const auto& path) { 196 return path. logicalLeft();197 }); 198 } 199 200 inline float PathLine:: logicalRight() const201 { 202 return WTF::switchOn(m_pathVariant, [](const auto& path) { 203 return path. logicalRight();193 inline float PathLine::contentLogicalLeft() const 194 { 195 return WTF::switchOn(m_pathVariant, [](const auto& path) { 196 return path.contentLogicalLeft(); 197 }); 198 } 199 200 inline float PathLine::contentLogicalRight() const 201 { 202 return WTF::switchOn(m_pathVariant, [](const auto& path) { 203 return path.contentLogicalRight(); 204 204 }); 205 205 } -
trunk/Source/WebCore/layout/integration/LayoutIntegrationLineIteratorLegacyPath.h
r269916 r270128 54 54 55 55 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(); } 58 58 float logicalHeight() const { return m_rootInlineBox->logicalHeight(); } 59 59 bool isHorizontal() const { return m_rootInlineBox->isHorizontal(); } -
trunk/Source/WebCore/layout/integration/LayoutIntegrationLineIteratorModernPath.h
r270110 r270128 60 60 LayoutUnit selectionBottom() const { return bottom(); } 61 61 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(); } 64 64 float y() const { return lineBoxTop(); } 65 65 float logicalHeight() const { return line().rect().height(); } -
trunk/Source/WebCore/rendering/RenderLineBreak.cpp
r269693 r270128 168 168 169 169 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); 171 171 } 172 172 … … 215 215 216 216 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); 218 218 219 219 if (rootBox.isFirstAfterPageBreak()) {
Note: See TracChangeset
for help on using the changeset viewer.