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

Changeset 267697 in webkit


Ignore:
Timestamp:
Sep 28, 2020, 6:42:33 AM (6 years ago)
Author:
Antti Koivisto
Message:

[LFC][Integration] Move run iterator to LayoutIntegration namespace
https://bugs.webkit.org/show_bug.cgi?id=217046

Reviewed by Zalan Bujtas.

Also use name 'Modern' for LFC and 'Legacy' for the old inline tree path.

Also rename box->run for more consistent terminology.

  • Sources.txt:
  • WebCore.xcodeproj/project.pbxproj:
  • dom/Position.cpp:

(WebCore::Position::upstream const):
(WebCore::Position::downstream const):

  • editing/TextIterator.cpp:

(WebCore::TextIterator::advance):
(WebCore::TextIterator::handleTextNode):
(WebCore::TextIterator::handleTextRun):
(WebCore::TextIterator::handleTextNodeFirstLetter):
(WebCore::TextIterator::handleTextBox): Deleted.

  • editing/TextIterator.h:
  • layout/integration/LayoutIntegrationLineLayout.cpp:

(WebCore::LayoutIntegration::LineLayout::textRunsFor const):
(WebCore::LayoutIntegration::LineLayout::elementRunFor const):
(WebCore::LayoutIntegration::LineLayout::paint):
(WebCore::LayoutIntegration::LineLayout::textBoxesFor const): Deleted.
(WebCore::LayoutIntegration::LineLayout::elementBoxFor const): Deleted.

  • layout/integration/LayoutIntegrationLineLayout.h:
  • layout/integration/LayoutIntegrationRunIterator.cpp: Renamed from Source/WebCore/rendering/line/LineLayoutTraversal.cpp.

(WebCore::LayoutIntegration::TextRunIterator::TextRunIterator):
(WebCore::LayoutIntegration::TextRunIterator::traverseNextInVisualOrder):
(WebCore::LayoutIntegration::TextRunIterator::traverseNextInTextOrder):
(WebCore::LayoutIntegration::TextRunIterator::operator== const):
(WebCore::LayoutIntegration::TextRunIterator::atEnd const):
(WebCore::LayoutIntegration::firstTextRunFor):
(WebCore::LayoutIntegration::firstTextRunInTextOrderFor):
(WebCore::LayoutIntegration::textRunsFor):
(WebCore::LayoutIntegration::ElementRunIterator::ElementRunIterator):
(WebCore::LayoutIntegration::ElementRunIterator::atEnd const):
(WebCore::LayoutIntegration::elementRunFor):

  • layout/integration/LayoutIntegrationRunIterator.h: Renamed from Source/WebCore/rendering/line/LineLayoutTraversal.h.

(WebCore::LayoutIntegration::TextRunIterator::TextRunIterator):
(WebCore::LayoutIntegration::TextRunIterator::operator++):
(WebCore::LayoutIntegration::TextRunIterator::operator!= const):
(WebCore::LayoutIntegration::TextRunIterator::operator* const):
(WebCore::LayoutIntegration::TextRunIterator::operator-> const):
(WebCore::LayoutIntegration::ElementRunIterator::ElementRunIterator):
(WebCore::LayoutIntegration::ElementRunIterator::operator* const):
(WebCore::LayoutIntegration::ElementRunIterator::operator-> const):
(WebCore::LayoutIntegration::TextRunRange::TextRunRange):
(WebCore::LayoutIntegration::TextRunRange::begin const):
(WebCore::LayoutIntegration::Run::Run):
(WebCore::LayoutIntegration::Run::rect const):
(WebCore::LayoutIntegration::Run::baseline const):
(WebCore::LayoutIntegration::Run::isLeftToRightDirection const):
(WebCore::LayoutIntegration::Run::isHorizontal const):
(WebCore::LayoutIntegration::Run::dirOverride const):
(WebCore::LayoutIntegration::Run::isLineBreak const):
(WebCore::LayoutIntegration::Run::useLineBreakBoxRenderTreeDumpQuirk const):
(WebCore::LayoutIntegration::TextRun::hasHyphen const):
(WebCore::LayoutIntegration::TextRun::TextRun):
(WebCore::LayoutIntegration::TextRun::text const):
(WebCore::LayoutIntegration::TextRun::localStartOffset const):
(WebCore::LayoutIntegration::TextRun::localEndOffset const):
(WebCore::LayoutIntegration::TextRun::length const):
(WebCore::LayoutIntegration::TextRun::isLastOnLine const):
(WebCore::LayoutIntegration::TextRun::isLast const):

  • layout/integration/LayoutIntegrationRunIteratorLegacyPath.h: Renamed from Source/WebCore/rendering/line/LineLayoutTraversalComplexPath.h.

(WebCore::LayoutIntegration::LegacyPath::LegacyPath):
(WebCore::LayoutIntegration::LegacyPath::operator== const):
(WebCore::LayoutIntegration::LegacyPath::nextInlineTextBoxInTextOrder const):

  • layout/integration/LayoutIntegrationRunIteratorModernPath.h: Renamed from Source/WebCore/rendering/line/LineLayoutTraversalDisplayRunPath.h.

(WebCore::LayoutIntegration::ModernPath::ModernPath):
(WebCore::LayoutIntegration::ModernPath::operator== const):
(WebCore::LayoutIntegration::ModernPath::rect const):

  • rendering/RenderLineBreak.cpp:

(WebCore::RenderLineBreak::linesBoundingBox const):
(WebCore::RenderLineBreak::boundingBoxForRenderTreeDump const):
(WebCore::RenderLineBreak::absoluteRects const):
(WebCore::RenderLineBreak::absoluteQuads const):

  • rendering/RenderText.cpp:

(WebCore::RenderText::absoluteRects const):
(WebCore::collectAbsoluteQuadsForNonComplexPaths):
(WebCore::RenderText::firstRunLocation const):
(WebCore::RenderText::linesBoundingBox const):
(WebCore::RenderText::caretMinOffset const):
(WebCore::RenderText::caretMaxOffset const):
(WebCore::RenderText::countRenderedCharacterOffsetsUntil const):
(WebCore::containsOffset):
(WebCore::RenderText::hasRenderedText const):

  • rendering/RenderTreeAsText.cpp:

(WebCore::RenderTreeAsText::writeRenderObject):
(WebCore::writeTextRun):
(WebCore::write):
(WebCore::writeTextBox): Deleted.

Location:
trunk/Source/WebCore
Files:
12 edited
4 moved

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r267688 r267697  
     12020-09-28  Antti Koivisto  <antti@apple.com>
     2
     3        [LFC][Integration] Move run iterator to LayoutIntegration namespace
     4        https://bugs.webkit.org/show_bug.cgi?id=217046
     5
     6        Reviewed by Zalan Bujtas.
     7
     8        Also use name 'Modern' for LFC and 'Legacy' for the old inline tree path.
     9
     10        Also rename box->run for more consistent terminology.
     11
     12        * Sources.txt:
     13        * WebCore.xcodeproj/project.pbxproj:
     14        * dom/Position.cpp:
     15        (WebCore::Position::upstream const):
     16        (WebCore::Position::downstream const):
     17        * editing/TextIterator.cpp:
     18        (WebCore::TextIterator::advance):
     19        (WebCore::TextIterator::handleTextNode):
     20        (WebCore::TextIterator::handleTextRun):
     21        (WebCore::TextIterator::handleTextNodeFirstLetter):
     22        (WebCore::TextIterator::handleTextBox): Deleted.
     23        * editing/TextIterator.h:
     24        * layout/integration/LayoutIntegrationLineLayout.cpp:
     25        (WebCore::LayoutIntegration::LineLayout::textRunsFor const):
     26        (WebCore::LayoutIntegration::LineLayout::elementRunFor const):
     27        (WebCore::LayoutIntegration::LineLayout::paint):
     28        (WebCore::LayoutIntegration::LineLayout::textBoxesFor const): Deleted.
     29        (WebCore::LayoutIntegration::LineLayout::elementBoxFor const): Deleted.
     30        * layout/integration/LayoutIntegrationLineLayout.h:
     31        * layout/integration/LayoutIntegrationRunIterator.cpp: Renamed from Source/WebCore/rendering/line/LineLayoutTraversal.cpp.
     32        (WebCore::LayoutIntegration::TextRunIterator::TextRunIterator):
     33        (WebCore::LayoutIntegration::TextRunIterator::traverseNextInVisualOrder):
     34        (WebCore::LayoutIntegration::TextRunIterator::traverseNextInTextOrder):
     35        (WebCore::LayoutIntegration::TextRunIterator::operator== const):
     36        (WebCore::LayoutIntegration::TextRunIterator::atEnd const):
     37        (WebCore::LayoutIntegration::firstTextRunFor):
     38        (WebCore::LayoutIntegration::firstTextRunInTextOrderFor):
     39        (WebCore::LayoutIntegration::textRunsFor):
     40        (WebCore::LayoutIntegration::ElementRunIterator::ElementRunIterator):
     41        (WebCore::LayoutIntegration::ElementRunIterator::atEnd const):
     42        (WebCore::LayoutIntegration::elementRunFor):
     43        * layout/integration/LayoutIntegrationRunIterator.h: Renamed from Source/WebCore/rendering/line/LineLayoutTraversal.h.
     44        (WebCore::LayoutIntegration::TextRunIterator::TextRunIterator):
     45        (WebCore::LayoutIntegration::TextRunIterator::operator++):
     46        (WebCore::LayoutIntegration::TextRunIterator::operator!= const):
     47        (WebCore::LayoutIntegration::TextRunIterator::operator* const):
     48        (WebCore::LayoutIntegration::TextRunIterator::operator-> const):
     49        (WebCore::LayoutIntegration::ElementRunIterator::ElementRunIterator):
     50        (WebCore::LayoutIntegration::ElementRunIterator::operator* const):
     51        (WebCore::LayoutIntegration::ElementRunIterator::operator-> const):
     52        (WebCore::LayoutIntegration::TextRunRange::TextRunRange):
     53        (WebCore::LayoutIntegration::TextRunRange::begin const):
     54        (WebCore::LayoutIntegration::Run::Run):
     55        (WebCore::LayoutIntegration::Run::rect const):
     56        (WebCore::LayoutIntegration::Run::baseline const):
     57        (WebCore::LayoutIntegration::Run::isLeftToRightDirection const):
     58        (WebCore::LayoutIntegration::Run::isHorizontal const):
     59        (WebCore::LayoutIntegration::Run::dirOverride const):
     60        (WebCore::LayoutIntegration::Run::isLineBreak const):
     61        (WebCore::LayoutIntegration::Run::useLineBreakBoxRenderTreeDumpQuirk const):
     62        (WebCore::LayoutIntegration::TextRun::hasHyphen const):
     63        (WebCore::LayoutIntegration::TextRun::TextRun):
     64        (WebCore::LayoutIntegration::TextRun::text const):
     65        (WebCore::LayoutIntegration::TextRun::localStartOffset const):
     66        (WebCore::LayoutIntegration::TextRun::localEndOffset const):
     67        (WebCore::LayoutIntegration::TextRun::length const):
     68        (WebCore::LayoutIntegration::TextRun::isLastOnLine const):
     69        (WebCore::LayoutIntegration::TextRun::isLast const):
     70        * layout/integration/LayoutIntegrationRunIteratorLegacyPath.h: Renamed from Source/WebCore/rendering/line/LineLayoutTraversalComplexPath.h.
     71        (WebCore::LayoutIntegration::LegacyPath::LegacyPath):
     72        (WebCore::LayoutIntegration::LegacyPath::operator== const):
     73        (WebCore::LayoutIntegration::LegacyPath::nextInlineTextBoxInTextOrder const):
     74        * layout/integration/LayoutIntegrationRunIteratorModernPath.h: Renamed from Source/WebCore/rendering/line/LineLayoutTraversalDisplayRunPath.h.
     75        (WebCore::LayoutIntegration::ModernPath::ModernPath):
     76        (WebCore::LayoutIntegration::ModernPath::operator== const):
     77        (WebCore::LayoutIntegration::ModernPath::rect const):
     78        * rendering/RenderLineBreak.cpp:
     79        (WebCore::RenderLineBreak::linesBoundingBox const):
     80        (WebCore::RenderLineBreak::boundingBoxForRenderTreeDump const):
     81        (WebCore::RenderLineBreak::absoluteRects const):
     82        (WebCore::RenderLineBreak::absoluteQuads const):
     83        * rendering/RenderText.cpp:
     84        (WebCore::RenderText::absoluteRects const):
     85        (WebCore::collectAbsoluteQuadsForNonComplexPaths):
     86        (WebCore::RenderText::firstRunLocation const):
     87        (WebCore::RenderText::linesBoundingBox const):
     88        (WebCore::RenderText::caretMinOffset const):
     89        (WebCore::RenderText::caretMaxOffset const):
     90        (WebCore::RenderText::countRenderedCharacterOffsetsUntil const):
     91        (WebCore::containsOffset):
     92        (WebCore::RenderText::hasRenderedText const):
     93        * rendering/RenderTreeAsText.cpp:
     94        (WebCore::RenderTreeAsText::writeRenderObject):
     95        (WebCore::writeTextRun):
     96        (WebCore::write):
     97        (WebCore::writeTextBox): Deleted.
     98
    1992020-09-24  Simon Fraser  <simon.fraser@apple.com>
    2100
  • trunk/Source/WebCore/Headers.cmake

    r267615 r267697  
    715715    layout/inlineformatting/InlineRect.h
    716716
     717    layout/integration/LayoutIntegrationRunIterator.h
     718    layout/integration/LayoutIntegrationRunIteratorLegacyPath.h
     719    layout/integration/LayoutIntegrationRunIteratorModernPath.h
     720
    717721    layout/layouttree/LayoutBox.h
    718722
     
    14281432    rendering/ScrollAlignment.h
    14291433
    1430     rendering/line/LineLayoutTraversal.h
    1431     rendering/line/LineLayoutTraversalComplexPath.h
    1432     rendering/line/LineLayoutTraversalDisplayRunPath.h
    14331434    rendering/line/LineWidth.h
    14341435    rendering/line/TrailingObjects.h
  • trunk/Source/WebCore/Sources.txt

    r267654 r267697  
    14691469layout/integration/LayoutIntegrationLineLayout.cpp
    14701470layout/integration/LayoutIntegrationPagination.cpp
     1471layout/integration/LayoutIntegrationRunIterator.cpp
    14711472layout/invalidation/InvalidationContext.cpp
    14721473layout/invalidation/InvalidationState.cpp
     
    22172218rendering/line/LineBreaker.cpp
    22182219rendering/line/LineInfo.cpp
    2219 rendering/line/LineLayoutTraversal.cpp
    22202220rendering/line/LineWidth.cpp
    22212221rendering/line/TrailingObjects.cpp
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r267654 r267697  
    49864986                E42E76DC1C7AF77600E3614D /* StyleUpdate.h in Headers */ = {isa = PBXBuildFile; fileRef = E42E76DB1C7AF77600E3614D /* StyleUpdate.h */; settings = {ATTRIBUTES = (Private, ); }; };
    49874987                E43105BB16750F1600DB2FB8 /* NodeTraversal.h in Headers */ = {isa = PBXBuildFile; fileRef = E43105BA16750F1600DB2FB8 /* NodeTraversal.h */; settings = {ATTRIBUTES = (Private, ); }; };
    4988                 E4343D252392779000EBBB66 /* LineLayoutTraversalComplexPath.h in Headers */ = {isa = PBXBuildFile; fileRef = E4343D242392778F00EBBB66 /* LineLayoutTraversalComplexPath.h */; settings = {ATTRIBUTES = (Private, ); }; };
    49894988                E43A023B17EB370A004CDD25 /* RenderElement.h in Headers */ = {isa = PBXBuildFile; fileRef = E43A023A17EB370A004CDD25 /* RenderElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
    49904989                E43AF8E71AC5B7EC00CA717E /* CacheValidation.h in Headers */ = {isa = PBXBuildFile; fileRef = E43AF8E51AC5B7DD00CA717E /* CacheValidation.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    50095008                E44B4BB4141650D7002B1D8B /* SelectorChecker.h in Headers */ = {isa = PBXBuildFile; fileRef = E44B4BB2141650D7002B1D8B /* SelectorChecker.h */; };
    50105009                E44FA1851BCA6B5A0091B6EF /* ComposedTreeIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = E44FA1841BCA6B5A0091B6EF /* ComposedTreeIterator.h */; };
    5011                 E451C628239293EC00993190 /* LineLayoutTraversalDisplayRunPath.h in Headers */ = {isa = PBXBuildFile; fileRef = E451C627239293EB00993190 /* LineLayoutTraversalDisplayRunPath.h */; settings = {ATTRIBUTES = (Private, ); }; };
    50125010                E451C6312394027900993190 /* LayoutUnits.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F73918C2106CEDD006AF262 /* LayoutUnits.h */; settings = {ATTRIBUTES = (Private, ); }; };
    50135011                E451C6322394031A00993190 /* MarginTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 6FE7AA2621C37B6300296DCD /* MarginTypes.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    50385036                E47E276516036ED200EE2AFB /* ExtensionStyleSheets.h in Headers */ = {isa = PBXBuildFile; fileRef = E47E276416036ED200EE2AFB /* ExtensionStyleSheets.h */; settings = {ATTRIBUTES = (Private, ); }; };
    50395037                E48137B91DB3B526005C59BF /* StyleValidity.h in Headers */ = {isa = PBXBuildFile; fileRef = E48137B81DB3B526005C59BF /* StyleValidity.h */; settings = {ATTRIBUTES = (Private, ); }; };
    5040                 E484A33E23055325009ADE6A /* LineLayoutTraversal.h in Headers */ = {isa = PBXBuildFile; fileRef = E484A33B23055303009ADE6A /* LineLayoutTraversal.h */; settings = {ATTRIBUTES = (Private, ); }; };
    50415038                E4863CFE23842E9E00972158 /* RuleData.h in Headers */ = {isa = PBXBuildFile; fileRef = E4863CFD23842E9E00972158 /* RuleData.h */; };
    50425039                E4946EAF156E64DD00D3297F /* StyleRuleImport.h in Headers */ = {isa = PBXBuildFile; fileRef = E4946EAD156E64DD00D3297F /* StyleRuleImport.h */; settings = {ATTRIBUTES = (Private, ); }; };
    50435040                E49BD9FA131FD2ED003C56F0 /* CSSValuePool.h in Headers */ = {isa = PBXBuildFile; fileRef = E49BD9F9131FD2ED003C56F0 /* CSSValuePool.h */; };
     5041                E4A664CC2521D4AF007081DC /* LayoutIntegrationRunIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = E4A664C62521B778007081DC /* LayoutIntegrationRunIterator.h */; settings = {ATTRIBUTES = (Private, ); }; };
     5042                E4A664CE2521D4C9007081DC /* LayoutIntegrationRunIteratorModernPath.h in Headers */ = {isa = PBXBuildFile; fileRef = E4A664C42521B777007081DC /* LayoutIntegrationRunIteratorModernPath.h */; settings = {ATTRIBUTES = (Private, ); }; };
     5043                E4A664CF2521D4E2007081DC /* LayoutIntegrationRunIteratorLegacyPath.h in Headers */ = {isa = PBXBuildFile; fileRef = E4A664C52521B778007081DC /* LayoutIntegrationRunIteratorLegacyPath.h */; settings = {ATTRIBUTES = (Private, ); }; };
    50445044                E4A7995220EE4B1400C19568 /* CSSParserContext.h in Headers */ = {isa = PBXBuildFile; fileRef = E4A7994E20EE4AE100C19568 /* CSSParserContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
    50455045                E4A814D41C6DEC4000BF85AC /* ClassChangeInvalidation.h in Headers */ = {isa = PBXBuildFile; fileRef = E4A814D31C6DEC4000BF85AC /* ClassChangeInvalidation.h */; };
     
    1585415854                E4312AB524B3265600678349 /* LayoutIntegrationPagination.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LayoutIntegrationPagination.cpp; sourceTree = "<group>"; };
    1585515855                E4312AB724B3265600678349 /* LayoutIntegrationPagination.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayoutIntegrationPagination.h; sourceTree = "<group>"; };
    15856                 E4343D242392778F00EBBB66 /* LineLayoutTraversalComplexPath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LineLayoutTraversalComplexPath.h; sourceTree = "<group>"; };
    1585715856                E43A023A17EB370A004CDD25 /* RenderElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderElement.h; sourceTree = "<group>"; };
    1585815857                E43A023C17EB3713004CDD25 /* RenderElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderElement.cpp; sourceTree = "<group>"; };
     
    1589215891                E44FA1841BCA6B5A0091B6EF /* ComposedTreeIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ComposedTreeIterator.h; sourceTree = "<group>"; };
    1589315892                E44FA1861BCA91560091B6EF /* ComposedTreeIterator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ComposedTreeIterator.cpp; sourceTree = "<group>"; };
    15894                 E451C627239293EB00993190 /* LineLayoutTraversalDisplayRunPath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LineLayoutTraversalDisplayRunPath.h; sourceTree = "<group>"; };
    1589515893                E451C6332394058E00993190 /* DisplayInlineContent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DisplayInlineContent.h; sourceTree = "<group>"; };
    1589615894                E45322A9140CE267005A0F92 /* SelectorQuery.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SelectorQuery.cpp; sourceTree = "<group>"; };
     
    1594115939                E47E276716036EDC00EE2AFB /* ExtensionStyleSheets.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExtensionStyleSheets.cpp; sourceTree = "<group>"; };
    1594215940                E48137B81DB3B526005C59BF /* StyleValidity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleValidity.h; sourceTree = "<group>"; };
    15943                 E484A33B23055303009ADE6A /* LineLayoutTraversal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LineLayoutTraversal.h; sourceTree = "<group>"; };
    15944                 E484A33D23055303009ADE6A /* LineLayoutTraversal.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LineLayoutTraversal.cpp; sourceTree = "<group>"; };
    1594515941                E4863CFA23842E8700972158 /* RuleData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RuleData.cpp; sourceTree = "<group>"; };
    1594615942                E4863CFD23842E9E00972158 /* RuleData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RuleData.h; sourceTree = "<group>"; };
     
    1595315949                E4A1822F1F13BE5800FEF698 /* StyleInvalidationFunctions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = StyleInvalidationFunctions.h; sourceTree = "<group>"; };
    1595415950                E4A1AC7822FAFD500017B75B /* ComplexLineLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ComplexLineLayout.h; sourceTree = "<group>"; };
     15951                E4A664C42521B777007081DC /* LayoutIntegrationRunIteratorModernPath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayoutIntegrationRunIteratorModernPath.h; sourceTree = "<group>"; };
     15952                E4A664C52521B778007081DC /* LayoutIntegrationRunIteratorLegacyPath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayoutIntegrationRunIteratorLegacyPath.h; sourceTree = "<group>"; };
     15953                E4A664C62521B778007081DC /* LayoutIntegrationRunIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayoutIntegrationRunIterator.h; sourceTree = "<group>"; };
     15954                E4A664C72521B779007081DC /* LayoutIntegrationRunIterator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LayoutIntegrationRunIterator.cpp; sourceTree = "<group>"; };
    1595515955                E4A7994E20EE4AE100C19568 /* CSSParserContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CSSParserContext.h; path = parser/CSSParserContext.h; sourceTree = "<group>"; };
    1595615956                E4A7995020EE4AE200C19568 /* CSSParserContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CSSParserContext.cpp; path = parser/CSSParserContext.cpp; sourceTree = "<group>"; };
     
    2849628496                        isa = PBXGroup;
    2849728497                        children = (
     28498                                E4A664C72521B779007081DC /* LayoutIntegrationRunIterator.cpp */,
     28499                                E4A664C62521B778007081DC /* LayoutIntegrationRunIterator.h */,
     28500                                E4A664C52521B778007081DC /* LayoutIntegrationRunIteratorLegacyPath.h */,
     28501                                E4A664C42521B777007081DC /* LayoutIntegrationRunIteratorModernPath.h */,
    2849828502                                E418025623D454B500FFB071 /* LayoutIntegrationBoxTree.cpp */,
    2849928503                                E418025323D4549A00FFB071 /* LayoutIntegrationBoxTree.h */,
     
    3024530249                                FFEFAB2D183BCB6F00514534 /* LineInlineHeaders.h */,
    3024630250                                FFEFAB2918380DA000514534 /* LineLayoutState.h */,
    30247                                 E484A33D23055303009ADE6A /* LineLayoutTraversal.cpp */,
    30248                                 E484A33B23055303009ADE6A /* LineLayoutTraversal.h */,
    30249                                 E4343D242392778F00EBBB66 /* LineLayoutTraversalComplexPath.h */,
    30250                                 E451C627239293EB00993190 /* LineLayoutTraversalDisplayRunPath.h */,
    3025130251                                FFDBC046183D27B700407109 /* LineWidth.cpp */,
    3025230252                                FFDBC045183D27B700407109 /* LineWidth.h */,
     
    3244832448                                07969DB217D14151007FF842 /* JSRTCDTMFToneChangeEvent.h in Headers */,
    3244932449                                07969DB617D14151007FF842 /* JSRTCIceCandidate.h in Headers */,
     32450                                E4A664CE2521D4C9007081DC /* LayoutIntegrationRunIteratorModernPath.h in Headers */,
    3245032451                                316DCB4C1E7910A6001B5F87 /* JSRTCIceConnectionState.h in Headers */,
    3245132452                                316DCB4E1E7910A6001B5F87 /* JSRTCIceGatheringState.h in Headers */,
     
    3249332494                                B59DD6A911902A71007E9684 /* JSSQLStatementErrorCallback.h in Headers */,
    3249432495                                BC82432A0D0CE8A200460C8F /* JSSQLTransaction.h in Headers */,
     32496                                E4A664CC2521D4AF007081DC /* LayoutIntegrationRunIterator.h in Headers */,
    3249532497                                B59DD69D11902A42007E9684 /* JSSQLTransactionCallback.h in Headers */,
    3249632498                                B59DD6A111902A52007E9684 /* JSSQLTransactionErrorCallback.h in Headers */,
     
    3282832830                                AB31C91E10AE1B8E000C7B92 /* LineClampValue.h in Headers */,
    3282932831                                FFEFAB2A18380DA000514534 /* LineLayoutState.h in Headers */,
    32830                                 E484A33E23055325009ADE6A /* LineLayoutTraversal.h in Headers */,
    32831                                 E4343D252392779000EBBB66 /* LineLayoutTraversalComplexPath.h in Headers */,
    32832                                 E451C628239293EC00993190 /* LineLayoutTraversalDisplayRunPath.h in Headers */,
    3283332832                                FFDBC047183D27B700407109 /* LineWidth.h in Headers */,
    3283432833                                CBA9DC0B1DF44DF40005675C /* LinkHeader.h in Headers */,
     
    3296532964                                C96F5EC51B5872260091EA9D /* MediaSessionInterruptionProviderMac.h in Headers */,
    3296632965                                C90F65561B2253BE002163A1 /* MediaSessionManager.h in Headers */,
     32966                                E4A664CF2521D4E2007081DC /* LayoutIntegrationRunIteratorLegacyPath.h in Headers */,
    3296732967                                417F7AEF2139BF6F00FBA7EC /* MediaSessionManagerCocoa.h in Headers */,
    3296832968                                07638A991884487200E15A1B /* MediaSessionManagerIOS.h in Headers */,
  • trunk/Source/WebCore/dom/Position.cpp

    r267363 r267697  
    3939#include "InlineIterator.h"
    4040#include "InlineTextBox.h"
    41 #include "LineLayoutTraversal.h"
     41#include "LayoutIntegrationRunIterator.h"
    4242#include "Logging.h"
    4343#include "NodeTraversal.h"
     
    729729            auto& textRenderer = downcast<RenderText>(*renderer);
    730730
    731             auto firstTextBox = LineLayoutTraversal::firstTextBoxInTextOrderFor(textRenderer);
    732             if (!firstTextBox)
     731            auto firstTextRun = LayoutIntegration::firstTextRunInTextOrderFor(textRenderer);
     732            if (!firstTextRun)
    733733                continue;
    734734
     
    743743
    744744            unsigned textOffset = currentPosition.offsetInLeafNode();
    745             for (auto box = firstTextBox; box; box.traverseNextInTextOrder()) {
    746                 if (textOffset <= box->localEndOffset()) {
    747                     if (textOffset > box->localStartOffset())
     745            for (auto run = firstTextRun; run; run.traverseNextInTextOrder()) {
     746                if (textOffset <= run->localEndOffset()) {
     747                    if (textOffset > run->localStartOffset())
    748748                        return currentPosition;
    749749                    continue;
    750750                }
    751751
    752                 if (textOffset == box->localEndOffset() + 1 && box->isLastOnLine() && !box->isLast())
     752                if (textOffset == run->localEndOffset() + 1 && run->isLastOnLine() && !run->isLast())
    753753                    return currentPosition;
    754754            }
     
    836836            auto& textRenderer = downcast<RenderText>(*renderer);
    837837
    838             auto firstTextBox = LineLayoutTraversal::firstTextBoxInTextOrderFor(textRenderer);
    839             if (!firstTextBox)
     838            auto firstTextRun = LayoutIntegration::firstTextRunInTextOrderFor(textRenderer);
     839            if (!firstTextRun)
    840840                continue;
    841841
     
    846846
    847847            unsigned textOffset = currentPosition.offsetInLeafNode();
    848             for (auto box = firstTextBox; box; box.traverseNextInTextOrder()) {
    849                 if (!box->length() && textOffset == box->localStartOffset())
     848            for (auto run = firstTextRun; run; run.traverseNextInTextOrder()) {
     849                if (!run->length() && textOffset == run->localStartOffset())
    850850                    return currentPosition;
    851851
    852                 if (textOffset < box->localEndOffset()) {
    853                     if (textOffset >= box->localStartOffset())
     852                if (textOffset < run->localEndOffset()) {
     853                    if (textOffset >= run->localStartOffset())
    854854                        return currentPosition;
    855855                    continue;
    856856                }
    857857
    858                 if (textOffset == box->localEndOffset() && box->isLastOnLine() && !box->isLast())
     858                if (textOffset == run->localEndOffset() && run->isLastOnLine() && !run->isLast())
    859859                    return currentPosition;
    860860            }
  • trunk/Source/WebCore/editing/TextIterator.cpp

    r267565 r267697  
    438438    }
    439439
    440     if (!m_textBox && m_remainingTextBox) {
    441         m_textBox = m_remainingTextBox;
    442         m_remainingTextBox = { };
     440    if (!m_textRun && m_remainingTextRun) {
     441        m_textRun = m_remainingTextRun;
     442        m_remainingTextRun = { };
    443443        m_firstLetterText = { };
    444444        m_offset = 0;
    445445    }
    446446    // handle remembered text box
    447     if (m_textBox) {
    448         handleTextBox();
     447    if (m_textRun) {
     448        handleTextRun();
    449449        if (m_positionNode)
    450450            return;
     
    564564                emitText(textNode, *m_firstLetterText, m_offset, m_offset + firstLetter.length());
    565565                m_firstLetterText = nullptr;
    566                 m_textBox = { };
     566                m_textRun = { };
    567567                return false;
    568568            }
     
    581581    }
    582582
    583     m_textBox = LineLayoutTraversal::firstTextBoxInTextOrderFor(renderer);
     583    m_textRun = LayoutIntegration::firstTextRunInTextOrderFor(renderer);
    584584
    585585    bool shouldHandleFirstLetter = !m_handledFirstLetter && is<RenderTextFragment>(renderer) && !m_offset;
     
    587587        handleTextNodeFirstLetter(downcast<RenderTextFragment>(renderer));
    588588
    589     if (!m_textBox && rendererText.length() && !shouldHandleFirstLetter) {
     589    if (!m_textRun && rendererText.length() && !shouldHandleFirstLetter) {
    590590        if (renderer.style().visibility() != Visibility::Visible && !(m_behavior & TextIteratorIgnoresStyleVisibility))
    591591            return false;
     
    594594    }
    595595
    596     handleTextBox();
     596    handleTextRun();
    597597    return true;
    598598}
    599599
    600 void TextIterator::handleTextBox()
     600void TextIterator::handleTextRun()
    601601{   
    602602    Text& textNode = downcast<Text>(*m_node);
     
    604604    auto& renderer = m_firstLetterText ? *m_firstLetterText : *textNode.renderer();
    605605    if (renderer.style().visibility() != Visibility::Visible && !(m_behavior & TextIteratorIgnoresStyleVisibility)) {
    606         m_textBox = { };
     606        m_textRun = { };
    607607        return;
    608608    }
    609609
    610     auto firstTextBox = LineLayoutTraversal::firstTextBoxInTextOrderFor(renderer);
     610    auto firstTextRun = LayoutIntegration::firstTextRunInTextOrderFor(renderer);
    611611
    612612    String rendererText = renderer.text();
    613613    unsigned start = m_offset;
    614614    unsigned end = (&textNode == m_endContainer) ? static_cast<unsigned>(m_endOffset) : UINT_MAX;
    615     while (m_textBox) {
    616         unsigned textBoxStart = m_textBox->localStartOffset();
    617         unsigned runStart = std::max(textBoxStart, start);
     615    while (m_textRun) {
     616        unsigned textRunStart = m_textRun->localStartOffset();
     617        unsigned runStart = std::max(textRunStart, start);
    618618
    619619        // Check for collapsed space at the start of this run.
    620         bool needSpace = m_lastTextNodeEndedWithCollapsedSpace || (m_textBox == firstTextBox && textBoxStart == runStart && runStart);
     620        bool needSpace = m_lastTextNodeEndedWithCollapsedSpace || (m_textRun == firstTextRun && textRunStart == runStart && runStart);
    621621        if (needSpace && !renderer.style().isCollapsibleWhiteSpace(m_lastCharacter) && m_lastCharacter) {
    622622            if (m_lastTextNode == &textNode && runStart && rendererText[runStart - 1] == ' ') {
     
    629629            return;
    630630        }
    631         unsigned textBoxEnd = textBoxStart + m_textBox->length();
    632         unsigned runEnd = std::min(textBoxEnd, end);
     631        unsigned textRunEnd = textRunStart + m_textRun->length();
     632        unsigned runEnd = std::min(textRunEnd, end);
    633633       
    634         // Determine what the next text box will be, but don't advance yet
    635         auto nextTextBox = m_textBox;
    636         nextTextBox.traverseNextInTextOrder();
     634        // Determine what the next text run will be, but don't advance yet
     635        auto nextTextRun = m_textRun;
     636        nextTextRun.traverseNextInTextOrder();
    637637
    638638        if (runStart < runEnd) {
     
    653653                }
    654654                if (subrunEnd == runEnd && (m_behavior & TextIteratorBehavesAsIfNodesFollowing)) {
    655                     bool lastSpaceCollapsedByNextNonTextBox = !nextTextBox && rendererText.length() > subrunEnd && rendererText[subrunEnd] == ' ';
    656                     if (lastSpaceCollapsedByNextNonTextBox)
     655                    bool lastSpaceCollapsedByNextNonTextRun = !nextTextRun && rendererText.length() > subrunEnd && rendererText[subrunEnd] == ' ';
     656                    if (lastSpaceCollapsedByNextNonTextRun)
    657657                        ++subrunEnd; // runEnd stopped before last space. Increment by one to restore the space.
    658658                }
     
    663663            // If we are doing a subrun that doesn't go to the end of the text box,
    664664            // come back again to finish handling this text box; don't advance to the next one.
    665             if (static_cast<unsigned>(m_positionEndOffset) < textBoxEnd)
     665            if (static_cast<unsigned>(m_positionEndOffset) < textRunEnd)
    666666                return;
    667667
    668668            // Advance and return
    669             unsigned nextRunStart = nextTextBox ? nextTextBox->localStartOffset() : rendererText.length();
     669            unsigned nextRunStart = nextTextRun ? nextTextRun->localStartOffset() : rendererText.length();
    670670            if (nextRunStart > runEnd)
    671671                m_lastTextNodeEndedWithCollapsedSpace = true; // collapsed space between runs or at the end
    672             m_textBox = nextTextBox;
     672            m_textRun = nextTextRun;
    673673            return;
    674674        }
    675675        // Advance and continue
    676         m_textBox = nextTextBox;
    677     }
    678     if (!m_textBox && m_remainingTextBox) {
    679         m_textBox = m_remainingTextBox;
    680         m_remainingTextBox = { };
     676        m_textRun = nextTextRun;
     677    }
     678    if (!m_textRun && m_remainingTextRun) {
     679        m_textRun = m_remainingTextRun;
     680        m_remainingTextRun = { };
    681681        m_firstLetterText = { };
    682682        m_offset = 0;
    683         handleTextBox();
     683        handleTextRun();
    684684    }
    685685}
     
    701701        if (auto* firstLetterText = firstRenderTextInFirstLetter(firstLetter)) {
    702702            m_handledFirstLetter = true;
    703             m_remainingTextBox = m_textBox;
    704             m_textBox = LineLayoutTraversal::firstTextBoxInTextOrderFor(*firstLetterText);
     703            m_remainingTextRun = m_textRun;
     704            m_textRun = LayoutIntegration::firstTextRunInTextOrderFor(*firstLetterText);
    705705            m_firstLetterText = firstLetterText;
    706706        }
  • trunk/Source/WebCore/editing/TextIterator.h

    r259401 r267697  
    2828#include "CharacterRange.h"
    2929#include "FindOptions.h"
    30 #include "LineLayoutTraversal.h"
     30#include "LayoutIntegrationRunIterator.h"
    3131#include "SimpleRange.h"
    3232#include "TextIteratorBehavior.h"
     
    117117    bool handleReplacedElement();
    118118    bool handleNonTextNode();
    119     void handleTextBox();
     119    void handleTextRun();
    120120    void handleTextNodeFirstLetter(RenderTextFragment&);
    121121    void emitCharacter(UChar, Node& characterNode, Node* offsetBaseNode, int textStartOffset, int textEndOffset);
     
    150150    // Used when there is still some pending text from the current node; when these are false and null, we go back to normal iterating.
    151151    Node* m_nodeForAdditionalNewline { nullptr };
    152     LineLayoutTraversal::TextBoxIterator m_textBox;
     152    LayoutIntegration::TextRunIterator m_textRun;
    153153
    154154    // Used when iterating over :first-letter text to save pointer to remaining text box.
    155     LineLayoutTraversal::TextBoxIterator m_remainingTextBox;
     155    LayoutIntegration::TextRunIterator m_remainingTextRun;
    156156
    157157    // Used to point to RenderText object for :first-letter.
  • trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp

    r267565 r267697  
    295295}
    296296
    297 LineLayoutTraversal::TextBoxIterator LineLayout::textBoxesFor(const RenderText& renderText) const
     297LayoutIntegration::TextRunIterator LineLayout::textRunsFor(const RenderText& renderText) const
    298298{
    299299    auto* inlineContent = displayInlineContent();
     
    317317        return { };
    318318
    319     return { LineLayoutTraversal::DisplayRunPath(*inlineContent, *firstIndex, lastIndex + 1) };
    320 }
    321 
    322 LineLayoutTraversal::ElementBoxIterator LineLayout::elementBoxFor(const RenderLineBreak& renderLineBreak) const
     319    return { LayoutIntegration::ModernPath(*inlineContent, *firstIndex, lastIndex + 1) };
     320}
     321
     322LayoutIntegration::ElementRunIterator LineLayout::elementRunFor(const RenderLineBreak& renderLineBreak) const
    323323{
    324324    auto* inlineContent = displayInlineContent();
     
    331331        auto& run =  inlineContent->runs[i];
    332332        if (&run.layoutBox() == layoutBox)
    333             return { LineLayoutTraversal::DisplayRunPath(*inlineContent, i, i + 1) };
     333            return { LayoutIntegration::ModernPath(*inlineContent, i, i + 1) };
    334334    }
    335335
     
    394394        // and the run starts at 100px, due to the horizontal aligment, the xpos is supposed to be at 0px).
    395395        auto xPos = rect.x() - (line.rect().x() + line.horizontalAlignmentOffset());
    396         TextRun textRun { !textWithHyphen.isEmpty() ? textWithHyphen : textContent.content(), xPos, expansion.horizontalExpansion, expansion.behavior };
     396        WebCore::TextRun textRun { !textWithHyphen.isEmpty() ? textWithHyphen : textContent.content(), xPos, expansion.horizontalExpansion, expansion.behavior };
    397397        textRun.setTabSize(!style.collapseWhiteSpace(), style.tabSize());
    398398        FloatPoint textOrigin { rect.x() + paintOffset.x(), roundToDevicePixel(baseline, deviceScaleFactor) };
  • trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.h

    r267468 r267697  
    2929
    3030#include "LayoutIntegrationBoxTree.h"
     31#include "LayoutIntegrationRunIterator.h"
    3132#include "LayoutPoint.h"
    3233#include "LayoutState.h"
    33 #include "LineLayoutTraversal.h"
    3434#include "RenderObjectEnums.h"
    3535
     
    7878    bool hitTest(const HitTestRequest&, HitTestResult&, const HitTestLocation&, const LayoutPoint& accumulatedOffset, HitTestAction);
    7979
    80     LineLayoutTraversal::TextBoxIterator textBoxesFor(const RenderText&) const;
    81     LineLayoutTraversal::ElementBoxIterator elementBoxFor(const RenderLineBreak&) const;
     80    TextRunIterator textRunsFor(const RenderText&) const;
     81    ElementRunIterator elementRunFor(const RenderLineBreak&) const;
    8282
    8383    static void releaseCaches(RenderView&);
  • trunk/Source/WebCore/layout/integration/LayoutIntegrationRunIterator.cpp

    r267696 r267697  
    2525
    2626#include "config.h"
    27 #include "LineLayoutTraversal.h"
     27#include "LayoutIntegrationRunIterator.h"
    2828
    2929#include "LayoutIntegrationLineLayout.h"
     
    3232
    3333namespace WebCore {
    34 namespace LineLayoutTraversal {
     34namespace LayoutIntegration {
    3535
    36 TextBoxIterator::TextBoxIterator(Box::PathVariant&& pathVariant)
    37     : m_textBox(WTFMove(pathVariant))
     36TextRunIterator::TextRunIterator(Run::PathVariant&& pathVariant)
     37    : m_textRun(WTFMove(pathVariant))
    3838{
    3939}
    4040
    41 TextBoxIterator& TextBoxIterator::traverseNextInVisualOrder()
     41TextRunIterator& TextRunIterator::traverseNextInVisualOrder()
    4242{
    43     WTF::switchOn(m_textBox.m_pathVariant, [](auto& path) {
    44         path.traverseNextTextBoxInVisualOrder();
     43    WTF::switchOn(m_textRun.m_pathVariant, [](auto& path) {
     44        path.traverseNextTextRunInVisualOrder();
    4545    });
    4646    return *this;
    4747}
    4848
    49 TextBoxIterator& TextBoxIterator::traverseNextInTextOrder()
     49TextRunIterator& TextRunIterator::traverseNextInTextOrder()
    5050{
    51     WTF::switchOn(m_textBox.m_pathVariant, [](auto& path) {
    52         path.traverseNextTextBoxInTextOrder();
     51    WTF::switchOn(m_textRun.m_pathVariant, [](auto& path) {
     52        path.traverseNextTextRunInTextOrder();
    5353    });
    5454    return *this;
    5555}
    5656
    57 bool TextBoxIterator::operator==(const TextBoxIterator& other) const
     57bool TextRunIterator::operator==(const TextRunIterator& other) const
    5858{
    59     if (m_textBox.m_pathVariant.index() != other.m_textBox.m_pathVariant.index())
     59    if (m_textRun.m_pathVariant.index() != other.m_textRun.m_pathVariant.index())
    6060        return false;
    6161
    62     return WTF::switchOn(m_textBox.m_pathVariant, [&](const auto& path) {
    63         return path == WTF::get<std::decay_t<decltype(path)>>(other.m_textBox.m_pathVariant);
     62    return WTF::switchOn(m_textRun.m_pathVariant, [&](const auto& path) {
     63        return path == WTF::get<std::decay_t<decltype(path)>>(other.m_textRun.m_pathVariant);
    6464    });
    6565}
    6666
    67 bool TextBoxIterator::atEnd() const
     67bool TextRunIterator::atEnd() const
    6868{
    69     return WTF::switchOn(m_textBox.m_pathVariant, [](auto& path) {
     69    return WTF::switchOn(m_textRun.m_pathVariant, [](auto& path) {
    7070        return path.atEnd();
    7171    });
     
    8080}
    8181
    82 TextBoxIterator firstTextBoxFor(const RenderText& text)
     82TextRunIterator firstTextRunFor(const RenderText& text)
    8383{
     84#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
    8485    if (auto* flow = lineLayoutSystemFlowForRenderer(text)) {
    85 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
    8686        if (auto* layoutFormattingContextLineLayout = flow->layoutFormattingContextLineLayout())
    87             return layoutFormattingContextLineLayout->textBoxesFor(text);
     87            return layoutFormattingContextLineLayout->textRunsFor(text);
     88    }
    8889#endif
    89     }
    9090
    91     return { ComplexPath { text.firstTextBox() } };
     91    return { LegacyPath { text.firstTextBox() } };
    9292}
    9393
    94 TextBoxIterator firstTextBoxInTextOrderFor(const RenderText& text)
     94TextRunIterator firstTextRunInTextOrderFor(const RenderText& text)
    9595{
    9696    if (text.firstTextBox() && text.containsReversedText()) {
     
    100100        std::sort(sortedTextBoxes.begin(), sortedTextBoxes.end(), InlineTextBox::compareByStart);
    101101        auto* first = sortedTextBoxes[0];
    102         return { ComplexPath { first, WTFMove(sortedTextBoxes), 0 } };
     102        return { LegacyPath { first, WTFMove(sortedTextBoxes), 0 } };
    103103    }
    104104
    105     return firstTextBoxFor(text);
     105    return firstTextRunFor(text);
    106106}
    107107
    108 TextBoxRange textBoxesFor(const RenderText& text)
     108TextRunRange textRunsFor(const RenderText& text)
    109109{
    110     return { firstTextBoxFor(text) };
     110    return { firstTextRunFor(text) };
    111111}
    112112
    113 ElementBoxIterator::ElementBoxIterator(Box::PathVariant&& pathVariant)
    114     : m_box(WTFMove(pathVariant))
     113ElementRunIterator::ElementRunIterator(Run::PathVariant&& pathVariant)
     114    : m_run(WTFMove(pathVariant))
    115115{
    116116}
    117117
    118 bool ElementBoxIterator::atEnd() const
     118bool ElementRunIterator::atEnd() const
    119119{
    120     return WTF::switchOn(m_box.m_pathVariant, [](auto& path) {
     120    return WTF::switchOn(m_run.m_pathVariant, [](auto& path) {
    121121        return path.atEnd();
    122122    });
    123123}
    124124
    125 ElementBoxIterator elementBoxFor(const RenderLineBreak& renderElement)
     125ElementRunIterator elementRunFor(const RenderLineBreak& renderElement)
    126126{
    127127    if (auto* flow = lineLayoutSystemFlowForRenderer(renderElement)) {
    128128#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
    129129        if (auto* layoutFormattingContextLineLayout = flow->layoutFormattingContextLineLayout())
    130             return layoutFormattingContextLineLayout->elementBoxFor(renderElement);
     130            return layoutFormattingContextLineLayout->elementRunFor(renderElement);
    131131#endif
    132132    }
    133133
    134     return { ComplexPath(renderElement.inlineBoxWrapper()) };
     134    return { LegacyPath(renderElement.inlineBoxWrapper()) };
    135135}
    136136
  • trunk/Source/WebCore/layout/integration/LayoutIntegrationRunIterator.h

    r267696 r267697  
    2727
    2828#include "InlineElementBox.h"
    29 #include "LineLayoutTraversalComplexPath.h"
    30 #include "LineLayoutTraversalDisplayRunPath.h"
     29#include "LayoutIntegrationRunIteratorLegacyPath.h"
     30#include "LayoutIntegrationRunIteratorModernPath.h"
    3131#include <wtf/Variant.h>
    3232
     
    3636class RenderText;
    3737
    38 namespace LineLayoutTraversal {
    39 
    40 class ElementBoxIterator;
    41 class TextBoxIterator;
     38namespace LayoutIntegration {
     39
     40class ElementRunIterator;
     41class TextRunIterator;
    4242
    4343struct EndIterator { };
    4444
    45 class Box {
     45class Run {
    4646public:
    4747    using PathVariant = Variant<
    4848#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
    49         DisplayRunPath,
     49        ModernPath,
    5050#endif
    51         ComplexPath
     51        LegacyPath
    5252    >;
    5353
    54     Box(PathVariant&&);
     54    Run(PathVariant&&);
    5555
    5656    FloatRect rect() const;
     
    6565
    6666protected:
    67     friend class ElementBoxIterator;
    68     friend class TextBoxIterator;
     67    friend class ElementRunIterator;
     68    friend class TextRunIterator;
    6969
    7070    PathVariant m_pathVariant;
    7171};
    7272
    73 class TextBox : public Box {
    74 public:
    75     TextBox(PathVariant&&);
     73class TextRun : public Run {
     74public:
     75    TextRun(PathVariant&&);
    7676
    7777    bool hasHyphen() const;
     
    8787};
    8888
    89 class TextBoxIterator {
    90 public:
    91     TextBoxIterator() : m_textBox(ComplexPath { nullptr, { } }) { };
    92     TextBoxIterator(Box::PathVariant&&);
    93 
    94     TextBoxIterator& operator++() { return traverseNextInVisualOrder(); }
    95     TextBoxIterator& traverseNextInVisualOrder();
    96     TextBoxIterator& traverseNextInTextOrder();
     89class TextRunIterator {
     90public:
     91    TextRunIterator() : m_textRun(LegacyPath { nullptr, { } }) { };
     92    TextRunIterator(Run::PathVariant&&);
     93
     94    TextRunIterator& operator++() { return traverseNextInVisualOrder(); }
     95    TextRunIterator& traverseNextInVisualOrder();
     96    TextRunIterator& traverseNextInTextOrder();
    9797
    9898    explicit operator bool() const { return !atEnd(); }
    9999
    100     bool operator==(const TextBoxIterator&) const;
    101     bool operator!=(const TextBoxIterator& other) const { return !(*this == other); }
     100    bool operator==(const TextRunIterator&) const;
     101    bool operator!=(const TextRunIterator& other) const { return !(*this == other); }
    102102
    103103    bool operator==(EndIterator) const { return atEnd(); }
    104104    bool operator!=(EndIterator) const { return !atEnd(); }
    105105
    106     const TextBox& operator*() const { return m_textBox; }
    107     const TextBox* operator->() const { return &m_textBox; }
     106    const TextRun& operator*() const { return m_textRun; }
     107    const TextRun* operator->() const { return &m_textRun; }
    108108
    109109    bool atEnd() const;
    110110
    111111private:
    112     TextBox m_textBox;
    113 };
    114 
    115 class ElementBoxIterator {
    116 public:
    117     ElementBoxIterator() : m_box(ComplexPath { nullptr, { } }) { };
    118     ElementBoxIterator(Box::PathVariant&&);
     112    TextRun m_textRun;
     113};
     114
     115class ElementRunIterator {
     116public:
     117    ElementRunIterator() : m_run(LegacyPath { nullptr, { } }) { };
     118    ElementRunIterator(Run::PathVariant&&);
    119119
    120120    explicit operator bool() const { return !atEnd(); }
    121121
    122     const Box& operator*() const { return m_box; }
    123     const Box* operator->() const { return &m_box; }
     122    const Run& operator*() const { return m_run; }
     123    const Run* operator->() const { return &m_run; }
    124124
    125125    bool atEnd() const;
    126126
    127127private:
    128     Box m_box;
    129 };
    130 
    131 class TextBoxRange {
    132 public:
    133     TextBoxRange(TextBoxIterator begin)
     128    Run m_run;
     129};
     130
     131class TextRunRange {
     132public:
     133    TextRunRange(TextRunIterator begin)
    134134        : m_begin(begin)
    135135    {
    136136    }
    137137
    138     TextBoxIterator begin() const { return m_begin; }
     138    TextRunIterator begin() const { return m_begin; }
    139139    EndIterator end() const { return { }; }
    140140
    141141private:
    142     TextBoxIterator m_begin;
    143 };
    144 
    145 TextBoxIterator firstTextBoxFor(const RenderText&);
    146 TextBoxIterator firstTextBoxInTextOrderFor(const RenderText&);
    147 TextBoxRange textBoxesFor(const RenderText&);
    148 ElementBoxIterator elementBoxFor(const RenderLineBreak&);
     142    TextRunIterator m_begin;
     143};
     144
     145TextRunIterator firstTextRunFor(const RenderText&);
     146TextRunIterator firstTextRunInTextOrderFor(const RenderText&);
     147TextRunRange textRunsFor(const RenderText&);
     148ElementRunIterator elementRunFor(const RenderLineBreak&);
    149149
    150150// -----------------------------------------------
    151151
    152 inline Box::Box(PathVariant&& path)
     152inline Run::Run(PathVariant&& path)
    153153    : m_pathVariant(WTFMove(path))
    154154{
    155155}
    156156
    157 inline FloatRect Box::rect() const
     157inline FloatRect Run::rect() const
    158158{
    159159    return WTF::switchOn(m_pathVariant, [](auto& path) {
     
    162162}
    163163
    164 inline float Box::baseline() const
     164inline float Run::baseline() const
    165165{
    166166    return WTF::switchOn(m_pathVariant, [](auto& path) {
     
    169169}
    170170
    171 inline bool Box::isLeftToRightDirection() const
     171inline bool Run::isLeftToRightDirection() const
    172172{
    173173    return WTF::switchOn(m_pathVariant, [](auto& path) {
     
    176176}
    177177
    178 inline bool Box::isHorizontal() const
     178inline bool Run::isHorizontal() const
    179179{
    180180    return WTF::switchOn(m_pathVariant, [](auto& path) {
     
    183183}
    184184
    185 inline bool Box::dirOverride() const
     185inline bool Run::dirOverride() const
    186186{
    187187    return WTF::switchOn(m_pathVariant, [](auto& path) {
     
    190190}
    191191
    192 inline bool Box::isLineBreak() const
     192inline bool Run::isLineBreak() const
    193193{
    194194    return WTF::switchOn(m_pathVariant, [](auto& path) {
     
    197197}
    198198
    199 inline bool Box::useLineBreakBoxRenderTreeDumpQuirk() const
     199inline bool Run::useLineBreakBoxRenderTreeDumpQuirk() const
    200200{
    201201    return WTF::switchOn(m_pathVariant, [](auto& path) {
     
    204204}
    205205
    206 inline bool TextBox::hasHyphen() const
     206inline bool TextRun::hasHyphen() const
    207207{
    208208    return WTF::switchOn(m_pathVariant, [](auto& path) {
     
    211211}
    212212
    213 inline TextBox::TextBox(PathVariant&& path)
    214     : Box(WTFMove(path))
    215 {
    216 }
    217 
    218 inline StringView TextBox::text() const
     213inline TextRun::TextRun(PathVariant&& path)
     214    : Run(WTFMove(path))
     215{
     216}
     217
     218inline StringView TextRun::text() const
    219219{
    220220    return WTF::switchOn(m_pathVariant, [](auto& path) {
     
    223223}
    224224
    225 inline unsigned TextBox::localStartOffset() const
     225inline unsigned TextRun::localStartOffset() const
    226226{
    227227    return WTF::switchOn(m_pathVariant, [](auto& path) {
     
    230230}
    231231
    232 inline unsigned TextBox::localEndOffset() const
     232inline unsigned TextRun::localEndOffset() const
    233233{
    234234    return WTF::switchOn(m_pathVariant, [](auto& path) {
     
    237237}
    238238
    239 inline unsigned TextBox::length() const
     239inline unsigned TextRun::length() const
    240240{
    241241    return WTF::switchOn(m_pathVariant, [](auto& path) {
     
    244244}
    245245
    246 inline bool TextBox::isLastOnLine() const
     246inline bool TextRun::isLastOnLine() const
    247247{
    248248    return WTF::switchOn(m_pathVariant, [](auto& path) {
     
    251251}
    252252
    253 inline bool TextBox::isLast() const
     253inline bool TextRun::isLast() const
    254254{
    255255    return WTF::switchOn(m_pathVariant, [](auto& path) {
  • trunk/Source/WebCore/layout/integration/LayoutIntegrationRunIteratorLegacyPath.h

    r267696 r267697  
    3131
    3232namespace WebCore {
    33 namespace LineLayoutTraversal {
     33namespace LayoutIntegration {
    3434
    35 class ComplexPath {
     35class LegacyPath {
    3636public:
    37     ComplexPath(const InlineBox* inlineBox, Vector<const InlineTextBox*>&& sortedInlineTextBoxes = { }, size_t sortedInlineTextBoxIndex = 0)
     37    LegacyPath(const InlineBox* inlineBox, Vector<const InlineTextBox*>&& sortedInlineTextBoxes = { }, size_t sortedInlineTextBoxIndex = 0)
    3838        : m_inlineBox(inlineBox)
    3939        , m_sortedInlineTextBoxes(WTFMove(sortedInlineTextBoxes))
     
    6767    inline bool isLast() const { return !nextInlineTextBoxInTextOrder(); };
    6868
    69     void traverseNextTextBoxInVisualOrder() { m_inlineBox = inlineTextBox()->nextTextBox(); }
    70     void traverseNextTextBoxInTextOrder()
     69    void traverseNextTextRunInVisualOrder() { m_inlineBox = inlineTextBox()->nextTextBox(); }
     70    void traverseNextTextRunInTextOrder()
    7171    {
    7272        m_inlineBox = nextInlineTextBoxInTextOrder();
     
    7575    }
    7676
    77     bool operator==(const ComplexPath& other) const { return m_inlineBox == other.m_inlineBox; }
     77    bool operator==(const LegacyPath& other) const { return m_inlineBox == other.m_inlineBox; }
    7878    bool atEnd() const { return !m_inlineBox; }
    7979
     
    8787};
    8888
    89 inline const InlineTextBox* ComplexPath::nextInlineTextBoxInTextOrder() const
     89inline const InlineTextBox* LegacyPath::nextInlineTextBoxInTextOrder() const
    9090{
    9191    if (!m_sortedInlineTextBoxes.isEmpty()) {
  • trunk/Source/WebCore/layout/integration/LayoutIntegrationRunIteratorModernPath.h

    r267696 r267697  
    3232namespace WebCore {
    3333
    34 namespace LineLayoutTraversal {
     34namespace LayoutIntegration {
    3535
    3636static FloatPoint linePosition(float left, float top)
     
    3939}
    4040
    41 class DisplayRunPath {
     41class ModernPath {
    4242public:
    43     DisplayRunPath(const Display::InlineContent& inlineContent, size_t startIndex, size_t endIndex)
     43    ModernPath(const Display::InlineContent& inlineContent, size_t startIndex, size_t endIndex)
    4444        : m_inlineContent(&inlineContent)
    4545        , m_endIndex(endIndex)
    4646        , m_runIndex(startIndex)
    4747    { }
    48     DisplayRunPath(DisplayRunPath&&) = default;
    49     DisplayRunPath(const DisplayRunPath&) = default;
    50     DisplayRunPath& operator=(const DisplayRunPath&) = default;
    51     DisplayRunPath& operator=(DisplayRunPath&&) = default;
     48    ModernPath(ModernPath&&) = default;
     49    ModernPath(const ModernPath&) = default;
     50    ModernPath& operator=(const ModernPath&) = default;
     51    ModernPath& operator=(ModernPath&&) = default;
    5252
    5353    FloatRect rect() const;
     
    8686    };
    8787
    88     void traverseNextTextBoxInVisualOrder()
     88    void traverseNextTextRunInVisualOrder()
    8989    {
    9090        ASSERT(!atEnd());
    9191        ++m_runIndex;
    9292    }
    93     void traverseNextTextBoxInTextOrder() {  traverseNextTextBoxInVisualOrder(); }
     93    void traverseNextTextRunInTextOrder() {  traverseNextTextRunInVisualOrder(); }
    9494
    95     bool operator==(const DisplayRunPath& other) const { return m_inlineContent == other.m_inlineContent && m_runIndex == other.m_runIndex; }
     95    bool operator==(const ModernPath& other) const { return m_inlineContent == other.m_inlineContent && m_runIndex == other.m_runIndex; }
    9696    bool atEnd() const { return m_runIndex == m_endIndex; }
    9797
     
    106106};
    107107
    108 inline FloatRect DisplayRunPath::rect() const
     108inline FloatRect ModernPath::rect() const
    109109{
    110110    auto rect = run().rect();
  • trunk/Source/WebCore/rendering/RenderLineBreak.cpp

    r266557 r267697  
    2828#include "HTMLWBRElement.h"
    2929#include "InlineElementBox.h"
    30 #include "LineLayoutTraversal.h"
     30#include "LayoutIntegrationRunIterator.h"
    3131#include "LogicalSelectionOffsetCaches.h"
    3232#include "RenderBlock.h"
     
    171171IntRect RenderLineBreak::linesBoundingBox() const
    172172{
    173     auto box = LineLayoutTraversal::elementBoxFor(*this);
     173    auto box = LayoutIntegration::elementRunFor(*this);
    174174    if (!box)
    175175        return { };
     
    180180IntRect RenderLineBreak::boundingBoxForRenderTreeDump() const
    181181{
    182     auto box = LineLayoutTraversal::elementBoxFor(*this);
     182    auto box = LayoutIntegration::elementRunFor(*this);
    183183    if (!box)
    184184        return { };
     
    202202void RenderLineBreak::absoluteRects(Vector<IntRect>& rects, const LayoutPoint& accumulatedOffset) const
    203203{
    204     auto box = LineLayoutTraversal::elementBoxFor(*this);
     204    auto box = LayoutIntegration::elementRunFor(*this);
    205205    if (!box)
    206206        return;
     
    212212void RenderLineBreak::absoluteQuads(Vector<FloatQuad>& quads, bool* wasFixed) const
    213213{
    214     auto box = LineLayoutTraversal::elementBoxFor(*this);
     214    auto box = LayoutIntegration::elementRunFor(*this);
    215215    if (!box)
    216216        return;
  • trunk/Source/WebCore/rendering/RenderText.cpp

    r267565 r267697  
    3838#include "Hyphenation.h"
    3939#include "InlineTextBox.h"
    40 #include "LineLayoutTraversal.h"
     40#include "LayoutIntegrationRunIterator.h"
    4141#include "Range.h"
    4242#include "RenderBlock.h"
     
    304304void RenderText::absoluteRects(Vector<IntRect>& rects, const LayoutPoint& accumulatedOffset) const
    305305{
    306     for (auto& box : LineLayoutTraversal::textBoxesFor(*this)) {
    307         auto rect = box.rect();
     306    for (auto& run : LayoutIntegration::textRunsFor(*this)) {
     307        auto rect = run.rect();
    308308        rects.append(enclosingIntRect(FloatRect(accumulatedOffset + rect.location(), rect.size())));
    309309    }
     
    409409
    410410    Vector<FloatQuad> quads;
    411     for (auto& box : LineLayoutTraversal::textBoxesFor(textRenderer))
    412         quads.append(textRenderer.localToAbsoluteQuad(FloatQuad(box.rect()), UseTransforms, wasFixed));
     411    for (auto& run : LayoutIntegration::textRunsFor(textRenderer))
     412        quads.append(textRenderer.localToAbsoluteQuad(FloatQuad(run.rect()), UseTransforms, wasFixed));
    413413    return quads;
    414414}
     
    10361036IntPoint RenderText::firstRunLocation() const
    10371037{
    1038     auto first = LineLayoutTraversal::firstTextBoxFor(*this);
     1038    auto first = LayoutIntegration::firstTextRunFor(*this);
    10391039    if (!first)
    10401040        return { };
     
    13561356IntRect RenderText::linesBoundingBox() const
    13571357{
    1358     auto first = LineLayoutTraversal::firstTextBoxFor(*this);
     1358    auto first = LayoutIntegration::firstTextRunFor(*this);
    13591359    if (!first)
    13601360        return { };
     
    14451445int RenderText::caretMinOffset() const
    14461446{
    1447     auto first = LineLayoutTraversal::firstTextBoxFor(*this);
     1447    auto first = LayoutIntegration::firstTextRunFor(*this);
    14481448    if (!first)
    14491449        return 0;
     
    14581458int RenderText::caretMaxOffset() const
    14591459{
    1460     auto first = LineLayoutTraversal::firstTextBoxFor(*this);
     1460    auto first = LayoutIntegration::firstTextRunFor(*this);
    14611461    if (!first)
    14621462        return text().length();
     
    14721472{
    14731473    unsigned result = 0;
    1474     for (auto& box : LineLayoutTraversal::textBoxesFor(*this)) {
    1475         auto start = box.localStartOffset();
    1476         auto length = box.length();
     1474    for (auto& run : LayoutIntegration::textRunsFor(*this)) {
     1475        auto start = run.localStartOffset();
     1476        auto length = run.length();
    14771477        if (offset < start)
    14781478            return result;
     
    14891489static bool containsOffset(const RenderText& text, unsigned offset, OffsetType type)
    14901490{
    1491     for (auto box = LineLayoutTraversal::firstTextBoxInTextOrderFor(text); box; box.traverseNextInTextOrder()) {
     1491    for (auto box = LayoutIntegration::firstTextRunInTextOrderFor(text); box; box.traverseNextInTextOrder()) {
    14921492        auto start = box->localStartOffset();
    14931493        if (offset < start)
     
    15181518bool RenderText::hasRenderedText() const
    15191519{
    1520     for (auto& box : LineLayoutTraversal::textBoxesFor(*this)) {
     1520    for (auto& box : LayoutIntegration::textRunsFor(*this)) {
    15211521        if (box.length())
    15221522            return true;
  • trunk/Source/WebCore/rendering/RenderTreeAsText.cpp

    r266980 r267697  
    3737#include "HTMLSpanElement.h"
    3838#include "InlineTextBox.h"
    39 #include "LineLayoutTraversal.h"
     39#include "LayoutIntegrationRunIterator.h"
    4040#include "Logging.h"
    4141#include "PrintContext.h"
     
    204204        const RenderText& text = downcast<RenderText>(o);
    205205        r = IntRect(text.firstRunLocation(), text.linesBoundingBox().size());
    206         if (!LineLayoutTraversal::firstTextBoxFor(text))
     206        if (!LayoutIntegration::firstTextRunFor(text))
    207207            adjustForTableCells = false;
    208208    } else if (o.isBR()) {
     
    479479}
    480480
    481 static void writeTextBox(TextStream& ts, const RenderText& o, const LineLayoutTraversal::TextBox& textBox)
    482 {
    483     auto rect = textBox.rect();
     481static void writeTextRun(TextStream& ts, const RenderText& o, const LayoutIntegration::TextRun& textRun)
     482{
     483    auto rect = textRun.rect();
    484484    int x = rect.x();
    485485    int y = rect.y();
    486486    // FIXME: Use non-logical width. webkit.org/b/206809.
    487     int logicalWidth = ceilf(rect.x() + (textBox.isHorizontal() ? rect.width() : rect.height())) - x;
     487    int logicalWidth = ceilf(rect.x() + (textRun.isHorizontal() ? rect.width() : rect.height())) - x;
    488488    // FIXME: Table cell adjustment is temporary until results can be updated.
    489489    if (is<RenderTableCell>(*o.containingBlock()))
     
    491491       
    492492    ts << "text run at (" << x << "," << y << ") width " << logicalWidth;
    493     if (!textBox.isLeftToRightDirection() || textBox.dirOverride()) {
    494         ts << (!textBox.isLeftToRightDirection() ? " RTL" : " LTR");
    495         if (textBox.dirOverride())
     493    if (!textRun.isLeftToRightDirection() || textRun.dirOverride()) {
     494        ts << (!textRun.isLeftToRightDirection() ? " RTL" : " LTR");
     495        if (textRun.dirOverride())
    496496            ts << " override";
    497497    }
    498498    ts << ": "
    499         << quoteAndEscapeNonPrintables(textBox.text());
    500     if (textBox.hasHyphen())
     499        << quoteAndEscapeNonPrintables(textRun.text());
     500    if (textRun.hasHyphen())
    501501        ts << " + hyphen string " << quoteAndEscapeNonPrintables(o.style().hyphenString().string());
    502502    ts << "\n";
     
    547547    if (is<RenderText>(o)) {
    548548        auto& text = downcast<RenderText>(o);
    549         for (auto& textBox : LineLayoutTraversal::textBoxesFor(text)) {
     549        for (auto& run : LayoutIntegration::textRunsFor(text)) {
    550550            ts << indent;
    551             writeTextBox(ts, text, textBox);
     551            writeTextRun(ts, text, run);
    552552        }
    553553    } else {
Note: See TracChangeset for help on using the changeset viewer.