Remove Simple Line Layout
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Sep 2020 13:16:23 +0000 (13:16 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Sep 2020 13:16:23 +0000 (13:16 +0000)
https://bugs.webkit.org/show_bug.cgi?id=216914

Reviewed by Sam Weinig.

It is already fully covered by LFC and so unused. Remove the code.

* Headers.cmake:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* accessibility/AXLogger.cpp:
* accessibility/AccessibilityObjectInterface.h:
* editing/TextIterator.cpp:
* layout/Verification.cpp:
(WebCore::Layout::verifyAndOutputSubtree):
(WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded): Deleted.
* layout/integration/LayoutIntegrationLineLayout.cpp:
* layout/integration/LayoutIntegrationPagination.cpp:
* rendering/ComplexLineLayout.cpp:
(WebCore::ComplexLineLayout::layoutLineBoxes):
(WebCore::ComplexLineLayout::addOverflowFromInlineChildren):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::layoutInlineChildren):
(WebCore::RenderBlockFlow::styleDidChange):
(WebCore::RenderBlockFlow::hitTestInlineChildren):
(WebCore::RenderBlockFlow::addOverflowFromInlineChildren):
(WebCore::RenderBlockFlow::markLinesDirtyInBlockRange):
(WebCore::RenderBlockFlow::firstLineBaseline const):
(WebCore::RenderBlockFlow::inlineBlockBaseline const):
(WebCore::RenderBlockFlow::inlineSelectionGaps):
(WebCore::RenderBlockFlow::lineCount const):
(WebCore::RenderBlockFlow::positionForPoint):
(WebCore::RenderBlockFlow::paintInlineChildren):
(WebCore::RenderBlockFlow::hasLines const):
(WebCore::RenderBlockFlow::invalidateLineLayoutPath):
(WebCore::RenderBlockFlow::ensureLineBoxes):
(WebCore::RenderBlockFlow::outputLineTreeAndMark const):
(WebCore::RenderBlockFlow::layoutSimpleLines): Deleted.
* rendering/RenderBlockFlow.h:
(WebCore::RenderBlockFlow::hasSimpleLineLayout const): Deleted.
(WebCore::RenderBlockFlow::simpleLineLayout const): Deleted.
(WebCore::RenderBlockFlow::simpleLineLayout): Deleted.
* rendering/RenderFragmentedFlow.cpp:
(WebCore::RenderFragmentedFlow::removeLineFragmentInfo):
* rendering/RenderText.cpp:
(WebCore::RenderText::absoluteQuadsForRange const):
(WebCore::RenderText::positionForPoint):
(WebCore::RenderText::setTextWithOffset):
(WebCore::RenderText::usesComplexLineLayoutPath const):
(WebCore::RenderText::linesVisualOverflowBoundingBox const):
(WebCore::RenderText::collectSelectionRectsForLineBoxes):
(WebCore::RenderText::simpleLineLayout const): Deleted.
* rendering/RenderText.h:
* rendering/SimpleLineLayout.cpp: Removed.
* rendering/SimpleLineLayout.h: Removed.
* rendering/SimpleLineLayoutCoverage.cpp: Removed.
* rendering/SimpleLineLayoutCoverage.h: Removed.
* rendering/SimpleLineLayoutFlowContents.cpp: Removed.
* rendering/SimpleLineLayoutFlowContents.h: Removed.
* rendering/SimpleLineLayoutFunctions.cpp: Removed.
* rendering/SimpleLineLayoutFunctions.h: Removed.
* rendering/SimpleLineLayoutPagination.cpp: Removed.
* rendering/SimpleLineLayoutPagination.h: Removed.
* rendering/SimpleLineLayoutResolver.cpp: Removed.
* rendering/SimpleLineLayoutResolver.h: Removed.
* rendering/SimpleLineLayoutTextFragmentIterator.cpp: Removed.
* rendering/SimpleLineLayoutTextFragmentIterator.h: Removed.
* rendering/TextPainter.cpp:
(WebCore::TextPainter::clearGlyphDisplayLists):
* rendering/line/LineLayoutTraversal.cpp:
(WebCore::LineLayoutTraversal::firstTextBoxFor):
(WebCore::LineLayoutTraversal::elementBoxFor):
* rendering/line/LineLayoutTraversal.h:
* rendering/line/LineLayoutTraversalSimplePath.h: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267565 268f45cc-cd09-0410-ab3c-d52691b4dbfc

34 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Headers.cmake
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/accessibility/AXLogger.cpp
Source/WebCore/accessibility/AccessibilityObjectInterface.h
Source/WebCore/editing/TextIterator.cpp
Source/WebCore/layout/Verification.cpp
Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp
Source/WebCore/layout/integration/LayoutIntegrationPagination.cpp
Source/WebCore/rendering/ComplexLineLayout.cpp
Source/WebCore/rendering/RenderBlockFlow.cpp
Source/WebCore/rendering/RenderBlockFlow.h
Source/WebCore/rendering/RenderFragmentedFlow.cpp
Source/WebCore/rendering/RenderText.cpp
Source/WebCore/rendering/RenderText.h
Source/WebCore/rendering/SimpleLineLayout.cpp [deleted file]
Source/WebCore/rendering/SimpleLineLayout.h [deleted file]
Source/WebCore/rendering/SimpleLineLayoutCoverage.cpp [deleted file]
Source/WebCore/rendering/SimpleLineLayoutCoverage.h [deleted file]
Source/WebCore/rendering/SimpleLineLayoutFlowContents.cpp [deleted file]
Source/WebCore/rendering/SimpleLineLayoutFlowContents.h [deleted file]
Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp [deleted file]
Source/WebCore/rendering/SimpleLineLayoutFunctions.h [deleted file]
Source/WebCore/rendering/SimpleLineLayoutPagination.cpp [deleted file]
Source/WebCore/rendering/SimpleLineLayoutPagination.h [deleted file]
Source/WebCore/rendering/SimpleLineLayoutResolver.cpp [deleted file]
Source/WebCore/rendering/SimpleLineLayoutResolver.h [deleted file]
Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.cpp [deleted file]
Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.h [deleted file]
Source/WebCore/rendering/TextPainter.cpp
Source/WebCore/rendering/line/LineLayoutTraversal.cpp
Source/WebCore/rendering/line/LineLayoutTraversal.h
Source/WebCore/rendering/line/LineLayoutTraversalSimplePath.h [deleted file]

index 162d2ab..2b567e7 100644 (file)
@@ -1,3 +1,80 @@
+2020-09-25  Antti Koivisto  <antti@apple.com>
+
+        Remove Simple Line Layout
+        https://bugs.webkit.org/show_bug.cgi?id=216914
+
+        Reviewed by Sam Weinig.
+
+        It is already fully covered by LFC and so unused. Remove the code.
+
+        * Headers.cmake:
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * accessibility/AXLogger.cpp:
+        * accessibility/AccessibilityObjectInterface.h:
+        * editing/TextIterator.cpp:
+        * layout/Verification.cpp:
+        (WebCore::Layout::verifyAndOutputSubtree):
+        (WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded): Deleted.
+        * layout/integration/LayoutIntegrationLineLayout.cpp:
+        * layout/integration/LayoutIntegrationPagination.cpp:
+        * rendering/ComplexLineLayout.cpp:
+        (WebCore::ComplexLineLayout::layoutLineBoxes):
+        (WebCore::ComplexLineLayout::addOverflowFromInlineChildren):
+        * rendering/RenderBlockFlow.cpp:
+        (WebCore::RenderBlockFlow::layoutInlineChildren):
+        (WebCore::RenderBlockFlow::styleDidChange):
+        (WebCore::RenderBlockFlow::hitTestInlineChildren):
+        (WebCore::RenderBlockFlow::addOverflowFromInlineChildren):
+        (WebCore::RenderBlockFlow::markLinesDirtyInBlockRange):
+        (WebCore::RenderBlockFlow::firstLineBaseline const):
+        (WebCore::RenderBlockFlow::inlineBlockBaseline const):
+        (WebCore::RenderBlockFlow::inlineSelectionGaps):
+        (WebCore::RenderBlockFlow::lineCount const):
+        (WebCore::RenderBlockFlow::positionForPoint):
+        (WebCore::RenderBlockFlow::paintInlineChildren):
+        (WebCore::RenderBlockFlow::hasLines const):
+        (WebCore::RenderBlockFlow::invalidateLineLayoutPath):
+        (WebCore::RenderBlockFlow::ensureLineBoxes):
+        (WebCore::RenderBlockFlow::outputLineTreeAndMark const):
+        (WebCore::RenderBlockFlow::layoutSimpleLines): Deleted.
+        * rendering/RenderBlockFlow.h:
+        (WebCore::RenderBlockFlow::hasSimpleLineLayout const): Deleted.
+        (WebCore::RenderBlockFlow::simpleLineLayout const): Deleted.
+        (WebCore::RenderBlockFlow::simpleLineLayout): Deleted.
+        * rendering/RenderFragmentedFlow.cpp:
+        (WebCore::RenderFragmentedFlow::removeLineFragmentInfo):
+        * rendering/RenderText.cpp:
+        (WebCore::RenderText::absoluteQuadsForRange const):
+        (WebCore::RenderText::positionForPoint):
+        (WebCore::RenderText::setTextWithOffset):
+        (WebCore::RenderText::usesComplexLineLayoutPath const):
+        (WebCore::RenderText::linesVisualOverflowBoundingBox const):
+        (WebCore::RenderText::collectSelectionRectsForLineBoxes):
+        (WebCore::RenderText::simpleLineLayout const): Deleted.
+        * rendering/RenderText.h:
+        * rendering/SimpleLineLayout.cpp: Removed.
+        * rendering/SimpleLineLayout.h: Removed.
+        * rendering/SimpleLineLayoutCoverage.cpp: Removed.
+        * rendering/SimpleLineLayoutCoverage.h: Removed.
+        * rendering/SimpleLineLayoutFlowContents.cpp: Removed.
+        * rendering/SimpleLineLayoutFlowContents.h: Removed.
+        * rendering/SimpleLineLayoutFunctions.cpp: Removed.
+        * rendering/SimpleLineLayoutFunctions.h: Removed.
+        * rendering/SimpleLineLayoutPagination.cpp: Removed.
+        * rendering/SimpleLineLayoutPagination.h: Removed.
+        * rendering/SimpleLineLayoutResolver.cpp: Removed.
+        * rendering/SimpleLineLayoutResolver.h: Removed.
+        * rendering/SimpleLineLayoutTextFragmentIterator.cpp: Removed.
+        * rendering/SimpleLineLayoutTextFragmentIterator.h: Removed.
+        * rendering/TextPainter.cpp:
+        (WebCore::TextPainter::clearGlyphDisplayLists):
+        * rendering/line/LineLayoutTraversal.cpp:
+        (WebCore::LineLayoutTraversal::firstTextBoxFor):
+        (WebCore::LineLayoutTraversal::elementBoxFor):
+        * rendering/line/LineLayoutTraversal.h:
+        * rendering/line/LineLayoutTraversalSimplePath.h: Removed.
+
 2020-09-25  Adrian Perez de Castro  <aperez@igalia.com>
 
         Non-unified build fixes, late September 2020 edition
index 4659bde..08edd58 100644 (file)
@@ -1424,15 +1424,10 @@ set(WebCore_PRIVATE_FRAMEWORK_HEADERS
     rendering/RenderWidget.h
     rendering/RootInlineBox.h
     rendering/ScrollAlignment.h
-    rendering/SimpleLineLayout.h
-    rendering/SimpleLineLayoutCoverage.h
-    rendering/SimpleLineLayoutFlowContents.h
-    rendering/SimpleLineLayoutResolver.h
 
     rendering/line/LineLayoutTraversal.h
     rendering/line/LineLayoutTraversalComplexPath.h
     rendering/line/LineLayoutTraversalDisplayRunPath.h
-    rendering/line/LineLayoutTraversalSimplePath.h
     rendering/line/LineWidth.h
     rendering/line/TrailingObjects.h
 
index db67cd6..a4d6eeb 100644 (file)
@@ -2206,13 +2206,6 @@ rendering/RenderView.cpp
 rendering/RenderWidget.cpp
 rendering/RootInlineBox.cpp
 rendering/ScrollAlignment.cpp
-rendering/SimpleLineLayout.cpp
-rendering/SimpleLineLayoutCoverage.cpp
-rendering/SimpleLineLayoutFlowContents.cpp
-rendering/SimpleLineLayoutFunctions.cpp
-rendering/SimpleLineLayoutPagination.cpp
-rendering/SimpleLineLayoutResolver.cpp
-rendering/SimpleLineLayoutTextFragmentIterator.cpp
 rendering/TableLayout.cpp
 rendering/TextDecorationPainter.cpp
 rendering/TextPaintStyle.cpp
index 0e26396..1475406 100644 (file)
                0FFD45AA243C3027000D4BEA /* ScrollingTreeLatchingController.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FFD45A7243BF257000D4BEA /* ScrollingTreeLatchingController.h */; settings = {ATTRIBUTES = (Private, ); }; };
                0FFD4D6118651FA300512F6E /* AsyncScrollingCoordinator.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FFD4D5F18651FA300512F6E /* AsyncScrollingCoordinator.h */; settings = {ATTRIBUTES = (Private, ); }; };
                10FB084B14E15C7E00A3DB98 /* PublicURLManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 10FB084A14E15C7E00A3DB98 /* PublicURLManager.h */; };
-               112B34D51E60B98300BB310A /* SimpleLineLayoutPagination.h in Headers */ = {isa = PBXBuildFile; fileRef = 112B34D41E60B98300BB310A /* SimpleLineLayoutPagination.h */; };
                11310CF220BA4A320065A8D0 /* LayoutTreeBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 11100FD7209514DF0081AA6C /* LayoutTreeBuilder.h */; settings = {ATTRIBUTES = (Private, ); }; };
                11310CF320BA4A370065A8D0 /* LayoutReplacedBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 111C615620AD1AE1005B82FA /* LayoutReplacedBox.h */; settings = {ATTRIBUTES = (Private, ); }; };
                11310CF420BA4A3D0065A8D0 /* LayoutIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = 11100FC72092764C0081AA6C /* LayoutIterator.h */; settings = {ATTRIBUTES = (Private, ); }; };
                119340A31FEE024000935F1E /* RenderTreeBuilderBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = 119340A11FEE024000935F1E /* RenderTreeBuilderBlock.h */; };
                1199FA46208E35A3002358CC /* LayoutContainerBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 1199FA44208E35A3002358CC /* LayoutContainerBox.h */; settings = {ATTRIBUTES = (Private, ); }; };
                11CB2789203BA570004A1DC9 /* RenderTreeBuilderFullScreen.h in Headers */ = {isa = PBXBuildFile; fileRef = 11CB2787203BA570004A1DC9 /* RenderTreeBuilderFullScreen.h */; };
-               11E067EE1E6246E500162D16 /* SimpleLineLayoutCoverage.h in Headers */ = {isa = PBXBuildFile; fileRef = 11E067ED1E6246E500162D16 /* SimpleLineLayoutCoverage.h */; settings = {ATTRIBUTES = (Private, ); }; };
                1400D7A817136EA70077CE05 /* ScriptWrappableInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 1400D7A717136EA70077CE05 /* ScriptWrappableInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
                1403B99709EB13AF00797C7F /* DOMWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = 1403B99509EB13AF00797C7F /* DOMWindow.h */; settings = {ATTRIBUTES = (Private, ); }; };
                1403BA0F09EB18F900797C7F /* JSDOMWindow.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 1403BA0E09EB18F800797C7F /* JSDOMWindow.h */; settings = {ATTRIBUTES = (Private, ); }; };
                580371641A66F1D300BAF519 /* LayerFragment.h in Headers */ = {isa = PBXBuildFile; fileRef = 580371631A66F1D300BAF519 /* LayerFragment.h */; settings = {ATTRIBUTES = (Private, ); }; };
                5824ABA31AE81116009074B7 /* RubyElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 5824ABA11AE81116009074B7 /* RubyElement.h */; };
                5824ABA71AE81384009074B7 /* RubyTextElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 5824ABA51AE81384009074B7 /* RubyTextElement.h */; };
-               582CB0531A78A14B00AFFCC4 /* SimpleLineLayoutTextFragmentIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = 582CB0521A78A14B00AFFCC4 /* SimpleLineLayoutTextFragmentIterator.h */; };
                582DE3251C30C85400BE02A8 /* TextDecorationPainter.h in Headers */ = {isa = PBXBuildFile; fileRef = 582DE3231C30C85400BE02A8 /* TextDecorationPainter.h */; };
-               585D6E041A1A792E00FA4F12 /* SimpleLineLayoutFlowContents.h in Headers */ = {isa = PBXBuildFile; fileRef = 585D6E021A1A792E00FA4F12 /* SimpleLineLayoutFlowContents.h */; settings = {ATTRIBUTES = (Private, ); }; };
                589556ED18D4A44000764B03 /* BorderEdge.h in Headers */ = {isa = PBXBuildFile; fileRef = 589556EC18D4A44000764B03 /* BorderEdge.h */; };
                58B2F9F42232D45300938D63 /* ResizeObservation.h in Headers */ = {isa = PBXBuildFile; fileRef = 58B2F9F32232D43F00938D63 /* ResizeObservation.h */; };
                58B2F9F52232D45800938D63 /* ResizeObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 58B2F9EC2232D43B00938D63 /* ResizeObserver.h */; };
                E4295FA412B0614E00D1ACE0 /* ResourceLoadPriority.h in Headers */ = {isa = PBXBuildFile; fileRef = E4295FA312B0614E00D1ACE0 /* ResourceLoadPriority.h */; settings = {ATTRIBUTES = (Private, ); }; };
                E42E76DC1C7AF77600E3614D /* StyleUpdate.h in Headers */ = {isa = PBXBuildFile; fileRef = E42E76DB1C7AF77600E3614D /* StyleUpdate.h */; settings = {ATTRIBUTES = (Private, ); }; };
                E43105BB16750F1600DB2FB8 /* NodeTraversal.h in Headers */ = {isa = PBXBuildFile; fileRef = E43105BA16750F1600DB2FB8 /* NodeTraversal.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               E4343D232392778400EBBB66 /* LineLayoutTraversalSimplePath.h in Headers */ = {isa = PBXBuildFile; fileRef = E4343D212392778300EBBB66 /* LineLayoutTraversalSimplePath.h */; settings = {ATTRIBUTES = (Private, ); }; };
                E4343D252392779000EBBB66 /* LineLayoutTraversalComplexPath.h in Headers */ = {isa = PBXBuildFile; fileRef = E4343D242392778F00EBBB66 /* LineLayoutTraversalComplexPath.h */; settings = {ATTRIBUTES = (Private, ); }; };
                E43A023B17EB370A004CDD25 /* RenderElement.h in Headers */ = {isa = PBXBuildFile; fileRef = E43A023A17EB370A004CDD25 /* RenderElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
                E43AF8E71AC5B7EC00CA717E /* CacheValidation.h in Headers */ = {isa = PBXBuildFile; fileRef = E43AF8E51AC5B7DD00CA717E /* CacheValidation.h */; settings = {ATTRIBUTES = (Private, ); }; };
                E48137B91DB3B526005C59BF /* StyleValidity.h in Headers */ = {isa = PBXBuildFile; fileRef = E48137B81DB3B526005C59BF /* StyleValidity.h */; settings = {ATTRIBUTES = (Private, ); }; };
                E484A33E23055325009ADE6A /* LineLayoutTraversal.h in Headers */ = {isa = PBXBuildFile; fileRef = E484A33B23055303009ADE6A /* LineLayoutTraversal.h */; settings = {ATTRIBUTES = (Private, ); }; };
                E4863CFE23842E9E00972158 /* RuleData.h in Headers */ = {isa = PBXBuildFile; fileRef = E4863CFD23842E9E00972158 /* RuleData.h */; };
-               E48944A3180B57D800F165D8 /* SimpleLineLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = E48944A1180B57D800F165D8 /* SimpleLineLayout.h */; settings = {ATTRIBUTES = (Private, ); }; };
                E4946EAF156E64DD00D3297F /* StyleRuleImport.h in Headers */ = {isa = PBXBuildFile; fileRef = E4946EAD156E64DD00D3297F /* StyleRuleImport.h */; settings = {ATTRIBUTES = (Private, ); }; };
                E49BD9FA131FD2ED003C56F0 /* CSSValuePool.h in Headers */ = {isa = PBXBuildFile; fileRef = E49BD9F9131FD2ED003C56F0 /* CSSValuePool.h */; };
                E4A7995220EE4B1400C19568 /* CSSParserContext.h in Headers */ = {isa = PBXBuildFile; fileRef = E4A7994E20EE4AE100C19568 /* CSSParserContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
                E4E8B4EC216B79E500B8834D /* SystemFontDatabaseCoreText.h in Headers */ = {isa = PBXBuildFile; fileRef = E4E8B4EA216B79E500B8834D /* SystemFontDatabaseCoreText.h */; };
                E4E8B4F5216B956500B8834D /* FontCascadeDescription.h in Headers */ = {isa = PBXBuildFile; fileRef = E4E8B4F2216B8B6000B8834D /* FontCascadeDescription.h */; settings = {ATTRIBUTES = (Private, ); }; };
                E4E94D6122FF158A00DD191F /* ComplexLineLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = E4A1AC7822FAFD500017B75B /* ComplexLineLayout.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               E4E9B1191810916F003ACCDF /* SimpleLineLayoutResolver.h in Headers */ = {isa = PBXBuildFile; fileRef = E4E9B1181810916F003ACCDF /* SimpleLineLayoutResolver.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               E4E9B11D1814569C003ACCDF /* SimpleLineLayoutFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = E4E9B11C1814569C003ACCDF /* SimpleLineLayoutFunctions.h */; };
                E4F9EEF3156DA00700D23E7E /* StyleSheetContents.h in Headers */ = {isa = PBXBuildFile; fileRef = E4F9EEF1156D84C400D23E7E /* StyleSheetContents.h */; settings = {ATTRIBUTES = (Private, ); }; };
                E516699120FF9918009D2C27 /* ListButtonArrow@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E516698F20FF9916009D2C27 /* ListButtonArrow@2x.png */; };
                E517670320B88C1400D41167 /* DataListSuggestionInformation.h in Headers */ = {isa = PBXBuildFile; fileRef = E517670220B88C1400D41167 /* DataListSuggestionInformation.h */; settings = {ATTRIBUTES = (Private, ); }; };
                11100FD7209514DF0081AA6C /* LayoutTreeBuilder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LayoutTreeBuilder.h; sourceTree = "<group>"; };
                111C615620AD1AE1005B82FA /* LayoutReplacedBox.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LayoutReplacedBox.h; sourceTree = "<group>"; };
                111C615720AD1AE1005B82FA /* LayoutReplacedBox.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = LayoutReplacedBox.cpp; sourceTree = "<group>"; };
-               112B34D01E60B8A700BB310A /* SimpleLineLayoutPagination.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SimpleLineLayoutPagination.cpp; sourceTree = "<group>"; };
-               112B34D41E60B98300BB310A /* SimpleLineLayoutPagination.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleLineLayoutPagination.h; sourceTree = "<group>"; };
                113409D7203E038000C66915 /* RenderTreeBuilderContinuation.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = RenderTreeBuilderContinuation.cpp; sourceTree = "<group>"; };
                113409D8203E038000C66915 /* RenderTreeBuilderContinuation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RenderTreeBuilderContinuation.h; sourceTree = "<group>"; };
                113D0B4F1F9FDD2B00F611BB /* FrameViewLayoutContext.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FrameViewLayoutContext.cpp; sourceTree = "<group>"; };
                11CB2786203BA570004A1DC9 /* RenderTreeBuilderFullScreen.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = RenderTreeBuilderFullScreen.cpp; sourceTree = "<group>"; };
                11CB2787203BA570004A1DC9 /* RenderTreeBuilderFullScreen.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RenderTreeBuilderFullScreen.h; sourceTree = "<group>"; };
                11D19C2E23159BAE008F24D3 /* TableFormattingContextGeometry.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TableFormattingContextGeometry.cpp; sourceTree = "<group>"; };
-               11E067EB1E62461300162D16 /* SimpleLineLayoutCoverage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SimpleLineLayoutCoverage.cpp; sourceTree = "<group>"; };
-               11E067ED1E6246E500162D16 /* SimpleLineLayoutCoverage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleLineLayoutCoverage.h; sourceTree = "<group>"; };
                11FF02D520BA3C810083F25B /* Verification.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Verification.cpp; sourceTree = "<group>"; };
                12F75A9A86EA03DAF24B7971 /* ISOProtectionSystemSpecificHeaderBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ISOProtectionSystemSpecificHeaderBox.h; sourceTree = "<group>"; };
                1400D7A717136EA70077CE05 /* ScriptWrappableInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptWrappableInlines.h; sourceTree = "<group>"; };
                5824ABA11AE81116009074B7 /* RubyElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RubyElement.h; sourceTree = "<group>"; };
                5824ABA41AE81384009074B7 /* RubyTextElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RubyTextElement.cpp; sourceTree = "<group>"; };
                5824ABA51AE81384009074B7 /* RubyTextElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RubyTextElement.h; sourceTree = "<group>"; };
-               582CB0521A78A14B00AFFCC4 /* SimpleLineLayoutTextFragmentIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleLineLayoutTextFragmentIterator.h; sourceTree = "<group>"; };
-               582CB0541A78A2B200AFFCC4 /* SimpleLineLayoutTextFragmentIterator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SimpleLineLayoutTextFragmentIterator.cpp; sourceTree = "<group>"; };
                582DE3221C30C85400BE02A8 /* TextDecorationPainter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextDecorationPainter.cpp; sourceTree = "<group>"; };
                582DE3231C30C85400BE02A8 /* TextDecorationPainter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextDecorationPainter.h; sourceTree = "<group>"; };
-               585D6DFB1A15355600FA4F12 /* SimpleLineLayoutResolver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SimpleLineLayoutResolver.cpp; sourceTree = "<group>"; };
-               585D6E011A1A792E00FA4F12 /* SimpleLineLayoutFlowContents.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SimpleLineLayoutFlowContents.cpp; sourceTree = "<group>"; };
-               585D6E021A1A792E00FA4F12 /* SimpleLineLayoutFlowContents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleLineLayoutFlowContents.h; sourceTree = "<group>"; };
                5884FE5622813E2D0040AFF6 /* JSResizeObserverEntryCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSResizeObserverEntryCustom.cpp; sourceTree = "<group>"; };
                589556EC18D4A44000764B03 /* BorderEdge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BorderEdge.h; sourceTree = "<group>"; };
                58AEE2F318D4BCCF0022E7FE /* BorderEdge.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BorderEdge.cpp; sourceTree = "<group>"; };
                E43105BA16750F1600DB2FB8 /* NodeTraversal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NodeTraversal.h; sourceTree = "<group>"; };
                E4312AB524B3265600678349 /* LayoutIntegrationPagination.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LayoutIntegrationPagination.cpp; sourceTree = "<group>"; };
                E4312AB724B3265600678349 /* LayoutIntegrationPagination.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayoutIntegrationPagination.h; sourceTree = "<group>"; };
-               E4343D212392778300EBBB66 /* LineLayoutTraversalSimplePath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LineLayoutTraversalSimplePath.h; sourceTree = "<group>"; };
                E4343D242392778F00EBBB66 /* LineLayoutTraversalComplexPath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LineLayoutTraversalComplexPath.h; sourceTree = "<group>"; };
                E43A023A17EB370A004CDD25 /* RenderElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderElement.h; sourceTree = "<group>"; };
                E43A023C17EB3713004CDD25 /* RenderElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderElement.cpp; sourceTree = "<group>"; };
                E484A33D23055303009ADE6A /* LineLayoutTraversal.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LineLayoutTraversal.cpp; sourceTree = "<group>"; };
                E4863CFA23842E8700972158 /* RuleData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RuleData.cpp; sourceTree = "<group>"; };
                E4863CFD23842E9E00972158 /* RuleData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RuleData.h; sourceTree = "<group>"; };
-               E48944A0180B57D800F165D8 /* SimpleLineLayout.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SimpleLineLayout.cpp; sourceTree = "<group>"; };
-               E48944A1180B57D800F165D8 /* SimpleLineLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleLineLayout.h; sourceTree = "<group>"; };
                E4946EAC156E64DD00D3297F /* StyleRuleImport.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StyleRuleImport.cpp; sourceTree = "<group>"; };
                E4946EAD156E64DD00D3297F /* StyleRuleImport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleRuleImport.h; sourceTree = "<group>"; };
                E49BD9F9131FD2ED003C56F0 /* CSSValuePool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSValuePool.h; sourceTree = "<group>"; };
                E4E8B4ED216B79F400B8834D /* SystemFontDatabaseCoreText.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SystemFontDatabaseCoreText.cpp; sourceTree = "<group>"; };
                E4E8B4F0216B8B5F00B8834D /* FontCascadeDescription.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontCascadeDescription.cpp; sourceTree = "<group>"; };
                E4E8B4F2216B8B6000B8834D /* FontCascadeDescription.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontCascadeDescription.h; sourceTree = "<group>"; };
-               E4E9B1181810916F003ACCDF /* SimpleLineLayoutResolver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleLineLayoutResolver.h; sourceTree = "<group>"; };
-               E4E9B11A18145692003ACCDF /* SimpleLineLayoutFunctions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SimpleLineLayoutFunctions.cpp; sourceTree = "<group>"; };
-               E4E9B11C1814569C003ACCDF /* SimpleLineLayoutFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleLineLayoutFunctions.h; sourceTree = "<group>"; };
                E4F9EEF0156D84C400D23E7E /* StyleSheetContents.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StyleSheetContents.cpp; sourceTree = "<group>"; };
                E4F9EEF1156D84C400D23E7E /* StyleSheetContents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleSheetContents.h; sourceTree = "<group>"; };
                E4FB4B35239BEB10003C336A /* DisplayInlineContent.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = DisplayInlineContent.cpp; sourceTree = "<group>"; };
                                A8CFF5DA0A155A05000A4234 /* RootInlineBox.h */,
                                5D925B650F64D4DD00B847F0 /* ScrollAlignment.cpp */,
                                5D925B660F64D4DD00B847F0 /* ScrollAlignment.h */,
-                               E48944A0180B57D800F165D8 /* SimpleLineLayout.cpp */,
-                               E48944A1180B57D800F165D8 /* SimpleLineLayout.h */,
-                               11E067EB1E62461300162D16 /* SimpleLineLayoutCoverage.cpp */,
-                               11E067ED1E6246E500162D16 /* SimpleLineLayoutCoverage.h */,
-                               585D6E011A1A792E00FA4F12 /* SimpleLineLayoutFlowContents.cpp */,
-                               585D6E021A1A792E00FA4F12 /* SimpleLineLayoutFlowContents.h */,
-                               E4E9B11A18145692003ACCDF /* SimpleLineLayoutFunctions.cpp */,
-                               E4E9B11C1814569C003ACCDF /* SimpleLineLayoutFunctions.h */,
-                               112B34D01E60B8A700BB310A /* SimpleLineLayoutPagination.cpp */,
-                               112B34D41E60B98300BB310A /* SimpleLineLayoutPagination.h */,
-                               585D6DFB1A15355600FA4F12 /* SimpleLineLayoutResolver.cpp */,
-                               E4E9B1181810916F003ACCDF /* SimpleLineLayoutResolver.h */,
-                               582CB0541A78A2B200AFFCC4 /* SimpleLineLayoutTextFragmentIterator.cpp */,
-                               582CB0521A78A14B00AFFCC4 /* SimpleLineLayoutTextFragmentIterator.h */,
                                E31CD750229F749500FBDA19 /* TableLayout.cpp */,
                                A8CFF04C0A154F09000A4234 /* TableLayout.h */,
                                0F54DCE31881051D003EEDBB /* TextAutoSizing.cpp */,
                                E484A33B23055303009ADE6A /* LineLayoutTraversal.h */,
                                E4343D242392778F00EBBB66 /* LineLayoutTraversalComplexPath.h */,
                                E451C627239293EB00993190 /* LineLayoutTraversalDisplayRunPath.h */,
-                               E4343D212392778300EBBB66 /* LineLayoutTraversalSimplePath.h */,
                                FFDBC046183D27B700407109 /* LineWidth.cpp */,
                                FFDBC045183D27B700407109 /* LineWidth.h */,
                                FFAC30FD184FB145008C4F1E /* TrailingObjects.cpp */,
                                E484A33E23055325009ADE6A /* LineLayoutTraversal.h in Headers */,
                                E4343D252392779000EBBB66 /* LineLayoutTraversalComplexPath.h in Headers */,
                                E451C628239293EC00993190 /* LineLayoutTraversalDisplayRunPath.h in Headers */,
-                               E4343D232392778400EBBB66 /* LineLayoutTraversalSimplePath.h in Headers */,
                                FFDBC047183D27B700407109 /* LineWidth.h in Headers */,
                                CBA9DC0B1DF44DF40005675C /* LinkHeader.h in Headers */,
                                5143B2631DDD15200014FAC6 /* LinkIcon.h in Headers */,
                                93309EA3099EB78C0056E581 /* SharedTimer.h in Headers */,
                                DF19E2AC24772BC1007BDACB /* ShouldRelaxThirdPartyCookieBlocking.h in Headers */,
                                8362E8C120CEF9CB00245886 /* ShouldTreatAsContinuingLoad.h in Headers */,
-                               E48944A3180B57D800F165D8 /* SimpleLineLayout.h in Headers */,
-                               11E067EE1E6246E500162D16 /* SimpleLineLayoutCoverage.h in Headers */,
-                               585D6E041A1A792E00FA4F12 /* SimpleLineLayoutFlowContents.h in Headers */,
-                               E4E9B11D1814569C003ACCDF /* SimpleLineLayoutFunctions.h in Headers */,
-                               112B34D51E60B98300BB310A /* SimpleLineLayoutPagination.h in Headers */,
-                               E4E9B1191810916F003ACCDF /* SimpleLineLayoutResolver.h in Headers */,
-                               582CB0531A78A14B00AFFCC4 /* SimpleLineLayoutTextFragmentIterator.h in Headers */,
                                9316DDFB240C64B4009340AA /* SimpleRange.h in Headers */,
                                C5A1EA7D152BCF08004D00B6 /* SimplifyMarkupCommand.h in Headers */,
                                572A7F211C6E5719009C6149 /* SimulatedClick.h in Headers */,
index 6839b63..4f5c6b5 100644 (file)
@@ -33,6 +33,7 @@
 #include "AXIsolatedObject.h"
 #endif
 #include "AXObjectCache.h"
+#include "FrameView.h"
 #include "Logging.h"
 #include <wtf/text/TextStream.h>
 
index 7f0f594..27c39d7 100644 (file)
@@ -32,6 +32,7 @@
 #include "LayoutRect.h"
 #include "TextIterator.h"
 #include "VisibleSelection.h"
+#include "Widget.h"
 #include <wtf/RefCounted.h>
 #include <wtf/Variant.h>
 
 #include "COMPtr.h"
 #endif
 
+#if USE(ATK)
+#include <wtf/glib/GRefPtr.h>
+#endif
+
 #if PLATFORM(COCOA)
 OBJC_CLASS WebAccessibilityObjectWrapper;
 typedef WebAccessibilityObjectWrapper AccessibilityObjectWrapper;
index b6a27dd..5e5814d 100644 (file)
@@ -54,9 +54,6 @@
 #include "RenderTextControl.h"
 #include "RenderTextFragment.h"
 #include "ShadowRoot.h"
-#include "SimpleLineLayout.h"
-#include "SimpleLineLayoutFunctions.h"
-#include "SimpleLineLayoutResolver.h"
 #include "TextBoundaries.h"
 #include "TextControlInnerElements.h"
 #include "TextPlaceholderElement.h"
index b629290..93e061f 100644 (file)
@@ -70,48 +70,6 @@ static bool areEssentiallyEqual(LayoutRect a, LayoutRect b)
         && areEssentiallyEqual(a.height(), b.height());
 }
 
-static bool outputMismatchingSimpleLineInformationIfNeeded(TextStream& stream, const LayoutState& layoutState, const RenderBlockFlow& blockFlow, const ContainerBox& inlineFormattingRoot)
-{
-    auto* lineLayoutData = blockFlow.simpleLineLayout();
-    if (!lineLayoutData) {
-        ASSERT_NOT_REACHED();
-        return true;
-    }
-
-    auto& inlineFormattingState = layoutState.establishedFormattingState(inlineFormattingRoot);
-    auto& lineRuns = downcast<InlineFormattingState>(inlineFormattingState).lineRuns();
-
-    if (lineRuns.size() != lineLayoutData->runCount()) {
-        stream << "Mismatching number of runs: simple runs(" << lineLayoutData->runCount() << ") inline runs(" << lineRuns.size() << ")";
-        stream.nextLine();
-        return true;
-    }
-
-    auto mismatched = false;
-    for (unsigned i = 0; i < lineLayoutData->runCount(); ++i) {
-        auto& simpleRun = lineLayoutData->runAt(i);
-        auto& lineRun = lineRuns[i];
-        auto matchingRuns = areEssentiallyEqual(simpleRun.logicalLeft, lineRun.logicalLeft()) && areEssentiallyEqual(simpleRun.logicalRight, lineRun.logicalRight());
-        if (matchingRuns && lineRun.text()) {
-            matchingRuns = simpleRun.start == lineRun.text()->start() && simpleRun.end == lineRun.text()->end();
-            // SLL handles strings in a more concatenated format <div>foo<br>bar</div> -> foo -> 0,3 bar -> 3,6 vs. 0,3 and 0,3
-            if (!matchingRuns)
-                matchingRuns = (simpleRun.end - simpleRun.start) == (lineRun.text()->end() - lineRun.text()->start());
-        }
-        if (matchingRuns)
-            continue;
-
-        stream << "Mismatching: simple run(" << simpleRun.start << ", " << simpleRun.end << ") (" << simpleRun.logicalLeft << ", " << simpleRun.logicalRight << ")";
-        stream << " inline run";
-        if (lineRun.text())
-            stream << " (" << lineRun.text()->start() << ", " << lineRun.text()->end() << ")";
-        stream << " (" << lineRun.logicalLeft() << ", " << lineRun.logicalTop() << ") (" << lineRun.logicalWidth() << "x" << lineRun.logicalHeight() << ")";
-        stream.nextLine();
-        mismatched = true;
-    }
-    return mismatched;
-}
-
 static bool checkForMatchingNonTextRuns(const LineRun& lineRun, const WebCore::InlineBox& inlineBox)
 {
     return areEssentiallyEqual(inlineBox.left(), lineRun.logicalLeft())
@@ -359,7 +317,7 @@ static bool verifyAndOutputSubtree(TextStream& stream, const LayoutState& contex
 
             auto& blockFlow = downcast<RenderBlockFlow>(*childRenderer);
             auto& formattingRoot = downcast<ContainerBox>(*childLayoutBox);
-            mismtachingGeometry |= blockFlow.lineLayoutPath() == RenderBlockFlow::SimpleLinesPath ? outputMismatchingSimpleLineInformationIfNeeded(stream, context, blockFlow, formattingRoot) : outputMismatchingComplexLineInformationIfNeeded(stream, context, blockFlow, formattingRoot);
+            mismtachingGeometry |= outputMismatchingComplexLineInformationIfNeeded(stream, context, blockFlow, formattingRoot);
         } else {
             auto mismatchingSubtreeGeometry = verifyAndOutputSubtree(stream, context, downcast<RenderBox>(*childRenderer), *childLayoutBox);
             mismtachingGeometry |= mismatchingSubtreeGeometry;
index f29987d..6c6d06d 100644 (file)
@@ -48,7 +48,6 @@
 #include "RenderView.h"
 #include "RuntimeEnabledFeatures.h"
 #include "Settings.h"
-#include "SimpleLineLayout.h"
 #include "TextDecorationPainter.h"
 #include "TextPainter.h"
 
index 862b48c..8fcb4ea 100644 (file)
@@ -30,8 +30,6 @@
 
 #include "FontCascade.h"
 #include "RenderBlockFlow.h"
-#include "SimpleLineLayout.h"
-#include "SimpleLineLayoutFunctions.h"
 
 namespace WebCore {
 namespace LayoutIntegration {
index e5cc992..e7d1e34 100644 (file)
@@ -1697,8 +1697,6 @@ void ComplexLineLayout::linkToEndLineIfNeeded(LineLayoutState& layoutState)
 
 void ComplexLineLayout::layoutLineBoxes(bool relayoutChildren, LayoutUnit& repaintLogicalTop, LayoutUnit& repaintLogicalBottom)
 {
-    ASSERT(!m_flow.simpleLineLayout());
-
     m_flow.setLogicalHeight(m_flow.borderAndPaddingBefore());
     
     // Lay out our hypothetical grid line as though it occurs at the top of the block.
@@ -2128,8 +2126,6 @@ bool ComplexLineLayout::matchedEndLine(LineLayoutState& layoutState, const Inlin
 
 void ComplexLineLayout::addOverflowFromInlineChildren()
 {
-    ASSERT(!m_flow.simpleLineLayout());
-
     LayoutUnit endPadding = m_flow.hasOverflowClip() ? m_flow.paddingEnd() : 0_lu;
     // FIXME: Need to find another way to do this, since scrollbars could show when we don't want them to.
     if (!endPadding)
index b4307d7..eb10aea 100644 (file)
@@ -54,9 +54,6 @@
 #include "RenderTreeBuilder.h"
 #include "RenderView.h"
 #include "Settings.h"
-#include "SimpleLineLayoutFunctions.h"
-#include "SimpleLineLayoutPagination.h"
-#include "SimpleLineLayoutResolver.h"
 #include "TextAutoSizing.h"
 #include "VerticalPositionCache.h"
 #include "VisiblePosition.h"
@@ -669,26 +666,16 @@ void RenderBlockFlow::layoutBlockChildren(bool relayoutChildren, LayoutUnit& max
 void RenderBlockFlow::layoutInlineChildren(bool relayoutChildren, LayoutUnit& repaintLogicalTop, LayoutUnit& repaintLogicalBottom)
 {
     auto computeLineLayoutPath = [&] {
-        bool isIntegrationEnabled = false;
 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
         if (LayoutIntegration::LineLayout::canUseFor(*this))
             return LayoutFormattingContextPath;
-        isIntegrationEnabled = LayoutIntegration::LineLayout::isEnabled();
 #endif
-        if (!isIntegrationEnabled && SimpleLineLayout::canUseFor(*this))
-            return SimpleLinesPath;
-
         return LineBoxesPath;
     };
 
     if (lineLayoutPath() == UndeterminedPath)
         setLineLayoutPath(computeLineLayoutPath());
 
-    if (lineLayoutPath() == SimpleLinesPath) {
-        layoutSimpleLines(relayoutChildren, repaintLogicalTop, repaintLogicalBottom);
-        return;
-    }
-
 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
     if (lineLayoutPath() == LayoutFormattingContextPath) {
         layoutLFCLines(relayoutChildren, repaintLogicalTop, repaintLogicalBottom);
@@ -2108,8 +2095,6 @@ void RenderBlockFlow::styleDidChange(StyleDifference diff, const RenderStyle* ol
         auto shouldInvalidateLineLayoutPath = [&] {
             if (selfNeedsLayout() || complexLineLayout())
                 return true;
-            if (simpleLineLayout() && !SimpleLineLayout::canUseForAfterStyleChange(*this, diff))
-                return true;
 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
             if (layoutFormattingContextLineLayout() && !LayoutIntegration::LineLayout::canUseForAfterStyleChange(*this, diff))
                 return true;
@@ -2989,9 +2974,6 @@ bool RenderBlockFlow::hitTestInlineChildren(const HitTestRequest& request, HitTe
 {
     ASSERT(childrenInline());
 
-    if (simpleLineLayout())
-        return SimpleLineLayout::hitTestFlow(*this, *simpleLineLayout(), request, result, locationInContainer, accumulatedOffset, hitTestAction);
-
 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
     if (layoutFormattingContextLineLayout())
         return layoutFormattingContextLineLayout()->hitTest(request, result, locationInContainer, accumulatedOffset, hitTestAction);
@@ -3002,12 +2984,6 @@ bool RenderBlockFlow::hitTestInlineChildren(const HitTestRequest& request, HitTe
 
 void RenderBlockFlow::addOverflowFromInlineChildren()
 {
-    if (auto simpleLineLayout = this->simpleLineLayout()) {
-        ASSERT(!hasOverflowClip());
-        SimpleLineLayout::collectFlowOverflow(*this, *simpleLineLayout);
-        return;
-    }
-
 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
     if (layoutFormattingContextLineLayout()) {
         layoutFormattingContextLineLayout()->collectOverflow(*this);
@@ -3097,11 +3073,6 @@ void RenderBlockFlow::markLinesDirtyInBlockRange(LayoutUnit logicalTop, LayoutUn
         return;
 
     // Floats currently affect the choice of layout path.
-    if (simpleLineLayout()) {
-        invalidateLineLayoutPath();
-        return;
-    }
-
 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
     if (layoutFormattingContextLineLayout()) {
         invalidateLineLayoutPath();
@@ -3138,9 +3109,6 @@ Optional<int> RenderBlockFlow::firstLineBaseline() const
         return floorToInt(layoutFormattingContextLineLayout()->firstLineBaseline());
 #endif
 
-    if (simpleLineLayout())
-        return { SimpleLineLayout::computeFlowFirstLineBaseline(*this, *simpleLineLayout()) };
-
     ASSERT(firstRootBox());
     if (style().isFlippedLinesWritingMode())
         return firstRootBox()->logicalTop() + firstLineStyle().fontMetrics().descent(firstRootBox()->baselineType());
@@ -3154,7 +3122,7 @@ Optional<int> RenderBlockFlow::inlineBlockBaseline(LineDirectionMode lineDirecti
 
     // Note that here we only take the left and bottom into consideration. Our caller takes the right and top into consideration.
     float boxHeight = lineDirection == HorizontalLine ? height() + m_marginBox.bottom() : width() + m_marginBox.left();
-    float lastBaseline;
+    float lastBaseline = 0;
     if (!childrenInline()) {
         Optional<int> inlineBlockBaseline = RenderBlock::inlineBlockBaseline(lineDirection);
         if (!inlineBlockBaseline)
@@ -3170,19 +3138,17 @@ Optional<int> RenderBlockFlow::inlineBlockBaseline(LineDirectionMode lineDirecti
                 + (lineDirection == HorizontalLine ? borderTop() + paddingTop() : borderRight() + paddingRight()));
         }
 
-        if (simpleLineLayout())
-            lastBaseline = SimpleLineLayout::computeFlowLastLineBaseline(*this, *simpleLineLayout());
-#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
-        else if (layoutFormattingContextLineLayout())
-            lastBaseline = floorToInt(layoutFormattingContextLineLayout()->lastLineBaseline());
-#endif
-        else {
+        if (complexLineLayout()) {
             bool isFirstLine = lastRootBox() == firstRootBox();
             const auto& style = isFirstLine ? firstLineStyle() : this->style();
             // InlineFlowBox::placeBoxesInBlockDirection will flip lines in case of verticalLR mode, so we can assume verticalRL for now.
             lastBaseline = style.fontMetrics().ascent(lastRootBox()->baselineType())
                 + (style.isFlippedLinesWritingMode() ? logicalHeight() - lastRootBox()->logicalBottom() : lastRootBox()->logicalTop());
         }
+#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
+        else if (layoutFormattingContextLineLayout())
+            lastBaseline = floorToInt(layoutFormattingContextLineLayout()->lastLineBaseline());
+#endif
     }
     // According to the CSS spec http://www.w3.org/TR/CSS21/visudet.html, we shouldn't be performing this min, but should
     // instead be returning boxHeight directly. However, we feel that a min here is better behavior (and is consistent
@@ -3200,8 +3166,6 @@ void RenderBlockFlow::setSelectionState(HighlightState state)
 GapRects RenderBlockFlow::inlineSelectionGaps(RenderBlock& rootBlock, const LayoutPoint& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock,
     LayoutUnit& lastLogicalTop, LayoutUnit& lastLogicalLeft, LayoutUnit& lastLogicalRight, const LogicalSelectionOffsetCaches& cache, const PaintInfo* paintInfo)
 {
-    ASSERT(!simpleLineLayout());
-
     GapRects result;
 
     bool containsStart = selectionState() == HighlightState::Start || selectionState() == HighlightState::Both;
@@ -3317,9 +3281,6 @@ int RenderBlockFlow::lineCount() const
         if (layoutFormattingContextLineLayout())
             return layoutFormattingContextLineLayout()->lineCount();
 #endif
-        if (simpleLineLayout())
-            return simpleLineLayout()->lineCount();
-
         if (complexLineLayout())
             return complexLineLayout()->lineCount();
 
@@ -3575,10 +3536,8 @@ VisiblePosition RenderBlockFlow::positionForPointWithInlineChildren(const Layout
 
 Position RenderBlockFlow::positionForPoint(const LayoutPoint& point)
 {
-    // FIXME: It supports single text child only (which is the majority of simple line layout supported content at this point).
-    if (!simpleLineLayout() || firstChild() != lastChild() || !is<RenderText>(firstChild()))
-        return positionForPoint(point, nullptr).deepEquivalent();
-    return downcast<RenderText>(*firstChild()).positionForPoint(point);
+    // FIXME: This forces Complex Line Layout.
+    return positionForPoint(point, nullptr).deepEquivalent();
 }
 
 VisiblePosition RenderBlockFlow::positionForPoint(const LayoutPoint& point, const RenderFragmentContainer*)
@@ -3609,11 +3568,6 @@ void RenderBlockFlow::paintInlineChildren(PaintInfo& paintInfo, const LayoutPoin
     }
 #endif
 
-    if (auto simpleLineLayout = this->simpleLineLayout()) {
-        SimpleLineLayout::paintFlow(*this, *simpleLineLayout, paintInfo, paintOffset);
-        return;
-    }
-
     if (complexLineLayout())
         complexLineLayout()->lineBoxes().paint(this, paintInfo, paintOffset);
 }
@@ -3671,8 +3625,6 @@ bool RenderBlockFlow::hasLines() const
     if (layoutFormattingContextLineLayout())
         return layoutFormattingContextLineLayout()->lineCount();
 #endif
-    if (simpleLineLayout())
-        return simpleLineLayout()->lineCount();
 
     return complexLineLayout() && complexLineLayout()->lineBoxes().firstLineBox();
 }
@@ -3682,15 +3634,11 @@ void RenderBlockFlow::invalidateLineLayoutPath()
     switch (lineLayoutPath()) {
     case UndeterminedPath:
     case ForceLineBoxesPath:
-        ASSERT(!simpleLineLayout());
         return;
     case LineBoxesPath:
-        ASSERT(!simpleLineLayout());
         setLineLayoutPath(UndeterminedPath);
         return;
     case LayoutFormattingContextPath: // FIXME: Not all clients of invalidateLineLayoutPath() actually need to wipe the layout.
-    case SimpleLinesPath:
-        // The simple line layout may have become invalid.
         m_lineLayout = WTF::Monostate();
         setLineLayoutPath(UndeterminedPath);
         if (needsLayout())
@@ -3702,32 +3650,6 @@ void RenderBlockFlow::invalidateLineLayoutPath()
     ASSERT_NOT_REACHED();
 }
 
-void RenderBlockFlow::layoutSimpleLines(bool relayoutChildren, LayoutUnit& repaintLogicalTop, LayoutUnit& repaintLogicalBottom)
-{
-    bool needsLayout = selfNeedsLayout() || relayoutChildren || !simpleLineLayout();
-    if (needsLayout)
-        m_lineLayout = SimpleLineLayout::create(*this);
-
-    auto& simpleLineLayout = *this->simpleLineLayout();
-
-    if (view().frameView().layoutContext().layoutState() && view().frameView().layoutContext().layoutState()->isPaginated()) {
-        simpleLineLayout.setIsPaginated();
-        SimpleLineLayout::adjustLinePositionsForPagination(simpleLineLayout, *this);
-    }
-
-    for (auto& renderer : childrenOfType<RenderObject>(*this)) {
-        if (is<RenderText>(renderer))
-            downcast<RenderText>(renderer).deleteLineBoxes();
-        renderer.clearNeedsLayout();
-    }
-
-    LayoutUnit lineLayoutHeight = SimpleLineLayout::computeFlowHeight(*this, simpleLineLayout);
-    LayoutUnit lineLayoutTop = borderAndPaddingBefore();
-    repaintLogicalTop = lineLayoutTop;
-    repaintLogicalBottom = needsLayout ? repaintLogicalTop + lineLayoutHeight + borderAndPaddingAfter() : repaintLogicalTop;
-    setLogicalHeight(lineLayoutTop + lineLayoutHeight + borderAndPaddingAfter());
-}
-
 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
 void RenderBlockFlow::layoutLFCLines(bool, LayoutUnit& repaintLogicalTop, LayoutUnit& repaintLogicalBottom)
 {
@@ -3768,11 +3690,7 @@ void RenderBlockFlow::ensureLineBoxes()
     if (complexLineLayout() || !hasLineLayout())
         return;
 
-    auto simpleLineLayout = makeRefPtr(this->simpleLineLayout());
-
     bool needsToPaginateComplexLines = [&] {
-        if (simpleLineLayout && simpleLineLayout->isPaginated())
-            return true;
 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
         if (layoutFormattingContextLineLayout() && layoutFormattingContextLineLayout()->isPaginated())
             return true;
@@ -3782,13 +3700,6 @@ void RenderBlockFlow::ensureLineBoxes()
 
     m_lineLayout = makeUnique<ComplexLineLayout>(*this);
 
-    if (simpleLineLayout) {
-        if (SimpleLineLayout::canUseForLineBoxTree(*this, *simpleLineLayout)) {
-            SimpleLineLayout::generateLineBoxTree(*this, *simpleLineLayout);
-            return;
-        }
-    }
-
     auto& complexLineLayout = *this->complexLineLayout();
 
 #if ASSERT_ENABLED
@@ -3822,9 +3733,6 @@ void RenderBlockFlow::outputLineTreeAndMark(WTF::TextStream& stream, const Inlin
 {
     for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRootBox())
         root->outputLineTreeAndMark(stream, markedBox, depth);
-
-    if (auto simpleLineLayout = this->simpleLineLayout())
-        SimpleLineLayout::outputLineLayoutForFlow(stream, *this, *simpleLineLayout, depth);
 }
 #endif
 
index a212073..9afa9e9 100644 (file)
@@ -27,7 +27,6 @@
 #include "LineWidth.h"
 #include "RenderBlock.h"
 #include "RenderLineBoxList.h"
-#include "SimpleLineLayout.h"
 #include "TrailingObjects.h"
 #include <memory>
 
@@ -344,7 +343,7 @@ public:
     bool hasLines() const;
     void invalidateLineLayoutPath() final;
 
-    enum LineLayoutPath { UndeterminedPath = 0, SimpleLinesPath, LineBoxesPath, LayoutFormattingContextPath, ForceLineBoxesPath };
+    enum LineLayoutPath { UndeterminedPath = 0, LineBoxesPath, LayoutFormattingContextPath, ForceLineBoxesPath };
     LineLayoutPath lineLayoutPath() const { return static_cast<LineLayoutPath>(renderBlockFlowLineLayoutPath()); }
     void setLineLayoutPath(LineLayoutPath path) { setRenderBlockFlowLineLayoutPath(path); }
 
@@ -359,8 +358,6 @@ public:
 
     bool containsNonZeroBidiLevel() const;
 
-    const SimpleLineLayout::Layout* simpleLineLayout() const;
-    SimpleLineLayout::Layout* simpleLineLayout();
     const ComplexLineLayout* complexLineLayout() const;
     ComplexLineLayout* complexLineLayout();
 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
@@ -543,11 +540,8 @@ public:
 
 private:
     bool hasLineLayout() const;
-    bool hasSimpleLineLayout() const;
     bool hasComplexLineLayout() const;
 
-    void layoutSimpleLines(bool relayoutChildren, LayoutUnit& repaintLogicalTop, LayoutUnit& repaintLogicalBottom);
-
 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
     bool hasLayoutFormattingContextLineLayout() const;
     void layoutLFCLines(bool relayoutChildren, LayoutUnit& repaintLogicalTop, LayoutUnit& repaintLogicalBottom);
@@ -592,7 +586,6 @@ protected:
 private:
     Variant<
         WTF::Monostate,
-        Ref<SimpleLineLayout::Layout>,
 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
         std::unique_ptr<LayoutIntegration::LineLayout>,
 #endif
@@ -624,21 +617,6 @@ inline ComplexLineLayout* RenderBlockFlow::complexLineLayout()
     return hasComplexLineLayout() ? WTF::get<std::unique_ptr<ComplexLineLayout>>(m_lineLayout).get() : nullptr;
 }
 
-inline bool RenderBlockFlow::hasSimpleLineLayout() const
-{
-    return WTF::holds_alternative<Ref<SimpleLineLayout::Layout>>(m_lineLayout);
-}
-
-inline const SimpleLineLayout::Layout* RenderBlockFlow::simpleLineLayout() const
-{
-    return hasSimpleLineLayout() ? WTF::get<Ref<SimpleLineLayout::Layout>>(m_lineLayout).ptr() : nullptr;
-}
-
-inline SimpleLineLayout::Layout* RenderBlockFlow::simpleLineLayout()
-{
-    return hasSimpleLineLayout() ? WTF::get<Ref<SimpleLineLayout::Layout>>(m_lineLayout).ptr() : nullptr;
-}
-
 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
 inline bool RenderBlockFlow::hasLayoutFormattingContextLineLayout() const
 {
index 0dd38ec..42dc192 100644 (file)
@@ -450,7 +450,7 @@ void RenderFragmentedFlow::removeRenderBoxFragmentInfo(RenderBox& box)
 
 void RenderFragmentedFlow::removeLineFragmentInfo(const RenderBlockFlow& blockFlow)
 {
-    if (!m_lineToFragmentMap || blockFlow.lineLayoutPath() == SimpleLinesPath)
+    if (!m_lineToFragmentMap)
         return;
 
     for (auto* curr = blockFlow.firstRootBox(); curr; curr = curr->nextRootBox())
index d461366..8e0eb27 100644 (file)
@@ -46,7 +46,6 @@
 #include "RenderView.h"
 #include "RenderedDocumentMarker.h"
 #include "Settings.h"
-#include "SimpleLineLayoutFunctions.h"
 #include "Text.h"
 #include "TextResourceDecoder.h"
 #include "VisiblePosition.h"
@@ -443,23 +442,13 @@ Vector<FloatQuad> RenderText::absoluteQuadsForRange(unsigned start, unsigned end
     ASSERT(start <= INT_MAX);
     start = std::min(start, static_cast<unsigned>(INT_MAX));
     end = std::min(end, static_cast<unsigned>(INT_MAX));
-    if (simpleLineLayout() && !useSelectionHeight)
-        return collectAbsoluteQuadsForRange(*this, start, end, *simpleLineLayout(), ignoreEmptyTextSelections, wasFixed);
+
     const_cast<RenderText&>(*this).ensureLineBoxes();
     return m_lineBoxes.absoluteQuadsForRange(*this, start, end, useSelectionHeight, ignoreEmptyTextSelections, wasFixed);
 }
 
 Position RenderText::positionForPoint(const LayoutPoint& point)
 {
-    if (simpleLineLayout() && parent()->firstChild() == parent()->lastChild()) {
-        auto offset = SimpleLineLayout::textOffsetForPoint(point, *this, *simpleLineLayout());
-        // Did not find a valid offset. Fall back to the normal line layout based Position.
-        if (offset == text().length())
-            return positionForPoint(point, nullptr).deepEquivalent();
-        auto position = Position(textNode(), offset);
-        ASSERT(position == positionForPoint(point, nullptr).deepEquivalent());
-        return position;
-    }
     return positionForPoint(point, nullptr).deepEquivalent();
 }
 
@@ -1076,7 +1065,7 @@ void RenderText::setTextWithOffset(const String& newText, unsigned offset, unsig
     int delta = newText.length() - text().length();
     unsigned end = offset + length;
 
-    m_linesDirty = simpleLineLayout() || m_lineBoxes.dirtyRange(*this, offset, end, delta);
+    m_linesDirty = m_lineBoxes.dirtyRange(*this, offset, end, delta);
 
     setText(newText, force || m_linesDirty);
 }
@@ -1300,13 +1289,6 @@ void RenderText::ensureLineBoxes()
     downcast<RenderBlockFlow>(*parent()).ensureLineBoxes();
 }
 
-const SimpleLineLayout::Layout* RenderText::simpleLineLayout() const
-{
-    if (!is<RenderBlockFlow>(*parent()))
-        return nullptr;
-    return downcast<RenderBlockFlow>(*parent()).simpleLineLayout();
-}
-
 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
 const LayoutIntegration::LineLayout* RenderText::layoutFormattingContextLineLayout() const
 {
@@ -1318,8 +1300,6 @@ const LayoutIntegration::LineLayout* RenderText::layoutFormattingContextLineLayo
 
 bool RenderText::usesComplexLineLayoutPath() const
 {
-    if (simpleLineLayout())
-        return false;
 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
     if (layoutFormattingContextLineLayout())
         return false;
@@ -1388,7 +1368,6 @@ IntRect RenderText::linesBoundingBox() const
 
 LayoutRect RenderText::linesVisualOverflowBoundingBox() const
 {
-    ASSERT(!simpleLineLayout());
     return m_lineBoxes.visualOverflowBoundingBox(*this);
 }
 
@@ -1411,7 +1390,6 @@ LayoutRect RenderText::clippedOverflowRectForRepaint(const RenderLayerModelObjec
 LayoutRect RenderText::collectSelectionRectsForLineBoxes(const RenderLayerModelObject* repaintContainer, bool clipToVisibleContent, Vector<LayoutRect>* rects)
 {
     ASSERT(!needsLayout());
-    ASSERT(!simpleLineLayout());
 
     if (selectionState() == HighlightState::None)
         return LayoutRect();
index 0079324..291d194 100644 (file)
@@ -24,7 +24,6 @@
 
 #include "RenderElement.h"
 #include "RenderTextLineBoxes.h"
-#include "SimpleLineLayout.h"
 #include "Text.h"
 #include <wtf/Forward.h>
 #include <wtf/text/TextBreakIterator.h>
@@ -169,7 +168,6 @@ public:
 #endif
 
     void ensureLineBoxes();
-    const SimpleLineLayout::Layout* simpleLineLayout() const;
 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
     const LayoutIntegration::LineLayout* layoutFormattingContextLineLayout() const;
 #endif
diff --git a/Source/WebCore/rendering/SimpleLineLayout.cpp b/Source/WebCore/rendering/SimpleLineLayout.cpp
deleted file mode 100644 (file)
index e28eab3..0000000
+++ /dev/null
@@ -1,1052 +0,0 @@
-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "SimpleLineLayout.h"
-
-#include "DocumentMarkerController.h"
-#include "FontCache.h"
-#include "Frame.h"
-#include "GraphicsContext.h"
-#include "HTMLTextFormControlElement.h"
-#include "HitTestLocation.h"
-#include "HitTestRequest.h"
-#include "HitTestResult.h"
-#include "Hyphenation.h"
-#include "InlineTextBox.h"
-#include "LineWidth.h"
-#include "Logging.h"
-#include "PaintInfo.h"
-#include "RenderBlockFlow.h"
-#include "RenderChildIterator.h"
-#include "RenderFragmentedFlow.h"
-#include "RenderLineBreak.h"
-#include "RenderMultiColumnFlow.h"
-#include "RenderStyle.h"
-#include "RenderText.h"
-#include "RenderTextControl.h"
-#include "RenderView.h"
-#include "Settings.h"
-#include "SimpleLineLayoutFlowContents.h"
-#include "SimpleLineLayoutFunctions.h"
-#include "SimpleLineLayoutResolver.h"
-#include "SimpleLineLayoutTextFragmentIterator.h"
-#include "Text.h"
-#include "TextPaintStyle.h"
-#include <pal/Logging.h>
-
-namespace WebCore {
-namespace SimpleLineLayout {
-
-#ifndef NDEBUG
-#define SET_REASON_AND_RETURN_IF_NEEDED(reason, reasons, includeReasons) { \
-        reasons |= reason; \
-        if (includeReasons == IncludeReasons::First) \
-            return reasons; \
-    }
-#else
-#define SET_REASON_AND_RETURN_IF_NEEDED(reason, reasons, includeReasons) { \
-        ASSERT_UNUSED(includeReasons, includeReasons == IncludeReasons::First); \
-        reasons |= reason; \
-        return reasons; \
-    }
-#endif
-
-
-template <typename CharacterType> AvoidanceReasonFlags canUseForCharacter(CharacterType, bool textIsJustified, IncludeReasons);
-
-template<> AvoidanceReasonFlags canUseForCharacter(UChar character, bool textIsJustified, IncludeReasons includeReasons)
-{
-    AvoidanceReasonFlags reasons = { };
-    if (textIsJustified) {
-        // Include characters up to Latin Extended-B and some punctuation range when text is justified.
-        bool isLatinIncludingExtendedB = character <= 0x01FF;
-        bool isPunctuationRange = character >= 0x2010 && character <= 0x2027;
-        if (!(isLatinIncludingExtendedB || isPunctuationRange))
-            SET_REASON_AND_RETURN_IF_NEEDED(FlowHasJustifiedNonLatinText, reasons, includeReasons);
-    }
-
-    if (U16_IS_SURROGATE(character))
-        SET_REASON_AND_RETURN_IF_NEEDED(FlowTextHasSurrogatePair, reasons, includeReasons);
-    
-    UCharDirection direction = u_charDirection(character);
-    if (direction == U_RIGHT_TO_LEFT || direction == U_RIGHT_TO_LEFT_ARABIC
-        || direction == U_RIGHT_TO_LEFT_EMBEDDING || direction == U_RIGHT_TO_LEFT_OVERRIDE
-        || direction == U_LEFT_TO_RIGHT_EMBEDDING || direction == U_LEFT_TO_RIGHT_OVERRIDE
-        || direction == U_POP_DIRECTIONAL_FORMAT || direction == U_BOUNDARY_NEUTRAL)
-        SET_REASON_AND_RETURN_IF_NEEDED(FlowTextHasDirectionCharacter, reasons, includeReasons);
-
-    return reasons;
-}
-
-template<> AvoidanceReasonFlags canUseForCharacter(LChar, bool, IncludeReasons)
-{
-    return { };
-}
-
-template <typename CharacterType>
-static AvoidanceReasonFlags canUseForText(const CharacterType* text, unsigned length, const FontCascade& fontCascade, Optional<float> lineHeightConstraint,
-    bool textIsJustified, IncludeReasons includeReasons)
-{
-    AvoidanceReasonFlags reasons = { };
-    auto& primaryFont = fontCascade.primaryFont();
-    auto& fontMetrics = primaryFont.fontMetrics();
-    auto availableSpaceForGlyphAscent = fontMetrics.ascent();
-    auto availableSpaceForGlyphDescent = fontMetrics.descent();
-    if (lineHeightConstraint) {
-        auto lineHeightPadding = *lineHeightConstraint - fontMetrics.height();
-        availableSpaceForGlyphAscent += lineHeightPadding / 2;
-        availableSpaceForGlyphDescent += lineHeightPadding / 2;
-    }
-
-    for (unsigned i = 0; i < length; ++i) {
-        auto character = text[i];
-        if (FontCascade::treatAsSpace(character))
-            continue;
-
-        if (character == softHyphen)
-            SET_REASON_AND_RETURN_IF_NEEDED(FlowTextHasSoftHyphen, reasons, includeReasons);
-
-        auto characterReasons = canUseForCharacter(character, textIsJustified, includeReasons);
-        if (characterReasons != NoReason)
-            SET_REASON_AND_RETURN_IF_NEEDED(characterReasons, reasons, includeReasons);
-
-        auto glyphData = fontCascade.glyphDataForCharacter(character, false);
-        if (!glyphData.isValid() || glyphData.font != &primaryFont)
-            SET_REASON_AND_RETURN_IF_NEEDED(FlowPrimaryFontIsInsufficient, reasons, includeReasons);
-
-        if (lineHeightConstraint) {
-            auto bounds = primaryFont.boundsForGlyph(glyphData.glyph);
-            if (ceilf(-bounds.y()) > availableSpaceForGlyphAscent || ceilf(bounds.maxY()) > availableSpaceForGlyphDescent)
-                SET_REASON_AND_RETURN_IF_NEEDED(FlowFontHasOverflowGlyph, reasons, includeReasons);
-        }
-    }
-    return reasons;
-}
-
-static AvoidanceReasonFlags canUseForText(StringView text, const FontCascade& fontCascade, Optional<float> lineHeightConstraint, bool textIsJustified, IncludeReasons includeReasons)
-{
-    if (text.is8Bit())
-        return canUseForText(text.characters8(), text.length(), fontCascade, lineHeightConstraint, textIsJustified, includeReasons);
-    return canUseForText(text.characters16(), text.length(), fontCascade, lineHeightConstraint, textIsJustified, includeReasons);
-}
-
-static AvoidanceReasonFlags canUseForFontAndText(const RenderBlockFlow& flow, IncludeReasons includeReasons)
-{
-    AvoidanceReasonFlags reasons = { };
-    // We assume that all lines have metrics based purely on the primary font.
-    const auto& style = flow.style();
-    auto& fontCascade = style.fontCascade();
-    if (fontCascade.primaryFont().isInterstitial())
-        SET_REASON_AND_RETURN_IF_NEEDED(FlowIsMissingPrimaryFont, reasons, includeReasons);
-    Optional<float> lineHeightConstraint;
-    if (style.lineBoxContain().contains(LineBoxContain::Glyphs))
-        lineHeightConstraint = lineHeightFromFlow(flow).toFloat();
-    bool flowIsJustified = style.textAlign() == TextAlignMode::Justify;
-    for (const auto& textRenderer : childrenOfType<RenderText>(flow)) {
-        // FIXME: Do not return until after checking all children.
-        if (textRenderer.text().isEmpty())
-            SET_REASON_AND_RETURN_IF_NEEDED(FlowTextIsEmpty, reasons, includeReasons);
-        if (textRenderer.isCombineText())
-            SET_REASON_AND_RETURN_IF_NEEDED(FlowTextIsCombineText, reasons, includeReasons);
-        if (textRenderer.isCounter())
-            SET_REASON_AND_RETURN_IF_NEEDED(FlowTextIsRenderCounter, reasons, includeReasons);
-        if (textRenderer.isQuote())
-            SET_REASON_AND_RETURN_IF_NEEDED(FlowTextIsRenderQuote, reasons, includeReasons);
-        if (textRenderer.isTextFragment())
-            SET_REASON_AND_RETURN_IF_NEEDED(FlowTextIsTextFragment, reasons, includeReasons);
-        if (textRenderer.isSVGInlineText())
-            SET_REASON_AND_RETURN_IF_NEEDED(FlowTextIsSVGInlineText, reasons, includeReasons);
-        if (!textRenderer.canUseSimpleFontCodePath()) {
-            // No need to check the code path at this point. We already know it can't be simple.
-            SET_REASON_AND_RETURN_IF_NEEDED(FlowHasComplexFontCodePath, reasons, includeReasons);
-        } else {
-            TextRun run(String(textRenderer.text()));
-            run.setCharacterScanForCodePath(false);
-            if (style.fontCascade().codePath(run) != FontCascade::Simple)
-                SET_REASON_AND_RETURN_IF_NEEDED(FlowHasComplexFontCodePath, reasons, includeReasons);
-        }
-
-        auto textReasons = canUseForText(textRenderer.stringView(), fontCascade, lineHeightConstraint, flowIsJustified, includeReasons);
-        if (textReasons != NoReason)
-            SET_REASON_AND_RETURN_IF_NEEDED(textReasons, reasons, includeReasons);
-    }
-    return reasons;
-}
-
-static AvoidanceReasonFlags canUseForStyle(const RenderStyle& style, IncludeReasons includeReasons)
-{
-    AvoidanceReasonFlags reasons = { };
-    if (style.textOverflow() == TextOverflow::Ellipsis)
-        SET_REASON_AND_RETURN_IF_NEEDED(FlowHasTextOverflow, reasons, includeReasons);
-    if (style.textUnderlinePosition() != TextUnderlinePosition::Auto || !style.textUnderlineOffset().isAuto() || !style.textDecorationThickness().isAuto())
-        SET_REASON_AND_RETURN_IF_NEEDED(FlowHasUnsupportedUnderlineDecoration, reasons, includeReasons);
-    // Non-visible overflow should be pretty easy to support.
-    if (style.overflowX() != Overflow::Visible || style.overflowY() != Overflow::Visible)
-        SET_REASON_AND_RETURN_IF_NEEDED(FlowHasOverflowNotVisible, reasons, includeReasons);
-    if (!style.isLeftToRightDirection())
-        SET_REASON_AND_RETURN_IF_NEEDED(FlowIsNotLTR, reasons, includeReasons);
-    if (!(style.lineBoxContain().contains(LineBoxContain::Block)))
-        SET_REASON_AND_RETURN_IF_NEEDED(FlowHasLineBoxContainProperty, reasons, includeReasons);
-    if (style.writingMode() != WritingMode::TopToBottom)
-        SET_REASON_AND_RETURN_IF_NEEDED(FlowIsNotTopToBottom, reasons, includeReasons);
-    if (style.lineBreak() != LineBreak::Auto)
-        SET_REASON_AND_RETURN_IF_NEEDED(FlowHasLineBreak, reasons, includeReasons);
-    if (style.unicodeBidi() != UBNormal)
-        SET_REASON_AND_RETURN_IF_NEEDED(FlowHasNonNormalUnicodeBiDi, reasons, includeReasons);
-    if (style.rtlOrdering() != Order::Logical)
-        SET_REASON_AND_RETURN_IF_NEEDED(FlowHasRTLOrdering, reasons, includeReasons);
-    if (style.lineAlign() != LineAlign::None)
-        SET_REASON_AND_RETURN_IF_NEEDED(FlowHasLineAlignEdges, reasons, includeReasons);
-    if (style.lineSnap() != LineSnap::None)
-        SET_REASON_AND_RETURN_IF_NEEDED(FlowHasLineSnap, reasons, includeReasons);
-    if (style.textEmphasisFill() != TextEmphasisFill::Filled || style.textEmphasisMark() != TextEmphasisMark::None)
-        SET_REASON_AND_RETURN_IF_NEEDED(FlowHasTextEmphasisFillOrMark, reasons, includeReasons);
-    if (style.textShadow())
-        SET_REASON_AND_RETURN_IF_NEEDED(FlowHasTextShadow, reasons, includeReasons);
-    if (style.hasPseudoStyle(PseudoId::FirstLine))
-        SET_REASON_AND_RETURN_IF_NEEDED(FlowHasPseudoFirstLine, reasons, includeReasons);
-    if (style.hasPseudoStyle(PseudoId::FirstLetter))
-        SET_REASON_AND_RETURN_IF_NEEDED(FlowHasPseudoFirstLetter, reasons, includeReasons);
-    if (style.hasTextCombine())
-        SET_REASON_AND_RETURN_IF_NEEDED(FlowHasTextCombine, reasons, includeReasons);
-    if (style.backgroundClip() == FillBox::Text)
-        SET_REASON_AND_RETURN_IF_NEEDED(FlowHasTextFillBox, reasons, includeReasons);
-    if (style.borderFit() == BorderFit::Lines)
-        SET_REASON_AND_RETURN_IF_NEEDED(FlowHasBorderFitLines, reasons, includeReasons);
-    if (style.lineBreak() != LineBreak::Auto)
-        SET_REASON_AND_RETURN_IF_NEEDED(FlowHasNonAutoLineBreak, reasons, includeReasons);
-    if (style.nbspMode() != NBSPMode::Normal)
-        SET_REASON_AND_RETURN_IF_NEEDED(FlowHasWebKitNBSPMode, reasons, includeReasons);
-    // Special handling of text-security:disc is not yet implemented in the simple line layout code path.
-    // See RenderBlock::updateSecurityDiscCharacters.
-    if (style.textSecurity() != TextSecurity::None)
-        SET_REASON_AND_RETURN_IF_NEEDED(FlowHasTextSecurity, reasons, includeReasons);
-    if (style.hyphens() == Hyphens::Auto) {
-        auto textReasons = canUseForText(style.hyphenString(), style.fontCascade(), WTF::nullopt, false, includeReasons);
-        if (textReasons != NoReason)
-            SET_REASON_AND_RETURN_IF_NEEDED(textReasons, reasons, includeReasons);
-    }
-    return reasons;
-}
-
-AvoidanceReasonFlags canUseForWithReason(const RenderBlockFlow& flow, IncludeReasons includeReasons)
-{
-#ifndef NDEBUG
-    static std::once_flag onceFlag;
-    std::call_once(onceFlag, [] {
-        PAL::registerNotifyCallback("com.apple.WebKit.showSimpleLineLayoutCoverage", WTF::Function<void()> { printSimpleLineLayoutCoverage });
-        PAL::registerNotifyCallback("com.apple.WebKit.showSimpleLineLayoutReasons", WTF::Function<void()> { printSimpleLineLayoutBlockList });
-        PAL::registerNotifyCallback("com.apple.WebKit.toggleSimpleLineLayout", WTF::Function<void()> { toggleSimpleLineLayout });
-    });
-#endif
-    AvoidanceReasonFlags reasons = { };
-    if (!flow.settings().simpleLineLayoutEnabled())
-        SET_REASON_AND_RETURN_IF_NEEDED(FeatureIsDisabled, reasons, includeReasons);
-    if (!flow.parent())
-        SET_REASON_AND_RETURN_IF_NEEDED(FlowHasNoParent, reasons, includeReasons);
-    if (!flow.firstChild())
-        SET_REASON_AND_RETURN_IF_NEEDED(FlowHasNoChild, reasons, includeReasons);
-    if (flow.fragmentedFlowState() != RenderObject::NotInsideFragmentedFlow) {
-        auto* fragmentedFlow = flow.enclosingFragmentedFlow();
-        if (!is<RenderMultiColumnFlow>(fragmentedFlow))
-            SET_REASON_AND_RETURN_IF_NEEDED(FlowIsInsideANonMultiColumnThread, reasons, includeReasons);
-        auto& columnThread = downcast<RenderMultiColumnFlow>(*fragmentedFlow);
-        if (columnThread.parent() != &flow.view())
-            SET_REASON_AND_RETURN_IF_NEEDED(MultiColumnFlowIsNotTopLevel, reasons, includeReasons);
-        if (columnThread.hasColumnSpanner())
-            SET_REASON_AND_RETURN_IF_NEEDED(MultiColumnFlowHasColumnSpanner, reasons, includeReasons);
-        auto& style = flow.style();
-        if (style.verticalAlign() != VerticalAlign::Baseline)
-            SET_REASON_AND_RETURN_IF_NEEDED(MultiColumnFlowVerticalAlign, reasons, includeReasons);
-        if (style.isFloating())
-            SET_REASON_AND_RETURN_IF_NEEDED(MultiColumnFlowIsFloating, reasons, includeReasons);
-    }
-    if (!flow.isHorizontalWritingMode())
-        SET_REASON_AND_RETURN_IF_NEEDED(FlowHasHorizonalWritingMode, reasons, includeReasons);
-    if (flow.hasOutline())
-        SET_REASON_AND_RETURN_IF_NEEDED(FlowHasOutline, reasons, includeReasons);
-    if (flow.isRubyText() || flow.isRubyBase())
-        SET_REASON_AND_RETURN_IF_NEEDED(FlowIsRuby, reasons, includeReasons);
-    if (!flow.style().hangingPunctuation().isEmpty())
-        SET_REASON_AND_RETURN_IF_NEEDED(FlowHasHangingPunctuation, reasons, includeReasons);
-    
-    // Printing does pagination without a flow thread.
-    if (flow.document().paginated())
-        SET_REASON_AND_RETURN_IF_NEEDED(FlowIsPaginated, reasons, includeReasons);
-    if (flow.firstLineBlock())
-        SET_REASON_AND_RETURN_IF_NEEDED(FlowHasPseudoFirstLine, reasons, includeReasons);
-    if (flow.isAnonymousBlock() && flow.parent()->style().textOverflow() == TextOverflow::Ellipsis)
-        SET_REASON_AND_RETURN_IF_NEEDED(FlowHasTextOverflow, reasons, includeReasons);
-    if (flow.parent()->isDeprecatedFlexibleBox())
-        SET_REASON_AND_RETURN_IF_NEEDED(FlowIsDepricatedFlexBox, reasons, includeReasons);
-    // FIXME: Placeholders do something strange.
-    if (is<RenderTextControl>(*flow.parent()) && downcast<RenderTextControl>(*flow.parent()).textFormControlElement().placeholderElement())
-        SET_REASON_AND_RETURN_IF_NEEDED(FlowParentIsPlaceholderElement, reasons, includeReasons);
-    // FIXME: Implementation of wrap=hard looks into lineboxes.
-    if (flow.parent()->isTextArea() && flow.parent()->element()->hasAttributeWithoutSynchronization(HTMLNames::wrapAttr))
-        SET_REASON_AND_RETURN_IF_NEEDED(FlowParentIsTextAreaWithWrapping, reasons, includeReasons);
-    // This currently covers <blockflow>#text</blockflow>, <blockflow>#text<br></blockflow> and mutiple (sibling) RenderText cases.
-    // The <blockflow><inline>#text</inline></blockflow> case is also popular and should be relatively easy to cover.
-    for (const auto* child = flow.firstChild(); child;) {
-        if (child->selectionState() != RenderObject::HighlightState::None)
-            SET_REASON_AND_RETURN_IF_NEEDED(FlowChildIsSelected, reasons, includeReasons);
-        if (is<RenderText>(*child)) {
-            const auto& renderText = downcast<RenderText>(*child);
-            if (renderText.textNode() && !renderText.document().markers().markersFor(*renderText.textNode()).isEmpty())
-                SET_REASON_AND_RETURN_IF_NEEDED(FlowIncludesDocumentMarkers, reasons, includeReasons);
-            child = child->nextSibling();
-            continue;
-        }
-        if (is<RenderLineBreak>(child) && !downcast<RenderLineBreak>(*child).isWBR() && child->style().clear() == Clear::None) {
-            child = child->nextSibling();
-            continue;
-        }
-        SET_REASON_AND_RETURN_IF_NEEDED(FlowHasNonSupportedChild, reasons, includeReasons);
-        break;
-    }
-    auto styleReasons = canUseForStyle(flow.style(), includeReasons);
-    if (styleReasons != NoReason)
-        SET_REASON_AND_RETURN_IF_NEEDED(styleReasons, reasons, includeReasons);
-    // We can't use the code path if any lines would need to be shifted below floats. This is because we don't keep per-line y coordinates.
-    if (flow.containsFloats()) {
-        float minimumWidthNeeded = std::numeric_limits<float>::max();
-        for (const auto& textRenderer : childrenOfType<RenderText>(flow)) {
-            minimumWidthNeeded = std::min(minimumWidthNeeded, textRenderer.minLogicalWidth());
-
-            for (auto& floatingObject : *flow.floatingObjectSet()) {
-                ASSERT(floatingObject);
-                // if a float has a shape, we cannot tell if content will need to be shifted until after we lay it out,
-                // since the amount of space is not uniform for the height of the float.
-                if (floatingObject->renderer().shapeOutsideInfo())
-                    SET_REASON_AND_RETURN_IF_NEEDED(FlowHasUnsupportedFloat, reasons, includeReasons);
-                float availableWidth = flow.availableLogicalWidthForLine(floatingObject->y(), DoNotIndentText);
-                if (availableWidth < minimumWidthNeeded)
-                    SET_REASON_AND_RETURN_IF_NEEDED(FlowHasUnsupportedFloat, reasons, includeReasons);
-            }
-        }
-    }
-    auto fontAndTextReasons = canUseForFontAndText(flow, includeReasons);
-    if (fontAndTextReasons != NoReason)
-        SET_REASON_AND_RETURN_IF_NEEDED(fontAndTextReasons, reasons, includeReasons);
-    return reasons;
-}
-
-bool canUseFor(const RenderBlockFlow& flow)
-{
-    return canUseForWithReason(flow, IncludeReasons::First) == NoReason;
-}
-
-bool canUseForAfterStyleChange(const RenderBlockFlow& blockContainer, StyleDifference diff)
-{
-    switch (diff) {
-    case StyleDifference::Equal:
-    case StyleDifference::RecompositeLayer:
-        return true;
-    case StyleDifference::Repaint:
-    case StyleDifference::RepaintIfTextOrBorderOrOutline:
-    case StyleDifference::RepaintLayer:
-        // FIXME: We could do a more focused style check by matching RendererStyle::changeRequiresRepaint&co.
-        return canUseForStyle(blockContainer.style(), IncludeReasons::First) == NoReason;
-    case StyleDifference::LayoutPositionedMovementOnly:
-        return true;
-    case StyleDifference::SimplifiedLayout:
-    case StyleDifference::SimplifiedLayoutAndPositionedMovement:
-        return canUseForStyle(blockContainer.style(), IncludeReasons::First) == NoReason;
-    case StyleDifference::Layout:
-    case StyleDifference::NewStyle:
-        return canUseFor(blockContainer);
-    }
-    ASSERT_NOT_REACHED();
-    return canUseFor(blockContainer);
-}
-
-static void revertAllRunsOnCurrentLine(Layout::RunVector& runs)
-{
-    while (!runs.isEmpty() && !runs.last().isEndOfLine)
-        runs.removeLast();
-}
-
-static void revertRuns(Layout::RunVector& runs, unsigned positionToRevertTo, float width)
-{
-    while (runs.size()) {
-        auto& lastRun = runs.last();
-        if (lastRun.end <= positionToRevertTo)
-            break;
-        if (lastRun.start >= positionToRevertTo) {
-            // Revert this run completely.
-            width -= (lastRun.logicalRight - lastRun.logicalLeft);
-            runs.removeLast();
-        } else {
-            lastRun.logicalRight -= width;
-            width = 0;
-            lastRun.end = positionToRevertTo;
-            // Partial removal.
-            break;
-        }
-    }
-}
-
-class LineState {
-public:
-    void setAvailableWidth(float width) { m_availableWidth = width; }
-    void setCollapedWhitespaceWidth(float width) { m_collapsedWhitespaceWidth = width; }
-    void setLogicalLeftOffset(float offset) { m_logicalLeftOffset = offset; }
-    void setOverflowedFragment(const TextFragmentIterator::TextFragment& fragment) { m_overflowedFragment = fragment; }
-    void setNeedsAllFragments()
-    {
-        ASSERT(!m_fragments);
-        m_fragments.emplace();
-    }
-    void setHyphenationDisabled() { m_hyphenationDisabled = true; }
-    bool isHyphenationDisabled() const { return m_hyphenationDisabled; }
-
-    float availableWidth() const { return m_availableWidth; }
-    float logicalLeftOffset() const { return m_logicalLeftOffset; }
-    const TextFragmentIterator::TextFragment& overflowedFragment() const { return m_overflowedFragment; }
-    bool hasTrailingWhitespace() const { return m_lastFragment.type() == TextFragmentIterator::TextFragment::Whitespace && m_lastFragment.length() > 0; }
-    bool hasWhitespaceFragments() const { return m_lastWhitespaceFragment != WTF::nullopt; }
-    TextFragmentIterator::TextFragment lastFragment() const { return m_lastFragment; }
-    bool isWhitespaceOnly() const { return m_trailingWhitespaceWidth && m_runsWidth == m_trailingWhitespaceWidth; }
-    bool fits(float extra) const { return m_availableWidth >= m_runsWidth + extra; }
-    bool firstCharacterFits() const { return m_firstCharacterFits; }
-    float width() const { return m_runsWidth; }
-    std::pair<unsigned, bool> expansionOpportunityCount(unsigned from, unsigned to) const
-    {
-        ASSERT(m_fragments);
-        // linebreak runs are special.
-        if (from == to)
-            return std::make_pair(0, false);
-        unsigned expansionOpportunityCount = 0;
-        auto previousFragmentType = TextFragmentIterator::TextFragment::ContentEnd;
-        for (const auto& fragment : *m_fragments) {
-            if (fragment.end() <= from)
-                continue;
-            auto currentFragmentType = fragment.type();
-            auto expansionOpportunity = this->expansionOpportunity(currentFragmentType, previousFragmentType);
-            if (expansionOpportunity)
-                ++expansionOpportunityCount;
-            previousFragmentType = currentFragmentType;
-            if (fragment.end() >= to)
-                return std::make_pair(expansionOpportunityCount, expansionOpportunity);
-        }
-        ASSERT_NOT_REACHED();
-        return std::make_pair(expansionOpportunityCount, false);
-    }
-
-    bool isEmpty() const
-    {
-        if (!m_lastFragment.isValid())
-            return true;
-        if (!m_lastCompleteFragment.isEmpty())
-            return false;
-        return m_lastFragment.overlapsToNextRenderer();
-    }
-
-    static inline unsigned endPositionForCollapsedFragment(const TextFragmentIterator::TextFragment& fragment)
-    {
-        return fragment.isCollapsed() ? fragment.start() + 1 : fragment.end();
-    }
-
-    void appendFragmentAndCreateRunIfNeeded(const TextFragmentIterator::TextFragment& fragment, Layout::RunVector& runs)
-    {
-        // Adjust end position while collapsing.
-        unsigned endPosition = endPositionForCollapsedFragment(fragment);
-        // New line needs new run.
-        if (!m_runsWidth) {
-            ASSERT(!m_uncompletedWidth);
-            runs.append(Run(fragment.start(), endPosition, m_runsWidth, m_runsWidth + fragment.width(), false, fragment.hasHyphen(), fragment.isLineBreak()));
-        } else {
-            // Advance last completed fragment when the previous fragment is all set (including multiple parts across renderers)
-            if ((m_lastFragment.type() != fragment.type()) || !m_lastFragment.overlapsToNextRenderer()) {
-                m_lastCompleteFragment = m_lastFragment;
-                m_uncompletedWidth = fragment.width();
-            } else
-                m_uncompletedWidth += fragment.width();
-            // Collapse neighbouring whitespace, if they are across multiple renderers and are not collapsed yet.
-            if (m_lastFragment.isCollapsible() && fragment.isCollapsible()) {
-                ASSERT(m_lastFragment.isLastInRenderer());
-                if (!m_lastFragment.isCollapsed()) {
-                    // Line width needs to be adjusted so that now it takes collapsing into consideration.
-                    m_runsWidth -= (m_lastFragment.width() - m_collapsedWhitespaceWidth);
-                }
-                // This fragment is collapsed completely. No run is needed.
-                return;
-            }
-            Run& lastRun = runs.last();
-            if (m_lastFragment.isLastInRenderer() || m_lastFragment.isCollapsed() || fragment.isLineBreak() || lastRun.isLineBreak)
-                runs.append(Run(fragment.start(), endPosition, m_runsWidth, m_runsWidth + fragment.width(), false, fragment.hasHyphen(), fragment.isLineBreak()));
-            else {
-                lastRun.end = endPosition;
-                lastRun.logicalRight += fragment.width();
-                ASSERT(!lastRun.hasHyphen);
-                lastRun.hasHyphen = fragment.hasHyphen();
-            }
-        }
-        m_runsWidth += fragment.width();
-        m_lastFragment = fragment;
-        if (m_fragments)
-            (*m_fragments).append(fragment);
-
-        if (fragment.type() == TextFragmentIterator::TextFragment::Whitespace) {
-            m_trailingWhitespaceWidth += fragment.width();
-            m_lastWhitespaceFragment = fragment;
-        } else {
-            m_trailingWhitespaceWidth = 0;
-            m_lastNonWhitespaceFragment = fragment;
-        }
-
-        if (!m_firstCharacterFits)
-            m_firstCharacterFits = fragment.start() + 1 > endPosition || m_runsWidth <= m_availableWidth;
-    }
-
-    TextFragmentIterator::TextFragment revertToLastCompleteFragment(Layout::RunVector& runs)
-    {
-        if (!m_uncompletedWidth) {
-            ASSERT(m_lastFragment == m_lastCompleteFragment);
-            return m_lastFragment;
-        }
-        ASSERT(m_lastFragment.isValid());
-        m_runsWidth -= m_uncompletedWidth;
-        revertRuns(runs, endPositionForCollapsedFragment(m_lastCompleteFragment), m_uncompletedWidth);
-        m_uncompletedWidth = 0;
-        ASSERT(m_lastCompleteFragment.isValid());
-        return m_lastCompleteFragment;
-    }
-
-    void removeTrailingWhitespace(Layout::RunVector& runs)
-    {
-        if (!hasTrailingWhitespace())
-            return;
-        if (m_lastNonWhitespaceFragment) {
-            auto needsReverting = m_lastNonWhitespaceFragment->end() != m_lastFragment.end();
-            // Trailing whitespace fragment might actually have zero length.
-            ASSERT(needsReverting || !m_trailingWhitespaceWidth);
-            if (needsReverting) {
-                revertRuns(runs, m_lastNonWhitespaceFragment->end(), m_trailingWhitespaceWidth);
-                m_runsWidth -= m_trailingWhitespaceWidth;
-            }
-            m_trailingWhitespaceWidth = 0;
-            m_lastFragment = *m_lastNonWhitespaceFragment;
-            return;
-        }
-        // This line is all whitespace.
-        revertAllRunsOnCurrentLine(runs);
-        m_runsWidth = 0;
-        m_trailingWhitespaceWidth = 0;
-        // FIXME: Make m_lastFragment optional.
-        m_lastFragment = TextFragmentIterator::TextFragment();
-    }
-
-    float trailingWhitespaceWidth() const { return m_trailingWhitespaceWidth; }
-
-private:
-    bool expansionOpportunity(TextFragmentIterator::TextFragment::Type currentFragmentType, TextFragmentIterator::TextFragment::Type previousFragmentType) const
-    {
-        return (currentFragmentType == TextFragmentIterator::TextFragment::Whitespace
-            || (currentFragmentType == TextFragmentIterator::TextFragment::NonWhitespace && previousFragmentType == TextFragmentIterator::TextFragment::NonWhitespace));
-    }
-
-    float m_availableWidth { 0 };
-    float m_logicalLeftOffset { 0 };
-    float m_runsWidth { 0 };
-    TextFragmentIterator::TextFragment m_overflowedFragment;
-    TextFragmentIterator::TextFragment m_lastFragment;
-    Optional<TextFragmentIterator::TextFragment> m_lastNonWhitespaceFragment;
-    Optional<TextFragmentIterator::TextFragment> m_lastWhitespaceFragment;
-    TextFragmentIterator::TextFragment m_lastCompleteFragment;
-    float m_uncompletedWidth { 0 };
-    float m_trailingWhitespaceWidth { 0 }; // Use this to remove trailing whitespace without re-mesuring the text.
-    float m_collapsedWhitespaceWidth { 0 };
-    // Having one character on the line does not necessarily mean it actually fits.
-    // First character of the first fragment might be forced on to the current line even if it does not fit.
-    bool m_firstCharacterFits { false };
-    bool m_hyphenationDisabled { false };
-    Optional<Vector<TextFragmentIterator::TextFragment, 30>> m_fragments;
-};
-
-static float computeLineLeft(const LineState& line, TextAlignMode textAlign, float& hangingWhitespaceWidth)
-{
-    float totalWidth = line.width() - hangingWhitespaceWidth;
-    float remainingWidth = line.availableWidth() - totalWidth;
-    float left = line.logicalLeftOffset();
-    switch (textAlign) {
-    case TextAlignMode::Left:
-    case TextAlignMode::WebKitLeft:
-    case TextAlignMode::Start:
-        hangingWhitespaceWidth = std::max(0.f, std::min(hangingWhitespaceWidth, remainingWidth));
-        return left;
-    case TextAlignMode::Right:
-    case TextAlignMode::WebKitRight:
-    case TextAlignMode::End:
-        hangingWhitespaceWidth = 0;
-        return left + std::max<float>(remainingWidth, 0);
-    case TextAlignMode::Center:
-    case TextAlignMode::WebKitCenter:
-        hangingWhitespaceWidth = std::max(0.f, std::min(hangingWhitespaceWidth, (remainingWidth + 1) / 2));
-        return left + std::max<float>(remainingWidth / 2, 0);
-    case TextAlignMode::Justify:
-        ASSERT_NOT_REACHED();
-        break;
-    }
-    ASSERT_NOT_REACHED();
-    return 0;
-}
-
-static bool preWrap(const TextFragmentIterator::Style& style)
-{
-    return style.wrapLines && !style.collapseWhitespace && !style.breakSpaces;
-}
-
-static void updateLineConstrains(const RenderBlockFlow& flow, LineState& line, const LineState& previousLine, unsigned& numberOfPrecedingLinesWithHyphen, const TextFragmentIterator::Style& style, bool isFirstLine)
-{
-    bool shouldApplyTextIndent = !flow.isAnonymous() || flow.parent()->firstChild() == &flow;
-    LayoutUnit height = flow.logicalHeight();
-    LayoutUnit logicalHeight = flow.minLineHeightForReplacedRenderer(false, 0);
-    line.setLogicalLeftOffset(flow.logicalLeftOffsetForLine(height, DoNotIndentText, logicalHeight) + (shouldApplyTextIndent && isFirstLine ? flow.textIndentOffset() : 0_lu));
-    float logicalRightOffset = flow.logicalRightOffsetForLine(height, DoNotIndentText, logicalHeight);
-    line.setAvailableWidth(std::max<float>(0, logicalRightOffset - line.logicalLeftOffset()));
-    if (style.textAlign == TextAlignMode::Justify)
-        line.setNeedsAllFragments();
-    numberOfPrecedingLinesWithHyphen = (previousLine.isEmpty() || !previousLine.lastFragment().hasHyphen()) ? 0 : numberOfPrecedingLinesWithHyphen + 1;
-    if (style.hyphenLimitLines && numberOfPrecedingLinesWithHyphen >= *style.hyphenLimitLines)
-        line.setHyphenationDisabled();
-    line.setCollapedWhitespaceWidth(style.font.spaceWidth() + style.wordSpacing);
-}
-
-struct SplitFragmentData {
-    unsigned position;
-    float width;
-};
-static Optional<unsigned> hyphenPositionForFragment(SplitFragmentData splitData, const TextFragmentIterator::TextFragment& fragmentToSplit,
-    const LineState& line, const TextFragmentIterator& textFragmentIterator, float availableWidth)
-{
-    auto& style = textFragmentIterator.style();
-    if (!style.shouldHyphenate || line.isHyphenationDisabled())
-        return WTF::nullopt;
-
-    // FIXME: This is a workaround for webkit.org/b/169613. See maxPrefixWidth computation in tryHyphenating().
-    // It does not work properly with non-collapsed leading tabs when font is enlarged.
-    auto adjustedAvailableWidth = availableWidth - style.hyphenStringWidth;
-    if (!line.isEmpty())
-        adjustedAvailableWidth += style.font.spaceWidth();
-    if (!enoughWidthForHyphenation(adjustedAvailableWidth, style.font.pixelSize()))
-        return WTF::nullopt;
-
-    // We might be able to fit the hyphen at the split position.
-    auto splitPositionWithHyphen = splitData.position;
-    // Find a splitting position where hyphen surely fits.
-    unsigned start = fragmentToSplit.start();
-    auto leftSideWidth = splitData.width;
-    while (leftSideWidth + style.hyphenStringWidth > availableWidth) {
-        if (--splitPositionWithHyphen <= start)
-            return WTF::nullopt; // No space for hyphen.
-        leftSideWidth -= textFragmentIterator.textWidth(splitPositionWithHyphen, splitPositionWithHyphen + 1, 0);
-    }
-    ASSERT(splitPositionWithHyphen > start);
-    return textFragmentIterator.lastHyphenPosition(fragmentToSplit, splitPositionWithHyphen + 1);
-}
-
-static SplitFragmentData split(const TextFragmentIterator::TextFragment& fragment, float availableWidth,
-    const TextFragmentIterator& textFragmentIterator)
-{
-    ASSERT(availableWidth >= 0);
-    auto left = fragment.start();
-    // Pathological case of (extremely)long string and narrow lines.
-    // Adjust the range so that we can pick a reasonable midpoint.
-    auto averageCharacterWidth = fragment.width() / fragment.length();
-    auto right = std::min<unsigned>(left + (2 * availableWidth / averageCharacterWidth), fragment.end() - 1);
-    // Preserve the left width for the final split position so that we don't need to remeasure the left side again.
-    float leftSideWidth = 0;
-    while (left < right) {
-        auto middle = (left + right) / 2;
-        auto width = textFragmentIterator.textWidth(fragment.start(), middle + 1, 0);
-        if (width < availableWidth) {
-            left = middle + 1;
-            leftSideWidth = width;
-        } else if (width > availableWidth)
-            right = middle;
-        else {
-            right = middle + 1;
-            leftSideWidth = width;
-            break;
-        }
-    }
-    return { right, leftSideWidth };
-}
-
-static TextFragmentIterator::TextFragment splitFragmentToFitLine(TextFragmentIterator::TextFragment& fragmentToSplit,
-    const LineState& line, const TextFragmentIterator& textFragmentIterator)
-{
-    auto availableWidth = line.availableWidth() - line.width();
-    auto splitFragmentData = split(fragmentToSplit, availableWidth, textFragmentIterator);
-    Optional<unsigned> hyphenPosition = WTF::nullopt;
-    // Does first character fit this line?
-    if (splitFragmentData.position == fragmentToSplit.start()) {
-        // Keep at least one character on empty lines.
-        if (line.isEmpty())
-            splitFragmentData.width = textFragmentIterator.textWidth(fragmentToSplit.start(), ++splitFragmentData.position, 0);
-    } else {
-        hyphenPosition = hyphenPositionForFragment(splitFragmentData, fragmentToSplit, line, textFragmentIterator, availableWidth);
-        if (hyphenPosition) {
-            splitFragmentData.position = *hyphenPosition;
-            splitFragmentData.width = textFragmentIterator.textWidth(fragmentToSplit.start(), splitFragmentData.position, 0);
-        }
-    }
-    // If the right side surely does not fit the (next)line, we don't need the width to be kerning/ligature adjusted.
-    // Part of it gets re-measured as the left side during next split.
-    // This saves measuring long chunk of text repeatedly (see pathological case at ::split).
-    auto rightSideWidth = fragmentToSplit.width() - splitFragmentData.width;
-    if (rightSideWidth < 2 * availableWidth)
-        rightSideWidth = textFragmentIterator.textWidth(splitFragmentData.position, fragmentToSplit.end(), 0);
-    return hyphenPosition ? fragmentToSplit.splitWithHyphen(splitFragmentData.position, textFragmentIterator.style().hyphenStringWidth,
-        splitFragmentData.width, rightSideWidth) : fragmentToSplit.split(splitFragmentData.position, splitFragmentData.width, rightSideWidth);
-}
-
-enum PreWrapLineBreakRule { Preserve, Ignore };
-
-static TextFragmentIterator::TextFragment consumeLineBreakIfNeeded(const TextFragmentIterator::TextFragment& fragment, TextFragmentIterator& textFragmentIterator, LineState& line, Layout::RunVector& runs,
-    PreWrapLineBreakRule preWrapLineBreakRule = PreWrapLineBreakRule::Preserve)
-{
-    if (!fragment.isLineBreak())
-        return fragment;
-
-    bool isHardLinebreak = fragment.type() == TextFragmentIterator::TextFragment::HardLineBreak;
-    // <br> always produces a run. (required by testing output)
-    if (isHardLinebreak)
-        line.appendFragmentAndCreateRunIfNeeded(fragment, runs);
-
-    auto& style = textFragmentIterator.style();
-    if (style.preserveNewline && preWrapLineBreakRule == PreWrapLineBreakRule::Preserve) {
-        if (!isHardLinebreak)
-            return fragment;
-    }
-    return textFragmentIterator.nextTextFragment();
-}
-
-static TextFragmentIterator::TextFragment skipWhitespaceIfNeeded(const TextFragmentIterator::TextFragment& fragment, TextFragmentIterator& textFragmentIterator)
-{
-    if (!textFragmentIterator.style().collapseWhitespace)
-        return fragment;
-
-    TextFragmentIterator::TextFragment firstNonWhitespaceFragment = fragment;
-    while (firstNonWhitespaceFragment.type() == TextFragmentIterator::TextFragment::Whitespace)
-        firstNonWhitespaceFragment = textFragmentIterator.nextTextFragment();
-    return firstNonWhitespaceFragment;
-}
-
-static TextFragmentIterator::TextFragment firstFragment(TextFragmentIterator& textFragmentIterator, LineState& currentLine, const LineState& previousLine, Layout::RunVector& runs)
-{
-    // Handle overflow fragment from previous line.
-    auto overflowedFragment = previousLine.overflowedFragment();
-    if (overflowedFragment.isEmpty())
-        return skipWhitespaceIfNeeded(textFragmentIterator.nextTextFragment(), textFragmentIterator);
-
-    if (overflowedFragment.type() != TextFragmentIterator::TextFragment::Whitespace)
-        return overflowedFragment;
-
-    // Leading whitespace handling.
-    auto& style = textFragmentIterator.style();
-    if (style.breakSpaces) {
-        // Leading whitespace created after breaking the previous line.
-        // Breaking before the first space after a word is only allowed in combination with break-all or break-word.
-        if (style.breakFirstWordOnOverflow || previousLine.hasTrailingWhitespace())
-            return overflowedFragment;
-    }
-    // Special overflow pre-wrap whitespace handling: skip the overflowed whitespace (even when style says not-collapsible)
-    // if we manage to fit at least one character on the previous line.
-    if ((style.collapseWhitespace || style.wrapLines) && previousLine.firstCharacterFits()) {
-        // If skipping the whitespace puts us on a newline, skip the newline too as we already wrapped the line.
-        auto firstFragmentCandidate = consumeLineBreakIfNeeded(textFragmentIterator.nextTextFragment(), textFragmentIterator, currentLine, runs,
-            preWrap(style) ? PreWrapLineBreakRule::Ignore : PreWrapLineBreakRule::Preserve);
-        return skipWhitespaceIfNeeded(firstFragmentCandidate, textFragmentIterator);
-    }
-    return skipWhitespaceIfNeeded(overflowedFragment, textFragmentIterator);
-}
-
-static void forceFragmentToLine(LineState& line, TextFragmentIterator& textFragmentIterator, Layout::RunVector& runs, const TextFragmentIterator::TextFragment& fragment)
-{
-    line.appendFragmentAndCreateRunIfNeeded(fragment, runs);
-    // Check if there are more fragments to add to the current line.
-    auto nextFragment = textFragmentIterator.nextTextFragment();
-    if (fragment.overlapsToNextRenderer()) {
-        while (true) {
-            if (nextFragment.type() != fragment.type())
-                break;
-            line.appendFragmentAndCreateRunIfNeeded(nextFragment, runs);
-            // Does it overlap to the next segment?
-            if (!nextFragment.overlapsToNextRenderer())
-                return;
-            nextFragment = textFragmentIterator.nextTextFragment();
-        }
-    }
-    // When the forced fragment is followed by either whitespace and/or line break, consume them too, otherwise we end up with an extra whitespace and/or line break.
-    nextFragment = skipWhitespaceIfNeeded(nextFragment, textFragmentIterator);
-    nextFragment = consumeLineBreakIfNeeded(nextFragment, textFragmentIterator, line, runs);
-    line.setOverflowedFragment(nextFragment);
-}
-
-static bool createLineRuns(LineState& line, const LineState& previousLine, Layout::RunVector& runs, TextFragmentIterator& textFragmentIterator)
-{
-    const auto& style = textFragmentIterator.style();
-    bool lineCanBeWrapped = style.wrapLines || style.breakFirstWordOnOverflow || style.breakAnyWordOnOverflow;
-    auto fragment = firstFragment(textFragmentIterator, line, previousLine, runs);
-    while (fragment.type() != TextFragmentIterator::TextFragment::ContentEnd) {
-        // Hard and soft linebreaks.
-        if (fragment.isLineBreak()) {
-            // Add the new line fragment only if there's nothing on the line. (otherwise the extra new line character would show up at the end of the content.)
-            if (line.isEmpty() || fragment.type() == TextFragmentIterator::TextFragment::HardLineBreak || preWrap(style) || style.preserveNewline) {
-                if (style.textAlign == TextAlignMode::Right || style.textAlign == TextAlignMode::WebKitRight)
-                    line.removeTrailingWhitespace(runs);
-                line.appendFragmentAndCreateRunIfNeeded(fragment, runs);
-            }
-            break;
-        }
-        if (lineCanBeWrapped && !line.fits(fragment.width())) {
-            // Overflow wrapping behaviour:
-            // 1. Whitesapce collapse on: whitespace is skipped. Jump to next line.
-            // 2. Whitespace collapse off: whitespace is wrapped.
-            // 3. First, non-whitespace fragment is either wrapped or kept on the line. (depends on overflow-wrap)
-            // 5. Non-whitespace fragment when there's already another fragment on the line either gets wrapped (word-break: break-all)
-            // or gets pushed to the next line.
-            bool emptyLine = line.isEmpty();
-            // Whitespace fragment.
-            if (fragment.type() == TextFragmentIterator::TextFragment::Whitespace) {
-                if (style.collapseWhitespace) {
-                    // Push collapased whitespace to the next line.
-                    line.setOverflowedFragment(fragment);
-                    break;
-                }
-                if (style.breakSpaces && line.hasWhitespaceFragments() && fragment.length() == 1) {
-                    // Breaking before the first space after a word is not allowed if there are previous breaking opportunities in the line.
-                    textFragmentIterator.revertToEndOfFragment(line.revertToLastCompleteFragment(runs));
-                    break;
-                }
-                if (preWrap(style)) {
-                    line.appendFragmentAndCreateRunIfNeeded(fragment, runs);
-                    fragment = textFragmentIterator.nextTextFragment(line.width());
-                    if (fragment.isLineBreak())
-                        continue;
-                    line.setOverflowedFragment(fragment);
-                    break;
-                }
-                // Split the whitespace; left part stays on this line, right is pushed to next line.
-                line.setOverflowedFragment(splitFragmentToFitLine(fragment, line, textFragmentIterator));
-                line.appendFragmentAndCreateRunIfNeeded(fragment, runs);
-                break;
-            }
-            // Non-whitespace fragment. (!style.wrapLines: bug138102(preserve existing behavior)
-            if (((emptyLine && style.breakFirstWordOnOverflow) || style.breakAnyWordOnOverflow) || !style.wrapLines) {
-                // Split the fragment; (modified)fragment stays on this line, overflowedFragment is pushed to next line.
-                line.setOverflowedFragment(splitFragmentToFitLine(fragment, line, textFragmentIterator));
-                line.appendFragmentAndCreateRunIfNeeded(fragment, runs);
-                break;
-            }
-            ASSERT(fragment.type() == TextFragmentIterator::TextFragment::NonWhitespace);
-            // Find out if this non-whitespace fragment has a hyphen where we can break.
-            if (style.shouldHyphenate) {
-                auto fragmentToSplit = fragment;
-                // Split and check if we actually ended up with a hyphen.
-                auto overflowFragment = splitFragmentToFitLine(fragmentToSplit, line, textFragmentIterator);
-                if (fragmentToSplit.hasHyphen()) {
-                    line.setOverflowedFragment(overflowFragment);
-                    line.appendFragmentAndCreateRunIfNeeded(fragmentToSplit, runs);
-                    break;
-                }
-                // No hyphen, no split.
-            }
-            // Non-breakable non-whitespace first fragment. Add it to the current line. -it overflows though.
-            if (emptyLine) {
-                forceFragmentToLine(line, textFragmentIterator, runs, fragment);
-                break;
-            }
-            // Non-breakable non-whitespace fragment when there's already content on the line. Push it to the next line.
-            ASSERT(line.lastFragment().isValid());
-            if (line.lastFragment().overlapsToNextRenderer()) {
-                // Check if this fragment is a continuation of a previous segment. In such cases, we need to remove them all.
-                textFragmentIterator.revertToEndOfFragment(line.revertToLastCompleteFragment(runs));
-                break;
-            }
-            line.setOverflowedFragment(fragment);
-            break;
-        }
-        line.appendFragmentAndCreateRunIfNeeded(fragment, runs);
-        // Find the next text fragment.
-        fragment = textFragmentIterator.nextTextFragment(line.width());
-    }
-    return (fragment.type() == TextFragmentIterator::TextFragment::ContentEnd && line.overflowedFragment().isEmpty()) || line.overflowedFragment().type() == TextFragmentIterator::TextFragment::ContentEnd;
-}
-
-static ExpansionBehavior expansionBehavior(bool isAfterExpansion, bool lastRunOnLine)
-{
-    ExpansionBehavior expansionBehavior;
-    expansionBehavior = isAfterExpansion ? ForbidLeftExpansion : AllowLeftExpansion;
-    expansionBehavior |= lastRunOnLine ? ForbidRightExpansion : AllowRightExpansion;
-    return expansionBehavior;
-}
-
-static void justifyRuns(const LineState& line, Layout::RunVector& runs, unsigned firstRunIndex)
-{
-    ASSERT(runs.size());
-    auto widthToDistribute = line.availableWidth() - line.width();
-    if (widthToDistribute <= 0)
-        return;
-
-    auto lastRunIndex = runs.size() - 1;
-    ASSERT(firstRunIndex <= lastRunIndex);
-    Vector<std::pair<unsigned, ExpansionBehavior>> expansionOpportunityList;
-    unsigned expansionOpportunityCountOnThisLine = 0;
-    auto isAfterExpansion = true;
-    for (auto i = firstRunIndex; i <= lastRunIndex; ++i) {
-        const auto& run = runs.at(i);
-        unsigned opportunityCountInRun = 0;
-        std::tie(opportunityCountInRun, isAfterExpansion) = line.expansionOpportunityCount(run.start, run.end);
-        expansionOpportunityList.append(std::make_pair(opportunityCountInRun, expansionBehavior(isAfterExpansion, i == lastRunIndex)));
-        expansionOpportunityCountOnThisLine += opportunityCountInRun;
-    }
-    if (!expansionOpportunityCountOnThisLine)
-        return;
-
-    ASSERT(expansionOpportunityList.size() == lastRunIndex - firstRunIndex + 1);
-    auto expansion = widthToDistribute / expansionOpportunityCountOnThisLine;
-    float accumulatedExpansion = 0;
-    for (auto i = firstRunIndex; i <= lastRunIndex; ++i) {
-        auto& run = runs.at(i);
-        unsigned opportunityCountInRun;
-        std::tie(opportunityCountInRun, run.expansionBehavior) = expansionOpportunityList.at(i - firstRunIndex);
-        run.expansion = opportunityCountInRun * expansion;
-        run.logicalLeft += accumulatedExpansion;
-        run.logicalRight += (accumulatedExpansion + run.expansion);
-        accumulatedExpansion += run.expansion;
-    }
-}
-
-static TextAlignMode textAlignForLine(const TextFragmentIterator::Style& style, bool lastLine)
-{
-    // Fallback to TextAlignMode::Left (START) alignment for non-collapsable content and for the last line before a forced break or the end of the block.
-    auto textAlign = style.textAlign;
-    if (textAlign == TextAlignMode::Justify && (!style.collapseWhitespace || lastLine))
-        textAlign = TextAlignMode::Left;
-    return textAlign;
-}
-
-static void closeLineEndingAndAdjustRuns(LineState& line, Layout::RunVector& runs, Optional<unsigned> lastRunIndexOfPreviousLine, unsigned& lineCount,
-    const TextFragmentIterator& textFragmentIterator, bool lastLineInFlow)
-{
-    if (!runs.size() || (lastRunIndexOfPreviousLine && runs.size() - 1 == lastRunIndexOfPreviousLine.value()))
-        return;
-
-    const auto& style = textFragmentIterator.style();
-
-    if (style.collapseWhitespace)
-        line.removeTrailingWhitespace(runs);
-
-    if (!runs.size())
-        return;
-
-    // Adjust runs' position by taking line's alignment into account.
-    auto firstRunIndex = lastRunIndexOfPreviousLine ? lastRunIndexOfPreviousLine.value() + 1 : 0;
-    auto lineLogicalLeft = line.logicalLeftOffset();
-    auto textAlign = textAlignForLine(style, lastLineInFlow || (line.lastFragment().isValid() && line.lastFragment().type() == TextFragmentIterator::TextFragment::HardLineBreak));
-
-    // https://www.w3.org/TR/css-text-3/#white-space-phase-2
-    bool shouldHangTrailingWhitespace = style.wrapLines && line.trailingWhitespaceWidth();
-    auto hangingWhitespaceWidth = shouldHangTrailingWhitespace ? line.trailingWhitespaceWidth() : 0;
-
-    if (textAlign == TextAlignMode::Justify) {
-        justifyRuns(line, runs, firstRunIndex);
-        hangingWhitespaceWidth = 0;
-    } else
-        lineLogicalLeft = computeLineLeft(line, textAlign, hangingWhitespaceWidth);
-
-    for (auto i = firstRunIndex; i < runs.size(); ++i) {
-        runs[i].logicalLeft += lineLogicalLeft;
-        runs[i].logicalRight += lineLogicalLeft;
-    }
-
-    if (shouldHangTrailingWhitespace && hangingWhitespaceWidth < line.trailingWhitespaceWidth())
-        runs.last().logicalRight = runs.last().logicalRight - (line.trailingWhitespaceWidth() - hangingWhitespaceWidth);
-
-    runs.last().isEndOfLine = true;
-    ++lineCount;
-}
-
-static void createTextRuns(Layout::RunVector& runs, RenderBlockFlow& flow, unsigned& lineCount)
-{
-    LayoutUnit borderAndPaddingBefore = flow.borderAndPaddingBefore();
-    LayoutUnit lineHeight = lineHeightFromFlow(flow);
-    LineState line;
-    unsigned numberOfPrecedingLinesWithHyphen = 0;
-    bool isEndOfContent = false;
-    TextFragmentIterator textFragmentIterator = TextFragmentIterator(flow);
-    Optional<unsigned> lastRunIndexOfPreviousLine;
-    do {
-        flow.setLogicalHeight(lineHeight * lineCount + borderAndPaddingBefore);
-        LineState previousLine = line;
-        line = LineState();
-        updateLineConstrains(flow, line, previousLine, numberOfPrecedingLinesWithHyphen, textFragmentIterator.style(), !lineCount);
-        isEndOfContent = createLineRuns(line, previousLine, runs, textFragmentIterator);
-        closeLineEndingAndAdjustRuns(line, runs, lastRunIndexOfPreviousLine, lineCount, textFragmentIterator, isEndOfContent);
-        if (runs.size())
-            lastRunIndexOfPreviousLine = runs.size() - 1;
-    } while (!isEndOfContent);
-}
-
-Ref<Layout> create(RenderBlockFlow& flow)
-{
-    unsigned lineCount = 0;
-    Layout::RunVector runs;
-    createTextRuns(runs, flow, lineCount);
-    return Layout::create(runs, lineCount, flow);
-}
-
-Ref<Layout> Layout::create(const RunVector& runVector, unsigned lineCount, const RenderBlockFlow& blockFlow)
-{
-    void* slot = WTF::fastMalloc(sizeof(Layout) + sizeof(Run) * runVector.size());
-    return adoptRef(*new (NotNull, slot) Layout(runVector, lineCount, blockFlow));
-}
-
-Layout::Layout(const RunVector& runVector, unsigned lineCount, const RenderBlockFlow& blockFlow)
-    : m_lineCount(lineCount)
-    , m_runCount(runVector.size())
-    , m_blockFlowRenderer(blockFlow)
-{
-    memcpy(m_runs, runVector.data(), m_runCount * sizeof(Run));
-}
-
-const RunResolver& Layout::runResolver() const
-{
-    if (!m_runResolver)
-        m_runResolver = makeUnique<RunResolver>(m_blockFlowRenderer, *this);
-    return *m_runResolver;
-}
-
-Layout::~Layout()
-{
-    simpleLineLayoutWillBeDeleted(*this);
-}
-
-}
-}
diff --git a/Source/WebCore/rendering/SimpleLineLayout.h b/Source/WebCore/rendering/SimpleLineLayout.h
deleted file mode 100644 (file)
index 8d16926..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include "RenderStyleConstants.h"
-#include "SimpleLineLayoutCoverage.h"
-#include "TextFlags.h"
-#include <wtf/RefCounted.h>
-#include <wtf/Vector.h>
-#include <wtf/text/WTFString.h>
-
-#if COMPILER(MSVC)
-#pragma warning(push)
-#pragma warning(disable: 4200) // Disable "zero-sized array in struct/union" warning
-#endif
-
-namespace WebCore {
-
-class RenderBlockFlow;
-
-namespace SimpleLineLayout {
-
-class RunResolver;
-
-bool canUseFor(const RenderBlockFlow&);
-bool canUseForAfterStyleChange(const RenderBlockFlow&, StyleDifference);
-AvoidanceReasonFlags canUseForWithReason(const RenderBlockFlow&, IncludeReasons);
-
-struct Run {
-#if COMPILER(MSVC)
-    Run() { }
-#endif
-    Run(unsigned start, unsigned end, float logicalLeft, float logicalRight, bool isEndOfLine, bool hasHyphen, bool isLineBreak)
-        : end(end)
-        , start(start)
-        , isEndOfLine(isEndOfLine)
-        , hasHyphen(hasHyphen)
-        , isLineBreak(isLineBreak)
-        , logicalLeft(logicalLeft)
-        , logicalRight(logicalRight)
-    { }
-
-    unsigned end;
-    unsigned start : 29;
-    unsigned isEndOfLine : 1;
-    unsigned hasHyphen : 1;
-    unsigned isLineBreak : 1;
-    float logicalLeft;
-    float logicalRight;
-    // TODO: Move these optional items out of SimpleLineLayout::Run to a supplementary structure.
-    float expansion { 0 };
-    ExpansionBehavior expansionBehavior { ForbidLeftExpansion | ForbidRightExpansion };
-};
-
-struct SimpleLineStrut {
-    unsigned lineBreak;
-    float offset;
-};
-
-class Layout : public RefCounted<Layout> {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    using RunVector = Vector<Run, 10>;
-    using SimpleLineStruts = Vector<SimpleLineStrut, 4>;
-    static Ref<Layout> create(const RunVector&, unsigned lineCount, const RenderBlockFlow&);
-
-    ~Layout();
-
-    unsigned lineCount() const { return m_lineCount; }
-
-    unsigned runCount() const { return m_runCount; }
-    const Run& runAt(unsigned i) const { return m_runs[i]; }
-
-    void setIsPaginated() { m_isPaginated = true; }
-    bool isPaginated() const { return m_isPaginated; }
-    bool hasLineStruts() const { return !m_lineStruts.isEmpty(); }
-    void setLineStruts(SimpleLineStruts&& lineStruts) { m_lineStruts = lineStruts; }
-    const SimpleLineStruts& struts() const { return m_lineStruts; }
-    const RunResolver& runResolver() const;
-
-private:
-    Layout(const RunVector&, unsigned lineCount, const RenderBlockFlow&);
-
-    unsigned m_lineCount;
-    unsigned m_runCount;
-    bool m_isPaginated { false };
-    SimpleLineStruts m_lineStruts;
-    const RenderBlockFlow& m_blockFlowRenderer;
-    mutable std::unique_ptr<RunResolver> m_runResolver;
-    Run m_runs[0];
-};
-
-Ref<Layout> create(RenderBlockFlow&);
-
-}
-}
-
-#if COMPILER(MSVC)
-#pragma warning(pop)
-#endif
diff --git a/Source/WebCore/rendering/SimpleLineLayoutCoverage.cpp b/Source/WebCore/rendering/SimpleLineLayoutCoverage.cpp
deleted file mode 100644 (file)
index 5768116..0000000
+++ /dev/null
@@ -1,372 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "SimpleLineLayoutCoverage.h"
-
-#include "Logging.h"
-#include "RenderBlockFlow.h"
-#include "RenderChildIterator.h"
-#include "RenderStyle.h"
-#include "RenderView.h"
-#include "Settings.h"
-#include "SimpleLineLayout.h"
-#include <wtf/text/TextStream.h>
-
-namespace WebCore {
-namespace SimpleLineLayout {
-
-#ifndef NDEBUG
-static void printReason(AvoidanceReason reason, TextStream& stream)
-{
-    switch (reason) {
-    case FlowIsInsideANonMultiColumnThread:
-        stream << "flow is inside a non-multicolumn container";
-        break;
-    case FlowHasHorizonalWritingMode:
-        stream << "horizontal writing mode";
-        break;
-    case FlowHasOutline:
-        stream << "outline";
-        break;
-    case FlowIsRuby:
-        stream << "ruby";
-        break;
-    case FlowHasHangingPunctuation:
-        stream << "hanging punctuation";
-        break;
-    case FlowIsPaginated:
-        stream << "paginated";
-        break;
-    case FlowHasTextOverflow:
-        stream << "text-overflow";
-        break;
-    case FlowIsDepricatedFlexBox:
-        stream << "depricatedFlexBox";
-        break;
-    case FlowParentIsPlaceholderElement:
-        stream << "placeholder element";
-        break;
-    case FlowParentIsTextAreaWithWrapping:
-        stream << "wrapping textarea";
-        break;
-    case FlowHasNonSupportedChild:
-        stream << "nested renderers";
-        break;
-    case FlowHasUnsupportedFloat:
-        stream << "complicated float";
-        break;
-    case FlowHasUnsupportedUnderlineDecoration:
-        stream << "text-underline-position: under";
-        break;
-    case FlowHasJustifiedNonLatinText:
-        stream << "text-align: justify with non-latin text";
-        break;
-    case FlowHasOverflowNotVisible:
-        stream << "overflow: hidden | scroll | auto";
-        break;
-    case FlowHasWebKitNBSPMode:
-        stream << "-webkit-nbsp-mode: space";
-        break;
-    case FlowIsNotLTR:
-        stream << "dir is not LTR";
-        break;
-    case FlowHasLineBoxContainProperty:
-        stream << "line-box-contain value indicates variable line height";
-        break;
-    case FlowIsNotTopToBottom:
-        stream << "non top-to-bottom flow";
-        break;
-    case FlowHasLineBreak:
-        stream << "line-break property";
-        break;
-    case FlowHasNonNormalUnicodeBiDi:
-        stream << "non-normal Unicode bidi";
-        break;
-    case FlowHasRTLOrdering:
-        stream << "-webkit-rtl-ordering";
-        break;
-    case FlowHasLineAlignEdges:
-        stream << "-webkit-line-align edges";
-        break;
-    case FlowHasLineSnap:
-        stream << "-webkit-line-snap property";
-        break;
-    case FlowHasTextEmphasisFillOrMark:
-        stream << "text-emphasis (fill/mark)";
-        break;
-    case FlowHasPseudoFirstLine:
-        stream << "first-line";
-        break;
-    case FlowHasPseudoFirstLetter:
-        stream << "first-letter";
-        break;
-    case FlowHasTextCombine:
-        stream << "text combine";
-        break;
-    case FlowHasTextFillBox:
-        stream << "background-color (text-fill)";
-        break;
-    case FlowHasBorderFitLines:
-        stream << "-webkit-border-fit";
-        break;
-    case FlowHasNonAutoLineBreak:
-        stream << "line-break is not auto";
-        break;
-    case FlowHasTextSecurity:
-        stream << "text-security is not none";
-        break;
-    case FlowHasSVGFont:
-        stream << "SVG font";
-        break;
-    case FlowTextHasSoftHyphen:
-        stream << "soft hyphen character";
-        break;
-    case FlowTextHasDirectionCharacter:
-        stream << "direction character";
-        break;
-    case FlowIsMissingPrimaryFont:
-        stream << "missing primary font";
-        break;
-    case FlowPrimaryFontIsInsufficient:
-        stream << "missing glyph or glyph needs another font";
-        break;
-    case FlowTextIsCombineText:
-        stream << "text is combine";
-        break;
-    case FlowTextIsRenderCounter:
-        stream << "unsupported RenderCounter";
-        break;
-    case FlowTextIsRenderQuote:
-        stream << "unsupported RenderQuote";
-        break;
-    case FlowTextIsTextFragment:
-        stream << "unsupported TextFragment";
-        break;
-    case FlowTextIsSVGInlineText:
-        stream << "unsupported SVGInlineText";
-        break;
-    case FlowHasComplexFontCodePath:
-        stream << "text with complex font codepath";
-        break;
-    case FlowHasTextShadow:
-        stream << "text-shadow";
-        break;
-    case FlowChildIsSelected:
-        stream << "selected content";
-        break;
-    case FlowFontHasOverflowGlyph:
-        stream << "-webkit-line-box-contain: glyphs with overflowing text.";
-        break;
-    case FlowTextHasSurrogatePair:
-        stream << "surrogate pair";
-        break;
-    case MultiColumnFlowIsNotTopLevel:
-        stream << "non top level column";
-        break;
-    case MultiColumnFlowHasColumnSpanner:
-        stream << "column has spanner";
-        break;
-    case MultiColumnFlowVerticalAlign:
-        stream << "column with vertical-align != baseline";
-        break;
-    case MultiColumnFlowIsFloating:
-        stream << "column with floating objects";
-        break;
-    case FlowIncludesDocumentMarkers:
-        stream << "text includes document markers";
-        break;
-    case FlowTextIsEmpty:
-    case FlowHasNoChild:
-    case FlowHasNoParent:
-    case FeatureIsDisabled:
-    default:
-        break;
-    }
-}
-
-static void printReasons(AvoidanceReasonFlags reasons, TextStream& stream)
-{
-    bool first = true;
-    for (auto reasonItem = EndOfReasons >> 1; reasonItem != NoReason; reasonItem >>= 1) {
-        if (!(reasons & reasonItem))
-            continue;
-        stream << (first ? " " : ", ");
-        first = false;
-        printReason(reasonItem, stream);
-    }
-}
-
-static void printTextForSubtree(const RenderObject& renderer, unsigned& charactersLeft, TextStream& stream)
-{
-    if (!charactersLeft)
-        return;
-    if (is<RenderText>(renderer)) {
-        String text = downcast<RenderText>(renderer).text();
-        text = text.stripWhiteSpace();
-        unsigned len = std::min(charactersLeft, text.length());
-        stream << text.left(len);
-        charactersLeft -= len;
-        return;
-    }
-    if (!is<RenderElement>(renderer))
-        return;
-    for (const auto* child = downcast<RenderElement>(renderer).firstChild(); child; child = child->nextSibling())
-        printTextForSubtree(*child, charactersLeft, stream);
-}
-
-static unsigned textLengthForSubtree(const RenderObject& renderer)
-{
-    if (is<RenderText>(renderer))
-        return downcast<RenderText>(renderer).text().length();
-    if (!is<RenderElement>(renderer))
-        return 0;
-    unsigned textLength = 0;
-    for (const auto* child = downcast<RenderElement>(renderer).firstChild(); child; child = child->nextSibling())
-        textLength += textLengthForSubtree(*child);
-    return textLength;
-}
-
-static void collectNonEmptyLeafRenderBlockFlows(const RenderObject& renderer, HashSet<const RenderBlockFlow*>& leafRenderers)
-{
-    if (is<RenderText>(renderer)) {
-        if (!downcast<RenderText>(renderer).text().length())
-            return;
-        // Find RenderBlockFlow ancestor.
-        for (const auto* current = renderer.parent(); current; current = current->parent()) {
-            if (!is<RenderBlockFlow>(current))
-                continue;
-            leafRenderers.add(downcast<RenderBlockFlow>(current));
-            break;
-        }
-        return;
-    }
-    if (!is<RenderElement>(renderer))
-        return;
-    for (const auto* child = downcast<RenderElement>(renderer).firstChild(); child; child = child->nextSibling())
-        collectNonEmptyLeafRenderBlockFlows(*child, leafRenderers);
-}
-
-static void collectNonEmptyLeafRenderBlockFlowsForCurrentPage(HashSet<const RenderBlockFlow*>& leafRenderers)
-{
-    for (const auto* document : Document::allDocuments()) {
-        if (!document->renderView() || document->backForwardCacheState() != Document::NotInBackForwardCache)
-            continue;
-        if (!document->isHTMLDocument() && !document->isXHTMLDocument())
-            continue;
-        collectNonEmptyLeafRenderBlockFlows(*document->renderView(), leafRenderers);
-    }
-}
-
-void toggleSimpleLineLayout()
-{
-    for (auto* document : Document::allDocuments()) {
-        auto& settings = document->mutableSettings();
-        settings.setSimpleLineLayoutEnabled(!settings.simpleLineLayoutEnabled());
-    }
-}
-
-void printSimpleLineLayoutBlockList()
-{
-    HashSet<const RenderBlockFlow*> leafRenderers;
-    collectNonEmptyLeafRenderBlockFlowsForCurrentPage(leafRenderers);
-    if (!leafRenderers.size()) {
-        WTFLogAlways("No text found in this document\n");
-        return;
-    }
-    TextStream stream;
-    stream << "---------------------------------------------------\n";
-    for (const auto* flow : leafRenderers) {
-        auto reason = canUseForWithReason(*flow, IncludeReasons::All);
-        if (reason == NoReason)
-            continue;
-        unsigned printedLength = 30;
-        stream << "\"";
-        printTextForSubtree(*flow, printedLength, stream);
-        for (;printedLength > 0; --printedLength)
-            stream << " ";
-        stream << "\"(" << textLengthForSubtree(*flow) << "):";
-        printReasons(reason, stream);
-        stream << "\n";
-    }
-    stream << "---------------------------------------------------\n";
-    WTFLogAlways("%s", stream.release().utf8().data());
-}
-
-void printSimpleLineLayoutCoverage()
-{
-    HashSet<const RenderBlockFlow*> leafRenderers;
-    collectNonEmptyLeafRenderBlockFlowsForCurrentPage(leafRenderers);
-    if (!leafRenderers.size()) {
-        WTFLogAlways("No text found in this document\n");
-        return;
-    }
-    TextStream stream;
-    HashMap<AvoidanceReason, unsigned> flowStatistics;
-    unsigned textLength = 0;
-    unsigned unsupportedTextLength = 0;
-    unsigned numberOfUnsupportedLeafBlocks = 0;
-    unsigned supportedButForcedToLineLayoutTextLength = 0;
-    unsigned numberOfSupportedButForcedToLineLayoutLeafBlocks = 0;
-    for (const auto* flow : leafRenderers) {
-        auto flowLength = textLengthForSubtree(*flow);
-        textLength += flowLength;
-        auto reasons = canUseForWithReason(*flow, IncludeReasons::All);
-        if (reasons == NoReason) {
-            if (flow->lineLayoutPath() == RenderBlockFlow::ForceLineBoxesPath) {
-                supportedButForcedToLineLayoutTextLength += flowLength;
-                ++numberOfSupportedButForcedToLineLayoutLeafBlocks;
-            }
-            continue;
-        }
-        ++numberOfUnsupportedLeafBlocks;
-        unsupportedTextLength += flowLength;
-        for (auto reasonItem = EndOfReasons >> 1; reasonItem != NoReason; reasonItem >>= 1) {
-            if (!(reasons & reasonItem))
-                continue;
-            auto result = flowStatistics.add(reasonItem, flowLength);
-            if (!result.isNewEntry)
-                result.iterator->value += flowLength;
-        }
-    }
-    stream << "---------------------------------------------------\n";
-    stream << "Number of blocks: total(" <<  leafRenderers.size() << ") non-simple(" << numberOfUnsupportedLeafBlocks << ")\nContent length: total(" <<
-        textLength << ") non-simple(" << unsupportedTextLength << ")\n";
-    for (const auto& reasonEntry : flowStatistics) {
-        printReason(reasonEntry.key, stream);
-        stream << ": " << (float)reasonEntry.value / (float)textLength * 100 << "%\n";
-    }
-    if (supportedButForcedToLineLayoutTextLength) {
-        stream << "Simple line layout potential coverage: " << (float)(textLength - unsupportedTextLength) / (float)textLength * 100 << "%\n\n";
-        stream << "Simple line layout actual coverage: " << (float)(textLength - unsupportedTextLength - supportedButForcedToLineLayoutTextLength) / (float)textLength * 100 << "%\nForced line layout blocks: " << numberOfSupportedButForcedToLineLayoutLeafBlocks << " content length: " << supportedButForcedToLineLayoutTextLength << "(" << (float)supportedButForcedToLineLayoutTextLength / (float)textLength * 100 << "%)";
-    } else
-        stream << "Simple line layout coverage: " << (float)(textLength - unsupportedTextLength) / (float)textLength * 100 << "%";
-    stream << "\n---------------------------------------------------\n";
-    WTFLogAlways("%s", stream.release().utf8().data());
-}
-#endif
-
-}
-}
diff --git a/Source/WebCore/rendering/SimpleLineLayoutCoverage.h b/Source/WebCore/rendering/SimpleLineLayoutCoverage.h
deleted file mode 100644 (file)
index 3824e95..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-namespace WebCore {
-namespace SimpleLineLayout {
-
-#ifndef NDEBUG
-void printSimpleLineLayoutCoverage();
-void printSimpleLineLayoutBlockList();
-void toggleSimpleLineLayout();
-#endif
-
-enum AvoidanceReason_ : uint64_t {
-    FlowIsInsideANonMultiColumnThread     = 1LLU  << 0,
-    FlowHasHorizonalWritingMode           = 1LLU  << 1,
-    FlowHasOutline                        = 1LLU  << 2,
-    FlowIsRuby                            = 1LLU  << 3,
-    FlowIsPaginated                       = 1LLU  << 4,
-    FlowHasTextOverflow                   = 1LLU  << 5,
-    FlowIsDepricatedFlexBox               = 1LLU  << 6,
-    FlowParentIsPlaceholderElement        = 1LLU  << 7,
-    FlowParentIsTextAreaWithWrapping      = 1LLU  << 8,
-    FlowHasNonSupportedChild              = 1LLU  << 9,
-    FlowHasUnsupportedFloat               = 1LLU  << 10,
-    FlowHasUnsupportedUnderlineDecoration = 1LLU  << 11,
-    FlowHasJustifiedNonLatinText          = 1LLU  << 12,
-    FlowHasOverflowNotVisible             = 1LLU  << 13,
-    FlowHasWebKitNBSPMode                 = 1LLU  << 14,
-    FlowIsNotLTR                          = 1LLU  << 15,
-    FlowHasLineBoxContainProperty         = 1LLU  << 16,
-    FlowIsNotTopToBottom                  = 1LLU  << 17,
-    FlowHasLineBreak                      = 1LLU  << 18,
-    FlowHasNonNormalUnicodeBiDi           = 1LLU  << 19,
-    FlowHasRTLOrdering                    = 1LLU  << 20,
-    FlowHasLineAlignEdges                 = 1LLU  << 21,
-    FlowHasLineSnap                       = 1LLU  << 22,
-    FlowHasTextEmphasisFillOrMark         = 1LLU  << 23,
-    FlowHasTextShadow                     = 1LLU  << 24,
-    FlowHasPseudoFirstLine                = 1LLU  << 25,
-    FlowHasPseudoFirstLetter              = 1LLU  << 26,
-    FlowHasTextCombine                    = 1LLU  << 27,
-    FlowHasTextFillBox                    = 1LLU  << 28,
-    FlowHasBorderFitLines                 = 1LLU  << 29,
-    FlowHasNonAutoLineBreak               = 1LLU  << 30,
-    FlowHasTextSecurity                   = 1LLU  << 31,
-    FlowHasSVGFont                        = 1LLU  << 32,
-    FlowTextIsEmpty                       = 1LLU  << 33,
-    FlowTextHasSoftHyphen                 = 1LLU  << 34,
-    FlowTextHasDirectionCharacter         = 1LLU  << 35,
-    FlowIsMissingPrimaryFont              = 1LLU  << 36,
-    FlowPrimaryFontIsInsufficient         = 1LLU  << 37,
-    FlowTextIsCombineText                 = 1LLU  << 38,
-    FlowTextIsRenderCounter               = 1LLU  << 39,
-    FlowTextIsRenderQuote                 = 1LLU  << 40,
-    FlowTextIsTextFragment                = 1LLU  << 41,
-    FlowTextIsSVGInlineText               = 1LLU  << 42,
-    FlowHasComplexFontCodePath            = 1LLU  << 43,
-    FeatureIsDisabled                     = 1LLU  << 44,
-    FlowHasNoParent                       = 1LLU  << 45,
-    FlowHasNoChild                        = 1LLU  << 46,
-    FlowChildIsSelected                   = 1LLU  << 47,
-    FlowHasHangingPunctuation             = 1LLU  << 48,
-    FlowFontHasOverflowGlyph              = 1LLU  << 49,
-    FlowTextHasSurrogatePair              = 1LLU  << 50,
-    MultiColumnFlowIsNotTopLevel          = 1LLU  << 51,
-    MultiColumnFlowHasColumnSpanner       = 1LLU  << 52,
-    MultiColumnFlowVerticalAlign          = 1LLU  << 53,
-    MultiColumnFlowIsFloating             = 1LLU  << 54,
-    FlowIncludesDocumentMarkers           = 1LLU  << 55,
-    EndOfReasons                          = 1LLU  << 56
-};
-const unsigned NoReason = 0;
-
-typedef uint64_t AvoidanceReason;
-typedef uint64_t AvoidanceReasonFlags;
-
-enum class IncludeReasons { First , All };
-
-}
-}
diff --git a/Source/WebCore/rendering/SimpleLineLayoutFlowContents.cpp b/Source/WebCore/rendering/SimpleLineLayoutFlowContents.cpp
deleted file mode 100644 (file)
index 29b36a0..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "SimpleLineLayoutFlowContents.h"
-
-#include "RenderBlockFlow.h"
-#include "RenderChildIterator.h"
-#include "RenderLineBreak.h"
-#include "RenderText.h"
-
-namespace WebCore {
-namespace SimpleLineLayout {
-
-static Vector<FlowContents::Segment> initializeSegments(const RenderBlockFlow& flow)
-{
-    unsigned numberOfChildren = 0;
-    auto children = childrenOfType<RenderObject>(flow);
-    for (auto it = children.begin(), end = children.end(); it != end; ++it)
-        ++numberOfChildren;
-    Vector<FlowContents::Segment> segments;
-    segments.reserveCapacity(numberOfChildren);
-    unsigned startPosition = 0;
-    for (auto& child : childrenOfType<RenderObject>(flow)) {
-        if (is<RenderText>(child)) {
-            auto& textChild = downcast<RenderText>(child);
-            unsigned textLength = textChild.text().length();
-            segments.append(FlowContents::Segment { startPosition, startPosition + textLength, textChild.text(),
-                textChild, textChild.canUseSimplifiedTextMeasuring() });
-            startPosition += textLength;
-            continue;
-        }
-        if (is<RenderLineBreak>(child)) {
-            segments.append(FlowContents::Segment { startPosition, startPosition, String(), child, true });
-            continue;
-        }
-        ASSERT_NOT_REACHED();
-    }
-    return segments;
-}
-
-FlowContents::FlowContents(const RenderBlockFlow& flow)
-    : m_segments(initializeSegments(flow))
-{
-}
-
-unsigned FlowContents::segmentIndexForRunSlow(unsigned start, unsigned end) const
-{
-    auto isEmptyRange = start == end;
-    auto it = std::lower_bound(m_segments.begin(), m_segments.end(), start, [isEmptyRange](const Segment& segment, unsigned start) {
-        // FIXME: This always find the first empty run (.vs subsequent <br> elements)
-        return (isEmptyRange && segment.start == segment.end) ? segment.start < start : segment.end <= start;
-    });
-    ASSERT(it != m_segments.end());
-    ASSERT(end <= it->end);
-    m_lastSegmentIndex = it - m_segments.begin();
-    return m_lastSegmentIndex;
-}
-
-}
-}
diff --git a/Source/WebCore/rendering/SimpleLineLayoutFlowContents.h b/Source/WebCore/rendering/SimpleLineLayoutFlowContents.h
deleted file mode 100644 (file)
index de63f68..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include "RenderObject.h"
-
-namespace WebCore {
-class RenderBlockFlow;
-
-namespace SimpleLineLayout {
-
-class FlowContents {
-public:
-    FlowContents(const RenderBlockFlow&);
-
-    struct Segment {
-        unsigned toSegmentPosition(unsigned position) const
-        {
-            ASSERT(position >= start);
-            return position - start;
-        }
-        unsigned toRenderPosition(unsigned position) const { return start + position; }
-        unsigned start;
-        unsigned end;
-        StringView text;
-        const RenderObject& renderer;
-        bool canUseSimplifiedTextMeasuring;
-    };
-    const Segment& segmentForRun(unsigned start, unsigned end) const;
-    const Segment& segmentForPosition(unsigned) const;
-
-    typedef Vector<Segment, 8>::const_iterator Iterator;
-    Iterator begin() const { return m_segments.begin(); }
-    Iterator end() const { return m_segments.end(); }
-
-private:
-    unsigned segmentIndexForRunSlow(unsigned start, unsigned end) const;
-    const Vector<Segment> m_segments;
-    mutable unsigned m_lastSegmentIndex { 0 };
-};
-
-inline const FlowContents::Segment& FlowContents::segmentForRun(unsigned start, unsigned end) const
-{
-    ASSERT(start <= end);
-    auto isEmptyRange = start == end;
-    auto& lastSegment = m_segments[m_lastSegmentIndex];
-    if ((lastSegment.start <= start && end <= lastSegment.end) && (!isEmptyRange || end != lastSegment.end))
-        return m_segments[m_lastSegmentIndex];
-    return m_segments[segmentIndexForRunSlow(start, end)];
-}
-
-inline const FlowContents::Segment& FlowContents::segmentForPosition(unsigned position) const
-{
-    auto it = std::lower_bound(m_segments.begin(), m_segments.end(), position, [](const Segment& segment, unsigned position) {
-        return segment.end <= position;
-    });
-    ASSERT(it != m_segments.end());
-    return m_segments[it - m_segments.begin()];
-}
-
-}
-}
diff --git a/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp b/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp
deleted file mode 100644 (file)
index 16cc0b6..0000000
+++ /dev/null
@@ -1,375 +0,0 @@
-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "SimpleLineLayoutFunctions.h"
-
-#include "BidiRun.h"
-#include "BidiRunList.h"
-#include "EventRegion.h"
-#include "FontCache.h"
-#include "Frame.h"
-#include "GraphicsContext.h"
-#include "HitTestLocation.h"
-#include "HitTestRequest.h"
-#include "HitTestResult.h"
-#include "InlineTextBox.h"
-#include "LineInfo.h"
-#include "PaintInfo.h"
-#include "RenderBlockFlow.h"
-#include "RenderChildIterator.h"
-#include "RenderIterator.h"
-#include "RenderStyle.h"
-#include "RenderText.h"
-#include "RenderView.h"
-#include "Settings.h"
-#include "SimpleLineLayoutFlowContents.h"
-#include "SimpleLineLayoutResolver.h"
-#include "Text.h"
-#include "TextDecorationPainter.h"
-#include "TextPaintStyle.h"
-#include "TextPainter.h"
-#include <wtf/text/TextStream.h>
-
-#if ENABLE(TREE_DEBUGGING)
-#include <stdio.h>
-#endif
-
-namespace WebCore {
-namespace SimpleLineLayout {
-
-FloatRect computeOverflow(const RenderBlockFlow& flow, const FloatRect& layoutRect)
-{
-    auto overflowRect = layoutRect;
-    auto viewportSize = flow.frame().view() ? flow.frame().view()->size() : IntSize();
-    auto strokeOverflow = std::ceil(flow.style().computedStrokeWidth(viewportSize));
-    overflowRect.inflate(strokeOverflow);
-
-    auto letterSpacing = flow.style().fontCascade().letterSpacing();
-    if (letterSpacing >= 0)
-        return overflowRect;
-    // Last letter's negative spacing shrinks layout rect. Push it to visual overflow.
-    overflowRect.expand(-letterSpacing, 0);
-    return overflowRect;
-}
-
-void paintFlow(const RenderBlockFlow& flow, const Layout& layout, PaintInfo& paintInfo, const LayoutPoint& paintOffset)
-{
-    if (paintInfo.phase == PaintPhase::EventRegion) {
-        if (!flow.visibleToHitTesting())
-            return;
-        auto paintRect = paintInfo.rect;
-        paintRect.moveBy(-paintOffset);
-        for (auto run : layout.runResolver().rangeForRect(paintRect)) {
-            FloatRect visualOverflowRect = computeOverflow(flow, run.rect());
-            paintInfo.eventRegionContext->unite(enclosingIntRect(visualOverflowRect), flow.style());
-        }
-        return;
-    }
-
-    if (paintInfo.phase != PaintPhase::Foreground)
-        return;
-
-    auto& style = flow.style();
-    if (style.visibility() != Visibility::Visible)
-        return;
-
-    TextPainter textPainter(paintInfo.context());
-    textPainter.setFont(style.fontCascade());
-    textPainter.setStyle(computeTextPaintStyle(flow.frame(), style, paintInfo));
-
-    std::unique_ptr<ShadowData> debugShadow = nullptr;
-    if (flow.settings().simpleLineLayoutDebugBordersEnabled()) {
-        debugShadow = makeUnique<ShadowData>(IntPoint(0, 0), 10, 20, ShadowStyle::Normal, true, Color::green.colorWithAlphaByte(200));
-        textPainter.setShadow(debugShadow.get());
-    }
-
-    Optional<TextDecorationPainter> textDecorationPainter;
-    if (!style.textDecorationsInEffect().isEmpty()) {
-        const RenderText* textRenderer = childrenOfType<RenderText>(flow).first();
-        if (textRenderer) {
-            textDecorationPainter.emplace(paintInfo.context(), style.textDecorationsInEffect(), *textRenderer, false, style.fontCascade());
-        }
-    }
-
-    LayoutRect paintRect = paintInfo.rect;
-    paintRect.moveBy(-paintOffset);
-
-    auto& resolver = layout.runResolver();
-    float deviceScaleFactor = flow.document().deviceScaleFactor();
-    for (auto run : resolver.rangeForRect(paintRect)) {
-        if (run.start() == run.end())
-            continue;
-
-        FloatRect rect = run.rect();
-        FloatRect visualOverflowRect = computeOverflow(flow, rect);
-        if (paintRect.y() > visualOverflowRect.maxY() || paintRect.maxY() < visualOverflowRect.y())
-            continue;
-
-        String textWithHyphen;
-        if (run.hasHyphen())
-            textWithHyphen = run.textWithHyphen();
-        // xPos is relative to the line box's logical left.
-        // We don't have any line geometry here in SLL, so let's get the first run's logical left in the current line and use it as the line's logical left.
-        auto lineLogicalLeft = (*resolver.rangeForLine(run.lineIndex()).begin()).logicalLeft();
-        TextRun textRun { run.hasHyphen() ? textWithHyphen : run.text(), run.logicalLeft() - lineLogicalLeft, run.expansion(), run.expansionBehavior() };
-        textRun.setTabSize(!style.collapseWhiteSpace(), style.tabSize());
-        FloatPoint textOrigin { rect.x() + paintOffset.x(), roundToDevicePixel(run.baselinePosition() + paintOffset.y(), deviceScaleFactor) };
-
-        textPainter.setGlyphDisplayListIfNeeded(run.simpleRun(), paintInfo, style.fontCascade(), paintInfo.context(), textRun);
-        textPainter.paint(textRun, rect, textOrigin);
-        if (textDecorationPainter) {
-            textDecorationPainter->setWidth(rect.width());
-            textDecorationPainter->paintTextDecoration(textRun, textOrigin, rect.location() + paintOffset);
-        }
-    }
-}
-
-bool hitTestFlow(const RenderBlockFlow& flow, const Layout& layout, const HitTestRequest& request, HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction hitTestAction)
-{
-    if (hitTestAction != HitTestForeground)
-        return false;
-
-    if (!layout.runCount())
-        return false;
-
-    auto& style = flow.style();
-    if (style.visibility() != Visibility::Visible || style.pointerEvents() == PointerEvents::None)
-        return false;
-
-    LayoutRect rangeRect = locationInContainer.boundingBox();
-    rangeRect.moveBy(-accumulatedOffset);
-    auto resolver = lineResolver(layout.runResolver());
-    auto range = resolver.rangeForRect(rangeRect);
-    for (auto it = range.begin(), end = range.end(); it != end; ++it) {
-        auto lineRect = *it;
-        lineRect.moveBy(accumulatedOffset);
-        auto& renderer = const_cast<RenderObject&>(it.renderer());
-        if (!locationInContainer.intersects(lineRect))
-            continue;
-        renderer.updateHitTestResult(result, locationInContainer.point() - toLayoutSize(accumulatedOffset));
-        if (result.addNodeToListBasedTestResult(renderer.nodeForHitTest(), request, locationInContainer, lineRect) == HitTestProgress::Stop)
-            return true;
-    }
-    return false;
-}
-
-void collectFlowOverflow(RenderBlockFlow& flow, const Layout& layout)
-{
-    for (auto lineRect : lineResolver(layout.runResolver())) {
-        LayoutRect visualOverflowRect = LayoutRect(computeOverflow(flow, lineRect));
-        flow.addLayoutOverflow(LayoutRect(lineRect));
-        flow.addVisualOverflow(visualOverflowRect);
-    }
-}
-
-unsigned textOffsetForPoint(const LayoutPoint& point, const RenderText& renderer, const Layout& layout)
-{
-    auto& flow = downcast<RenderBlockFlow>(*renderer.parent());
-    ASSERT(flow.firstChild() == flow.lastChild());
-    auto& resolver = layout.runResolver();
-    auto it = resolver.runForPoint(point);
-    if (it == resolver.end())
-        return renderer.text().length();
-    auto run = *it;
-    auto& style = flow.style();
-    TextRun textRun(run.text(), run.logicalLeft(), run.expansion(), run.expansionBehavior());
-    textRun.setTabSize(!style.collapseWhiteSpace(), style.tabSize());
-    return run.start() + style.fontCascade().offsetForPosition(textRun, point.x() - run.logicalLeft(), true);
-}
-
-Vector<FloatQuad> collectAbsoluteQuadsForRange(const RenderObject& renderer, unsigned start, unsigned end, const Layout& layout, bool ignoreEmptyTextSelections, bool* wasFixed)
-{
-    auto& style = downcast<RenderBlockFlow>(*renderer.parent()).style();
-    Vector<FloatQuad> quads;
-    auto& resolver = layout.runResolver();
-    for (auto run : resolver.rangeForRendererWithOffsets(renderer, start, end)) {
-        if (ignoreEmptyTextSelections && run.start() == run.end())
-            continue;
-        // This run is fully contained.
-        if (start <= run.start() && end >= run.end()) {
-            quads.append(renderer.localToAbsoluteQuad(FloatQuad(run.rect()), UseTransforms, wasFixed));
-            continue;
-        }
-        // Partially contained run.
-        TextRun textRun(run.text(), run.logicalLeft(), run.expansion(), run.expansionBehavior());
-        textRun.setTabSize(!style.collapseWhiteSpace(), style.tabSize());
-        LayoutRect runRect(run.rect());
-        // Special case empty ranges.
-        if (start == end) {
-            runRect.setWidth(0);
-            quads.append(renderer.localToAbsoluteQuad(FloatQuad(runRect), UseTransforms, wasFixed));
-            continue;
-        }
-        auto localStart = std::max(run.start(), start) - run.start();
-        auto localEnd = std::min(run.end(), end) - run.start();
-        ASSERT(localStart <= localEnd);
-        style.fontCascade().adjustSelectionRectForText(textRun, runRect, localStart, localEnd);
-        runRect = snappedSelectionRect(runRect, run.logicalRight(), runRect.y(), runRect.height(), true /* isHorizontal */);
-        quads.append(renderer.localToAbsoluteQuad(FloatQuad(runRect), UseTransforms, wasFixed));
-    }
-    return quads;
-}
-
-void simpleLineLayoutWillBeDeleted(const Layout& layout)
-{
-    for (unsigned i = 0; i < layout.runCount(); ++i)
-        TextPainter::removeGlyphDisplayList(layout.runAt(i));
-}
-
-bool canUseForLineBoxTree(RenderBlockFlow& flow, const Layout& layout)
-{
-    // Line breaking requires some context that SLL can't provide at the moment (see RootInlineBox::setLineBreakInfo).
-    if (layout.lineCount() > 1)
-        return false;
-
-    if (layout.isPaginated())
-        return false;
-    
-    if (flow.style().preserveNewline())
-        return false;
-    
-    if (!flow.firstChild())
-        return false;
-    
-    for (auto& child : childrenOfType<RenderObject>(flow)) {
-        if (!is<RenderText>(child))
-            return false;
-        // Simple line layout iterator can't handle renderers with zero length properly.
-        if (!downcast<RenderText>(child).length())
-            return false;
-    }
-    return true;
-}
-
-static void initializeInlineTextBox(RenderBlockFlow& flow, InlineTextBox& inlineTextBox, const RunResolver::Run& run)
-{
-    inlineTextBox.setLogicalLeft(run.logicalLeft());
-    inlineTextBox.setLogicalTop(run.rect().y());
-    inlineTextBox.setLogicalWidth(run.logicalRight() - run.logicalLeft());
-    auto overflowRect = computeOverflow(const_cast<RenderBlockFlow&>(flow), run.rect());
-    if (overflowRect != run.rect())
-        inlineTextBox.setLogicalOverflowRect(LayoutRect(overflowRect));
-
-    inlineTextBox.setHasHyphen(run.hasHyphen());
-    inlineTextBox.setExpansionWithoutGrowing(run.expansion());
-
-    auto expansionBehavior = run.expansionBehavior();
-    inlineTextBox.setCanHaveLeftExpansion(expansionBehavior & AllowLeftExpansion);
-    inlineTextBox.setCanHaveRightExpansion(expansionBehavior & AllowRightExpansion);
-    if (expansionBehavior & ForceRightExpansion)
-        inlineTextBox.setForceRightExpansion();
-    if (expansionBehavior & ForceLeftExpansion)
-        inlineTextBox.setForceLeftExpansion();
-}
-
-void generateLineBoxTree(RenderBlockFlow& flow, const Layout& layout)
-{
-    ASSERT(!flow.complexLineLayout()->lineBoxes().firstLineBox());
-    if (!layout.runCount())
-        return;
-
-    Ref<BidiContext> bidiContext = BidiContext::create(0, U_LEFT_TO_RIGHT);
-    auto& resolver = layout.runResolver();
-    unsigned lineIndex = 0;
-    while (true) {
-        auto range = resolver.rangeForLine(lineIndex++);
-        if (range.begin() == range.end())
-            break;
-
-        // Generate bidi runs out of simple line layout runs.
-        BidiRunList<BidiRun> bidiRuns;
-        for (auto it = range.begin(); it != range.end(); ++it) {
-            auto run = *it;
-            bidiRuns.appendRun(makeUnique<BidiRun>(run.localStart(), run.localEnd(), const_cast<RenderObject&>(run.renderer()), bidiContext.ptr(), U_LEFT_TO_RIGHT));
-        }
-
-        LineInfo lineInfo;
-        lineInfo.setFirstLine(!flow.complexLineLayout()->lineBoxes().firstLineBox());
-        // FIXME: This is needed for flow boxes -but we don't have them yet.
-        // lineInfo.setLastLine(lastLine);
-        lineInfo.setEmpty(!bidiRuns.runCount());
-        bidiRuns.setLogicallyLastRun(bidiRuns.lastRun());
-        auto* root = flow.complexLineLayout()->constructLine(bidiRuns, lineInfo);
-        bidiRuns.clear();
-        if (!root)
-            continue;
-
-        auto& rootLineBox = *root;
-        auto it = range.begin();
-        float lineWidth = 0;
-        // Set the geometry for the inlineboxes.
-        for (auto* inlineBox = rootLineBox.firstChild(); inlineBox && it != range.end(); inlineBox = inlineBox->nextOnLine(), ++it) {
-            auto run = *it;
-            initializeInlineTextBox(flow, downcast<InlineTextBox>(*inlineBox), run);
-            lineWidth += inlineBox->logicalWidth();
-        }
-
-        // Finish setting up the rootline.
-        auto iter = range.begin();
-        auto firstRun = *iter;
-        rootLineBox.setLogicalLeft(firstRun.logicalLeft());
-        rootLineBox.setLogicalWidth(lineWidth);
-        auto lineTop = firstRun.rect().y();
-        auto lineHeight = firstRun.rect().height();
-        rootLineBox.setLogicalTop(lineTop);
-        rootLineBox.setLineTopBottomPositions(LayoutUnit(lineTop), LayoutUnit(lineTop + lineHeight), LayoutUnit(lineTop), LayoutUnit(lineTop + lineHeight));
-    }
-}
-
-#if ENABLE(TREE_DEBUGGING)
-static void printPrefix(TextStream& stream, int& printedCharacters, int depth)
-{
-    stream << "-------- --";
-    printedCharacters = 0;
-    while (++printedCharacters <= depth * 2)
-        stream << " ";
-}
-
-void outputLineLayoutForFlow(TextStream& stream, const RenderBlockFlow&, const Layout& layout, int depth)
-{
-    int printedCharacters = 0;
-    printPrefix(stream, printedCharacters, depth);
-
-    stream << "SimpleLineLayout (" << layout.lineCount() << " lines, " << layout.runCount() << " runs) (" << &layout << ")";
-    stream.nextLine();
-    ++depth;
-
-    for (auto run : layout.runResolver()) {
-        FloatRect rect = run.rect();
-        printPrefix(stream, printedCharacters, depth);
-        if (run.start() < run.end()) {
-            stream << "line " << run.lineIndex() << " run(" << run.start() << ", " << run.end() << ") " << rect << " \"" << run.text().toStringWithoutCopying().utf8().data() << "\"";
-        } else {
-            ASSERT(run.start() == run.end());
-            stream << "line break " << run.lineIndex() << " run(" << run.start() << ", " << run.end() << ") " << rect;
-        }
-    }
-    stream.nextLine();
-}
-#endif
-
-}
-}
diff --git a/Source/WebCore/rendering/SimpleLineLayoutFunctions.h b/Source/WebCore/rendering/SimpleLineLayoutFunctions.h
deleted file mode 100644 (file)
index 98c7d4c..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include "RenderBlockFlow.h"
-#include "RenderText.h"
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-
-class HitTestLocation;
-class HitTestRequest;
-class HitTestResult;
-class RenderBlockFlow;
-struct PaintInfo;
-
-namespace SimpleLineLayout {
-class FlowContents;
-
-LayoutUnit computeFlowHeight(const RenderBlockFlow&, const Layout&);
-LayoutUnit computeFlowFirstLineBaseline(const RenderBlockFlow&, const Layout&);
-LayoutUnit computeFlowLastLineBaseline(const RenderBlockFlow&, const Layout&);
-FloatRect computeOverflow(const RenderBlockFlow&, const FloatRect&);
-
-void paintFlow(const RenderBlockFlow&, const Layout&, PaintInfo&, const LayoutPoint& paintOffset);
-bool hitTestFlow(const RenderBlockFlow&, const Layout&, const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction);
-void collectFlowOverflow(RenderBlockFlow&, const Layout&);
-
-unsigned textOffsetForPoint(const LayoutPoint&, const RenderText&, const Layout&);
-Vector<FloatQuad> collectAbsoluteQuadsForRange(const RenderObject&, unsigned start, unsigned end, const Layout&, bool ignoreEmptyTextSelections, bool* wasFixed);
-
-LayoutUnit lineHeightFromFlow(const RenderBlockFlow&);
-LayoutUnit baselineFromFlow(const RenderBlockFlow&);
-
-bool canUseForLineBoxTree(RenderBlockFlow&, const Layout&);
-void generateLineBoxTree(RenderBlockFlow&, const Layout&);
-
-void simpleLineLayoutWillBeDeleted(const Layout&);
-
-#if ENABLE(TREE_DEBUGGING)
-void outputLineLayoutForFlow(WTF::TextStream&, const RenderBlockFlow&, const Layout&, int depth);
-#endif
-
-}
-
-namespace SimpleLineLayout {
-
-inline LayoutUnit computeFlowHeight(const RenderBlockFlow& flow, const Layout& layout)
-{
-    auto flowHeight = lineHeightFromFlow(flow) * layout.lineCount();
-    if (!layout.hasLineStruts())
-        return flowHeight;
-    for (auto& strutEntry : layout.struts())
-        flowHeight += strutEntry.offset;
-    return flowHeight;
-}
-
-inline LayoutUnit computeFlowFirstLineBaseline(const RenderBlockFlow& flow, const Layout& layout)
-{
-    ASSERT_UNUSED(layout, layout.lineCount());
-    return flow.borderAndPaddingBefore() + baselineFromFlow(flow);
-}
-
-inline LayoutUnit computeFlowLastLineBaseline(const RenderBlockFlow& flow, const Layout& layout)
-{
-    ASSERT(layout.lineCount());
-    return flow.borderAndPaddingBefore() + lineHeightFromFlow(flow) * (layout.lineCount() - 1) + baselineFromFlow(flow);
-}
-
-inline LayoutUnit lineHeightFromFlow(const RenderBlockFlow& flow)
-{
-    return flow.lineHeight(false, HorizontalLine, PositionOfInteriorLineBoxes);
-}
-
-inline LayoutUnit baselineFromFlow(const RenderBlockFlow& flow)
-{
-    return flow.baselinePosition(AlphabeticBaseline, false, HorizontalLine, PositionOfInteriorLineBoxes);
-}
-
-}
-}
diff --git a/Source/WebCore/rendering/SimpleLineLayoutPagination.cpp b/Source/WebCore/rendering/SimpleLineLayoutPagination.cpp
deleted file mode 100644 (file)
index 1c8de70..0000000
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "SimpleLineLayoutPagination.h"
-
-#include "FontCascade.h"
-#include "RenderBlockFlow.h"
-#include "SimpleLineLayout.h"
-#include "SimpleLineLayoutFunctions.h"
-
-namespace WebCore {
-namespace SimpleLineLayout {
-
-struct PaginatedLine {
-    LayoutUnit top;
-    LayoutUnit bottom;
-    LayoutUnit height; // Same value for each lines atm.
-};
-using PaginatedLines = Vector<PaginatedLine, 20>;
-
-static PaginatedLine computeLineTopAndBottomWithOverflow(const RenderBlockFlow& flow, unsigned lineIndex, Layout::SimpleLineStruts& struts)
-{
-    // FIXME: Add visualOverflowForDecorations.
-    auto& fontMetrics = flow.style().fontCascade().fontMetrics();
-    auto ascent = fontMetrics.ascent();
-    auto descent = fontMetrics.descent();
-    auto lineHeight = lineHeightFromFlow(flow);
-    LayoutUnit offset = flow.borderAndPaddingBefore();
-    for (auto& strut : struts) {
-        if (strut.lineBreak > lineIndex)
-            break;
-        offset += strut.offset;
-    }
-    if (ascent + descent <= lineHeight) {
-        auto topPosition = lineIndex * lineHeight + offset;
-        return { topPosition, topPosition + lineHeight, lineHeight };
-    }
-    auto baseline = baselineFromFlow(flow);
-    auto topPosition = lineIndex * lineHeight + offset + baseline - ascent;
-    auto bottomPosition = topPosition + ascent + descent;
-    return { topPosition, bottomPosition, bottomPosition - topPosition };
-}
-
-static unsigned computeLineBreakIndex(unsigned breakCandidate, unsigned lineCount, int orphansNeeded, int widowsNeeded,
-    const Layout::SimpleLineStruts& struts)
-{
-    // First line does not fit the current page.
-    if (!breakCandidate)
-        return breakCandidate;
-    
-    int widowsOnTheNextPage = lineCount - breakCandidate;
-    if (widowsNeeded <= widowsOnTheNextPage)
-        return breakCandidate;
-    // Only break after the first line with widows.
-    auto lineBreak = std::max<int>(lineCount - widowsNeeded, 1);
-    if (orphansNeeded > lineBreak)
-        return breakCandidate;
-    // Break on current page only.
-    if (struts.isEmpty())
-        return lineBreak;
-    ASSERT(struts.last().lineBreak + 1 < lineCount);
-    return std::max<unsigned>(struts.last().lineBreak + 1, lineBreak);
-}
-
-static LayoutUnit computeOffsetAfterLineBreak(LayoutUnit lineBreakPosition, bool isFirstLine, bool atTheTopOfColumnOrPage, const RenderBlockFlow& flow)
-{
-    // No offset for top of the page lines unless widows pushed the line break.
-    LayoutUnit offset = isFirstLine ? flow.borderAndPaddingBefore() : 0_lu;
-    if (atTheTopOfColumnOrPage)
-        return offset;
-    return offset + flow.pageRemainingLogicalHeightForOffset(lineBreakPosition, RenderBlockFlow::ExcludePageBoundary);
-}
-
-static void setPageBreakForLine(unsigned lineBreakIndex, PaginatedLines& lines, RenderBlockFlow& flow, Layout::SimpleLineStruts& struts,
-    bool atTheTopOfColumnOrPage, bool lineDoesNotFit)
-{
-    auto line = lines.at(lineBreakIndex);
-    auto remainingLogicalHeight = flow.pageRemainingLogicalHeightForOffset(line.top, RenderBlockFlow::ExcludePageBoundary);
-    auto& style = flow.style();
-    auto firstLineDoesNotFit = !lineBreakIndex && line.height < flow.pageLogicalHeightForOffset(line.top);
-    auto moveOrphanToNextColumn = lineDoesNotFit && !style.hasAutoOrphans() && style.orphans() > (short)lineBreakIndex;
-    if (firstLineDoesNotFit || moveOrphanToNextColumn) {
-        auto firstLine = lines.first();
-        auto firstLineOverflowRect = computeOverflow(flow, LayoutRect(0_lu, firstLine.top, 0_lu, firstLine.height));
-        auto firstLineUpperOverhang = std::max(LayoutUnit(-firstLineOverflowRect.y()), 0_lu);
-        flow.setPaginationStrut(line.top + remainingLogicalHeight + firstLineUpperOverhang);
-        return;
-    }
-    if (atTheTopOfColumnOrPage)
-        flow.setPageBreak(line.top, line.height);
-    else
-        flow.setPageBreak(line.top, line.height - remainingLogicalHeight);
-    struts.append({ lineBreakIndex, computeOffsetAfterLineBreak(lines[lineBreakIndex].top, !lineBreakIndex, atTheTopOfColumnOrPage, flow) });
-}
-
-static void updateMinimumPageHeight(RenderBlockFlow& flow, unsigned lineCount)
-{
-    auto& style = flow.style();
-    auto widows = style.hasAutoWidows() ? 1 : std::max<int>(style.widows(), 1);
-    auto orphans = style.hasAutoOrphans() ? 1 : std::max<int>(style.orphans(), 1);
-    auto minimumLineCount = std::min<unsigned>(std::max(widows, orphans), lineCount);
-    flow.updateMinimumPageHeight(0, minimumLineCount * lineHeightFromFlow(flow));
-}
-
-void adjustLinePositionsForPagination(SimpleLineLayout::Layout& simpleLines, RenderBlockFlow& flow)
-{
-    Layout::SimpleLineStruts struts;
-    auto lineCount = simpleLines.lineCount();
-    updateMinimumPageHeight(flow, lineCount);
-    // First pass with no pagination offset?
-    if (!flow.pageLogicalHeightForOffset(0))
-        return;
-    unsigned lineIndex = 0;
-    auto widows = flow.style().hasAutoWidows() ? 1 : std::max<int>(flow.style().widows(), 1);
-    auto orphans = flow.style().hasAutoOrphans() ? 1 : std::max<int>(flow.style().orphans(), 1);
-    PaginatedLines lines;
-    for (unsigned runIndex = 0; runIndex < simpleLines.runCount(); ++runIndex) {
-        auto& run = simpleLines.runAt(runIndex);
-        if (!run.isEndOfLine)
-            continue;
-
-        auto line = computeLineTopAndBottomWithOverflow(flow, lineIndex, struts);
-        lines.append(line);
-        auto remainingHeight = flow.pageRemainingLogicalHeightForOffset(line.top, RenderBlockFlow::ExcludePageBoundary);
-        auto atTheTopOfColumnOrPage = flow.pageLogicalHeightForOffset(line.top) == remainingHeight;
-        auto lineDoesNotFit = line.height > remainingHeight;
-        if (lineDoesNotFit || (atTheTopOfColumnOrPage && lineIndex)) {
-            auto lineBreakIndex = computeLineBreakIndex(lineIndex, lineCount, orphans, widows, struts);
-            // Are we still at the top of the column/page?
-            atTheTopOfColumnOrPage = atTheTopOfColumnOrPage ? lineIndex == lineBreakIndex : false;
-            setPageBreakForLine(lineBreakIndex, lines, flow, struts, atTheTopOfColumnOrPage, lineDoesNotFit);
-            // Recompute line positions that we already visited but widow break pushed them to a new page.
-            for (auto i = lineBreakIndex; i < lines.size(); ++i)
-                lines.at(i) = computeLineTopAndBottomWithOverflow(flow, i, struts);
-        }
-        ++lineIndex;
-    }
-    simpleLines.setLineStruts(WTFMove(struts));
-}
-
-}
-}
diff --git a/Source/WebCore/rendering/SimpleLineLayoutPagination.h b/Source/WebCore/rendering/SimpleLineLayoutPagination.h
deleted file mode 100644 (file)
index dd6a17c..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-namespace WebCore {
-
-class RenderBlockFlow;
-
-namespace SimpleLineLayout {
-
-class Layout;
-    
-void adjustLinePositionsForPagination(Layout&, RenderBlockFlow&);
-
-}
-}
diff --git a/Source/WebCore/rendering/SimpleLineLayoutResolver.cpp b/Source/WebCore/rendering/SimpleLineLayoutResolver.cpp
deleted file mode 100644 (file)
index d3a6c18..0000000
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "SimpleLineLayoutResolver.h"
-
-#include "InlineTextBoxStyle.h"
-#include "RenderBlockFlow.h"
-#include "RenderObject.h"
-#include "SimpleLineLayoutFunctions.h"
-
-namespace WebCore {
-namespace SimpleLineLayout {
-
-static FloatPoint linePosition(float logicalLeft, float logicalTop)
-{
-    return FloatPoint(logicalLeft, roundf(logicalTop));
-}
-
-static FloatSize lineSize(float logicalLeft, float logicalRight, float height)
-{
-    return FloatSize(logicalRight - logicalLeft, height);
-}
-
-RunResolver::Run::Run(const Iterator& iterator)
-    : m_iterator(iterator)
-{
-}
-
-String RunResolver::Run::textWithHyphen() const
-{
-    auto& run = m_iterator.simpleRun();
-    ASSERT(run.hasHyphen);
-    // Empty runs should not have hyphen.
-    ASSERT(run.start < run.end);
-    auto& segment = m_iterator.resolver().m_flowContents.segmentForRun(run.start, run.end);
-    auto text = StringView(segment.text).substring(segment.toSegmentPosition(run.start), run.end - run.start);
-    return makeString(text, m_iterator.resolver().flow().style().hyphenString());
-}
-
-FloatRect RunResolver::Run::rect() const
-{
-    auto& run = m_iterator.simpleRun();
-    auto& resolver = m_iterator.resolver();
-    float baseline = computeBaselinePosition();
-    FloatPoint position = linePosition(run.logicalLeft, baseline - resolver.m_ascent);
-    FloatSize size = lineSize(run.logicalLeft, run.logicalRight, resolver.m_ascent + resolver.m_descent + resolver.m_visualOverflowOffset);
-
-    return FloatRect(position, size);
-}
-
-StringView RunResolver::Run::text() const
-{
-    auto& run = m_iterator.simpleRun();
-    ASSERT(run.start < run.end);
-    auto& segment = m_iterator.resolver().m_flowContents.segmentForRun(run.start, run.end);
-    // We currently split runs on segment boundaries (different RenderObject).
-    ASSERT(run.end <= segment.end);
-    return StringView(segment.text).substring(segment.toSegmentPosition(run.start), run.end - run.start);
-}
-
-const RenderObject& RunResolver::Run::renderer() const
-{
-    auto& run = m_iterator.simpleRun();
-    // FlowContents cannot differentiate empty runs.
-    ASSERT(run.start != run.end);
-    return m_iterator.resolver().m_flowContents.segmentForRun(run.start, run.end).renderer;
-}
-
-unsigned RunResolver::Run::localStart() const
-{
-    auto& run = m_iterator.simpleRun();
-    // FlowContents cannot differentiate empty runs.
-    ASSERT(run.start != run.end);
-    return m_iterator.resolver().m_flowContents.segmentForRun(run.start, run.end).toSegmentPosition(run.start);
-}
-
-unsigned RunResolver::Run::localEnd() const
-{
-    auto& run = m_iterator.simpleRun();
-    // FlowContents cannot differentiate empty runs.
-    ASSERT(run.start != run.end);
-    return m_iterator.resolver().m_flowContents.segmentForRun(run.start, run.end).toSegmentPosition(run.end);
-}
-
-RunResolver::Iterator::Iterator(const RunResolver& resolver, unsigned runIndex, unsigned lineIndex)
-    : m_layout(&resolver.m_layout)
-    , m_resolver(&resolver)
-    , m_runIndex(runIndex)
-    , m_lineIndex(lineIndex)
-{
-    ASSERT(&resolver == &m_layout->runResolver());
-}
-
-RunResolver::Iterator& RunResolver::Iterator::advance()
-{
-    if (simpleRun().isEndOfLine)
-        ++m_lineIndex;
-    ++m_runIndex;
-    return *this;
-}
-
-RunResolver::Iterator& RunResolver::Iterator::advanceLines(unsigned lineCount)
-{
-    unsigned runCount = layout().runCount();
-    if (runCount == layout().lineCount()) {
-        m_runIndex = std::min(runCount, m_runIndex + lineCount);
-        m_lineIndex = m_runIndex;
-        return *this;
-    }
-    unsigned target = m_lineIndex + lineCount;
-    while (m_lineIndex < target && m_runIndex < runCount)
-        advance();
-
-    return *this;
-}
-
-RunResolver::RunResolver(const RenderBlockFlow& flow, const Layout& layout)
-    : m_flowRenderer(flow)
-    , m_layout(layout)
-    , m_flowContents(flow)
-    , m_lineHeight(lineHeightFromFlow(flow))
-    , m_baseline(baselineFromFlow(flow))
-    , m_borderAndPaddingBefore(flow.borderAndPaddingBefore())
-    , m_ascent(flow.style().fontCascade().fontMetrics().ascent())
-    , m_descent(flow.style().fontCascade().fontMetrics().descent())
-    , m_visualOverflowOffset(visualOverflowForDecorations(flow.style(), nullptr).bottom)
-{
-}
-
-unsigned RunResolver::adjustLineIndexForStruts(LayoutUnit y, IndexType type, unsigned lineIndexCandidate) const
-{
-    auto& struts = m_layout.struts();
-    // We need to offset the lineIndex with line struts when there's an actual strut before the candidate.
-    auto& strut = struts.first();
-    if (strut.lineBreak >= lineIndexCandidate)
-        return lineIndexCandidate;
-    unsigned strutIndex = 0;
-    Optional<unsigned> lastIndexCandidate;
-    auto top = strut.lineBreak * m_lineHeight;
-    auto lineHeightWithOverflow = m_lineHeight;
-    // If font is larger than the line height (glyphs overflow), use the font size when checking line boundaries.
-    if (m_ascent + m_descent > m_lineHeight) {
-        lineHeightWithOverflow = m_ascent + m_descent;
-        top += m_baseline - m_ascent;
-    }
-    auto bottom = top + lineHeightWithOverflow;
-    for (auto lineIndex = strut.lineBreak; lineIndex < m_layout.lineCount(); ++lineIndex) {
-        float strutOffset = 0;
-        if (strutIndex < struts.size() && struts.at(strutIndex).lineBreak == lineIndex)
-            strutOffset = struts.at(strutIndex++).offset;
-        bottom = top + strutOffset + lineHeightWithOverflow;
-        if (y >= top && y < bottom) {
-            if (type == IndexType::First)
-                return lineIndex;
-            lastIndexCandidate = lineIndex;
-        } else if (lastIndexCandidate)
-            return *lastIndexCandidate;
-        top += m_lineHeight + strutOffset;
-    }
-    if (lastIndexCandidate || y >= bottom)
-        return m_layout.lineCount() - 1;
-    // We missed the line.
-    ASSERT_NOT_REACHED();
-    return lineIndexCandidate;
-}
-
-unsigned RunResolver::lineIndexForHeight(LayoutUnit height, IndexType type) const
-{
-    ASSERT(m_lineHeight);
-    float y = height - m_borderAndPaddingBefore;
-    // Lines may overlap, adjust to get the first or last line at this height.
-    auto adjustedY = y;
-    if (type == IndexType::First)
-        adjustedY += m_lineHeight - (m_baseline + m_descent);
-    else
-        adjustedY -= m_baseline - m_ascent;
-    adjustedY = std::max<float>(adjustedY, 0);
-    auto lineIndexCandidate =  std::min<unsigned>(adjustedY / m_lineHeight, m_layout.lineCount() - 1);
-    if (m_layout.hasLineStruts())
-        return adjustLineIndexForStruts(LayoutUnit(y), type, lineIndexCandidate);
-    return lineIndexCandidate;
-}
-
-WTF::IteratorRange<RunResolver::Iterator> RunResolver::rangeForRect(const LayoutRect& rect) const
-{ 
-    if (!m_lineHeight)
-        return { begin(), end() };
-
-    unsigned firstLine = lineIndexForHeight(rect.y(), IndexType::First);
-    unsigned lastLine = std::max(firstLine, lineIndexForHeight(rect.maxY(), IndexType::Last));
-    auto rangeBegin = begin().advanceLines(firstLine);
-    if (rangeBegin == end())
-        return { end(), end() };
-    auto rangeEnd = rangeBegin;
-    ASSERT(lastLine >= firstLine);
-    rangeEnd.advanceLines(lastLine - firstLine + 1);
-    return { rangeBegin, rangeEnd };
-}
-
-WTF::IteratorRange<RunResolver::Iterator> RunResolver::rangeForLine(unsigned lineIndex) const
-{
-    auto rangeBegin = begin().advanceLines(lineIndex);
-    if (rangeBegin == end())
-        return { end(), end() };
-    auto rangeEnd = rangeBegin;
-    rangeEnd.advanceLines(1);
-    return { rangeBegin, rangeEnd };
-}
-
-WTF::IteratorRange<RunResolver::Iterator> RunResolver::rangeForRenderer(const RenderObject& renderer) const
-{
-    if (begin() == end())
-        return { end(), end() };
-    FlowContents::Iterator segment = m_flowContents.begin();
-    auto run = begin();
-    ASSERT(segment->start <= (*run).start());
-    // Move run to the beginning of the segment.
-    while (&segment->renderer != &renderer && run != end()) {
-        if ((*run).start() == segment->start && (*run).end() == segment->end) {
-            ++run;
-            ++segment;
-        } else if ((*run).start() < segment->end)
-            ++run;
-        else
-            ++segment;
-        ASSERT(segment != m_flowContents.end());
-    }
-    // Do we actually have a run for this renderer?
-    // Collapsed whitespace with dedicated renderer could end up with no run at all.
-    if (run == end() || (segment->start != segment->end && segment->end <= (*run).start()))
-        return { end(), end() };
-
-    auto rangeBegin = run;
-    // Move beyond the end of the segment.
-    while (run != end() && (*run).start() < segment->end)
-        ++run;
-    // Special case when segment == run.
-    if (run == rangeBegin)
-        ++run;
-    return { rangeBegin, run };
-}
-
-RunResolver::Iterator RunResolver::runForPoint(const LayoutPoint& point) const
-{
-    if (!m_lineHeight)
-        return end();
-    if (begin() == end())
-        return end();
-    unsigned lineIndex = lineIndexForHeight(point.y(), IndexType::Last);
-    auto x = point.x() - m_borderAndPaddingBefore;
-    auto it = begin();
-    it.advanceLines(lineIndex);
-    // Point is at the left side of the first run on this line.
-    if ((*it).logicalLeft() > x)
-        return it;
-    // Advance to the first candidate run on this line.
-    while (it != end() && (*it).logicalRight() < x && lineIndex == it.lineIndex())
-        ++it;
-    // We jumped to the next line so the point is at the right side of the previous line.
-    if (it.lineIndex() > lineIndex)
-        return --it;
-    // Now we have a candidate run.
-    // Find the last run that still contains this point (taking overlapping runs with odd word spacing values into account).
-    while (it != end() && (*it).logicalLeft() <= x && lineIndex == it.lineIndex())
-        ++it;
-    return --it;
-}
-
-WTF::IteratorRange<RunResolver::Iterator> RunResolver::rangeForRendererWithOffsets(const RenderObject& renderer, unsigned startOffset, unsigned endOffset) const
-{
-    ASSERT(startOffset <= endOffset);
-    auto range = rangeForRenderer(renderer);
-    if (range.begin() == range.end())
-        return { end(), end() };
-    auto it = range.begin();
-    auto localEnd = (*it).start() + endOffset;
-    // Advance to the first run before the start offset. Only the first node in a range can have a startOffset.
-    // Note that the start offset may coincide with the end of a run. The run is still considered so that we
-    // can return an empty rect, which conforms to the behavior of Element.getClientRects().
-    while (it != range.end() && (*it).end() < startOffset)
-        ++it;
-    if (it == range.end())
-        return { end(), end() };
-    auto rangeBegin = it;
-    // Special case empty ranges that start at the edge of the run. Apparently normal line layout include those.
-    if (localEnd == startOffset && (*it).start() == localEnd)
-        return { rangeBegin, ++it };
-    // Advance beyond the last run with the end offset.
-    while (it != range.end() && (*it).start() < localEnd)
-        ++it;
-    return { rangeBegin, it };
-}
-
-LineResolver::Iterator::Iterator(RunResolver::Iterator runIterator)
-    : m_runIterator(runIterator)
-{
-}
-
-FloatRect LineResolver::Iterator::operator*() const
-{
-    unsigned currentLine = m_runIterator.lineIndex();
-    auto it = m_runIterator;
-    FloatRect rect = (*it).rect();
-    while (it.advance().lineIndex() == currentLine)
-        rect.unite((*it).rect());
-    return rect;
-}
-
-const RenderObject& LineResolver::Iterator::renderer() const
-{
-    // FIXME: This works as long as we've got only one renderer per line.
-    auto run = *m_runIterator;
-    return m_runIterator.resolver().flowContents().segmentForRun(run.start(), run.end()).renderer;
-}
-
-LineResolver::LineResolver(const RunResolver& runResolver)
-    : m_runResolver(runResolver)
-{
-}
-
-}
-}
diff --git a/Source/WebCore/rendering/SimpleLineLayoutResolver.h b/Source/WebCore/rendering/SimpleLineLayoutResolver.h
deleted file mode 100644 (file)
index 1c60047..0000000
+++ /dev/null
@@ -1,317 +0,0 @@
-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include "LayoutRect.h"
-#include "RenderBlockFlow.h"
-#include "SimpleLineLayout.h"
-#include "SimpleLineLayoutFlowContents.h"
-#include <wtf/IteratorRange.h>
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-namespace SimpleLineLayout {
-
-class RunResolver {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    class Iterator;
-
-    class Run {
-    public:
-        explicit Run(const Iterator&);
-
-        // Position relative to the enclosing flow block.
-        unsigned start() const;
-        unsigned end() const;
-        // Position relative to the actual renderer.
-        unsigned localStart() const;
-        unsigned localEnd() const;
-
-        float logicalLeft() const;
-        float logicalRight() const;
-
-        FloatRect rect() const;
-        float expansion() const;
-        ExpansionBehavior expansionBehavior() const;
-        int baselinePosition() const;
-        int baseline() const { return m_iterator.resolver().m_baseline; }
-        StringView text() const;
-        String textWithHyphen() const;
-        const RenderObject& renderer() const;
-        bool isEndOfLine() const;
-        bool hasHyphen() const { return m_iterator.simpleRun().hasHyphen; }
-        bool isLineBreak() const { return m_iterator.simpleRun().isLineBreak; }
-        const SimpleLineLayout::Run& simpleRun() const { return m_iterator.simpleRun(); }
-
-        unsigned lineIndex() const;
-
-    private:
-        float computeBaselinePosition() const;
-        void constructStringForHyphenIfNeeded();
-
-        const Iterator& m_iterator;
-    };
-
-    class Iterator {
-    friend class Run;
-    friend class RunResolver;
-    friend class LineResolver;
-    public:
-        Iterator(const RunResolver&, unsigned runIndex, unsigned lineIndex);
-
-        Iterator& operator++();
-        Iterator& operator--();
-
-        bool operator==(const Iterator&) const;
-        bool operator!=(const Iterator&) const;
-
-        Run operator*() const;
-
-        bool atBegin() const;
-
-    private:
-        const SimpleLineLayout::Run& simpleRun() const;
-        unsigned lineIndex() const { return m_lineIndex; }
-        Iterator& advance();
-        Iterator& advanceLines(unsigned);
-        const RunResolver& resolver() const { return *m_resolver; }
-        const Layout& layout() const { return *m_layout; }
-
-        RefPtr<const Layout> m_layout;
-        const RunResolver* m_resolver;
-        unsigned m_runIndex;
-        unsigned m_lineIndex;
-    };
-
-    RunResolver(const RenderBlockFlow&, const Layout&);
-
-    const RenderBlockFlow& flow() const { return m_flowRenderer; }
-    const FlowContents& flowContents() const { return m_flowContents; }
-    Iterator begin() const;
-    Iterator end() const;
-
-    WTF::IteratorRange<Iterator> rangeForRect(const LayoutRect&) const;
-    WTF::IteratorRange<Iterator> rangeForRenderer(const RenderObject&) const;
-    WTF::IteratorRange<Iterator> rangeForLine(unsigned lineIndex) const;
-    Iterator runForPoint(const LayoutPoint&) const;
-    WTF::IteratorRange<Iterator> rangeForRendererWithOffsets(const RenderObject&, unsigned start, unsigned end) const;
-
-private:
-    enum class IndexType { First, Last };
-    unsigned lineIndexForHeight(LayoutUnit, IndexType) const;
-    unsigned adjustLineIndexForStruts(LayoutUnit, IndexType, unsigned lineIndexCandidate) const;
-
-    const RenderBlockFlow& m_flowRenderer;
-    const Layout& m_layout;
-    const FlowContents m_flowContents;
-    const LayoutUnit m_lineHeight;
-    const LayoutUnit m_baseline;
-    const LayoutUnit m_borderAndPaddingBefore;
-    const float m_ascent;
-    const float m_descent;
-    const float m_visualOverflowOffset;
-};
-
-class LineResolver {
-public:
-    class Iterator {
-    public:
-        explicit Iterator(RunResolver::Iterator);
-
-        Iterator& operator++();
-        bool operator==(const Iterator&) const;
-        bool operator!=(const Iterator&) const;
-
-        FloatRect operator*() const;
-        // FIXME: Use a list to support multiple renderers per line.
-        const RenderObject& renderer() const;
-
-    private:
-        RunResolver::Iterator m_runIterator;
-    };
-
-    LineResolver(const RunResolver&);
-
-    Iterator begin() const;
-    Iterator end() const;
-
-    WTF::IteratorRange<Iterator> rangeForRect(const LayoutRect&) const;
-
-private:
-    const RunResolver& m_runResolver;
-};
-
-RunResolver runResolver(const RenderBlockFlow&, const Layout&);
-LineResolver lineResolver(const RunResolver&);
-
-inline unsigned RunResolver::Run::start() const
-{
-    return m_iterator.simpleRun().start;
-}
-
-inline unsigned RunResolver::Run::end() const
-{
-    return m_iterator.simpleRun().end;
-}
-
-inline float RunResolver::Run::logicalLeft() const
-{
-    return m_iterator.simpleRun().logicalLeft;
-}
-
-inline float RunResolver::Run::logicalRight() const
-{
-    return m_iterator.simpleRun().logicalRight;
-}
-
-inline float RunResolver::Run::expansion() const
-{
-    return m_iterator.simpleRun().expansion;
-}
-
-inline ExpansionBehavior RunResolver::Run::expansionBehavior() const
-{
-    return m_iterator.simpleRun().expansionBehavior;
-}
-
-inline int RunResolver::Run::baselinePosition() const
-{
-    return roundToInt(computeBaselinePosition());
-}
-
-inline bool RunResolver::Run::isEndOfLine() const
-{
-    return m_iterator.simpleRun().isEndOfLine;
-}
-
-inline unsigned RunResolver::Run::lineIndex() const
-{
-    return m_iterator.lineIndex();
-}
-
-inline RunResolver::Iterator& RunResolver::Iterator::operator++()
-{
-    return advance();
-}
-
-inline float RunResolver::Run::computeBaselinePosition() const
-{
-    auto& resolver = m_iterator.resolver();
-    auto offset = resolver.m_borderAndPaddingBefore + resolver.m_lineHeight * lineIndex();
-    if (!m_iterator.layout().hasLineStruts())
-        return offset + resolver.m_baseline;
-    for (auto& strutEntry : resolver.m_layout.struts()) {
-        if (strutEntry.lineBreak > lineIndex())
-            break;
-        offset += strutEntry.offset;
-    }
-    return offset + resolver.m_baseline;
-}
-
-inline RunResolver::Iterator& RunResolver::Iterator::operator--()
-{
-    --m_runIndex;
-    if (simpleRun().isEndOfLine)
-        --m_lineIndex;
-    return *this;
-}
-
-inline bool RunResolver::Iterator::operator==(const Iterator& other) const
-{
-    ASSERT(m_resolver == other.m_resolver);
-    return m_runIndex == other.m_runIndex;
-}
-
-inline bool RunResolver::Iterator::operator!=(const Iterator& other) const
-{
-    return !(*this == other);
-}
-
-inline RunResolver::Run RunResolver::Iterator::operator*() const
-{
-    return Run(*this);
-}
-
-inline bool RunResolver::Iterator::atBegin() const
-{
-    return *this == resolver().begin();
-}
-
-inline const SimpleLineLayout::Run& RunResolver::Iterator::simpleRun() const
-{
-    return layout().runAt(m_runIndex);
-}
-
-inline RunResolver::Iterator RunResolver::begin() const
-{
-    return Iterator(*this, 0, 0);
-}
-
-inline RunResolver::Iterator RunResolver::end() const
-{
-    return Iterator(*this, m_layout.runCount(), m_layout.lineCount());
-}
-
-inline LineResolver::Iterator& LineResolver::Iterator::operator++()
-{
-    m_runIterator.advanceLines(1);
-    return *this;
-}
-
-inline bool LineResolver::Iterator::operator==(const Iterator& other) const
-{
-    return m_runIterator == other.m_runIterator;
-}
-
-inline bool LineResolver::Iterator::operator!=(const Iterator& other) const
-{
-    return m_runIterator != other.m_runIterator;
-}
-
-inline LineResolver::Iterator LineResolver::begin() const
-{
-    return Iterator(m_runResolver.begin());
-}
-
-inline LineResolver::Iterator LineResolver::end() const
-{
-    return Iterator(m_runResolver.end());
-}
-
-inline WTF::IteratorRange<LineResolver::Iterator> LineResolver::rangeForRect(const LayoutRect& rect) const
-{
-    auto runRange = m_runResolver.rangeForRect(rect);
-    return { Iterator(runRange.begin()), Iterator(runRange.end()) };
-}
-
-inline LineResolver lineResolver(const RunResolver& runResolver)
-{
-    return LineResolver(runResolver);
-}
-
-}
-}
diff --git a/Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.cpp b/Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.cpp
deleted file mode 100644 (file)
index 1e27d74..0000000
+++ /dev/null
@@ -1,269 +0,0 @@
-/*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "SimpleLineLayoutTextFragmentIterator.h"
-
-#include "FontCascade.h"
-#include "Hyphenation.h"
-#include "RenderBlockFlow.h"
-#include "RenderChildIterator.h"
-#include "SimpleLineLayoutFlowContents.h"
-
-namespace WebCore {
-namespace SimpleLineLayout {
-
-TextFragmentIterator::Style::Style(const RenderStyle& style)
-    : font(style.fontCascade())
-    , textAlign(style.textAlign())
-    , hasKerningOrLigatures(font.enableKerning() || font.requiresShaping())
-    , collapseWhitespace(style.collapseWhiteSpace())
-    , preserveNewline(style.preserveNewline())
-    , wrapLines(style.autoWrap())
-    , breakSpaces(style.whiteSpace() == WhiteSpace::BreakSpaces)
-    , breakAnyWordOnOverflow(style.wordBreak() == WordBreak::BreakAll && wrapLines)
-    , breakWordOnOverflow(style.breakWords() && (wrapLines || preserveNewline))
-    , breakFirstWordOnOverflow(breakAnyWordOnOverflow || breakWordOnOverflow)
-    , breakNBSP(wrapLines && style.nbspMode() == NBSPMode::Space)
-    , keepAllWordsForCJK(style.wordBreak() == WordBreak::KeepAll)
-    , wordSpacing(font.wordSpacing())
-    , tabWidth(collapseWhitespace ? TabSize(0) : style.tabSize())
-    , shouldHyphenate(style.hyphens() == Hyphens::Auto && canHyphenate(style.computedLocale()))
-    , hyphenStringWidth(shouldHyphenate ? font.width(TextRun(String(style.hyphenString()))) : 0)
-    , hyphenLimitBefore(style.hyphenationLimitBefore() < 0 ? 2 : style.hyphenationLimitBefore())
-    , hyphenLimitAfter(style.hyphenationLimitAfter() < 0 ? 2 : style.hyphenationLimitAfter())
-    , locale(style.computedLocale())
-{
-    if (style.hyphenationLimitLines() > -1)
-        hyphenLimitLines = style.hyphenationLimitLines();
-}
-
-TextFragmentIterator::TextFragmentIterator(const RenderBlockFlow& flow)
-    : m_flowContents(flow)
-    , m_currentSegment(m_flowContents.begin())
-    , m_lineBreakIterator(m_currentSegment->text, flow.style().computedLocale())
-    , m_style(flow.style())
-{
-}
-
-TextFragmentIterator::TextFragment TextFragmentIterator::nextTextFragment(float xPosition)
-{
-    TextFragmentIterator::TextFragment nextFragment = findNextTextFragment(xPosition);
-    m_atEndOfSegment = (m_currentSegment == m_flowContents.end()) || (m_position == m_currentSegment->end);
-    return nextFragment;
-}
-
-TextFragmentIterator::TextFragment TextFragmentIterator::findNextTextFragment(float xPosition)
-{
-    // A fragment can either be
-    // 1. line break when <br> is present or preserveNewline is on (not considered as whitespace) or
-    // 2. whitespace (collasped, non-collapsed multi or single) or
-    // 3. non-whitespace characters.
-    // 4. content end.
-    ASSERT(m_currentSegment != m_flowContents.end());
-    unsigned startPosition = m_position;
-    if (m_atEndOfSegment)
-        ++m_currentSegment;
-
-    if (m_currentSegment == m_flowContents.end())
-        return TextFragment(startPosition, startPosition, 0, TextFragment::ContentEnd);
-    if (isHardLineBreak(m_currentSegment))
-        return TextFragment(startPosition, startPosition, 0, TextFragment::HardLineBreak);
-    if (isSoftLineBreak(startPosition)) {
-        unsigned endPosition = ++m_position;
-        return TextFragment(startPosition, endPosition, 0, TextFragment::SoftLineBreak);
-    }
-    float width = 0;
-    bool overlappingFragment = false;
-    unsigned endPosition = skipToNextPosition(PositionType::NonWhitespace, startPosition, width, xPosition, overlappingFragment);
-    unsigned segmentEndPosition = m_currentSegment->end;
-    ASSERT(startPosition <= endPosition);
-    if (startPosition < endPosition) {
-        bool multipleWhitespace = startPosition + 1 < endPosition;
-        bool isCollapsed = multipleWhitespace && m_style.collapseWhitespace;
-        m_position = endPosition;
-        return TextFragment(startPosition, endPosition, width, TextFragment::Whitespace, endPosition == segmentEndPosition, false, isCollapsed, m_style.collapseWhitespace);
-    }
-    endPosition = skipToNextPosition(PositionType::Breakable, startPosition, width, xPosition, overlappingFragment);
-    m_position = endPosition;
-    return TextFragment(startPosition, endPosition, width, TextFragment::NonWhitespace, endPosition == segmentEndPosition, overlappingFragment, false, false);
-}
-
-void TextFragmentIterator::revertToEndOfFragment(const TextFragment& fragment)
-{
-    ASSERT(m_position >= fragment.end());
-    while (m_currentSegment->start > fragment.end())
-        --m_currentSegment;
-    // TODO: It reverts to the last fragment on the same position, but that's ok for now as we don't need to
-    // differentiate multiple renderers on the same position.
-    m_position = fragment.end();
-    m_atEndOfSegment = false;
-}
-
-static inline unsigned nextBreakablePositionInSegment(LazyLineBreakIterator& lineBreakIterator, unsigned startPosition, bool breakNBSP, bool keepAllWordsForCJK)
-{
-    if (keepAllWordsForCJK) {
-        if (breakNBSP)
-            return nextBreakablePositionKeepingAllWords(lineBreakIterator, startPosition);
-        return nextBreakablePositionKeepingAllWordsIgnoringNBSP(lineBreakIterator, startPosition);
-    }
-
-    if (lineBreakIterator.mode() == LineBreakIteratorMode::Default) {
-        if (breakNBSP)
-            return WebCore::nextBreakablePosition(lineBreakIterator, startPosition);
-        return nextBreakablePositionIgnoringNBSP(lineBreakIterator, startPosition);
-    }
-
-    if (breakNBSP)
-        return nextBreakablePositionWithoutShortcut(lineBreakIterator, startPosition);
-    return nextBreakablePositionIgnoringNBSPWithoutShortcut(lineBreakIterator, startPosition);
-}
-
-unsigned TextFragmentIterator::nextBreakablePosition(const FlowContents::Segment& segment, unsigned startPosition)
-{
-    ASSERT(startPosition < segment.end);
-    StringView currentText = m_lineBreakIterator.stringView();
-    StringView segmentText = StringView(segment.text);
-    if (segmentText != currentText) {
-        unsigned textLength = currentText.length();
-        UChar lastCharacter = textLength > 0 ? currentText[textLength - 1] : 0;
-        UChar secondToLastCharacter = textLength > 1 ? currentText[textLength - 2] : 0;
-        m_lineBreakIterator.setPriorContext(lastCharacter, secondToLastCharacter);
-        m_lineBreakIterator.resetStringAndReleaseIterator(segment.text, m_style.locale, LineBreakIteratorMode::Default);
-    }
-    return segment.toRenderPosition(nextBreakablePositionInSegment(m_lineBreakIterator, segment.toSegmentPosition(startPosition), m_style.breakNBSP, m_style.keepAllWordsForCJK));
-}
-
-unsigned TextFragmentIterator::nextNonWhitespacePosition(const FlowContents::Segment& segment, unsigned startPosition)
-{
-    ASSERT(startPosition < segment.end);
-    unsigned position = startPosition;
-    for (; position < segment.end; ++position) {
-        auto character = segment.text[segment.toSegmentPosition(position)];
-        bool isWhitespace = character == ' ' || character == '\t' || (!m_style.preserveNewline && character == '\n');
-        if (!isWhitespace)
-            return position;
-    }
-    return position;
-}
-
-Optional<unsigned> TextFragmentIterator::lastHyphenPosition(const TextFragmentIterator::TextFragment& run, unsigned before) const
-{
-    ASSERT(run.start() < before);
-    auto& segment = *m_currentSegment;
-    ASSERT(segment.start <= before && before <= segment.end);
-    ASSERT(is<RenderText>(segment.renderer));
-    if (!m_style.shouldHyphenate || run.type() != TextFragment::NonWhitespace)
-        return WTF::nullopt;
-    // Check if there are enough characters in the run.
-    unsigned runLength = run.end() - run.start();
-    if (m_style.hyphenLimitBefore >= runLength || m_style.hyphenLimitAfter >= runLength || m_style.hyphenLimitBefore + m_style.hyphenLimitAfter > runLength)
-        return WTF::nullopt;
-    auto runStart = segment.toSegmentPosition(run.start());
-    auto beforeIndex = segment.toSegmentPosition(before) - runStart;
-    if (beforeIndex <= m_style.hyphenLimitBefore)
-        return WTF::nullopt;
-    // Adjust before index to accommodate the limit-after value (this is the last potential hyphen location).
-    beforeIndex = std::min(beforeIndex, runLength - m_style.hyphenLimitAfter + 1);
-    auto substringForHyphenation = StringView(segment.text).substring(runStart, run.end() - run.start());
-    auto hyphenLocation = lastHyphenLocation(substringForHyphenation, beforeIndex, m_style.locale);
-    // Check if there are enough characters before and after the hyphen.
-    if (hyphenLocation && hyphenLocation >= m_style.hyphenLimitBefore && m_style.hyphenLimitAfter <= (runLength - hyphenLocation))
-        return segment.toRenderPosition(hyphenLocation + runStart);
-    return WTF::nullopt;
-}
-
-unsigned TextFragmentIterator::skipToNextPosition(PositionType positionType, unsigned startPosition, float& width, float xPosition, bool& overlappingFragment)
-{
-    overlappingFragment = false;
-    unsigned currentPosition = startPosition;
-    unsigned nextPosition = currentPosition;
-    // Collapsed whitespace has constant width. Do not measure it.
-    if (positionType == NonWhitespace)
-        nextPosition = nextNonWhitespacePosition(*m_currentSegment, currentPosition);
-    else if (positionType == Breakable) {
-        nextPosition = nextBreakablePosition(*m_currentSegment, currentPosition);
-        // nextBreakablePosition returns the same position for certain characters such as hyphens. Call next again with modified position unless we are at the end of the segment.
-        bool skipCurrentPosition = nextPosition == currentPosition;
-        if (skipCurrentPosition) {
-            // When we are skipping the last character in the segment, just move to the end of the segment and we'll check the next segment whether it is an overlapping fragment.
-            ASSERT(currentPosition < m_currentSegment->end);
-            if (currentPosition == m_currentSegment->end - 1)
-                nextPosition = m_currentSegment->end;
-            else
-                nextPosition = nextBreakablePosition(*m_currentSegment, currentPosition + 1);
-        }
-        // We need to know whether the word actually finishes at the end of this renderer or not.
-        if (nextPosition == m_currentSegment->end) {
-            const auto nextSegment = m_currentSegment + 1;
-            if (nextSegment != m_flowContents.end() && !isHardLineBreak(nextSegment))
-                overlappingFragment = nextPosition < nextBreakablePosition(*nextSegment, nextPosition);
-        }
-    }
-    width = 0;
-    if (nextPosition == currentPosition)
-        return currentPosition;
-    // Both non-collapsed whitespace and non-whitespace runs need to be measured.
-    bool measureText = positionType != NonWhitespace || !m_style.collapseWhitespace;
-    if (measureText)
-        width = this->textWidth(currentPosition, nextPosition, xPosition);
-    else if (startPosition < nextPosition)
-        width = m_style.font.spaceWidth() + m_style.wordSpacing;
-    return nextPosition;
-}
-
-float TextFragmentIterator::textWidth(unsigned from, unsigned to, float xPosition) const
-{
-    auto& segment = *m_currentSegment;
-    ASSERT(segment.start <= from && from <= segment.end && segment.start <= to && to <= segment.end);
-    ASSERT(is<RenderText>(segment.renderer));
-    if (!m_style.font.size() || from == to)
-        return 0;
-
-    unsigned segmentFrom = segment.toSegmentPosition(from);
-    unsigned segmentTo = segment.toSegmentPosition(to);
-    if (m_style.font.isFixedPitch())
-        return downcast<RenderText>(segment.renderer).width(segmentFrom, segmentTo - segmentFrom, m_style.font, xPosition, nullptr, nullptr);
-
-    bool measureWithEndSpace = m_style.hasKerningOrLigatures && m_style.collapseWhitespace
-        && segmentTo < segment.text.length() && segment.text[segmentTo] == ' ';
-    if (measureWithEndSpace)
-        ++segmentTo;
-    float width = 0;
-    if (segment.canUseSimplifiedTextMeasuring)
-        width = m_style.font.widthForSimpleText(StringView(segment.text).substring(segmentFrom, segmentTo - segmentFrom));
-    else {
-        TextRun run(StringView(segment.text).substring(segmentFrom, segmentTo - segmentFrom), xPosition);
-        if (m_style.tabWidth)
-            run.setTabSize(true, m_style.tabWidth);
-        width = m_style.font.width(run);
-    }
-    if (measureWithEndSpace)
-        width -= (m_style.font.spaceWidth() + m_style.wordSpacing);
-    return std::max<float>(0, width);
-}
-
-}
-}
diff --git a/Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.h b/Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.h
deleted file mode 100644 (file)
index cfc9c37..0000000
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * Copyright (C) 2015-2016 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include "BreakLines.h"
-#include "RenderLineBreak.h"
-#include "SimpleLineLayoutFlowContents.h"
-
-namespace WebCore {
-
-class RenderBlockFlow;
-class RenderStyle;
-
-namespace SimpleLineLayout {
-
-class TextFragmentIterator  {
-public:
-    TextFragmentIterator(const RenderBlockFlow&);
-    class TextFragment {
-    public:
-        enum Type { Invalid, ContentEnd, SoftLineBreak, HardLineBreak, Whitespace, NonWhitespace };
-        TextFragment() = default;
-        TextFragment(unsigned start, unsigned end, float width, Type type, bool isLastInRenderer = false, bool overlapsToNextRenderer = false, bool isCollapsed = false, bool isCollapsible = false)
-            : m_start(start)
-            , m_end(end)
-            , m_width(width)
-            , m_type(type)
-            , m_isLastInRenderer(isLastInRenderer)
-            , m_overlapsToNextRenderer(overlapsToNextRenderer)
-            , m_isCollapsed(isCollapsed)
-            , m_isCollapsible(isCollapsible)
-        {
-        }
-
-        bool isValid() const { return m_type != Invalid; }
-        unsigned start() const { return m_start; }
-        unsigned end() const { return m_end; }
-        unsigned length() const { ASSERT(m_end >= m_start); return m_end - m_start; }
-        float width() const { return m_width; }
-        Type type() const { return m_type; }
-        bool overlapsToNextRenderer() const { return m_overlapsToNextRenderer; }
-        bool isLastInRenderer() const { return m_isLastInRenderer; }
-        bool isLineBreak() const { return m_type == SoftLineBreak || m_type == HardLineBreak; }
-        bool isCollapsed() const { return m_isCollapsed; }
-        bool isCollapsible() const { return m_isCollapsible; }
-        bool hasHyphen() const { return m_hasHyphen; }
-
-        bool isEmpty() const { return start() == end() && !isLineBreak(); }
-        TextFragment split(unsigned splitPosition, float leftSideWidth, float rightSideWidth);
-        TextFragment splitWithHyphen(unsigned hyphenPosition, float hyphenStringWidth, float leftSideWidth, float rightSideWidth);
-        bool operator==(const TextFragment& other) const
-        {
-            return m_start == other.m_start
-                && m_end == other.m_end
-                && m_width == other.m_width
-                && m_type == other.m_type
-                && m_isLastInRenderer == other.m_isLastInRenderer
-                && m_overlapsToNextRenderer == other.m_overlapsToNextRenderer
-                && m_isCollapsed == other.m_isCollapsed
-                && m_isCollapsible == other.m_isCollapsible
-                && m_hasHyphen == other.m_hasHyphen;
-        }
-
-    private:
-        unsigned m_start { 0 };
-        unsigned m_end { 0 };
-        float m_width { 0 };
-        Type m_type { Invalid };
-        bool m_isLastInRenderer { false };
-        bool m_overlapsToNextRenderer { false };
-        bool m_isCollapsed { false };
-        bool m_isCollapsible { false };
-        bool m_hasHyphen { false };
-    };
-    TextFragment nextTextFragment(float xPosition = 0);
-    void revertToEndOfFragment(const TextFragment&);
-
-    // FIXME: These functions below should be decoupled from the text iterator.
-    float textWidth(unsigned startPosition, unsigned endPosition, float xPosition) const;
-    Optional<unsigned> lastHyphenPosition(const TextFragmentIterator::TextFragment& run, unsigned beforeIndex) const;
-
-    struct Style {
-        explicit Style(const RenderStyle&);
-
-        const FontCascade& font;
-        TextAlignMode textAlign;
-        bool hasKerningOrLigatures;
-        bool collapseWhitespace;
-        bool preserveNewline;
-        bool wrapLines;
-        bool breakSpaces;
-        bool breakAnyWordOnOverflow;
-        bool breakWordOnOverflow;
-        bool breakFirstWordOnOverflow;
-        bool breakNBSP;
-        bool keepAllWordsForCJK;
-        float wordSpacing;
-        TabSize tabWidth;
-        bool shouldHyphenate;
-        float hyphenStringWidth;
-        unsigned hyphenLimitBefore;
-        unsigned hyphenLimitAfter;
-        AtomString locale;
-        Optional<unsigned> hyphenLimitLines;
-    };
-    const Style& style() const { return m_style; }
-
-private:
-    TextFragment findNextTextFragment(float xPosition);
-    enum PositionType { Breakable, NonWhitespace };
-    unsigned skipToNextPosition(PositionType, unsigned startPosition, float& width, float xPosition, bool& overlappingFragment);
-    bool isSoftLineBreak(unsigned position) const;
-    bool isHardLineBreak(const FlowContents::Iterator& segment) const;
-    unsigned nextBreakablePosition(const FlowContents::Segment&, unsigned startPosition);
-    unsigned nextNonWhitespacePosition(const FlowContents::Segment&, unsigned startPosition);
-
-    FlowContents m_flowContents;
-    FlowContents::Iterator m_currentSegment;
-    LazyLineBreakIterator m_lineBreakIterator;
-    const Style m_style;
-    unsigned m_position { 0 };
-    bool m_atEndOfSegment { false };
-};
-
-inline TextFragmentIterator::TextFragment TextFragmentIterator::TextFragment::split(unsigned splitPosition, float leftSideWidth, float rightSideWidth)
-{
-    auto updateFragmentProperties = [] (TextFragment& fragment, unsigned start, unsigned end, float width)
-    {
-        fragment.m_start = start;
-        fragment.m_end = end;
-        fragment.m_width = width;
-        if (fragment.start() + 1 > fragment.end())
-            return;
-        fragment.m_isCollapsed = false;
-    };
-
-    TextFragment rightSide(*this);
-    updateFragmentProperties(*this, start(), splitPosition, leftSideWidth);
-    updateFragmentProperties(rightSide, splitPosition, rightSide.end(), rightSideWidth);
-    return rightSide;
-}
-
-inline TextFragmentIterator::TextFragment TextFragmentIterator::TextFragment::splitWithHyphen(unsigned hyphenPosition, float hyphenStringWidth,
-    float leftSideWidth, float rightSideWidth)
-{
-    auto rightSide = split(hyphenPosition, leftSideWidth, rightSideWidth);
-    m_hasHyphen = true;
-    m_width += hyphenStringWidth;
-    return rightSide;
-}
-
-inline bool TextFragmentIterator::isSoftLineBreak(unsigned position) const
-{
-    const auto& segment = *m_currentSegment;
-    ASSERT(segment.start <= position && position < segment.end);
-    return m_style.preserveNewline && segment.text[position - segment.start] == '\n';
-}
-
-inline bool TextFragmentIterator::isHardLineBreak(const FlowContents::Iterator& segment) const
-{
-    ASSERT(segment->start != segment->end || (segment->start == segment->end && is<RenderLineBreak>(segment->renderer)));
-    return segment->start == segment->end;
-}
-
-}
-}
index a70a88e..95ce87f 100644 (file)
@@ -228,7 +228,6 @@ void TextPainter::paintRange(const TextRun& textRun, const FloatRect& boxRect, c
 void TextPainter::clearGlyphDisplayLists()
 {
     GlyphDisplayListCache<InlineTextBox>::singleton().clear();
-    GlyphDisplayListCache<SimpleLineLayout::Run>::singleton().clear();
 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
     if (RuntimeEnabledFeatures::sharedFeatures().layoutFormattingContextIntegrationEnabled())
         GlyphDisplayListCache<Display::Run>::singleton().clear();
index 51ef21f..85f88ef 100644 (file)
@@ -27,6 +27,7 @@
 #include "LineLayoutTraversal.h"
 
 #include "LayoutIntegrationLineLayout.h"
+#include "RenderBlockFlow.h"
 #include "RenderLineBreak.h"
 
 namespace WebCore {
@@ -81,11 +82,6 @@ static const RenderBlockFlow* lineLayoutSystemFlowForRenderer(const RenderObject
 TextBoxIterator firstTextBoxFor(const RenderText& text)
 {
     if (auto* flow = lineLayoutSystemFlowForRenderer(text)) {
-        if (auto* simpleLineLayout = flow->simpleLineLayout()) {
-            auto range = simpleLineLayout->runResolver().rangeForRenderer(text);
-            return { SimplePath { range.begin(), range.end() } };
-        }
-
 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
         if (auto* layoutFormattingContextLineLayout = flow->layoutFormattingContextLineLayout())
             return layoutFormattingContextLineLayout->textBoxesFor(text);
@@ -129,11 +125,6 @@ bool ElementBoxIterator::atEnd() const
 ElementBoxIterator elementBoxFor(const RenderLineBreak& renderElement)
 {
     if (auto* flow = lineLayoutSystemFlowForRenderer(renderElement)) {
-        if (auto* simpleLineLayout = flow->simpleLineLayout()) {
-            auto range = simpleLineLayout->runResolver().rangeForRenderer(renderElement);
-            return { SimplePath(range.begin(), range.end()) };
-        }
-
 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
         if (auto* layoutFormattingContextLineLayout = flow->layoutFormattingContextLineLayout())
             return layoutFormattingContextLineLayout->elementBoxFor(renderElement);
index d730497..01f6989 100644 (file)
@@ -28,7 +28,6 @@
 #include "InlineElementBox.h"
 #include "LineLayoutTraversalComplexPath.h"
 #include "LineLayoutTraversalDisplayRunPath.h"
-#include "LineLayoutTraversalSimplePath.h"
 #include <wtf/Variant.h>
 
 namespace WebCore {
@@ -49,8 +48,7 @@ public:
 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
         DisplayRunPath,
 #endif
-        ComplexPath,
-        SimplePath
+        ComplexPath
     >;
 
     Box(PathVariant&&);
diff --git a/Source/WebCore/rendering/line/LineLayoutTraversalSimplePath.h b/Source/WebCore/rendering/line/LineLayoutTraversalSimplePath.h
deleted file mode 100644 (file)
index 0cd3c23..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright (C) 2019 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include "LineLayoutTraversal.h"
-#include "SimpleLineLayoutResolver.h"
-
-namespace WebCore {
-namespace LineLayoutTraversal {
-
-class SimplePath {
-public:
-    SimplePath(SimpleLineLayout::RunResolver::Iterator iterator, SimpleLineLayout::RunResolver::Iterator end)
-        : m_iterator(iterator)
-        , m_end(end)
-    { }
-
-    FloatRect rect() const { return (*m_iterator).rect(); }
-
-    float baseline() const { return (*m_iterator).baseline(); }
-
-    bool isLeftToRightDirection() const { return true; }
-    bool isHorizontal() const { return true; }
-    bool dirOverride() const { return false; }
-    bool isLineBreak() const { return (*m_iterator).isLineBreak(); }
-
-    bool useLineBreakBoxRenderTreeDumpQuirk() const
-    {
-        if (m_iterator.atBegin())
-            return false;
-        auto previous = m_iterator;
-        --previous;
-        return !(*previous).isEndOfLine();
-    }
-
-    bool hasHyphen() const { return (*m_iterator).hasHyphen(); }
-    StringView text() const { return (*m_iterator).text(); }
-    unsigned localStartOffset() const { return (*m_iterator).localStart(); }
-    unsigned localEndOffset() const { return (*m_iterator).localEnd(); }
-    unsigned length() const { return (*m_iterator).end() - (*m_iterator).start(); }
-
-    bool isLastOnLine() const
-    {
-        auto next = m_iterator;
-        ++next;
-        return next == m_end || (*m_iterator).lineIndex() != (*next).lineIndex();
-    }
-    bool isLast() const
-    {
-        auto next = m_iterator;
-        ++next;
-        return next == m_end;
-    };
-
-    void traverseNextTextBoxInVisualOrder()
-    {
-        // This function is currently only used for consecutive text runs.
-        ++m_iterator;
-    }
-    void traverseNextTextBoxInTextOrder() {  traverseNextTextBoxInVisualOrder(); }
-
-    bool operator==(const SimplePath& other) const { return m_iterator == other.m_iterator; }
-    bool atEnd() const { return m_iterator == m_end; }
-
-private:
-    SimpleLineLayout::RunResolver::Iterator m_iterator;
-    SimpleLineLayout::RunResolver::Iterator m_end;
-};
-
-}
-}