Changeset 267697 in webkit
- Timestamp:
- Sep 28, 2020, 6:42:33 AM (6 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 12 edited
- 4 moved
-
ChangeLog (modified) (1 diff)
-
Headers.cmake (modified) (2 diffs)
-
Sources.txt (modified) (2 diffs)
-
WebCore.xcodeproj/project.pbxproj (modified) (13 diffs)
-
dom/Position.cpp (modified) (5 diffs)
-
editing/TextIterator.cpp (modified) (10 diffs)
-
editing/TextIterator.h (modified) (3 diffs)
-
layout/integration/LayoutIntegrationLineLayout.cpp (modified) (4 diffs)
-
layout/integration/LayoutIntegrationLineLayout.h (modified) (2 diffs)
-
layout/integration/LayoutIntegrationRunIterator.cpp (moved) (moved from trunk/Source/WebCore/rendering/line/LineLayoutTraversal.cpp ) (4 diffs)
-
layout/integration/LayoutIntegrationRunIterator.h (moved) (moved from trunk/Source/WebCore/rendering/line/LineLayoutTraversal.h ) (17 diffs)
-
layout/integration/LayoutIntegrationRunIteratorLegacyPath.h (moved) (moved from trunk/Source/WebCore/rendering/line/LineLayoutTraversalComplexPath.h ) (4 diffs)
-
layout/integration/LayoutIntegrationRunIteratorModernPath.h (moved) (moved from trunk/Source/WebCore/rendering/line/LineLayoutTraversalDisplayRunPath.h ) (4 diffs)
-
rendering/RenderLineBreak.cpp (modified) (5 diffs)
-
rendering/RenderText.cpp (modified) (10 diffs)
-
rendering/RenderTreeAsText.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r267688 r267697 1 2020-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 1 99 2020-09-24 Simon Fraser <simon.fraser@apple.com> 2 100 -
trunk/Source/WebCore/Headers.cmake
r267615 r267697 715 715 layout/inlineformatting/InlineRect.h 716 716 717 layout/integration/LayoutIntegrationRunIterator.h 718 layout/integration/LayoutIntegrationRunIteratorLegacyPath.h 719 layout/integration/LayoutIntegrationRunIteratorModernPath.h 720 717 721 layout/layouttree/LayoutBox.h 718 722 … … 1428 1432 rendering/ScrollAlignment.h 1429 1433 1430 rendering/line/LineLayoutTraversal.h1431 rendering/line/LineLayoutTraversalComplexPath.h1432 rendering/line/LineLayoutTraversalDisplayRunPath.h1433 1434 rendering/line/LineWidth.h 1434 1435 rendering/line/TrailingObjects.h -
trunk/Source/WebCore/Sources.txt
r267654 r267697 1469 1469 layout/integration/LayoutIntegrationLineLayout.cpp 1470 1470 layout/integration/LayoutIntegrationPagination.cpp 1471 layout/integration/LayoutIntegrationRunIterator.cpp 1471 1472 layout/invalidation/InvalidationContext.cpp 1472 1473 layout/invalidation/InvalidationState.cpp … … 2217 2218 rendering/line/LineBreaker.cpp 2218 2219 rendering/line/LineInfo.cpp 2219 rendering/line/LineLayoutTraversal.cpp2220 2220 rendering/line/LineWidth.cpp 2221 2221 rendering/line/TrailingObjects.cpp -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r267654 r267697 4986 4986 E42E76DC1C7AF77600E3614D /* StyleUpdate.h in Headers */ = {isa = PBXBuildFile; fileRef = E42E76DB1C7AF77600E3614D /* StyleUpdate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 4987 4987 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, ); }; };4989 4988 E43A023B17EB370A004CDD25 /* RenderElement.h in Headers */ = {isa = PBXBuildFile; fileRef = E43A023A17EB370A004CDD25 /* RenderElement.h */; settings = {ATTRIBUTES = (Private, ); }; }; 4990 4989 E43AF8E71AC5B7EC00CA717E /* CacheValidation.h in Headers */ = {isa = PBXBuildFile; fileRef = E43AF8E51AC5B7DD00CA717E /* CacheValidation.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 5009 5008 E44B4BB4141650D7002B1D8B /* SelectorChecker.h in Headers */ = {isa = PBXBuildFile; fileRef = E44B4BB2141650D7002B1D8B /* SelectorChecker.h */; }; 5010 5009 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, ); }; };5012 5010 E451C6312394027900993190 /* LayoutUnits.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F73918C2106CEDD006AF262 /* LayoutUnits.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5013 5011 E451C6322394031A00993190 /* MarginTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 6FE7AA2621C37B6300296DCD /* MarginTypes.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 5038 5036 E47E276516036ED200EE2AFB /* ExtensionStyleSheets.h in Headers */ = {isa = PBXBuildFile; fileRef = E47E276416036ED200EE2AFB /* ExtensionStyleSheets.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5039 5037 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, ); }; };5041 5038 E4863CFE23842E9E00972158 /* RuleData.h in Headers */ = {isa = PBXBuildFile; fileRef = E4863CFD23842E9E00972158 /* RuleData.h */; }; 5042 5039 E4946EAF156E64DD00D3297F /* StyleRuleImport.h in Headers */ = {isa = PBXBuildFile; fileRef = E4946EAD156E64DD00D3297F /* StyleRuleImport.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5043 5040 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, ); }; }; 5044 5044 E4A7995220EE4B1400C19568 /* CSSParserContext.h in Headers */ = {isa = PBXBuildFile; fileRef = E4A7994E20EE4AE100C19568 /* CSSParserContext.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5045 5045 E4A814D41C6DEC4000BF85AC /* ClassChangeInvalidation.h in Headers */ = {isa = PBXBuildFile; fileRef = E4A814D31C6DEC4000BF85AC /* ClassChangeInvalidation.h */; }; … … 15854 15854 E4312AB524B3265600678349 /* LayoutIntegrationPagination.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LayoutIntegrationPagination.cpp; sourceTree = "<group>"; }; 15855 15855 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>"; };15857 15856 E43A023A17EB370A004CDD25 /* RenderElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderElement.h; sourceTree = "<group>"; }; 15858 15857 E43A023C17EB3713004CDD25 /* RenderElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderElement.cpp; sourceTree = "<group>"; }; … … 15892 15891 E44FA1841BCA6B5A0091B6EF /* ComposedTreeIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ComposedTreeIterator.h; sourceTree = "<group>"; }; 15893 15892 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>"; };15895 15893 E451C6332394058E00993190 /* DisplayInlineContent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DisplayInlineContent.h; sourceTree = "<group>"; }; 15896 15894 E45322A9140CE267005A0F92 /* SelectorQuery.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SelectorQuery.cpp; sourceTree = "<group>"; }; … … 15941 15939 E47E276716036EDC00EE2AFB /* ExtensionStyleSheets.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExtensionStyleSheets.cpp; sourceTree = "<group>"; }; 15942 15940 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>"; };15945 15941 E4863CFA23842E8700972158 /* RuleData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RuleData.cpp; sourceTree = "<group>"; }; 15946 15942 E4863CFD23842E9E00972158 /* RuleData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RuleData.h; sourceTree = "<group>"; }; … … 15953 15949 E4A1822F1F13BE5800FEF698 /* StyleInvalidationFunctions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = StyleInvalidationFunctions.h; sourceTree = "<group>"; }; 15954 15950 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>"; }; 15955 15955 E4A7994E20EE4AE100C19568 /* CSSParserContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CSSParserContext.h; path = parser/CSSParserContext.h; sourceTree = "<group>"; }; 15956 15956 E4A7995020EE4AE200C19568 /* CSSParserContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CSSParserContext.cpp; path = parser/CSSParserContext.cpp; sourceTree = "<group>"; }; … … 28496 28496 isa = PBXGroup; 28497 28497 children = ( 28498 E4A664C72521B779007081DC /* LayoutIntegrationRunIterator.cpp */, 28499 E4A664C62521B778007081DC /* LayoutIntegrationRunIterator.h */, 28500 E4A664C52521B778007081DC /* LayoutIntegrationRunIteratorLegacyPath.h */, 28501 E4A664C42521B777007081DC /* LayoutIntegrationRunIteratorModernPath.h */, 28498 28502 E418025623D454B500FFB071 /* LayoutIntegrationBoxTree.cpp */, 28499 28503 E418025323D4549A00FFB071 /* LayoutIntegrationBoxTree.h */, … … 30245 30249 FFEFAB2D183BCB6F00514534 /* LineInlineHeaders.h */, 30246 30250 FFEFAB2918380DA000514534 /* LineLayoutState.h */, 30247 E484A33D23055303009ADE6A /* LineLayoutTraversal.cpp */,30248 E484A33B23055303009ADE6A /* LineLayoutTraversal.h */,30249 E4343D242392778F00EBBB66 /* LineLayoutTraversalComplexPath.h */,30250 E451C627239293EB00993190 /* LineLayoutTraversalDisplayRunPath.h */,30251 30251 FFDBC046183D27B700407109 /* LineWidth.cpp */, 30252 30252 FFDBC045183D27B700407109 /* LineWidth.h */, … … 32448 32448 07969DB217D14151007FF842 /* JSRTCDTMFToneChangeEvent.h in Headers */, 32449 32449 07969DB617D14151007FF842 /* JSRTCIceCandidate.h in Headers */, 32450 E4A664CE2521D4C9007081DC /* LayoutIntegrationRunIteratorModernPath.h in Headers */, 32450 32451 316DCB4C1E7910A6001B5F87 /* JSRTCIceConnectionState.h in Headers */, 32451 32452 316DCB4E1E7910A6001B5F87 /* JSRTCIceGatheringState.h in Headers */, … … 32493 32494 B59DD6A911902A71007E9684 /* JSSQLStatementErrorCallback.h in Headers */, 32494 32495 BC82432A0D0CE8A200460C8F /* JSSQLTransaction.h in Headers */, 32496 E4A664CC2521D4AF007081DC /* LayoutIntegrationRunIterator.h in Headers */, 32495 32497 B59DD69D11902A42007E9684 /* JSSQLTransactionCallback.h in Headers */, 32496 32498 B59DD6A111902A52007E9684 /* JSSQLTransactionErrorCallback.h in Headers */, … … 32828 32830 AB31C91E10AE1B8E000C7B92 /* LineClampValue.h in Headers */, 32829 32831 FFEFAB2A18380DA000514534 /* LineLayoutState.h in Headers */, 32830 E484A33E23055325009ADE6A /* LineLayoutTraversal.h in Headers */,32831 E4343D252392779000EBBB66 /* LineLayoutTraversalComplexPath.h in Headers */,32832 E451C628239293EC00993190 /* LineLayoutTraversalDisplayRunPath.h in Headers */,32833 32832 FFDBC047183D27B700407109 /* LineWidth.h in Headers */, 32834 32833 CBA9DC0B1DF44DF40005675C /* LinkHeader.h in Headers */, … … 32965 32964 C96F5EC51B5872260091EA9D /* MediaSessionInterruptionProviderMac.h in Headers */, 32966 32965 C90F65561B2253BE002163A1 /* MediaSessionManager.h in Headers */, 32966 E4A664CF2521D4E2007081DC /* LayoutIntegrationRunIteratorLegacyPath.h in Headers */, 32967 32967 417F7AEF2139BF6F00FBA7EC /* MediaSessionManagerCocoa.h in Headers */, 32968 32968 07638A991884487200E15A1B /* MediaSessionManagerIOS.h in Headers */, -
trunk/Source/WebCore/dom/Position.cpp
r267363 r267697 39 39 #include "InlineIterator.h" 40 40 #include "InlineTextBox.h" 41 #include "L ineLayoutTraversal.h"41 #include "LayoutIntegrationRunIterator.h" 42 42 #include "Logging.h" 43 43 #include "NodeTraversal.h" … … 729 729 auto& textRenderer = downcast<RenderText>(*renderer); 730 730 731 auto firstText Box = LineLayoutTraversal::firstTextBoxInTextOrderFor(textRenderer);732 if (!firstText Box)731 auto firstTextRun = LayoutIntegration::firstTextRunInTextOrderFor(textRenderer); 732 if (!firstTextRun) 733 733 continue; 734 734 … … 743 743 744 744 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()) 748 748 return currentPosition; 749 749 continue; 750 750 } 751 751 752 if (textOffset == box->localEndOffset() + 1 && box->isLastOnLine() && !box->isLast())752 if (textOffset == run->localEndOffset() + 1 && run->isLastOnLine() && !run->isLast()) 753 753 return currentPosition; 754 754 } … … 836 836 auto& textRenderer = downcast<RenderText>(*renderer); 837 837 838 auto firstText Box = LineLayoutTraversal::firstTextBoxInTextOrderFor(textRenderer);839 if (!firstText Box)838 auto firstTextRun = LayoutIntegration::firstTextRunInTextOrderFor(textRenderer); 839 if (!firstTextRun) 840 840 continue; 841 841 … … 846 846 847 847 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()) 850 850 return currentPosition; 851 851 852 if (textOffset < box->localEndOffset()) {853 if (textOffset >= box->localStartOffset())852 if (textOffset < run->localEndOffset()) { 853 if (textOffset >= run->localStartOffset()) 854 854 return currentPosition; 855 855 continue; 856 856 } 857 857 858 if (textOffset == box->localEndOffset() && box->isLastOnLine() && !box->isLast())858 if (textOffset == run->localEndOffset() && run->isLastOnLine() && !run->isLast()) 859 859 return currentPosition; 860 860 } -
trunk/Source/WebCore/editing/TextIterator.cpp
r267565 r267697 438 438 } 439 439 440 if (!m_text Box && m_remainingTextBox) {441 m_text Box = m_remainingTextBox;442 m_remainingText Box= { };440 if (!m_textRun && m_remainingTextRun) { 441 m_textRun = m_remainingTextRun; 442 m_remainingTextRun = { }; 443 443 m_firstLetterText = { }; 444 444 m_offset = 0; 445 445 } 446 446 // handle remembered text box 447 if (m_text Box) {448 handleText Box();447 if (m_textRun) { 448 handleTextRun(); 449 449 if (m_positionNode) 450 450 return; … … 564 564 emitText(textNode, *m_firstLetterText, m_offset, m_offset + firstLetter.length()); 565 565 m_firstLetterText = nullptr; 566 m_text Box= { };566 m_textRun = { }; 567 567 return false; 568 568 } … … 581 581 } 582 582 583 m_text Box = LineLayoutTraversal::firstTextBoxInTextOrderFor(renderer);583 m_textRun = LayoutIntegration::firstTextRunInTextOrderFor(renderer); 584 584 585 585 bool shouldHandleFirstLetter = !m_handledFirstLetter && is<RenderTextFragment>(renderer) && !m_offset; … … 587 587 handleTextNodeFirstLetter(downcast<RenderTextFragment>(renderer)); 588 588 589 if (!m_text Box&& rendererText.length() && !shouldHandleFirstLetter) {589 if (!m_textRun && rendererText.length() && !shouldHandleFirstLetter) { 590 590 if (renderer.style().visibility() != Visibility::Visible && !(m_behavior & TextIteratorIgnoresStyleVisibility)) 591 591 return false; … … 594 594 } 595 595 596 handleText Box();596 handleTextRun(); 597 597 return true; 598 598 } 599 599 600 void TextIterator::handleText Box()600 void TextIterator::handleTextRun() 601 601 { 602 602 Text& textNode = downcast<Text>(*m_node); … … 604 604 auto& renderer = m_firstLetterText ? *m_firstLetterText : *textNode.renderer(); 605 605 if (renderer.style().visibility() != Visibility::Visible && !(m_behavior & TextIteratorIgnoresStyleVisibility)) { 606 m_text Box= { };606 m_textRun = { }; 607 607 return; 608 608 } 609 609 610 auto firstText Box = LineLayoutTraversal::firstTextBoxInTextOrderFor(renderer);610 auto firstTextRun = LayoutIntegration::firstTextRunInTextOrderFor(renderer); 611 611 612 612 String rendererText = renderer.text(); 613 613 unsigned start = m_offset; 614 614 unsigned end = (&textNode == m_endContainer) ? static_cast<unsigned>(m_endOffset) : UINT_MAX; 615 while (m_text Box) {616 unsigned text BoxStart = m_textBox->localStartOffset();617 unsigned runStart = std::max(text BoxStart, start);615 while (m_textRun) { 616 unsigned textRunStart = m_textRun->localStartOffset(); 617 unsigned runStart = std::max(textRunStart, start); 618 618 619 619 // Check for collapsed space at the start of this run. 620 bool needSpace = m_lastTextNodeEndedWithCollapsedSpace || (m_text Box == firstTextBox && textBoxStart == runStart && runStart);620 bool needSpace = m_lastTextNodeEndedWithCollapsedSpace || (m_textRun == firstTextRun && textRunStart == runStart && runStart); 621 621 if (needSpace && !renderer.style().isCollapsibleWhiteSpace(m_lastCharacter) && m_lastCharacter) { 622 622 if (m_lastTextNode == &textNode && runStart && rendererText[runStart - 1] == ' ') { … … 629 629 return; 630 630 } 631 unsigned text BoxEnd = textBoxStart + m_textBox->length();632 unsigned runEnd = std::min(text BoxEnd, end);631 unsigned textRunEnd = textRunStart + m_textRun->length(); 632 unsigned runEnd = std::min(textRunEnd, end); 633 633 634 // Determine what the next text boxwill be, but don't advance yet635 auto nextText Box = m_textBox;636 nextText Box.traverseNextInTextOrder();634 // Determine what the next text run will be, but don't advance yet 635 auto nextTextRun = m_textRun; 636 nextTextRun.traverseNextInTextOrder(); 637 637 638 638 if (runStart < runEnd) { … … 653 653 } 654 654 if (subrunEnd == runEnd && (m_behavior & TextIteratorBehavesAsIfNodesFollowing)) { 655 bool lastSpaceCollapsedByNextNonText Box = !nextTextBox&& rendererText.length() > subrunEnd && rendererText[subrunEnd] == ' ';656 if (lastSpaceCollapsedByNextNonText Box)655 bool lastSpaceCollapsedByNextNonTextRun = !nextTextRun && rendererText.length() > subrunEnd && rendererText[subrunEnd] == ' '; 656 if (lastSpaceCollapsedByNextNonTextRun) 657 657 ++subrunEnd; // runEnd stopped before last space. Increment by one to restore the space. 658 658 } … … 663 663 // If we are doing a subrun that doesn't go to the end of the text box, 664 664 // come back again to finish handling this text box; don't advance to the next one. 665 if (static_cast<unsigned>(m_positionEndOffset) < text BoxEnd)665 if (static_cast<unsigned>(m_positionEndOffset) < textRunEnd) 666 666 return; 667 667 668 668 // Advance and return 669 unsigned nextRunStart = nextText Box ? nextTextBox->localStartOffset() : rendererText.length();669 unsigned nextRunStart = nextTextRun ? nextTextRun->localStartOffset() : rendererText.length(); 670 670 if (nextRunStart > runEnd) 671 671 m_lastTextNodeEndedWithCollapsedSpace = true; // collapsed space between runs or at the end 672 m_text Box = nextTextBox;672 m_textRun = nextTextRun; 673 673 return; 674 674 } 675 675 // Advance and continue 676 m_text Box = nextTextBox;677 } 678 if (!m_text Box && m_remainingTextBox) {679 m_text Box = m_remainingTextBox;680 m_remainingText Box= { };676 m_textRun = nextTextRun; 677 } 678 if (!m_textRun && m_remainingTextRun) { 679 m_textRun = m_remainingTextRun; 680 m_remainingTextRun = { }; 681 681 m_firstLetterText = { }; 682 682 m_offset = 0; 683 handleText Box();683 handleTextRun(); 684 684 } 685 685 } … … 701 701 if (auto* firstLetterText = firstRenderTextInFirstLetter(firstLetter)) { 702 702 m_handledFirstLetter = true; 703 m_remainingText Box = m_textBox;704 m_text Box = LineLayoutTraversal::firstTextBoxInTextOrderFor(*firstLetterText);703 m_remainingTextRun = m_textRun; 704 m_textRun = LayoutIntegration::firstTextRunInTextOrderFor(*firstLetterText); 705 705 m_firstLetterText = firstLetterText; 706 706 } -
trunk/Source/WebCore/editing/TextIterator.h
r259401 r267697 28 28 #include "CharacterRange.h" 29 29 #include "FindOptions.h" 30 #include "L ineLayoutTraversal.h"30 #include "LayoutIntegrationRunIterator.h" 31 31 #include "SimpleRange.h" 32 32 #include "TextIteratorBehavior.h" … … 117 117 bool handleReplacedElement(); 118 118 bool handleNonTextNode(); 119 void handleText Box();119 void handleTextRun(); 120 120 void handleTextNodeFirstLetter(RenderTextFragment&); 121 121 void emitCharacter(UChar, Node& characterNode, Node* offsetBaseNode, int textStartOffset, int textEndOffset); … … 150 150 // Used when there is still some pending text from the current node; when these are false and null, we go back to normal iterating. 151 151 Node* m_nodeForAdditionalNewline { nullptr }; 152 L ineLayoutTraversal::TextBoxIterator m_textBox;152 LayoutIntegration::TextRunIterator m_textRun; 153 153 154 154 // Used when iterating over :first-letter text to save pointer to remaining text box. 155 L ineLayoutTraversal::TextBoxIterator m_remainingTextBox;155 LayoutIntegration::TextRunIterator m_remainingTextRun; 156 156 157 157 // Used to point to RenderText object for :first-letter. -
trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp
r267565 r267697 295 295 } 296 296 297 L ineLayoutTraversal::TextBoxIterator LineLayout::textBoxesFor(const RenderText& renderText) const297 LayoutIntegration::TextRunIterator LineLayout::textRunsFor(const RenderText& renderText) const 298 298 { 299 299 auto* inlineContent = displayInlineContent(); … … 317 317 return { }; 318 318 319 return { L ineLayoutTraversal::DisplayRunPath(*inlineContent, *firstIndex, lastIndex + 1) };320 } 321 322 L ineLayoutTraversal::ElementBoxIterator LineLayout::elementBoxFor(const RenderLineBreak& renderLineBreak) const319 return { LayoutIntegration::ModernPath(*inlineContent, *firstIndex, lastIndex + 1) }; 320 } 321 322 LayoutIntegration::ElementRunIterator LineLayout::elementRunFor(const RenderLineBreak& renderLineBreak) const 323 323 { 324 324 auto* inlineContent = displayInlineContent(); … … 331 331 auto& run = inlineContent->runs[i]; 332 332 if (&run.layoutBox() == layoutBox) 333 return { L ineLayoutTraversal::DisplayRunPath(*inlineContent, i, i + 1) };333 return { LayoutIntegration::ModernPath(*inlineContent, i, i + 1) }; 334 334 } 335 335 … … 394 394 // and the run starts at 100px, due to the horizontal aligment, the xpos is supposed to be at 0px). 395 395 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 }; 397 397 textRun.setTabSize(!style.collapseWhiteSpace(), style.tabSize()); 398 398 FloatPoint textOrigin { rect.x() + paintOffset.x(), roundToDevicePixel(baseline, deviceScaleFactor) }; -
trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.h
r267468 r267697 29 29 30 30 #include "LayoutIntegrationBoxTree.h" 31 #include "LayoutIntegrationRunIterator.h" 31 32 #include "LayoutPoint.h" 32 33 #include "LayoutState.h" 33 #include "LineLayoutTraversal.h"34 34 #include "RenderObjectEnums.h" 35 35 … … 78 78 bool hitTest(const HitTestRequest&, HitTestResult&, const HitTestLocation&, const LayoutPoint& accumulatedOffset, HitTestAction); 79 79 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; 82 82 83 83 static void releaseCaches(RenderView&); -
trunk/Source/WebCore/layout/integration/LayoutIntegrationRunIterator.cpp
r267696 r267697 25 25 26 26 #include "config.h" 27 #include "L ineLayoutTraversal.h"27 #include "LayoutIntegrationRunIterator.h" 28 28 29 29 #include "LayoutIntegrationLineLayout.h" … … 32 32 33 33 namespace WebCore { 34 namespace L ineLayoutTraversal{34 namespace LayoutIntegration { 35 35 36 Text BoxIterator::TextBoxIterator(Box::PathVariant&& pathVariant)37 : m_text Box(WTFMove(pathVariant))36 TextRunIterator::TextRunIterator(Run::PathVariant&& pathVariant) 37 : m_textRun(WTFMove(pathVariant)) 38 38 { 39 39 } 40 40 41 Text BoxIterator& TextBoxIterator::traverseNextInVisualOrder()41 TextRunIterator& TextRunIterator::traverseNextInVisualOrder() 42 42 { 43 WTF::switchOn(m_text Box.m_pathVariant, [](auto& path) {44 path.traverseNextText BoxInVisualOrder();43 WTF::switchOn(m_textRun.m_pathVariant, [](auto& path) { 44 path.traverseNextTextRunInVisualOrder(); 45 45 }); 46 46 return *this; 47 47 } 48 48 49 Text BoxIterator& TextBoxIterator::traverseNextInTextOrder()49 TextRunIterator& TextRunIterator::traverseNextInTextOrder() 50 50 { 51 WTF::switchOn(m_text Box.m_pathVariant, [](auto& path) {52 path.traverseNextText BoxInTextOrder();51 WTF::switchOn(m_textRun.m_pathVariant, [](auto& path) { 52 path.traverseNextTextRunInTextOrder(); 53 53 }); 54 54 return *this; 55 55 } 56 56 57 bool Text BoxIterator::operator==(const TextBoxIterator& other) const57 bool TextRunIterator::operator==(const TextRunIterator& other) const 58 58 { 59 if (m_text Box.m_pathVariant.index() != other.m_textBox.m_pathVariant.index())59 if (m_textRun.m_pathVariant.index() != other.m_textRun.m_pathVariant.index()) 60 60 return false; 61 61 62 return WTF::switchOn(m_text Box.m_pathVariant, [&](const auto& path) {63 return path == WTF::get<std::decay_t<decltype(path)>>(other.m_text Box.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); 64 64 }); 65 65 } 66 66 67 bool Text BoxIterator::atEnd() const67 bool TextRunIterator::atEnd() const 68 68 { 69 return WTF::switchOn(m_text Box.m_pathVariant, [](auto& path) {69 return WTF::switchOn(m_textRun.m_pathVariant, [](auto& path) { 70 70 return path.atEnd(); 71 71 }); … … 80 80 } 81 81 82 Text BoxIterator firstTextBoxFor(const RenderText& text)82 TextRunIterator firstTextRunFor(const RenderText& text) 83 83 { 84 #if ENABLE(LAYOUT_FORMATTING_CONTEXT) 84 85 if (auto* flow = lineLayoutSystemFlowForRenderer(text)) { 85 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)86 86 if (auto* layoutFormattingContextLineLayout = flow->layoutFormattingContextLineLayout()) 87 return layoutFormattingContextLineLayout->textBoxesFor(text); 87 return layoutFormattingContextLineLayout->textRunsFor(text); 88 } 88 89 #endif 89 }90 90 91 return { ComplexPath { text.firstTextBox() } };91 return { LegacyPath { text.firstTextBox() } }; 92 92 } 93 93 94 Text BoxIterator firstTextBoxInTextOrderFor(const RenderText& text)94 TextRunIterator firstTextRunInTextOrderFor(const RenderText& text) 95 95 { 96 96 if (text.firstTextBox() && text.containsReversedText()) { … … 100 100 std::sort(sortedTextBoxes.begin(), sortedTextBoxes.end(), InlineTextBox::compareByStart); 101 101 auto* first = sortedTextBoxes[0]; 102 return { ComplexPath { first, WTFMove(sortedTextBoxes), 0 } };102 return { LegacyPath { first, WTFMove(sortedTextBoxes), 0 } }; 103 103 } 104 104 105 return firstText BoxFor(text);105 return firstTextRunFor(text); 106 106 } 107 107 108 Text BoxRange textBoxesFor(const RenderText& text)108 TextRunRange textRunsFor(const RenderText& text) 109 109 { 110 return { firstText BoxFor(text) };110 return { firstTextRunFor(text) }; 111 111 } 112 112 113 Element BoxIterator::ElementBoxIterator(Box::PathVariant&& pathVariant)114 : m_ box(WTFMove(pathVariant))113 ElementRunIterator::ElementRunIterator(Run::PathVariant&& pathVariant) 114 : m_run(WTFMove(pathVariant)) 115 115 { 116 116 } 117 117 118 bool Element BoxIterator::atEnd() const118 bool ElementRunIterator::atEnd() const 119 119 { 120 return WTF::switchOn(m_ box.m_pathVariant, [](auto& path) {120 return WTF::switchOn(m_run.m_pathVariant, [](auto& path) { 121 121 return path.atEnd(); 122 122 }); 123 123 } 124 124 125 Element BoxIterator elementBoxFor(const RenderLineBreak& renderElement)125 ElementRunIterator elementRunFor(const RenderLineBreak& renderElement) 126 126 { 127 127 if (auto* flow = lineLayoutSystemFlowForRenderer(renderElement)) { 128 128 #if ENABLE(LAYOUT_FORMATTING_CONTEXT) 129 129 if (auto* layoutFormattingContextLineLayout = flow->layoutFormattingContextLineLayout()) 130 return layoutFormattingContextLineLayout->element BoxFor(renderElement);130 return layoutFormattingContextLineLayout->elementRunFor(renderElement); 131 131 #endif 132 132 } 133 133 134 return { ComplexPath(renderElement.inlineBoxWrapper()) };134 return { LegacyPath(renderElement.inlineBoxWrapper()) }; 135 135 } 136 136 -
trunk/Source/WebCore/layout/integration/LayoutIntegrationRunIterator.h
r267696 r267697 27 27 28 28 #include "InlineElementBox.h" 29 #include "L ineLayoutTraversalComplexPath.h"30 #include "L ineLayoutTraversalDisplayRunPath.h"29 #include "LayoutIntegrationRunIteratorLegacyPath.h" 30 #include "LayoutIntegrationRunIteratorModernPath.h" 31 31 #include <wtf/Variant.h> 32 32 … … 36 36 class RenderText; 37 37 38 namespace L ineLayoutTraversal{39 40 class Element BoxIterator;41 class Text BoxIterator;38 namespace LayoutIntegration { 39 40 class ElementRunIterator; 41 class TextRunIterator; 42 42 43 43 struct EndIterator { }; 44 44 45 class Box{45 class Run { 46 46 public: 47 47 using PathVariant = Variant< 48 48 #if ENABLE(LAYOUT_FORMATTING_CONTEXT) 49 DisplayRunPath,49 ModernPath, 50 50 #endif 51 ComplexPath51 LegacyPath 52 52 >; 53 53 54 Box(PathVariant&&);54 Run(PathVariant&&); 55 55 56 56 FloatRect rect() const; … … 65 65 66 66 protected: 67 friend class Element BoxIterator;68 friend class Text BoxIterator;67 friend class ElementRunIterator; 68 friend class TextRunIterator; 69 69 70 70 PathVariant m_pathVariant; 71 71 }; 72 72 73 class Text Box : public Box{74 public: 75 Text Box(PathVariant&&);73 class TextRun : public Run { 74 public: 75 TextRun(PathVariant&&); 76 76 77 77 bool hasHyphen() const; … … 87 87 }; 88 88 89 class Text BoxIterator {90 public: 91 Text BoxIterator() : m_textBox(ComplexPath { nullptr, { } }) { };92 Text BoxIterator(Box::PathVariant&&);93 94 Text BoxIterator& operator++() { return traverseNextInVisualOrder(); }95 Text BoxIterator& traverseNextInVisualOrder();96 Text BoxIterator& traverseNextInTextOrder();89 class TextRunIterator { 90 public: 91 TextRunIterator() : m_textRun(LegacyPath { nullptr, { } }) { }; 92 TextRunIterator(Run::PathVariant&&); 93 94 TextRunIterator& operator++() { return traverseNextInVisualOrder(); } 95 TextRunIterator& traverseNextInVisualOrder(); 96 TextRunIterator& traverseNextInTextOrder(); 97 97 98 98 explicit operator bool() const { return !atEnd(); } 99 99 100 bool operator==(const Text BoxIterator&) const;101 bool operator!=(const Text BoxIterator& other) const { return !(*this == other); }100 bool operator==(const TextRunIterator&) const; 101 bool operator!=(const TextRunIterator& other) const { return !(*this == other); } 102 102 103 103 bool operator==(EndIterator) const { return atEnd(); } 104 104 bool operator!=(EndIterator) const { return !atEnd(); } 105 105 106 const Text Box& operator*() const { return m_textBox; }107 const Text Box* operator->() const { return &m_textBox; }106 const TextRun& operator*() const { return m_textRun; } 107 const TextRun* operator->() const { return &m_textRun; } 108 108 109 109 bool atEnd() const; 110 110 111 111 private: 112 Text Box m_textBox;113 }; 114 115 class Element BoxIterator {116 public: 117 Element BoxIterator() : m_box(ComplexPath { nullptr, { } }) { };118 Element BoxIterator(Box::PathVariant&&);112 TextRun m_textRun; 113 }; 114 115 class ElementRunIterator { 116 public: 117 ElementRunIterator() : m_run(LegacyPath { nullptr, { } }) { }; 118 ElementRunIterator(Run::PathVariant&&); 119 119 120 120 explicit operator bool() const { return !atEnd(); } 121 121 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; } 124 124 125 125 bool atEnd() const; 126 126 127 127 private: 128 Box m_box;129 }; 130 131 class Text BoxRange {132 public: 133 Text BoxRange(TextBoxIterator begin)128 Run m_run; 129 }; 130 131 class TextRunRange { 132 public: 133 TextRunRange(TextRunIterator begin) 134 134 : m_begin(begin) 135 135 { 136 136 } 137 137 138 Text BoxIterator begin() const { return m_begin; }138 TextRunIterator begin() const { return m_begin; } 139 139 EndIterator end() const { return { }; } 140 140 141 141 private: 142 Text BoxIterator m_begin;143 }; 144 145 Text BoxIterator firstTextBoxFor(const RenderText&);146 Text BoxIterator firstTextBoxInTextOrderFor(const RenderText&);147 Text BoxRange textBoxesFor(const RenderText&);148 Element BoxIterator elementBoxFor(const RenderLineBreak&);142 TextRunIterator m_begin; 143 }; 144 145 TextRunIterator firstTextRunFor(const RenderText&); 146 TextRunIterator firstTextRunInTextOrderFor(const RenderText&); 147 TextRunRange textRunsFor(const RenderText&); 148 ElementRunIterator elementRunFor(const RenderLineBreak&); 149 149 150 150 // ----------------------------------------------- 151 151 152 inline Box::Box(PathVariant&& path)152 inline Run::Run(PathVariant&& path) 153 153 : m_pathVariant(WTFMove(path)) 154 154 { 155 155 } 156 156 157 inline FloatRect Box::rect() const157 inline FloatRect Run::rect() const 158 158 { 159 159 return WTF::switchOn(m_pathVariant, [](auto& path) { … … 162 162 } 163 163 164 inline float Box::baseline() const164 inline float Run::baseline() const 165 165 { 166 166 return WTF::switchOn(m_pathVariant, [](auto& path) { … … 169 169 } 170 170 171 inline bool Box::isLeftToRightDirection() const171 inline bool Run::isLeftToRightDirection() const 172 172 { 173 173 return WTF::switchOn(m_pathVariant, [](auto& path) { … … 176 176 } 177 177 178 inline bool Box::isHorizontal() const178 inline bool Run::isHorizontal() const 179 179 { 180 180 return WTF::switchOn(m_pathVariant, [](auto& path) { … … 183 183 } 184 184 185 inline bool Box::dirOverride() const185 inline bool Run::dirOverride() const 186 186 { 187 187 return WTF::switchOn(m_pathVariant, [](auto& path) { … … 190 190 } 191 191 192 inline bool Box::isLineBreak() const192 inline bool Run::isLineBreak() const 193 193 { 194 194 return WTF::switchOn(m_pathVariant, [](auto& path) { … … 197 197 } 198 198 199 inline bool Box::useLineBreakBoxRenderTreeDumpQuirk() const199 inline bool Run::useLineBreakBoxRenderTreeDumpQuirk() const 200 200 { 201 201 return WTF::switchOn(m_pathVariant, [](auto& path) { … … 204 204 } 205 205 206 inline bool Text Box::hasHyphen() const206 inline bool TextRun::hasHyphen() const 207 207 { 208 208 return WTF::switchOn(m_pathVariant, [](auto& path) { … … 211 211 } 212 212 213 inline Text Box::TextBox(PathVariant&& path)214 : Box(WTFMove(path))215 { 216 } 217 218 inline StringView Text Box::text() const213 inline TextRun::TextRun(PathVariant&& path) 214 : Run(WTFMove(path)) 215 { 216 } 217 218 inline StringView TextRun::text() const 219 219 { 220 220 return WTF::switchOn(m_pathVariant, [](auto& path) { … … 223 223 } 224 224 225 inline unsigned Text Box::localStartOffset() const225 inline unsigned TextRun::localStartOffset() const 226 226 { 227 227 return WTF::switchOn(m_pathVariant, [](auto& path) { … … 230 230 } 231 231 232 inline unsigned Text Box::localEndOffset() const232 inline unsigned TextRun::localEndOffset() const 233 233 { 234 234 return WTF::switchOn(m_pathVariant, [](auto& path) { … … 237 237 } 238 238 239 inline unsigned Text Box::length() const239 inline unsigned TextRun::length() const 240 240 { 241 241 return WTF::switchOn(m_pathVariant, [](auto& path) { … … 244 244 } 245 245 246 inline bool Text Box::isLastOnLine() const246 inline bool TextRun::isLastOnLine() const 247 247 { 248 248 return WTF::switchOn(m_pathVariant, [](auto& path) { … … 251 251 } 252 252 253 inline bool Text Box::isLast() const253 inline bool TextRun::isLast() const 254 254 { 255 255 return WTF::switchOn(m_pathVariant, [](auto& path) { -
trunk/Source/WebCore/layout/integration/LayoutIntegrationRunIteratorLegacyPath.h
r267696 r267697 31 31 32 32 namespace WebCore { 33 namespace L ineLayoutTraversal{33 namespace LayoutIntegration { 34 34 35 class ComplexPath {35 class LegacyPath { 36 36 public: 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) 38 38 : m_inlineBox(inlineBox) 39 39 , m_sortedInlineTextBoxes(WTFMove(sortedInlineTextBoxes)) … … 67 67 inline bool isLast() const { return !nextInlineTextBoxInTextOrder(); }; 68 68 69 void traverseNextText BoxInVisualOrder() { m_inlineBox = inlineTextBox()->nextTextBox(); }70 void traverseNextText BoxInTextOrder()69 void traverseNextTextRunInVisualOrder() { m_inlineBox = inlineTextBox()->nextTextBox(); } 70 void traverseNextTextRunInTextOrder() 71 71 { 72 72 m_inlineBox = nextInlineTextBoxInTextOrder(); … … 75 75 } 76 76 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; } 78 78 bool atEnd() const { return !m_inlineBox; } 79 79 … … 87 87 }; 88 88 89 inline const InlineTextBox* ComplexPath::nextInlineTextBoxInTextOrder() const89 inline const InlineTextBox* LegacyPath::nextInlineTextBoxInTextOrder() const 90 90 { 91 91 if (!m_sortedInlineTextBoxes.isEmpty()) { -
trunk/Source/WebCore/layout/integration/LayoutIntegrationRunIteratorModernPath.h
r267696 r267697 32 32 namespace WebCore { 33 33 34 namespace L ineLayoutTraversal{34 namespace LayoutIntegration { 35 35 36 36 static FloatPoint linePosition(float left, float top) … … 39 39 } 40 40 41 class DisplayRunPath {41 class ModernPath { 42 42 public: 43 DisplayRunPath(const Display::InlineContent& inlineContent, size_t startIndex, size_t endIndex)43 ModernPath(const Display::InlineContent& inlineContent, size_t startIndex, size_t endIndex) 44 44 : m_inlineContent(&inlineContent) 45 45 , m_endIndex(endIndex) 46 46 , m_runIndex(startIndex) 47 47 { } 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; 52 52 53 53 FloatRect rect() const; … … 86 86 }; 87 87 88 void traverseNextText BoxInVisualOrder()88 void traverseNextTextRunInVisualOrder() 89 89 { 90 90 ASSERT(!atEnd()); 91 91 ++m_runIndex; 92 92 } 93 void traverseNextText BoxInTextOrder() { traverseNextTextBoxInVisualOrder(); }93 void traverseNextTextRunInTextOrder() { traverseNextTextRunInVisualOrder(); } 94 94 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; } 96 96 bool atEnd() const { return m_runIndex == m_endIndex; } 97 97 … … 106 106 }; 107 107 108 inline FloatRect DisplayRunPath::rect() const108 inline FloatRect ModernPath::rect() const 109 109 { 110 110 auto rect = run().rect(); -
trunk/Source/WebCore/rendering/RenderLineBreak.cpp
r266557 r267697 28 28 #include "HTMLWBRElement.h" 29 29 #include "InlineElementBox.h" 30 #include "L ineLayoutTraversal.h"30 #include "LayoutIntegrationRunIterator.h" 31 31 #include "LogicalSelectionOffsetCaches.h" 32 32 #include "RenderBlock.h" … … 171 171 IntRect RenderLineBreak::linesBoundingBox() const 172 172 { 173 auto box = L ineLayoutTraversal::elementBoxFor(*this);173 auto box = LayoutIntegration::elementRunFor(*this); 174 174 if (!box) 175 175 return { }; … … 180 180 IntRect RenderLineBreak::boundingBoxForRenderTreeDump() const 181 181 { 182 auto box = L ineLayoutTraversal::elementBoxFor(*this);182 auto box = LayoutIntegration::elementRunFor(*this); 183 183 if (!box) 184 184 return { }; … … 202 202 void RenderLineBreak::absoluteRects(Vector<IntRect>& rects, const LayoutPoint& accumulatedOffset) const 203 203 { 204 auto box = L ineLayoutTraversal::elementBoxFor(*this);204 auto box = LayoutIntegration::elementRunFor(*this); 205 205 if (!box) 206 206 return; … … 212 212 void RenderLineBreak::absoluteQuads(Vector<FloatQuad>& quads, bool* wasFixed) const 213 213 { 214 auto box = L ineLayoutTraversal::elementBoxFor(*this);214 auto box = LayoutIntegration::elementRunFor(*this); 215 215 if (!box) 216 216 return; -
trunk/Source/WebCore/rendering/RenderText.cpp
r267565 r267697 38 38 #include "Hyphenation.h" 39 39 #include "InlineTextBox.h" 40 #include "L ineLayoutTraversal.h"40 #include "LayoutIntegrationRunIterator.h" 41 41 #include "Range.h" 42 42 #include "RenderBlock.h" … … 304 304 void RenderText::absoluteRects(Vector<IntRect>& rects, const LayoutPoint& accumulatedOffset) const 305 305 { 306 for (auto& box : LineLayoutTraversal::textBoxesFor(*this)) {307 auto rect = box.rect();306 for (auto& run : LayoutIntegration::textRunsFor(*this)) { 307 auto rect = run.rect(); 308 308 rects.append(enclosingIntRect(FloatRect(accumulatedOffset + rect.location(), rect.size()))); 309 309 } … … 409 409 410 410 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)); 413 413 return quads; 414 414 } … … 1036 1036 IntPoint RenderText::firstRunLocation() const 1037 1037 { 1038 auto first = L ineLayoutTraversal::firstTextBoxFor(*this);1038 auto first = LayoutIntegration::firstTextRunFor(*this); 1039 1039 if (!first) 1040 1040 return { }; … … 1356 1356 IntRect RenderText::linesBoundingBox() const 1357 1357 { 1358 auto first = L ineLayoutTraversal::firstTextBoxFor(*this);1358 auto first = LayoutIntegration::firstTextRunFor(*this); 1359 1359 if (!first) 1360 1360 return { }; … … 1445 1445 int RenderText::caretMinOffset() const 1446 1446 { 1447 auto first = L ineLayoutTraversal::firstTextBoxFor(*this);1447 auto first = LayoutIntegration::firstTextRunFor(*this); 1448 1448 if (!first) 1449 1449 return 0; … … 1458 1458 int RenderText::caretMaxOffset() const 1459 1459 { 1460 auto first = L ineLayoutTraversal::firstTextBoxFor(*this);1460 auto first = LayoutIntegration::firstTextRunFor(*this); 1461 1461 if (!first) 1462 1462 return text().length(); … … 1472 1472 { 1473 1473 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(); 1477 1477 if (offset < start) 1478 1478 return result; … … 1489 1489 static bool containsOffset(const RenderText& text, unsigned offset, OffsetType type) 1490 1490 { 1491 for (auto box = L ineLayoutTraversal::firstTextBoxInTextOrderFor(text); box; box.traverseNextInTextOrder()) {1491 for (auto box = LayoutIntegration::firstTextRunInTextOrderFor(text); box; box.traverseNextInTextOrder()) { 1492 1492 auto start = box->localStartOffset(); 1493 1493 if (offset < start) … … 1518 1518 bool RenderText::hasRenderedText() const 1519 1519 { 1520 for (auto& box : L ineLayoutTraversal::textBoxesFor(*this)) {1520 for (auto& box : LayoutIntegration::textRunsFor(*this)) { 1521 1521 if (box.length()) 1522 1522 return true; -
trunk/Source/WebCore/rendering/RenderTreeAsText.cpp
r266980 r267697 37 37 #include "HTMLSpanElement.h" 38 38 #include "InlineTextBox.h" 39 #include "L ineLayoutTraversal.h"39 #include "LayoutIntegrationRunIterator.h" 40 40 #include "Logging.h" 41 41 #include "PrintContext.h" … … 204 204 const RenderText& text = downcast<RenderText>(o); 205 205 r = IntRect(text.firstRunLocation(), text.linesBoundingBox().size()); 206 if (!L ineLayoutTraversal::firstTextBoxFor(text))206 if (!LayoutIntegration::firstTextRunFor(text)) 207 207 adjustForTableCells = false; 208 208 } else if (o.isBR()) { … … 479 479 } 480 480 481 static void writeText Box(TextStream& ts, const RenderText& o, const LineLayoutTraversal::TextBox& textBox)482 { 483 auto rect = text Box.rect();481 static void writeTextRun(TextStream& ts, const RenderText& o, const LayoutIntegration::TextRun& textRun) 482 { 483 auto rect = textRun.rect(); 484 484 int x = rect.x(); 485 485 int y = rect.y(); 486 486 // FIXME: Use non-logical width. webkit.org/b/206809. 487 int logicalWidth = ceilf(rect.x() + (text Box.isHorizontal() ? rect.width() : rect.height())) - x;487 int logicalWidth = ceilf(rect.x() + (textRun.isHorizontal() ? rect.width() : rect.height())) - x; 488 488 // FIXME: Table cell adjustment is temporary until results can be updated. 489 489 if (is<RenderTableCell>(*o.containingBlock())) … … 491 491 492 492 ts << "text run at (" << x << "," << y << ") width " << logicalWidth; 493 if (!text Box.isLeftToRightDirection() || textBox.dirOverride()) {494 ts << (!text Box.isLeftToRightDirection() ? " RTL" : " LTR");495 if (text Box.dirOverride())493 if (!textRun.isLeftToRightDirection() || textRun.dirOverride()) { 494 ts << (!textRun.isLeftToRightDirection() ? " RTL" : " LTR"); 495 if (textRun.dirOverride()) 496 496 ts << " override"; 497 497 } 498 498 ts << ": " 499 << quoteAndEscapeNonPrintables(text Box.text());500 if (text Box.hasHyphen())499 << quoteAndEscapeNonPrintables(textRun.text()); 500 if (textRun.hasHyphen()) 501 501 ts << " + hyphen string " << quoteAndEscapeNonPrintables(o.style().hyphenString().string()); 502 502 ts << "\n"; … … 547 547 if (is<RenderText>(o)) { 548 548 auto& text = downcast<RenderText>(o); 549 for (auto& textBox : LineLayoutTraversal::textBoxesFor(text)) {549 for (auto& run : LayoutIntegration::textRunsFor(text)) { 550 550 ts << indent; 551 writeText Box(ts, text, textBox);551 writeTextRun(ts, text, run); 552 552 } 553 553 } else {
Note:
See TracChangeset
for help on using the changeset viewer.