Title: [267969] trunk/Source/WebCore
Revision
267969
Author
an...@apple.com
Date
2020-10-05 08:43:07 -0700 (Mon, 05 Oct 2020)

Log Message

[LFC][Integration] Move Display::InlineContent to LayoutIntegration namespace
https://bugs.webkit.org/show_bug.cgi?id=217310

Reviewed by Zalan Bujtas.

It is only used by the integration code

Also move the related classes and rename the path independent iterator run to PathRun

* Headers.cmake:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* display/DisplayView.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const):
* layout/displaytree/DisplayRect.h: Removed.
* layout/flexformatting/FlexFormattingContext.cpp:
(WebCore::Layout::FlexFormattingContext::sizeAndPlaceFlexItems):
* layout/flexformatting/FlexFormattingState.h:
(WebCore::Layout::FlexFormattingState::lines const):
(WebCore::Layout::FlexFormattingState::addLine):
* layout/integration/LayoutIntegrationInlineContent.cpp: Renamed from Source/WebCore/layout/displaytree/DisplayInlineContent.cpp.
* layout/integration/LayoutIntegrationInlineContent.h: Renamed from Source/WebCore/layout/displaytree/DisplayInlineContent.h.
* layout/integration/LayoutIntegrationLine.h: Renamed from Source/WebCore/layout/displaytree/DisplayLine.h.
* layout/integration/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::layout):
(WebCore::LayoutIntegration::LineLayout::constructContent):
(WebCore::LayoutIntegration::LineLayout::lineCount const):
(WebCore::LayoutIntegration::LineLayout::adjustForPagination):
(WebCore::LayoutIntegration::LineLayout::collectOverflow):
(WebCore::LayoutIntegration::LineLayout::ensureInlineContent):
(WebCore::LayoutIntegration::LineLayout::textRunsFor const):
(WebCore::LayoutIntegration::LineLayout::runFor const):
(WebCore::LayoutIntegration::LineLayout::paint):
(WebCore::LayoutIntegration::LineLayout::hitTest):
(WebCore::LayoutIntegration::LineLayout::constructDisplayContent): Deleted.
(WebCore::LayoutIntegration::LineLayout::ensureDisplayInlineContent): Deleted.
* layout/integration/LayoutIntegrationLineLayout.h:
(WebCore::LayoutIntegration::LineLayout::inlineContent const):
(WebCore::LayoutIntegration::LineLayout::displayInlineContent const): Deleted.
* layout/integration/LayoutIntegrationPagination.cpp:
(WebCore::LayoutIntegration::computeLineTopAndBottomWithOverflow):
(WebCore::LayoutIntegration::updateMinimumPageHeight):
(WebCore::LayoutIntegration::makeAdjustedContent):
(WebCore::LayoutIntegration::adjustLinePositionsForPagination):
* layout/integration/LayoutIntegrationPagination.h:
* layout/integration/LayoutIntegrationRun.h: Renamed from Source/WebCore/layout/displaytree/DisplayRun.h.
* layout/integration/LayoutIntegrationRunIterator.cpp:
(WebCore::LayoutIntegration::RunIterator::RunIterator):
(WebCore::LayoutIntegration::TextRunIterator::TextRunIterator):
(WebCore::LayoutIntegration::LineRunIterator::LineRunIterator):
(WebCore::LayoutIntegration::PathRun::modernPath):
(WebCore::LayoutIntegration::PathRun::legacyPath):
(WebCore::LayoutIntegration::Run::modernPath): Deleted.
(WebCore::LayoutIntegration::Run::legacyPath): Deleted.
* layout/integration/LayoutIntegrationRunIterator.h:
(WebCore::LayoutIntegration::PathTextRun::legacyInlineBox const):
(WebCore::LayoutIntegration::RunIterator::operator* const):
(WebCore::LayoutIntegration::RunIterator::operator-> const):
(WebCore::LayoutIntegration::TextRunIterator::operator* const):
(WebCore::LayoutIntegration::TextRunIterator::operator-> const):
(WebCore::LayoutIntegration::TextRunIterator::get const):
(WebCore::LayoutIntegration::PathRun::PathRun):
(WebCore::LayoutIntegration::PathRun::isText const):
(WebCore::LayoutIntegration::PathRun::rect const):
(WebCore::LayoutIntegration::PathRun::baseline const):
(WebCore::LayoutIntegration::PathRun::isHorizontal const):
(WebCore::LayoutIntegration::PathRun::dirOverride const):
(WebCore::LayoutIntegration::PathRun::isLineBreak const):
(WebCore::LayoutIntegration::PathRun::useLineBreakBoxRenderTreeDumpQuirk const):
(WebCore::LayoutIntegration::PathRun::minimumCaretOffset const):
(WebCore::LayoutIntegration::PathRun::maximumCaretOffset const):
(WebCore::LayoutIntegration::PathRun::bidiLevel const):
(WebCore::LayoutIntegration::PathRun::onSameLine const):
(WebCore::LayoutIntegration::PathRun::legacyInlineBox const):
(WebCore::LayoutIntegration::PathTextRun::hasHyphen const):
(WebCore::LayoutIntegration::PathTextRun::PathTextRun):
(WebCore::LayoutIntegration::PathTextRun::text const):
(WebCore::LayoutIntegration::PathTextRun::localStartOffset const):
(WebCore::LayoutIntegration::PathTextRun::localEndOffset const):
(WebCore::LayoutIntegration::PathTextRun::length const):
(WebCore::LayoutIntegration::PathTextRun::isLastTextRunOnLine const):
(WebCore::LayoutIntegration::PathTextRun::isLastTextRun const):
(isType):
(WebCore::LayoutIntegration::Run::leftmostCaretOffset const): Deleted.
(WebCore::LayoutIntegration::Run::rightmostCaretOffset const): Deleted.
(WebCore::LayoutIntegration::Run::direction const): Deleted.
(WebCore::LayoutIntegration::Run::isLeftToRightDirection const): Deleted.
(WebCore::LayoutIntegration::TextRun::legacyInlineBox const): Deleted.
(WebCore::LayoutIntegration::Run::Run): Deleted.
(WebCore::LayoutIntegration::Run::isText const): Deleted.
(WebCore::LayoutIntegration::Run::rect const): Deleted.
(WebCore::LayoutIntegration::Run::baseline const): Deleted.
(WebCore::LayoutIntegration::Run::isHorizontal const): Deleted.
(WebCore::LayoutIntegration::Run::dirOverride const): Deleted.
(WebCore::LayoutIntegration::Run::isLineBreak const): Deleted.
(WebCore::LayoutIntegration::Run::useLineBreakBoxRenderTreeDumpQuirk const): Deleted.
(WebCore::LayoutIntegration::Run::minimumCaretOffset const): Deleted.
(WebCore::LayoutIntegration::Run::maximumCaretOffset const): Deleted.
(WebCore::LayoutIntegration::Run::bidiLevel const): Deleted.
(WebCore::LayoutIntegration::Run::onSameLine const): Deleted.
(WebCore::LayoutIntegration::Run::legacyInlineBox const): Deleted.
(WebCore::LayoutIntegration::TextRun::hasHyphen const): Deleted.
(WebCore::LayoutIntegration::TextRun::TextRun): Deleted.
(WebCore::LayoutIntegration::TextRun::text const): Deleted.
(WebCore::LayoutIntegration::TextRun::localStartOffset const): Deleted.
(WebCore::LayoutIntegration::TextRun::localEndOffset const): Deleted.
(WebCore::LayoutIntegration::TextRun::length const): Deleted.
(WebCore::LayoutIntegration::TextRun::isLastTextRunOnLine const): Deleted.
(WebCore::LayoutIntegration::TextRun::isLastTextRun const): Deleted.
* layout/integration/LayoutIntegrationRunIteratorModernPath.h:
(WebCore::LayoutIntegration::ModernPath::ModernPath):
(WebCore::LayoutIntegration::ModernPath::runs const):
(WebCore::LayoutIntegration::ModernPath::run const):
(WebCore::LayoutIntegration::ModernPath::line const):
* layout/layouttree/LayoutTreeBuilder.cpp:
* rendering/RenderTreeAsText.cpp:
(WebCore::write):
(WebCore::writeTextRun): Deleted.
* rendering/TextPainter.cpp:
(WebCore::TextPainter::clearGlyphDisplayLists):

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (267968 => 267969)


--- trunk/Source/WebCore/ChangeLog	2020-10-05 15:40:54 UTC (rev 267968)
+++ trunk/Source/WebCore/ChangeLog	2020-10-05 15:43:07 UTC (rev 267969)
@@ -1,3 +1,127 @@
+2020-10-05  Antti Koivisto  <an...@apple.com>
+
+        [LFC][Integration] Move Display::InlineContent to LayoutIntegration namespace
+        https://bugs.webkit.org/show_bug.cgi?id=217310
+
+        Reviewed by Zalan Bujtas.
+
+        It is only used by the integration code
+
+        Also move the related classes and rename the path independent iterator run to PathRun
+
+        * Headers.cmake:
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * display/DisplayView.h:
+        * layout/FormattingContextGeometry.cpp:
+        (WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const):
+        * layout/displaytree/DisplayRect.h: Removed.
+        * layout/flexformatting/FlexFormattingContext.cpp:
+        (WebCore::Layout::FlexFormattingContext::sizeAndPlaceFlexItems):
+        * layout/flexformatting/FlexFormattingState.h:
+        (WebCore::Layout::FlexFormattingState::lines const):
+        (WebCore::Layout::FlexFormattingState::addLine):
+        * layout/integration/LayoutIntegrationInlineContent.cpp: Renamed from Source/WebCore/layout/displaytree/DisplayInlineContent.cpp.
+        * layout/integration/LayoutIntegrationInlineContent.h: Renamed from Source/WebCore/layout/displaytree/DisplayInlineContent.h.
+        * layout/integration/LayoutIntegrationLine.h: Renamed from Source/WebCore/layout/displaytree/DisplayLine.h.
+        * layout/integration/LayoutIntegrationLineLayout.cpp:
+        (WebCore::LayoutIntegration::LineLayout::layout):
+        (WebCore::LayoutIntegration::LineLayout::constructContent):
+        (WebCore::LayoutIntegration::LineLayout::lineCount const):
+        (WebCore::LayoutIntegration::LineLayout::adjustForPagination):
+        (WebCore::LayoutIntegration::LineLayout::collectOverflow):
+        (WebCore::LayoutIntegration::LineLayout::ensureInlineContent):
+        (WebCore::LayoutIntegration::LineLayout::textRunsFor const):
+        (WebCore::LayoutIntegration::LineLayout::runFor const):
+        (WebCore::LayoutIntegration::LineLayout::paint):
+        (WebCore::LayoutIntegration::LineLayout::hitTest):
+        (WebCore::LayoutIntegration::LineLayout::constructDisplayContent): Deleted.
+        (WebCore::LayoutIntegration::LineLayout::ensureDisplayInlineContent): Deleted.
+        * layout/integration/LayoutIntegrationLineLayout.h:
+        (WebCore::LayoutIntegration::LineLayout::inlineContent const):
+        (WebCore::LayoutIntegration::LineLayout::displayInlineContent const): Deleted.
+        * layout/integration/LayoutIntegrationPagination.cpp:
+        (WebCore::LayoutIntegration::computeLineTopAndBottomWithOverflow):
+        (WebCore::LayoutIntegration::updateMinimumPageHeight):
+        (WebCore::LayoutIntegration::makeAdjustedContent):
+        (WebCore::LayoutIntegration::adjustLinePositionsForPagination):
+        * layout/integration/LayoutIntegrationPagination.h:
+        * layout/integration/LayoutIntegrationRun.h: Renamed from Source/WebCore/layout/displaytree/DisplayRun.h.
+        * layout/integration/LayoutIntegrationRunIterator.cpp:
+        (WebCore::LayoutIntegration::RunIterator::RunIterator):
+        (WebCore::LayoutIntegration::TextRunIterator::TextRunIterator):
+        (WebCore::LayoutIntegration::LineRunIterator::LineRunIterator):
+        (WebCore::LayoutIntegration::PathRun::modernPath):
+        (WebCore::LayoutIntegration::PathRun::legacyPath):
+        (WebCore::LayoutIntegration::Run::modernPath): Deleted.
+        (WebCore::LayoutIntegration::Run::legacyPath): Deleted.
+        * layout/integration/LayoutIntegrationRunIterator.h:
+        (WebCore::LayoutIntegration::PathTextRun::legacyInlineBox const):
+        (WebCore::LayoutIntegration::RunIterator::operator* const):
+        (WebCore::LayoutIntegration::RunIterator::operator-> const):
+        (WebCore::LayoutIntegration::TextRunIterator::operator* const):
+        (WebCore::LayoutIntegration::TextRunIterator::operator-> const):
+        (WebCore::LayoutIntegration::TextRunIterator::get const):
+        (WebCore::LayoutIntegration::PathRun::PathRun):
+        (WebCore::LayoutIntegration::PathRun::isText const):
+        (WebCore::LayoutIntegration::PathRun::rect const):
+        (WebCore::LayoutIntegration::PathRun::baseline const):
+        (WebCore::LayoutIntegration::PathRun::isHorizontal const):
+        (WebCore::LayoutIntegration::PathRun::dirOverride const):
+        (WebCore::LayoutIntegration::PathRun::isLineBreak const):
+        (WebCore::LayoutIntegration::PathRun::useLineBreakBoxRenderTreeDumpQuirk const):
+        (WebCore::LayoutIntegration::PathRun::minimumCaretOffset const):
+        (WebCore::LayoutIntegration::PathRun::maximumCaretOffset const):
+        (WebCore::LayoutIntegration::PathRun::bidiLevel const):
+        (WebCore::LayoutIntegration::PathRun::onSameLine const):
+        (WebCore::LayoutIntegration::PathRun::legacyInlineBox const):
+        (WebCore::LayoutIntegration::PathTextRun::hasHyphen const):
+        (WebCore::LayoutIntegration::PathTextRun::PathTextRun):
+        (WebCore::LayoutIntegration::PathTextRun::text const):
+        (WebCore::LayoutIntegration::PathTextRun::localStartOffset const):
+        (WebCore::LayoutIntegration::PathTextRun::localEndOffset const):
+        (WebCore::LayoutIntegration::PathTextRun::length const):
+        (WebCore::LayoutIntegration::PathTextRun::isLastTextRunOnLine const):
+        (WebCore::LayoutIntegration::PathTextRun::isLastTextRun const):
+        (isType):
+        (WebCore::LayoutIntegration::Run::leftmostCaretOffset const): Deleted.
+        (WebCore::LayoutIntegration::Run::rightmostCaretOffset const): Deleted.
+        (WebCore::LayoutIntegration::Run::direction const): Deleted.
+        (WebCore::LayoutIntegration::Run::isLeftToRightDirection const): Deleted.
+        (WebCore::LayoutIntegration::TextRun::legacyInlineBox const): Deleted.
+        (WebCore::LayoutIntegration::Run::Run): Deleted.
+        (WebCore::LayoutIntegration::Run::isText const): Deleted.
+        (WebCore::LayoutIntegration::Run::rect const): Deleted.
+        (WebCore::LayoutIntegration::Run::baseline const): Deleted.
+        (WebCore::LayoutIntegration::Run::isHorizontal const): Deleted.
+        (WebCore::LayoutIntegration::Run::dirOverride const): Deleted.
+        (WebCore::LayoutIntegration::Run::isLineBreak const): Deleted.
+        (WebCore::LayoutIntegration::Run::useLineBreakBoxRenderTreeDumpQuirk const): Deleted.
+        (WebCore::LayoutIntegration::Run::minimumCaretOffset const): Deleted.
+        (WebCore::LayoutIntegration::Run::maximumCaretOffset const): Deleted.
+        (WebCore::LayoutIntegration::Run::bidiLevel const): Deleted.
+        (WebCore::LayoutIntegration::Run::onSameLine const): Deleted.
+        (WebCore::LayoutIntegration::Run::legacyInlineBox const): Deleted.
+        (WebCore::LayoutIntegration::TextRun::hasHyphen const): Deleted.
+        (WebCore::LayoutIntegration::TextRun::TextRun): Deleted.
+        (WebCore::LayoutIntegration::TextRun::text const): Deleted.
+        (WebCore::LayoutIntegration::TextRun::localStartOffset const): Deleted.
+        (WebCore::LayoutIntegration::TextRun::localEndOffset const): Deleted.
+        (WebCore::LayoutIntegration::TextRun::length const): Deleted.
+        (WebCore::LayoutIntegration::TextRun::isLastTextRunOnLine const): Deleted.
+        (WebCore::LayoutIntegration::TextRun::isLastTextRun const): Deleted.
+        * layout/integration/LayoutIntegrationRunIteratorModernPath.h:
+        (WebCore::LayoutIntegration::ModernPath::ModernPath):
+        (WebCore::LayoutIntegration::ModernPath::runs const):
+        (WebCore::LayoutIntegration::ModernPath::run const):
+        (WebCore::LayoutIntegration::ModernPath::line const):
+        * layout/layouttree/LayoutTreeBuilder.cpp:
+        * rendering/RenderTreeAsText.cpp:
+        (WebCore::write):
+        (WebCore::writeTextRun): Deleted.
+        * rendering/TextPainter.cpp:
+        (WebCore::TextPainter::clearGlyphDisplayLists):
+
 2020-10-05  Zalan Bujtas  <za...@apple.com>
 
         [LFC][Integration] Enable non-uniform line height content with floats

Modified: trunk/Source/WebCore/Headers.cmake (267968 => 267969)


--- trunk/Source/WebCore/Headers.cmake	2020-10-05 15:40:54 UTC (rev 267968)
+++ trunk/Source/WebCore/Headers.cmake	2020-10-05 15:43:07 UTC (rev 267969)
@@ -705,13 +705,11 @@
     layout/LayoutUnits.h
     layout/MarginTypes.h
 
-    layout/displaytree/DisplayInlineContent.h
-    layout/displaytree/DisplayLine.h
-    layout/displaytree/DisplayRect.h
-    layout/displaytree/DisplayRun.h
-
     layout/inlineformatting/InlineRect.h
 
+    layout/integration/LayoutIntegrationInlineContent.h
+    layout/integration/LayoutIntegrationLine.h
+    layout/integration/LayoutIntegrationRun.h
     layout/integration/LayoutIntegrationRunIterator.h
     layout/integration/LayoutIntegrationRunIteratorLegacyPath.h
     layout/integration/LayoutIntegrationRunIteratorModernPath.h

Modified: trunk/Source/WebCore/Sources.txt (267968 => 267969)


--- trunk/Source/WebCore/Sources.txt	2020-10-05 15:40:54 UTC (rev 267968)
+++ trunk/Source/WebCore/Sources.txt	2020-10-05 15:43:07 UTC (rev 267969)
@@ -1451,7 +1451,6 @@
 layout/blockformatting/PrecomputedBlockMarginCollapse.cpp
 layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp
 layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContextQuirks.cpp
-layout/displaytree/DisplayInlineContent.cpp
 layout/displaytree/DisplayPainter.cpp
 layout/flexformatting/FlexFormattingContext.cpp
 layout/flexformatting/FlexFormattingContextGeometry.cpp
@@ -1472,6 +1471,7 @@
 layout/inlineformatting/text/TextUtil.cpp
 layout/integration/LayoutIntegrationBoxTree.cpp
 layout/integration/LayoutIntegrationCoverage.cpp
+layout/integration/LayoutIntegrationInlineContent.cpp
 layout/integration/LayoutIntegrationLineLayout.cpp
 layout/integration/LayoutIntegrationPagination.cpp
 layout/integration/LayoutIntegrationRunIterator.cpp

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (267968 => 267969)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2020-10-05 15:40:54 UTC (rev 267968)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2020-10-05 15:43:07 UTC (rev 267969)
@@ -2078,14 +2078,13 @@
 		6FA4454E898F2FC168BC38C1 /* JSBeforeUnloadEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 29E04A27BED2F81F98E9022B /* JSBeforeUnloadEvent.h */; };
 		6FB11B5C21783FD000E2A574 /* TextUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = 6FB11B5921783FCF00E2A574 /* TextUtil.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		6FB2400523DFF12800796458 /* InlineLineBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 6FB2400323DFF12700796458 /* InlineLineBox.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		6FB47E632277425A00C7BCB0 /* DisplayLine.h in Headers */ = {isa = PBXBuildFile; fileRef = 6FB47E612277425A00C7BCB0 /* DisplayLine.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		6FB47E632277425A00C7BCB0 /* LayoutIntegrationLine.h in Headers */ = {isa = PBXBuildFile; fileRef = 6FB47E612277425A00C7BCB0 /* LayoutIntegrationLine.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		6FB5E214221F2453003989CF /* ContentChangeObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 6FB5E212221F2447003989CF /* ContentChangeObserver.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		6FB7D2DD250FD828000207AA /* FlexFormattingContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 6FB7D2D9250FD7FC000207AA /* FlexFormattingContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		6FB7D2DE250FD82E000207AA /* FlexFormattingState.h in Headers */ = {isa = PBXBuildFile; fileRef = 6FB7D2DA250FD7FC000207AA /* FlexFormattingState.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		6FC3F9472516756700A49BEA /* InlineLineRun.h in Headers */ = {isa = PBXBuildFile; fileRef = 6FC3F9452516756600A49BEA /* InlineLineRun.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		6FCE1A1A22618ABD004F0343 /* DisplayRun.h in Headers */ = {isa = PBXBuildFile; fileRef = 6FCE1A1822618AB3004F0343 /* DisplayRun.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		6FCE1A1A22618ABD004F0343 /* LayoutIntegrationRun.h in Headers */ = {isa = PBXBuildFile; fileRef = 6FCE1A1822618AB3004F0343 /* LayoutIntegrationRun.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		6FD09543251115220098877D /* LayoutGeometryRect.h in Headers */ = {isa = PBXBuildFile; fileRef = 6FD09541251115220098877D /* LayoutGeometryRect.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		6FD9CD54227E21C800E53957 /* DisplayRect.h in Headers */ = {isa = PBXBuildFile; fileRef = 6FD9CD52227E21C800E53957 /* DisplayRect.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		6FE198172178397C00446F08 /* InlineContentBreaker.h in Headers */ = {isa = PBXBuildFile; fileRef = 6FE198152178397C00446F08 /* InlineContentBreaker.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		6FE7CFA22177EEF2005B1573 /* InlineItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 6FE7CFA02177EEF1005B1573 /* InlineItem.h */; };
 		6FFA4C0123F2FED9007E4EBC /* LayoutLineBreakBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 6FFA4C0023F2FED9007E4EBC /* LayoutLineBreakBox.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -5020,7 +5019,7 @@
 		E44FA1851BCA6B5A0091B6EF /* ComposedTreeIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = E44FA1841BCA6B5A0091B6EF /* ComposedTreeIterator.h */; };
 		E451C6312394027900993190 /* LayoutUnits.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F73918C2106CEDD006AF262 /* LayoutUnits.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		E451C6322394031A00993190 /* MarginTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 6FE7AA2621C37B6300296DCD /* MarginTypes.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		E451C6342394058F00993190 /* DisplayInlineContent.h in Headers */ = {isa = PBXBuildFile; fileRef = E451C6332394058E00993190 /* DisplayInlineContent.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		E451C6342394058F00993190 /* LayoutIntegrationInlineContent.h in Headers */ = {isa = PBXBuildFile; fileRef = E451C6332394058E00993190 /* LayoutIntegrationInlineContent.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		E45322AC140CE267005A0F92 /* SelectorQuery.h in Headers */ = {isa = PBXBuildFile; fileRef = E45322AA140CE267005A0F92 /* SelectorQuery.h */; };
 		E45A6C772417BA59006E4CD5 /* PseudoClassChangeInvalidation.h in Headers */ = {isa = PBXBuildFile; fileRef = E45A6C762417BA59006E4CD5 /* PseudoClassChangeInvalidation.h */; };
 		E45BA6AA2374926C004DFC07 /* MatchedDeclarationsCache.h in Headers */ = {isa = PBXBuildFile; fileRef = E45BA6A82374926B004DFC07 /* MatchedDeclarationsCache.h */; };
@@ -9644,7 +9643,7 @@
 		6FB11B5B21783FCF00E2A574 /* TextUtil.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextUtil.cpp; sourceTree = "<group>"; };
 		6FB22E30230097E300C20866 /* TableGrid.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TableGrid.h; sourceTree = "<group>"; };
 		6FB2400323DFF12700796458 /* InlineLineBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InlineLineBox.h; sourceTree = "<group>"; };
-		6FB47E612277425A00C7BCB0 /* DisplayLine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DisplayLine.h; sourceTree = "<group>"; };
+		6FB47E612277425A00C7BCB0 /* LayoutIntegrationLine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayoutIntegrationLine.h; sourceTree = "<group>"; };
 		6FB5E212221F2447003989CF /* ContentChangeObserver.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ContentChangeObserver.h; sourceTree = "<group>"; };
 		6FB7D2D7250FD7E5000207AA /* FlexFormattingContext.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FlexFormattingContext.cpp; sourceTree = "<group>"; };
 		6FB7D2D8250FD7EF000207AA /* FlexFormattingState.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FlexFormattingState.cpp; sourceTree = "<group>"; };
@@ -9657,9 +9656,8 @@
 		6FC5CA9422E3599400B13E11 /* TableFormattingContext.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TableFormattingContext.cpp; sourceTree = "<group>"; };
 		6FC5CA9522E3599400B13E11 /* TableFormattingContext.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TableFormattingContext.h; sourceTree = "<group>"; };
 		6FC5CA9622E3599500B13E11 /* TableFormattingState.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TableFormattingState.h; sourceTree = "<group>"; };
-		6FCE1A1822618AB3004F0343 /* DisplayRun.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DisplayRun.h; sourceTree = "<group>"; };
+		6FCE1A1822618AB3004F0343 /* LayoutIntegrationRun.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LayoutIntegrationRun.h; sourceTree = "<group>"; };
 		6FD09541251115220098877D /* LayoutGeometryRect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayoutGeometryRect.h; sourceTree = "<group>"; };
-		6FD9CD52227E21C800E53957 /* DisplayRect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DisplayRect.h; sourceTree = "<group>"; };
 		6FE198132178397B00446F08 /* InlineContentBreaker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InlineContentBreaker.cpp; sourceTree = "<group>"; };
 		6FE198152178397C00446F08 /* InlineContentBreaker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InlineContentBreaker.h; sourceTree = "<group>"; };
 		6FE7AA2621C37B6300296DCD /* MarginTypes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MarginTypes.h; sourceTree = "<group>"; };
@@ -15941,7 +15939,7 @@
 		E44EE3A717576E5500EEE8CF /* FontGenericFamilies.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FontGenericFamilies.h; sourceTree = "<group>"; };
 		E44FA1841BCA6B5A0091B6EF /* ComposedTreeIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ComposedTreeIterator.h; sourceTree = "<group>"; };
 		E44FA1861BCA91560091B6EF /* ComposedTreeIterator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ComposedTreeIterator.cpp; sourceTree = "<group>"; };
-		E451C6332394058E00993190 /* DisplayInlineContent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DisplayInlineContent.h; sourceTree = "<group>"; };
+		E451C6332394058E00993190 /* LayoutIntegrationInlineContent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayoutIntegrationInlineContent.h; sourceTree = "<group>"; };
 		E45322A9140CE267005A0F92 /* SelectorQuery.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SelectorQuery.cpp; sourceTree = "<group>"; };
 		E45322AA140CE267005A0F92 /* SelectorQuery.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectorQuery.h; sourceTree = "<group>"; };
 		E45390190EAFCACA003695C8 /* PasteboardIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PasteboardIOS.mm; sourceTree = "<group>"; };
@@ -16087,7 +16085,7 @@
 		E4E8B4F2216B8B6000B8834D /* FontCascadeDescription.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontCascadeDescription.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>"; };
+		E4FB4B35239BEB10003C336A /* LayoutIntegrationInlineContent.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = LayoutIntegrationInlineContent.cpp; sourceTree = "<group>"; };
 		E516698F20FF9916009D2C27 /* listbuttonar...@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "listbuttonar...@2x.png"; sourceTree = "<group>"; };
 		E517670220B88C1400D41167 /* DataListSuggestionInformation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DataListSuggestionInformation.h; sourceTree = "<group>"; };
 		E51A81DE17298D7700BFCA61 /* JSPerformance.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSPerformance.cpp; sourceTree = "<group>"; };
@@ -17627,13 +17625,8 @@
 		1199FA58208E3C4C002358CC /* displaytree */ = {
 			isa = PBXGroup;
 			children = (
-				E4FB4B35239BEB10003C336A /* DisplayInlineContent.cpp */,
-				E451C6332394058E00993190 /* DisplayInlineContent.h */,
-				6FB47E612277425A00C7BCB0 /* DisplayLine.h */,
 				6F77868523491AC6004D9636 /* DisplayPainter.cpp */,
 				6F77868723491AD7004D9636 /* DisplayPainter.h */,
-				6FD9CD52227E21C800E53957 /* DisplayRect.h */,
-				6FCE1A1822618AB3004F0343 /* DisplayRun.h */,
 			);
 			path = displaytree;
 			sourceTree = "<group>";
@@ -28537,10 +28530,14 @@
 				E418025323D4549A00FFB071 /* LayoutIntegrationBoxTree.h */,
 				E403B79F251B118B0019E800 /* LayoutIntegrationCoverage.cpp */,
 				E403B7A1251B11930019E800 /* LayoutIntegrationCoverage.h */,
+				E4FB4B35239BEB10003C336A /* LayoutIntegrationInlineContent.cpp */,
+				E451C6332394058E00993190 /* LayoutIntegrationInlineContent.h */,
+				6FB47E612277425A00C7BCB0 /* LayoutIntegrationLine.h */,
 				E4ABABDE2360893D00FA4345 /* LayoutIntegrationLineLayout.cpp */,
 				E4ABABDB236088FD00FA4345 /* LayoutIntegrationLineLayout.h */,
 				E4312AB524B3265600678349 /* LayoutIntegrationPagination.cpp */,
 				E4312AB724B3265600678349 /* LayoutIntegrationPagination.h */,
+				6FCE1A1822618AB3004F0343 /* LayoutIntegrationRun.h */,
 				E4A664C72521B779007081DC /* LayoutIntegrationRunIterator.cpp */,
 				E4A664C62521B778007081DC /* LayoutIntegrationRunIterator.h */,
 				E4A664C52521B778007081DC /* LayoutIntegrationRunIteratorLegacyPath.h */,
@@ -31183,9 +31180,9 @@
 				835D54C51F4DE53800E60671 /* DirectoryFileListCreator.h in Headers */,
 				F47A09D120A93A9700240FAE /* DisabledAdaptations.h in Headers */,
 				7EDAAFC919A2CCDC0034DFD1 /* DiskCacheMonitorCocoa.h in Headers */,
-				E451C6342394058F00993190 /* DisplayInlineContent.h in Headers */,
+				E451C6342394058F00993190 /* LayoutIntegrationInlineContent.h in Headers */,
 				0F790F422517CE6E009BA034 /* DisplayLayerController.h in Headers */,
-				6FB47E632277425A00C7BCB0 /* DisplayLine.h in Headers */,
+				6FB47E632277425A00C7BCB0 /* LayoutIntegrationLine.h in Headers */,
 				0FE5FBD31C3DD51E0007A2CA /* DisplayList.h in Headers */,
 				55AD09402408964000DE4D2F /* DisplayListDrawingContext.h in Headers */,
 				55AD093E2408963500DE4D2F /* DisplayListImageBuffer.h in Headers */,
@@ -31193,13 +31190,12 @@
 				0FE5FBD71C3DD51E0007A2CA /* DisplayListRecorder.h in Headers */,
 				0FE5FBD91C3DD51E0007A2CA /* DisplayListReplayer.h in Headers */,
 				6F77868823491AD8004D9636 /* DisplayPainter.h in Headers */,
-				6FD9CD54227E21C800E53957 /* DisplayRect.h in Headers */,
 				49AF2D6914435D050016A784 /* DisplayRefreshMonitor.h in Headers */,
 				2D29ECC6192ECC8300984B78 /* DisplayRefreshMonitorClient.h in Headers */,
 				2D29ECCA192F1F1D00984B78 /* DisplayRefreshMonitorIOS.h in Headers */,
 				2DE70023192FE82A00B0975C /* DisplayRefreshMonitorMac.h in Headers */,
 				2D29ECC8192ECC8300984B78 /* DisplayRefreshMonitorManager.h in Headers */,
-				6FCE1A1A22618ABD004F0343 /* DisplayRun.h in Headers */,
+				6FCE1A1A22618ABD004F0343 /* LayoutIntegrationRun.h in Headers */,
 				0F790F432517CE6E009BA034 /* DisplayView.h in Headers */,
 				FD31609112B026F700C1A359 /* Distance.h in Headers */,
 				83040283249A7A6200A90D8D /* DistanceModelType.h in Headers */,

Modified: trunk/Source/WebCore/display/DisplayView.h (267968 => 267969)


--- trunk/Source/WebCore/display/DisplayView.h	2020-10-05 15:40:54 UTC (rev 267968)
+++ trunk/Source/WebCore/display/DisplayView.h	2020-10-05 15:43:07 UTC (rev 267969)
@@ -28,7 +28,6 @@
 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
 
 #include "DisplayLayerController.h"
-#include "DisplayRect.h"
 #include "LayoutUnits.h"
 #include <wtf/IsoMalloc.h>
 

Modified: trunk/Source/WebCore/layout/FormattingContextGeometry.cpp (267968 => 267969)


--- trunk/Source/WebCore/layout/FormattingContextGeometry.cpp	2020-10-05 15:40:54 UTC (rev 267968)
+++ trunk/Source/WebCore/layout/FormattingContextGeometry.cpp	2020-10-05 15:43:07 UTC (rev 267969)
@@ -201,8 +201,8 @@
         auto& lines = layoutState.establishedFlexFormattingState(formattingRootContainer).lines();
         ASSERT(!lines.isEmpty());
         // FIXME: Move flex over to layout geometry.
-        top = lines.first().rect().y();
-        bottom = lines.last().rect().maxY();
+        top = lines.first().top();
+        bottom = lines.last().bottom();
     } else if (formattingRootContainer.establishesBlockFormattingContext() || formattingRootContainer.establishesTableFormattingContext() || formattingRootContainer.isDocumentBox()) {
         if (formattingRootContainer.hasInFlowChild()) {
             auto& firstBoxGeometry = formattingContext.geometryForBox(*formattingRootContainer.firstInFlowChild(), EscapeReason::NeedsGeometryFromEstablishedFormattingContext);

Deleted: trunk/Source/WebCore/layout/displaytree/DisplayInlineContent.cpp (267968 => 267969)


--- trunk/Source/WebCore/layout/displaytree/DisplayInlineContent.cpp	2020-10-05 15:40:54 UTC (rev 267968)
+++ trunk/Source/WebCore/layout/displaytree/DisplayInlineContent.cpp	2020-10-05 15:43:07 UTC (rev 267969)
@@ -1,56 +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.
-*/
-
-#include "config.h"
-
-#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
-
-#include "DisplayInlineContent.h"
-#include "RuntimeEnabledFeatures.h"
-#include "TextPainter.h"
-
-namespace WebCore {
-namespace Display {
-
-WTF::IteratorRange<const Run*> InlineContent::runsForRect(const LayoutRect&) const
-{
-    // FIXME: Do something efficient e.g. using line boxes.
-    if (runs.isEmpty())
-        return { nullptr, nullptr };
-    return { &runs.first(), &runs.last() + 1 };
-}
-
-InlineContent::~InlineContent()
-{
-    if (RuntimeEnabledFeatures::sharedFeatures().layoutFormattingContextIntegrationEnabled()) {
-        for (auto& run : runs)
-            TextPainter::removeGlyphDisplayList(run);
-    }
-}
-
-}
-}
-
-#endif

Deleted: trunk/Source/WebCore/layout/displaytree/DisplayInlineContent.h (267968 => 267969)


--- trunk/Source/WebCore/layout/displaytree/DisplayInlineContent.h	2020-10-05 15:40:54 UTC (rev 267968)
+++ trunk/Source/WebCore/layout/displaytree/DisplayInlineContent.h	2020-10-05 15:43:07 UTC (rev 267969)
@@ -1,65 +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
-
-#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
-
-#include "DisplayLine.h"
-#include "DisplayRun.h"
-#include <wtf/IteratorRange.h>
-#include <wtf/Vector.h>
-
-namespace WebCore {
-namespace Display {
-
-struct InlineContent : public RefCounted<InlineContent> {
-    static Ref<InlineContent> create() { return adoptRef(*new InlineContent); }
-    ~InlineContent();
-
-    using Runs = Vector<Run, 4>;
-    using Lines = Vector<Line, 4>;
-
-    Runs runs;
-    Lines lines;
-
-    const Line& lineForRun(const Run& run) const { return lines[run.lineIndex()]; }
-    WTF::IteratorRange<const Run*> runsForRect(const LayoutRect&) const;
-    void shrinkToFit();
-
-private:
-    InlineContent() = default;
-};
-
-inline void InlineContent::shrinkToFit()
-{
-    runs.shrinkToFit();
-    lines.shrinkToFit();
-}
-
-}
-}
-
-#endif

Deleted: trunk/Source/WebCore/layout/displaytree/DisplayLine.h (267968 => 267969)


--- trunk/Source/WebCore/layout/displaytree/DisplayLine.h	2020-10-05 15:40:54 UTC (rev 267968)
+++ trunk/Source/WebCore/layout/displaytree/DisplayLine.h	2020-10-05 15:43:07 UTC (rev 267969)
@@ -1,67 +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
-
-#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
-
-#include "FloatRect.h"
-
-namespace WebCore {
-namespace Display {
-
-class Line {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    Line(const FloatRect&, const FloatRect& scrollableOverflow, const FloatRect& inkOverflow, float baseline, float horizontalAlignmentOffset);
-
-    const FloatRect& rect() const { return m_rect; }
-    const FloatRect& scrollableOverflow() const { return m_scrollableOverflow; }
-    const FloatRect& inkOverflow() const { return m_inkOverflow; }
-    float baseline() const { return m_baseline; }
-    float horizontalAlignmentOffset() const { return m_horizontalAlignmentOffset; }
-
-
-private:
-    FloatRect m_rect;
-    FloatRect m_scrollableOverflow;
-    FloatRect m_inkOverflow;
-    float m_baseline { 0 };
-    float m_horizontalAlignmentOffset;
-};
-
-inline Line::Line(const FloatRect& rect, const FloatRect& scrollableOverflow, const FloatRect& inkOverflow, float baseline, float horizontalAlignmentOffset)
-    : m_rect(rect)
-    , m_scrollableOverflow(scrollableOverflow)
-    , m_inkOverflow(inkOverflow)
-    , m_baseline(baseline)
-    , m_horizontalAlignmentOffset(horizontalAlignmentOffset)
-{
-}
-
-}
-}
-
-#endif

Deleted: trunk/Source/WebCore/layout/displaytree/DisplayRect.h (267968 => 267969)


--- trunk/Source/WebCore/layout/displaytree/DisplayRect.h	2020-10-05 15:40:54 UTC (rev 267968)
+++ trunk/Source/WebCore/layout/displaytree/DisplayRect.h	2020-10-05 15:43:07 UTC (rev 267969)
@@ -1,308 +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
-
-#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
-
-#include "LayoutRect.h"
-#include "LayoutUnits.h"
-
-namespace WebCore {
-namespace Display {
-
-class Rect {
-public:
-    Rect() = default;
-    Rect(LayoutUnit top, LayoutUnit left, LayoutUnit width, LayoutUnit height);
-    Rect(LayoutPoint topLeft, LayoutUnit width, LayoutUnit height);
-    Rect(const LayoutPoint& topLeft, const LayoutSize&);
-    
-    LayoutUnit top() const;
-    LayoutUnit left() const;
-    LayoutPoint topLeft() const;
-
-    LayoutUnit bottom() const;
-    LayoutUnit right() const;        
-    LayoutPoint bottomRight() const;
-
-    LayoutUnit width() const;
-    LayoutUnit height() const;
-    LayoutSize size() const;
-
-    void setTop(LayoutUnit);
-    void setLeft(LayoutUnit);
-    void setTopLeft(const LayoutPoint&);
-    void setWidth(LayoutUnit);
-    void setHeight(LayoutUnit);
-    void setSize(const LayoutSize&);
-
-    void shiftLeftTo(LayoutUnit);
-    void shiftRightTo(LayoutUnit);
-    void shiftTopTo(LayoutUnit);
-    void shiftBottomTo(LayoutUnit);
-
-    void moveHorizontally(LayoutUnit);
-    void moveVertically(LayoutUnit);
-
-    void expand(Optional<LayoutUnit>, Optional<LayoutUnit>);
-    void expandHorizontally(LayoutUnit delta) { expand(delta, { }); }
-    void expandVertically(LayoutUnit delta) { expand({ }, delta); }
-    bool intersects(const Rect& rect) const { return m_rect.intersects(rect); }
-
-    Rect clone() const;
-    operator LayoutRect() const;
-
-private:
-#if ASSERT_ENABLED
-    void invalidateTop() { m_hasValidTop = false; }
-    void invalidateLeft() { m_hasValidLeft = false; }
-    void invalidateWidth() { m_hasValidWidth = false; }
-    void invalidateHeight() { m_hasValidHeight = false; }
-    void invalidatePosition();
-
-    bool hasValidPosition() const { return m_hasValidTop && m_hasValidLeft; }
-    bool hasValidSize() const { return m_hasValidWidth && m_hasValidHeight; }
-    bool hasValidGeometry() const { return hasValidPosition() && hasValidSize(); }
-
-    void setHasValidPosition();
-    void setHasValidSize();
-
-    bool m_hasValidTop { false };
-    bool m_hasValidLeft { false };
-    bool m_hasValidWidth { false };
-    bool m_hasValidHeight { false };
-#endif // ASSERT_ENABLED
-    LayoutRect m_rect;
-};
-
-inline Rect::Rect(LayoutUnit top, LayoutUnit left, LayoutUnit width, LayoutUnit height)
-    : m_rect(left, top, width, height)
-{
-#if ASSERT_ENABLED
-    m_hasValidTop = true;
-    m_hasValidLeft = true;
-    m_hasValidWidth = true;
-    m_hasValidHeight = true;
-#endif
-}
-
-inline Rect::Rect(LayoutPoint topLeft, LayoutUnit width, LayoutUnit height)
-    : Rect(topLeft.y(), topLeft.x(), width, height)
-{
-}
-
-inline Rect::Rect(const LayoutPoint& topLeft, const LayoutSize& size)
-    : Rect(topLeft.y(), topLeft.x(), size.width(), size.height())
-{
-}
-
-#if ASSERT_ENABLED
-inline void Rect::invalidatePosition()
-{
-    invalidateTop();
-    invalidateLeft();
-}
-
-inline void Rect::setHasValidPosition()
-{
-    m_hasValidTop = true;
-    m_hasValidLeft = true;
-}
-
-inline void Rect::setHasValidSize()
-{
-    m_hasValidWidth = true;
-    m_hasValidHeight = true;
-}
-#endif
-
-inline LayoutUnit Rect::top() const
-{
-    ASSERT(m_hasValidTop);
-    return m_rect.y();
-}
-
-inline LayoutUnit Rect::left() const
-{
-    ASSERT(m_hasValidLeft);
-    return m_rect.x();
-}
-
-inline LayoutUnit Rect::bottom() const
-{
-    ASSERT(m_hasValidTop && m_hasValidHeight);
-    return m_rect.maxY();
-}
-
-inline LayoutUnit Rect::right() const
-{
-    ASSERT(m_hasValidLeft && m_hasValidWidth);
-    return m_rect.maxX();
-}
-
-inline LayoutPoint Rect::topLeft() const
-{
-    ASSERT(hasValidPosition());
-    return m_rect.minXMinYCorner();
-}
-
-inline LayoutPoint Rect::bottomRight() const
-{
-    ASSERT(hasValidGeometry());
-    return m_rect.maxXMaxYCorner();
-}
-
-inline LayoutSize Rect::size() const
-{
-    ASSERT(hasValidSize());
-    return m_rect.size();
-}
-
-inline LayoutUnit Rect::width() const
-{
-    ASSERT(m_hasValidWidth);
-    return m_rect.width();
-}
-
-inline LayoutUnit Rect::height() const
-{
-    ASSERT(m_hasValidHeight);
-    return m_rect.height();
-}
-
-inline void Rect::setTopLeft(const LayoutPoint& topLeft)
-{
-#if ASSERT_ENABLED
-    setHasValidPosition();
-#endif
-    m_rect.setLocation(topLeft);
-}
-
-inline void Rect::setTop(LayoutUnit top)
-{
-#if ASSERT_ENABLED
-    m_hasValidTop = true;
-#endif
-    m_rect.setY(top);
-}
-
-inline void Rect::setLeft(LayoutUnit left)
-{
-#if ASSERT_ENABLED
-    m_hasValidLeft = true;
-#endif
-    m_rect.setX(left);
-}
-
-inline void Rect::setWidth(LayoutUnit width)
-{
-#if ASSERT_ENABLED
-    m_hasValidWidth = true;
-#endif
-    m_rect.setWidth(width);
-}
-
-inline void Rect::setHeight(LayoutUnit height)
-{
-#if ASSERT_ENABLED
-    m_hasValidHeight = true;
-#endif
-    m_rect.setHeight(height);
-}
-
-inline void Rect::setSize(const LayoutSize& size)
-{
-#if ASSERT_ENABLED
-    setHasValidSize();
-#endif
-    m_rect.setSize(size);
-}
-
-inline void Rect::shiftLeftTo(LayoutUnit left)
-{
-    ASSERT(m_hasValidLeft);
-    m_rect.shiftXEdgeTo(left);
-}
-
-inline void Rect::shiftRightTo(LayoutUnit right)
-{
-    ASSERT(m_hasValidLeft && m_hasValidWidth);
-    m_rect.shiftMaxXEdgeTo(right);
-}
-
-inline void Rect::shiftTopTo(LayoutUnit top)
-{
-    ASSERT(m_hasValidTop);
-    m_rect.shiftYEdgeTo(top);
-}
-
-inline void Rect::shiftBottomTo(LayoutUnit bottom)
-{
-    ASSERT(m_hasValidTop && m_hasValidHeight);
-    m_rect.shiftMaxYEdgeTo(bottom);
-}
-
-inline void Rect::moveHorizontally(LayoutUnit offset)
-{
-    ASSERT(m_hasValidLeft);
-    m_rect.move(LayoutSize { offset, 0 });
-}
-
-inline void Rect::moveVertically(LayoutUnit offset)
-{
-    ASSERT(m_hasValidTop);
-    m_rect.move(LayoutSize { 0, offset });
-}
-
-inline void Rect::expand(Optional<LayoutUnit> width, Optional<LayoutUnit> height)
-{
-    ASSERT(!width || m_hasValidWidth);
-    ASSERT(!height || m_hasValidHeight);
-    m_rect.expand(width.valueOr(0), height.valueOr(0));
-}
-
-inline Rect Rect::clone() const
-{
-    Rect rect;
-#if ASSERT_ENABLED
-    rect.m_hasValidTop = m_hasValidTop;
-    rect.m_hasValidLeft = m_hasValidLeft;
-    rect.m_hasValidWidth = m_hasValidWidth;
-    rect.m_hasValidHeight  = m_hasValidHeight;
-#endif 
-    rect.m_rect = m_rect;
-    return rect;
-}
-
-inline Rect::operator LayoutRect() const
-{
-    ASSERT(hasValidGeometry()); 
-    return m_rect;
-}
-
-}
-}
-#endif

Deleted: trunk/Source/WebCore/layout/displaytree/DisplayRun.h (267968 => 267969)


--- trunk/Source/WebCore/layout/displaytree/DisplayRun.h	2020-10-05 15:40:54 UTC (rev 267968)
+++ trunk/Source/WebCore/layout/displaytree/DisplayRun.h	2020-10-05 15:43:07 UTC (rev 267969)
@@ -1,118 +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
-
-#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
-
-#include "InlineRect.h"
-#include "LayoutBox.h"
-#include "RenderStyle.h"
-#include "TextFlags.h"
-
-namespace WebCore {
-
-class CachedImage;
-
-namespace Display {
-
-struct Run {
-    WTF_MAKE_STRUCT_FAST_ALLOCATED;
-    struct TextContent {
-        WTF_MAKE_STRUCT_FAST_ALLOCATED;
-    public:
-        TextContent(size_t position, size_t length, const String&, bool needsHyphen);
-
-        size_t start() const { return m_start; }
-        size_t end() const { return start() + length(); }
-        size_t length() const { return m_length; }
-        StringView content() const { return StringView(m_contentString).substring(m_start, m_length); }
-        bool needsHyphen() const { return m_needsHyphen; }
-
-    private:
-        size_t m_start { 0 };
-        size_t m_length { 0 };
-        bool m_needsHyphen { false };
-        String m_contentString;
-    };
-
-    struct Expansion;
-    Run(size_t lineIndex, const Layout::Box&, const FloatRect&, const FloatRect& inkOverflow, Expansion, Optional<TextContent> = WTF::nullopt);
-
-    const FloatRect& rect() const { return m_rect; }
-    const FloatRect& inkOverflow() const { return m_inkOverflow; }
-
-    Optional<TextContent>& textContent() { return m_textContent; }
-    const Optional<TextContent>& textContent() const { return m_textContent; }
-    // FIXME: This information should be preserved at Run construction time.
-    bool isLineBreak() const { return layoutBox().isLineBreakBox() || (textContent() && textContent()->content() == "\n" && style().preserveNewline()); }
-
-    struct Expansion {
-        ExpansionBehavior behavior { DefaultExpansion };
-        InlineLayoutUnit horizontalExpansion { 0 };
-    };
-    Expansion expansion() const { return m_expansion; }
-
-    CachedImage* image() const { return m_cachedImage; }
-
-    bool hasUnderlyingLayout() const { return !!m_layoutBox; }
-    
-    const Layout::Box& layoutBox() const { return *m_layoutBox; }
-    const RenderStyle& style() const { return m_layoutBox->style(); }
-
-    size_t lineIndex() const { return m_lineIndex; }
-
-private:
-    // FIXME: Find out the Display::Run <-> paint style setup.
-    const size_t m_lineIndex;
-    WeakPtr<const Layout::Box> m_layoutBox;
-    CachedImage* m_cachedImage { nullptr };
-    FloatRect m_rect;
-    FloatRect m_inkOverflow;
-    Expansion m_expansion;
-    Optional<TextContent> m_textContent;
-};
-
-inline Run::Run(size_t lineIndex, const Layout::Box& layoutBox, const FloatRect& rect, const FloatRect& inkOverflow, Expansion expansion, Optional<TextContent> textContent)
-    : m_lineIndex(lineIndex)
-    , m_layoutBox(makeWeakPtr(layoutBox))
-    , m_rect(rect)
-    , m_inkOverflow(inkOverflow)
-    , m_expansion(expansion)
-    , m_textContent(textContent)
-{
-}
-
-inline Run::TextContent::TextContent(size_t start, size_t length, const String& contentString, bool needsHyphen)
-    : m_start(start)
-    , m_length(length)
-    , m_needsHyphen(needsHyphen)
-    , m_contentString(contentString)
-{
-}
-
-}
-}
-#endif

Modified: trunk/Source/WebCore/layout/flexformatting/FlexFormattingContext.cpp (267968 => 267969)


--- trunk/Source/WebCore/layout/flexformatting/FlexFormattingContext.cpp	2020-10-05 15:40:54 UTC (rev 267968)
+++ trunk/Source/WebCore/layout/flexformatting/FlexFormattingContext.cpp	2020-10-05 15:43:07 UTC (rev 267969)
@@ -97,7 +97,7 @@
         computeFlexItemGeometry();
     }
     auto flexLine = InlineRect { flexItemCrosAxisStart, flexItemMainAxisStart, flexItemMainAxisEnd - flexItemMainAxisStart, flexItemCrosAxisEnd - flexItemCrosAxisStart };
-    formattingState.addLine({ flexLine, flexLine, flexLine, { }, { } });
+    formattingState.addLine(flexLine);
 }
 
 void FlexFormattingContext::computeIntrinsicWidthConstraintsForFlexItems()

Modified: trunk/Source/WebCore/layout/flexformatting/FlexFormattingState.h (267968 => 267969)


--- trunk/Source/WebCore/layout/flexformatting/FlexFormattingState.h	2020-10-05 15:40:54 UTC (rev 267968)
+++ trunk/Source/WebCore/layout/flexformatting/FlexFormattingState.h	2020-10-05 15:43:07 UTC (rev 267969)
@@ -27,8 +27,8 @@
 
 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
 
-#include "DisplayLine.h"
 #include "FormattingState.h"
+#include "InlineRect.h"
 #include <wtf/IsoMalloc.h>
 
 namespace WebCore {
@@ -40,12 +40,11 @@
     FlexFormattingState(Ref<FloatingState>&&, LayoutState&);
     ~FlexFormattingState();
 
-    using FlexLines = Vector<Display::Line>;
-    const FlexLines& lines() const { return m_lines; }
-    void addLine(const Display::Line& line) { m_lines.append(line); }
+    const auto& lines() const { return m_lines; }
+    void addLine(const InlineRect& line) { m_lines.append(line); }
 
 private:
-    FlexLines m_lines;
+    Vector<InlineRect> m_lines;
 };
 
 }

Copied: trunk/Source/WebCore/layout/integration/LayoutIntegrationInlineContent.cpp (from rev 267968, trunk/Source/WebCore/layout/displaytree/DisplayInlineContent.cpp) (0 => 267969)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationInlineContent.cpp	                        (rev 0)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationInlineContent.cpp	2020-10-05 15:43:07 UTC (rev 267969)
@@ -0,0 +1,56 @@
+/*
+* 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.
+*/
+
+#include "config.h"
+#include "LayoutIntegrationInlineContent.h"
+
+#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
+
+#include "RuntimeEnabledFeatures.h"
+#include "TextPainter.h"
+
+namespace WebCore {
+namespace LayoutIntegration {
+
+WTF::IteratorRange<const Run*> InlineContent::runsForRect(const LayoutRect&) const
+{
+    // FIXME: Do something efficient e.g. using line boxes.
+    if (runs.isEmpty())
+        return { nullptr, nullptr };
+    return { &runs.first(), &runs.last() + 1 };
+}
+
+InlineContent::~InlineContent()
+{
+    if (RuntimeEnabledFeatures::sharedFeatures().layoutFormattingContextIntegrationEnabled()) {
+        for (auto& run : runs)
+            TextPainter::removeGlyphDisplayList(run);
+    }
+}
+
+}
+}
+
+#endif

Copied: trunk/Source/WebCore/layout/integration/LayoutIntegrationInlineContent.h (from rev 267968, trunk/Source/WebCore/layout/displaytree/DisplayInlineContent.h) (0 => 267969)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationInlineContent.h	                        (rev 0)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationInlineContent.h	2020-10-05 15:43:07 UTC (rev 267969)
@@ -0,0 +1,65 @@
+/*
+ * 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
+
+#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
+
+#include "LayoutIntegrationLine.h"
+#include "LayoutIntegrationRun.h"
+#include <wtf/IteratorRange.h>
+#include <wtf/Vector.h>
+
+namespace WebCore {
+namespace LayoutIntegration {
+
+struct InlineContent : public RefCounted<InlineContent> {
+    static Ref<InlineContent> create() { return adoptRef(*new InlineContent); }
+    ~InlineContent();
+
+    using Runs = Vector<Run, 4>;
+    using Lines = Vector<Line, 4>;
+
+    Runs runs;
+    Lines lines;
+
+    const Line& lineForRun(const Run& run) const { return lines[run.lineIndex()]; }
+    WTF::IteratorRange<const Run*> runsForRect(const LayoutRect&) const;
+    void shrinkToFit();
+
+private:
+    InlineContent() = default;
+};
+
+inline void InlineContent::shrinkToFit()
+{
+    runs.shrinkToFit();
+    lines.shrinkToFit();
+}
+
+}
+}
+
+#endif

Copied: trunk/Source/WebCore/layout/integration/LayoutIntegrationLine.h (from rev 267968, trunk/Source/WebCore/layout/displaytree/DisplayLine.h) (0 => 267969)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationLine.h	                        (rev 0)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationLine.h	2020-10-05 15:43:07 UTC (rev 267969)
@@ -0,0 +1,67 @@
+/*
+ * 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
+
+#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
+
+#include "FloatRect.h"
+
+namespace WebCore {
+namespace LayoutIntegration {
+
+class Line {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    Line(const FloatRect&, const FloatRect& scrollableOverflow, const FloatRect& inkOverflow, float baseline, float horizontalAlignmentOffset);
+
+    const FloatRect& rect() const { return m_rect; }
+    const FloatRect& scrollableOverflow() const { return m_scrollableOverflow; }
+    const FloatRect& inkOverflow() const { return m_inkOverflow; }
+    float baseline() const { return m_baseline; }
+    float horizontalAlignmentOffset() const { return m_horizontalAlignmentOffset; }
+
+
+private:
+    FloatRect m_rect;
+    FloatRect m_scrollableOverflow;
+    FloatRect m_inkOverflow;
+    float m_baseline { 0 };
+    float m_horizontalAlignmentOffset;
+};
+
+inline Line::Line(const FloatRect& rect, const FloatRect& scrollableOverflow, const FloatRect& inkOverflow, float baseline, float horizontalAlignmentOffset)
+    : m_rect(rect)
+    , m_scrollableOverflow(scrollableOverflow)
+    , m_inkOverflow(inkOverflow)
+    , m_baseline(baseline)
+    , m_horizontalAlignmentOffset(horizontalAlignmentOffset)
+{
+}
+
+}
+}
+
+#endif

Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp (267968 => 267969)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp	2020-10-05 15:40:54 UTC (rev 267968)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp	2020-10-05 15:43:07 UTC (rev 267969)
@@ -105,7 +105,7 @@
     prepareLayoutState();
     prepareFloatingState();
 
-    m_displayInlineContent = nullptr;
+    m_inlineContent = nullptr;
     auto inlineFormattingContext = Layout::InlineFormattingContext { rootLayoutBox(), m_inlineFormattingState };
 
     auto invalidationState = Layout::InvalidationState { };
@@ -113,12 +113,12 @@
     auto verticalConstraints = Layout::VerticalConstraints { m_flow.borderAndPaddingBefore(), { } };
 
     inlineFormattingContext.layoutInFlowContent(invalidationState, { horizontalConstraints, verticalConstraints });
-    constructDisplayContent();
+    constructContent();
 }
 
-void LineLayout::constructDisplayContent()
+void LineLayout::constructContent()
 {
-    auto& displayInlineContent = ensureDisplayInlineContent();
+    auto& displayInlineContent = ensureInlineContent();
 
     auto constructDisplayLineRuns = [&] {
         auto initialContaingBlockSize = m_layoutState.viewportSize();
@@ -141,17 +141,17 @@
                 return inkOverflow;
             };
             auto logicalRect = FloatRect { lineRun.logicalRect() };
-            // Inline boxes are relative to the line box while final Display::Runs need to be relative to the parent Display:Box
+            // Inline boxes are relative to the line box while final Runs need to be relative to the parent Box
             // FIXME: Shouldn't we just leave them be relative to the line box?
             auto lineIndex = lineRun.lineIndex();
             auto& lineBoxLogicalRect = m_inlineFormattingState.lines()[lineIndex].lineBoxLogicalRect();
             logicalRect.moveBy({ lineBoxLogicalRect.left(), lineBoxLogicalRect.top() });
 
-            WTF::Optional<Display::Run::TextContent> textContent;
+            WTF::Optional<Run::TextContent> textContent;
             if (auto text = lineRun.text())
-                textContent = Display::Run::TextContent { text->start(), text->length(), text->content(), text->needsHyphen() };
-            auto expansion = Display::Run::Expansion { lineRun.expansion().behavior, lineRun.expansion().horizontalExpansion };
-            auto displayRun = Display::Run { lineIndex, layoutBox, logicalRect, computedInkOverflow(logicalRect), expansion, textContent };
+                textContent = Run::TextContent { text->start(), text->length(), text->content(), text->needsHyphen() };
+            auto expansion = Run::Expansion { lineRun.expansion().behavior, lineRun.expansion().horizontalExpansion };
+            auto displayRun = Run { lineIndex, layoutBox, logicalRect, computedInkOverflow(logicalRect), expansion, textContent };
             displayInlineContent.runs.append(displayRun);
         }
     };
@@ -229,10 +229,9 @@
 
 size_t LineLayout::lineCount() const
 {
-    auto* inlineContent = displayInlineContent();
-    if (!inlineContent)
+    if (!m_inlineContent)
         return 0;
-    if (inlineContent->runs.isEmpty())
+    if (m_inlineContent->runs.isEmpty())
         return 0;
     return m_inlineFormattingState.lines().size();
 }
@@ -264,8 +263,8 @@
 void LineLayout::adjustForPagination(RenderBlockFlow& flow)
 {
     ASSERT(&flow == &m_flow);
-    auto paginedInlineContent = adjustLinePositionsForPagination(*m_displayInlineContent, flow);
-    if (paginedInlineContent.ptr() == m_displayInlineContent) {
+    auto paginedInlineContent = adjustLinePositionsForPagination(*m_inlineContent, flow);
+    if (paginedInlineContent.ptr() == m_inlineContent) {
         m_paginatedHeight = { };
         return;
     }
@@ -273,7 +272,7 @@
     auto& lines = paginedInlineContent->lines;
     m_paginatedHeight = LayoutUnit { lines.last().rect().maxY() - lines.first().rect().y() };
 
-    m_displayInlineContent = WTFMove(paginedInlineContent);
+    m_inlineContent = WTFMove(paginedInlineContent);
 }
 
 void LineLayout::collectOverflow(RenderBlockFlow& flow)
@@ -281,30 +280,29 @@
     ASSERT(&flow == &m_flow);
     ASSERT(!flow.hasOverflowClip());
 
-    for (auto& line : displayInlineContent()->lines) {
+    for (auto& line : inlineContent()->lines) {
         flow.addLayoutOverflow(Layout::toLayoutRect(line.scrollableOverflow()));
         flow.addVisualOverflow(Layout::toLayoutRect(line.inkOverflow()));
     }
 }
 
-Display::InlineContent& LineLayout::ensureDisplayInlineContent()
+InlineContent& LineLayout::ensureInlineContent()
 {
-    if (!m_displayInlineContent)
-        m_displayInlineContent = Display::InlineContent::create();
-    return *m_displayInlineContent;
+    if (!m_inlineContent)
+        m_inlineContent = InlineContent::create();
+    return *m_inlineContent;
 }
 
 TextRunIterator LineLayout::textRunsFor(const RenderText& renderText) const
 {
-    auto* inlineContent = displayInlineContent();
-    if (!inlineContent)
+    if (!m_inlineContent)
         return { };
     auto* layoutBox = m_boxTree.layoutBoxForRenderer(renderText);
     ASSERT(layoutBox);
 
     auto firstIndex = [&]() -> Optional<size_t> {
-        for (size_t i = 0; i < inlineContent->runs.size(); ++i) {
-            if (&inlineContent->runs[i].layoutBox() == layoutBox)
+        for (size_t i = 0; i < m_inlineContent->runs.size(); ++i) {
+            if (&m_inlineContent->runs[i].layoutBox() == layoutBox)
                 return i;
         }
         return { };
@@ -313,21 +311,20 @@
     if (!firstIndex)
         return { };
 
-    return { LayoutIntegration::ModernPath(*inlineContent, *firstIndex) };
+    return { LayoutIntegration::ModernPath(*m_inlineContent, *firstIndex) };
 }
 
 RunIterator LineLayout::runFor(const RenderElement& renderElement) const
 {
-    auto* inlineContent = displayInlineContent();
-    if (!inlineContent)
+    if (!m_inlineContent)
         return { };
     auto* layoutBox = m_boxTree.layoutBoxForRenderer(renderElement);
     ASSERT(layoutBox);
 
-    for (size_t i = 0; i < inlineContent->runs.size(); ++i) {
-        auto& run =  inlineContent->runs[i];
+    for (size_t i = 0; i < m_inlineContent->runs.size(); ++i) {
+        auto& run =  m_inlineContent->runs[i];
         if (&run.layoutBox() == layoutBox)
-            return { LayoutIntegration::ModernPath(*inlineContent, i) };
+            return { LayoutIntegration::ModernPath(*m_inlineContent, i) };
     }
 
     return { };
@@ -345,13 +342,13 @@
 
 void LineLayout::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
 {
-    if (!displayInlineContent())
+    if (!m_inlineContent)
         return;
 
     if (paintInfo.phase != PaintPhase::Foreground && paintInfo.phase != PaintPhase::EventRegion)
         return;
 
-    auto& inlineContent = *displayInlineContent();
+    auto& inlineContent = *m_inlineContent;
     float deviceScaleFactor = m_flow.document().deviceScaleFactor();
 
     auto paintRect = paintInfo.rect;
@@ -419,10 +416,10 @@
     if (hitTestAction != HitTestForeground)
         return false;
 
-    if (!displayInlineContent())
+    if (!m_inlineContent)
         return false;
 
-    auto& inlineContent = *displayInlineContent();
+    auto& inlineContent = *m_inlineContent;
 
     // FIXME: This should do something efficient to find the run range.
     for (auto& run : inlineContent.runs) {

Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.h (267968 => 267969)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.h	2020-10-05 15:40:54 UTC (rev 267968)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.h	2020-10-05 15:43:07 UTC (rev 267969)
@@ -43,12 +43,10 @@
 class RenderLineBreak;
 struct PaintInfo;
 
-namespace Display {
+namespace LayoutIntegration {
+
 struct InlineContent;
-}
 
-namespace LayoutIntegration {
-
 class LineLayout {
     WTF_MAKE_FAST_ALLOCATED;
 public:
@@ -71,7 +69,7 @@
     void adjustForPagination(RenderBlockFlow&);
     void collectOverflow(RenderBlockFlow&);
 
-    const Display::InlineContent* displayInlineContent() const { return m_displayInlineContent.get(); }
+    const InlineContent* inlineContent() const { return m_inlineContent.get(); }
     bool isPaginated() const { return !!m_paginatedHeight; }
 
     void paint(PaintInfo&, const LayoutPoint& paintOffset);
@@ -85,8 +83,8 @@
 private:
     void prepareLayoutState();
     void prepareFloatingState();
-    void constructDisplayContent();
-    Display::InlineContent& ensureDisplayInlineContent();
+    void constructContent();
+    InlineContent& ensureInlineContent();
 
     const Layout::ContainerBox& rootLayoutBox() const;
     Layout::ContainerBox& rootLayoutBox();
@@ -97,7 +95,7 @@
     BoxTree m_boxTree;
     Layout::LayoutState m_layoutState;
     Layout::InlineFormattingState& m_inlineFormattingState;
-    RefPtr<Display::InlineContent> m_displayInlineContent;
+    RefPtr<InlineContent> m_inlineContent;
     Optional<LayoutUnit> m_paginatedHeight;
 };
 

Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationPagination.cpp (267968 => 267969)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationPagination.cpp	2020-10-05 15:40:54 UTC (rev 267968)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationPagination.cpp	2020-10-05 15:43:07 UTC (rev 267969)
@@ -45,7 +45,7 @@
 };
 using PaginatedLines = Vector<PaginatedLine, 20>;
 
-static PaginatedLine computeLineTopAndBottomWithOverflow(const RenderBlockFlow&, Display::InlineContent::Lines& lines, unsigned lineIndex, Vector<Strut>& struts)
+static PaginatedLine computeLineTopAndBottomWithOverflow(const RenderBlockFlow&, InlineContent::Lines& lines, unsigned lineIndex, Vector<Strut>& struts)
 {
     LayoutUnit offset = 0;
     for (auto& strut : struts) {
@@ -108,7 +108,7 @@
     struts.append({ lineBreakIndex, computeOffsetAfterLineBreak(lines[lineBreakIndex].top, !lineBreakIndex, atTheTopOfColumnOrPage, flow) });
 }
 
-static void updateMinimumPageHeight(RenderBlockFlow& flow, const Display::InlineContent& inlineContent, unsigned lineCount)
+static void updateMinimumPageHeight(RenderBlockFlow& flow, const InlineContent& inlineContent, unsigned lineCount)
 {
     auto& style = flow.style();
     auto widows = style.hasAutoWidows() ? 1 : std::max<int>(style.widows(), 1);
@@ -117,7 +117,7 @@
     flow.updateMinimumPageHeight(0, LayoutUnit(inlineContent.lines[minimumLineCount - 1].rect().maxY()));
 }
 
-static Ref<Display::InlineContent> makeAdjustedContent(const Display::InlineContent& inlineContent, Vector<float> adjustments)
+static Ref<InlineContent> makeAdjustedContent(const InlineContent& inlineContent, Vector<float> adjustments)
 {
     auto moveVertically = [](FloatRect rect, float offset) {
         rect.move(FloatSize(0, offset));
@@ -124,9 +124,9 @@
         return rect;
     };
 
-    auto adjustedLine = [&](const Display::Line& line, float offset)
+    auto adjustedLine = [&](const Line& line, float offset)
     {
-        return Display::Line {
+        return Line {
             moveVertically(line.rect(), offset),
             moveVertically(line.scrollableOverflow(), offset),
             moveVertically(line.inkOverflow(), offset),
@@ -135,9 +135,9 @@
         };
     };
 
-    auto adjustedRun = [&](const Display::Run& run, float offset)
+    auto adjustedRun = [&](const Run& run, float offset)
     {
-        return Display::Run {
+        return Run {
             run.lineIndex(),
             run.layoutBox(),
             moveVertically(run.rect(), offset),
@@ -147,7 +147,7 @@
         };
     };
 
-    auto adjustedContent = Display::InlineContent::create();
+    auto adjustedContent = InlineContent::create();
 
     for (size_t lineIndex = 0; lineIndex < inlineContent.lines.size(); ++lineIndex)
         adjustedContent->lines.append(adjustedLine(inlineContent.lines[lineIndex], adjustments[lineIndex]));
@@ -158,7 +158,7 @@
     return adjustedContent;
 }
 
-Ref<Display::InlineContent> adjustLinePositionsForPagination(Display::InlineContent& inlineContent, RenderBlockFlow& flow)
+Ref<InlineContent> adjustLinePositionsForPagination(InlineContent& inlineContent, RenderBlockFlow& flow)
 {
     Vector<Strut> struts;
     auto lineCount = inlineContent.lines.size();

Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationPagination.h (267968 => 267969)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationPagination.h	2020-10-05 15:40:54 UTC (rev 267968)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationPagination.h	2020-10-05 15:43:07 UTC (rev 267969)
@@ -27,7 +27,7 @@
 
 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
 
-#include "DisplayInlineContent.h"
+#include "LayoutIntegrationInlineContent.h"
 
 namespace WebCore {
 
@@ -35,7 +35,7 @@
 
 namespace LayoutIntegration {
     
-Ref<Display::InlineContent> adjustLinePositionsForPagination(Display::InlineContent&, RenderBlockFlow&);
+Ref<InlineContent> adjustLinePositionsForPagination(InlineContent&, RenderBlockFlow&);
 
 }
 }

Copied: trunk/Source/WebCore/layout/integration/LayoutIntegrationRun.h (from rev 267968, trunk/Source/WebCore/layout/displaytree/DisplayRun.h) (0 => 267969)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationRun.h	                        (rev 0)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationRun.h	2020-10-05 15:43:07 UTC (rev 267969)
@@ -0,0 +1,118 @@
+/*
+ * 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
+
+#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
+
+#include "InlineRect.h"
+#include "LayoutBox.h"
+#include "RenderStyle.h"
+#include "TextFlags.h"
+
+namespace WebCore {
+
+class CachedImage;
+
+namespace LayoutIntegration {
+
+struct Run {
+    WTF_MAKE_STRUCT_FAST_ALLOCATED;
+    struct TextContent {
+        WTF_MAKE_STRUCT_FAST_ALLOCATED;
+    public:
+        TextContent(size_t position, size_t length, const String&, bool needsHyphen);
+
+        size_t start() const { return m_start; }
+        size_t end() const { return start() + length(); }
+        size_t length() const { return m_length; }
+        StringView content() const { return StringView(m_contentString).substring(m_start, m_length); }
+        bool needsHyphen() const { return m_needsHyphen; }
+
+    private:
+        size_t m_start { 0 };
+        size_t m_length { 0 };
+        bool m_needsHyphen { false };
+        String m_contentString;
+    };
+
+    struct Expansion;
+    Run(size_t lineIndex, const Layout::Box&, const FloatRect&, const FloatRect& inkOverflow, Expansion, Optional<TextContent> = WTF::nullopt);
+
+    const FloatRect& rect() const { return m_rect; }
+    const FloatRect& inkOverflow() const { return m_inkOverflow; }
+
+    Optional<TextContent>& textContent() { return m_textContent; }
+    const Optional<TextContent>& textContent() const { return m_textContent; }
+    // FIXME: This information should be preserved at Run construction time.
+    bool isLineBreak() const { return layoutBox().isLineBreakBox() || (textContent() && textContent()->content() == "\n" && style().preserveNewline()); }
+
+    struct Expansion {
+        ExpansionBehavior behavior { DefaultExpansion };
+        InlineLayoutUnit horizontalExpansion { 0 };
+    };
+    Expansion expansion() const { return m_expansion; }
+
+    CachedImage* image() const { return m_cachedImage; }
+
+    bool hasUnderlyingLayout() const { return !!m_layoutBox; }
+    
+    const Layout::Box& layoutBox() const { return *m_layoutBox; }
+    const RenderStyle& style() const { return m_layoutBox->style(); }
+
+    size_t lineIndex() const { return m_lineIndex; }
+
+private:
+    // FIXME: Find out the Display::Run <-> paint style setup.
+    const size_t m_lineIndex;
+    WeakPtr<const Layout::Box> m_layoutBox;
+    CachedImage* m_cachedImage { nullptr };
+    FloatRect m_rect;
+    FloatRect m_inkOverflow;
+    Expansion m_expansion;
+    Optional<TextContent> m_textContent;
+};
+
+inline Run::Run(size_t lineIndex, const Layout::Box& layoutBox, const FloatRect& rect, const FloatRect& inkOverflow, Expansion expansion, Optional<TextContent> textContent)
+    : m_lineIndex(lineIndex)
+    , m_layoutBox(makeWeakPtr(layoutBox))
+    , m_rect(rect)
+    , m_inkOverflow(inkOverflow)
+    , m_expansion(expansion)
+    , m_textContent(textContent)
+{
+}
+
+inline Run::TextContent::TextContent(size_t start, size_t length, const String& contentString, bool needsHyphen)
+    : m_start(start)
+    , m_length(length)
+    , m_needsHyphen(needsHyphen)
+    , m_contentString(contentString)
+{
+}
+
+}
+}
+#endif

Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationRunIterator.cpp (267968 => 267969)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationRunIterator.cpp	2020-10-05 15:40:54 UTC (rev 267968)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationRunIterator.cpp	2020-10-05 15:43:07 UTC (rev 267969)
@@ -33,7 +33,7 @@
 namespace WebCore {
 namespace LayoutIntegration {
 
-RunIterator::RunIterator(Run::PathVariant&& pathVariant)
+RunIterator::RunIterator(PathRun::PathVariant&& pathVariant)
     : m_run(WTFMove(pathVariant))
 {
 }
@@ -82,7 +82,7 @@
     return LineRunIterator(*this).traversePreviousOnLineIgnoringLineBreak();
 }
 
-TextRunIterator::TextRunIterator(Run::PathVariant&& pathVariant)
+TextRunIterator::TextRunIterator(PathRun::PathVariant&& pathVariant)
     : RunIterator(WTFMove(pathVariant))
 {
 }
@@ -103,7 +103,7 @@
     return *this;
 }
 
-LineRunIterator::LineRunIterator(Run::PathVariant&& pathVariant)
+LineRunIterator::LineRunIterator(PathRun::PathVariant&& pathVariant)
     : RunIterator(WTFMove(pathVariant))
 {
 }
@@ -212,13 +212,13 @@
 }
 
 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
-ModernPath& Run::modernPath()
+ModernPath& PathRun::modernPath()
 {
     return WTF::get<ModernPath>(m_pathVariant);
 }
 #endif
 
-LegacyPath& Run::legacyPath()
+LegacyPath& PathRun::legacyPath()
 {
     return WTF::get<LegacyPath>(m_pathVariant);
 }

Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationRunIterator.h (267968 => 267969)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationRunIterator.h	2020-10-05 15:40:54 UTC (rev 267968)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationRunIterator.h	2020-10-05 15:43:07 UTC (rev 267969)
@@ -42,7 +42,7 @@
 
 struct EndIterator { };
 
-class Run {
+class PathRun {
 public:
     using PathVariant = Variant<
 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
@@ -51,7 +51,7 @@
         LegacyPath
     >;
 
-    Run(PathVariant&&);
+    PathRun(PathVariant&&);
 
     bool isText() const;
 
@@ -73,7 +73,7 @@
     TextDirection direction() const { return bidiLevel() % 2 ? TextDirection::RTL : TextDirection::LTR; }
     bool isLeftToRightDirection() const { return direction() == TextDirection::LTR; }
 
-    bool onSameLine(const Run&) const;
+    bool onSameLine(const PathRun&) const;
 
     // For intermediate porting steps only.
     InlineBox* legacyInlineBox() const;
@@ -92,9 +92,9 @@
     PathVariant m_pathVariant;
 };
 
-class TextRun : public Run {
+class PathTextRun : public PathRun {
 public:
-    TextRun(PathVariant&&);
+    PathTextRun(PathVariant&&);
 
     bool hasHyphen() const;
     StringView text() const;
@@ -107,13 +107,13 @@
     bool isLastTextRunOnLine() const;
     bool isLastTextRun() const;
 
-    InlineTextBox* legacyInlineBox() const { return downcast<InlineTextBox>(Run::legacyInlineBox()); }
+    InlineTextBox* legacyInlineBox() const { return downcast<InlineTextBox>(PathRun::legacyInlineBox()); }
 };
 
 class RunIterator {
 public:
     RunIterator() : m_run(LegacyPath { nullptr, { } }) { };
-    RunIterator(Run::PathVariant&&);
+    RunIterator(PathRun::PathVariant&&);
 
     explicit operator bool() const { return !atEnd(); }
 
@@ -123,8 +123,8 @@
     bool operator==(EndIterator) const { return atEnd(); }
     bool operator!=(EndIterator) const { return !atEnd(); }
 
-    const Run& operator*() const { return m_run; }
-    const Run* operator->() const { return &m_run; }
+    const PathRun& operator*() const { return m_run; }
+    const PathRun* operator->() const { return &m_run; }
 
     bool atEnd() const;
 
@@ -136,18 +136,18 @@
 protected:
     void setAtEnd();
 
-    Run m_run;
+    PathRun m_run;
 };
 
 class TextRunIterator : public RunIterator {
 public:
     TextRunIterator() { }
-    TextRunIterator(Run::PathVariant&&);
+    TextRunIterator(PathRun::PathVariant&&);
 
     TextRunIterator& operator++() { return traverseNextTextRun(); }
 
-    const TextRun& operator*() const { return get(); }
-    const TextRun* operator->() const { return &get(); }
+    const PathTextRun& operator*() const { return get(); }
+    const PathTextRun* operator->() const { return &get(); }
 
     TextRunIterator& traverseNextTextRun();
     TextRunIterator& traverseNextTextRunInTextOrder();
@@ -156,7 +156,7 @@
     TextRunIterator nextTextRunInTextOrder() const { return TextRunIterator(*this).traverseNextTextRunInTextOrder(); }
 
 private:
-    const TextRun& get() const { return downcast<TextRun>(m_run); }
+    const PathTextRun& get() const { return downcast<PathTextRun>(m_run); }
 };
 
 class LineRunIterator : public RunIterator {
@@ -163,7 +163,7 @@
 public:
     LineRunIterator() { }
     LineRunIterator(const RunIterator&);
-    LineRunIterator(Run::PathVariant&&);
+    LineRunIterator(PathRun::PathVariant&&);
 
     LineRunIterator& operator++() { return traverseNextOnLine(); }
 
@@ -196,12 +196,12 @@
 
 // -----------------------------------------------
 
-inline Run::Run(PathVariant&& path)
+inline PathRun::PathRun(PathVariant&& path)
     : m_pathVariant(WTFMove(path))
 {
 }
 
-inline bool Run::isText() const
+inline bool PathRun::isText() const
 {
     return WTF::switchOn(m_pathVariant, [](auto& path) {
         return path.isText();
@@ -208,7 +208,7 @@
     });
 }
 
-inline FloatRect Run::rect() const
+inline FloatRect PathRun::rect() const
 {
     return WTF::switchOn(m_pathVariant, [](auto& path) {
         return path.rect();
@@ -215,7 +215,7 @@
     });
 }
 
-inline float Run::baseline() const
+inline float PathRun::baseline() const
 {
     return WTF::switchOn(m_pathVariant, [](auto& path) {
         return path.baseline();
@@ -222,7 +222,7 @@
     });
 }
 
-inline bool Run::isHorizontal() const
+inline bool PathRun::isHorizontal() const
 {
     return WTF::switchOn(m_pathVariant, [](auto& path) {
         return path.isHorizontal();
@@ -229,7 +229,7 @@
     });
 }
 
-inline bool Run::dirOverride() const
+inline bool PathRun::dirOverride() const
 {
     return WTF::switchOn(m_pathVariant, [](auto& path) {
         return path.dirOverride();
@@ -236,7 +236,7 @@
     });
 }
 
-inline bool Run::isLineBreak() const
+inline bool PathRun::isLineBreak() const
 {
     return WTF::switchOn(m_pathVariant, [](auto& path) {
         return path.isLineBreak();
@@ -243,7 +243,7 @@
     });
 }
 
-inline bool Run::useLineBreakBoxRenderTreeDumpQuirk() const
+inline bool PathRun::useLineBreakBoxRenderTreeDumpQuirk() const
 {
     return WTF::switchOn(m_pathVariant, [](auto& path) {
         return path.useLineBreakBoxRenderTreeDumpQuirk();
@@ -250,7 +250,7 @@
     });
 }
 
-inline unsigned Run::minimumCaretOffset() const
+inline unsigned PathRun::minimumCaretOffset() const
 {
     return WTF::switchOn(m_pathVariant, [](auto& path) {
         return path.minimumCaretOffset();
@@ -257,7 +257,7 @@
     });
 }
 
-inline unsigned Run::maximumCaretOffset() const
+inline unsigned PathRun::maximumCaretOffset() const
 {
     return WTF::switchOn(m_pathVariant, [](auto& path) {
         return path.maximumCaretOffset();
@@ -264,7 +264,7 @@
     });
 }
 
-inline unsigned char Run::bidiLevel() const
+inline unsigned char PathRun::bidiLevel() const
 {
     return WTF::switchOn(m_pathVariant, [](auto& path) {
         return path.bidiLevel();
@@ -271,7 +271,7 @@
     });
 }
 
-inline bool Run::onSameLine(const Run& other) const
+inline bool PathRun::onSameLine(const PathRun& other) const
 {
     if (m_pathVariant.index() != other.m_pathVariant.index())
         return false;
@@ -281,7 +281,7 @@
     });
 }
 
-inline InlineBox* Run::legacyInlineBox() const
+inline InlineBox* PathRun::legacyInlineBox() const
 {
     return WTF::switchOn(m_pathVariant, [](auto& path) {
         return path.legacyInlineBox();
@@ -288,7 +288,7 @@
     });
 }
 
-inline bool TextRun::hasHyphen() const
+inline bool PathTextRun::hasHyphen() const
 {
     return WTF::switchOn(m_pathVariant, [](auto& path) {
         return path.hasHyphen();
@@ -295,12 +295,12 @@
     });
 }
 
-inline TextRun::TextRun(PathVariant&& path)
-    : Run(WTFMove(path))
+inline PathTextRun::PathTextRun(PathVariant&& path)
+    : PathRun(WTFMove(path))
 {
 }
 
-inline StringView TextRun::text() const
+inline StringView PathTextRun::text() const
 {
     return WTF::switchOn(m_pathVariant, [](auto& path) {
         return path.text();
@@ -307,7 +307,7 @@
     });
 }
 
-inline unsigned TextRun::localStartOffset() const
+inline unsigned PathTextRun::localStartOffset() const
 {
     return WTF::switchOn(m_pathVariant, [](auto& path) {
         return path.localStartOffset();
@@ -314,7 +314,7 @@
     });
 }
 
-inline unsigned TextRun::localEndOffset() const
+inline unsigned PathTextRun::localEndOffset() const
 {
     return WTF::switchOn(m_pathVariant, [](auto& path) {
         return path.localEndOffset();
@@ -321,7 +321,7 @@
     });
 }
 
-inline unsigned TextRun::length() const
+inline unsigned PathTextRun::length() const
 {
     return WTF::switchOn(m_pathVariant, [](auto& path) {
         return path.length();
@@ -328,7 +328,7 @@
     });
 }
 
-inline bool TextRun::isLastTextRunOnLine() const
+inline bool PathTextRun::isLastTextRunOnLine() const
 {
     return WTF::switchOn(m_pathVariant, [](auto& path) {
         return path.isLastTextRunOnLine();
@@ -335,7 +335,7 @@
     });
 }
 
-inline bool TextRun::isLastTextRun() const
+inline bool PathTextRun::isLastTextRun() const
 {
     return WTF::switchOn(m_pathVariant, [](auto& path) {
         return path.isLastTextRun();
@@ -345,8 +345,8 @@
 }
 }
 
-SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::LayoutIntegration::TextRun)
-static bool isType(const WebCore::LayoutIntegration::Run& run) { return run.isText(); }
+SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::LayoutIntegration::PathTextRun)
+static bool isType(const WebCore::LayoutIntegration::PathRun& run) { return run.isText(); }
 SPECIALIZE_TYPE_TRAITS_END()
 
 SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::LayoutIntegration::TextRunIterator)

Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationRunIteratorModernPath.h (267968 => 267969)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationRunIteratorModernPath.h	2020-10-05 15:40:54 UTC (rev 267968)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationRunIteratorModernPath.h	2020-10-05 15:43:07 UTC (rev 267969)
@@ -27,7 +27,7 @@
 
 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
 
-#include "DisplayInlineContent.h"
+#include "LayoutIntegrationInlineContent.h"
 
 namespace WebCore {
 
@@ -40,7 +40,7 @@
 
 class ModernPath {
 public:
-    ModernPath(const Display::InlineContent& inlineContent, size_t startIndex)
+    ModernPath(const InlineContent& inlineContent, size_t startIndex)
         : m_inlineContent(&inlineContent)
         , m_runIndex(startIndex)
     {
@@ -156,11 +156,11 @@
     }
 
 private:
-    const Display::InlineContent::Runs& runs() const { return m_inlineContent->runs; }
-    const Display::Run& run() const { return runs()[m_runIndex]; }
-    const Display::Line& line() const { return m_inlineContent->lineForRun(run()); }
+    const InlineContent::Runs& runs() const { return m_inlineContent->runs; }
+    const Run& run() const { return runs()[m_runIndex]; }
+    const Line& line() const { return m_inlineContent->lineForRun(run()); }
 
-    RefPtr<const Display::InlineContent> m_inlineContent;
+    RefPtr<const InlineContent> m_inlineContent;
     size_t m_runIndex { 0 };
 };
 

Modified: trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp (267968 => 267969)


--- trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp	2020-10-05 15:40:54 UTC (rev 267968)
+++ trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp	2020-10-05 15:43:07 UTC (rev 267969)
@@ -29,7 +29,6 @@
 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
 
 #include "CachedImage.h"
-#include "DisplayRun.h"
 #include "HTMLNames.h"
 #include "HTMLTableCellElement.h"
 #include "HTMLTableColElement.h"

Modified: trunk/Source/WebCore/rendering/RenderTreeAsText.cpp (267968 => 267969)


--- trunk/Source/WebCore/rendering/RenderTreeAsText.cpp	2020-10-05 15:40:54 UTC (rev 267968)
+++ trunk/Source/WebCore/rendering/RenderTreeAsText.cpp	2020-10-05 15:43:07 UTC (rev 267969)
@@ -478,32 +478,32 @@
     }
 }
 
-static void writeTextRun(TextStream& ts, const RenderText& o, const LayoutIntegration::TextRun& textRun)
+void write(TextStream& ts, const RenderObject& o, OptionSet<RenderAsTextFlag> behavior)
 {
-    auto rect = textRun.rect();
-    int x = rect.x();
-    int y = rect.y();
-    // FIXME: Use non-logical width. webkit.org/b/206809.
-    int logicalWidth = ceilf(rect.x() + (textRun.isHorizontal() ? rect.width() : rect.height())) - x;
-    // FIXME: Table cell adjustment is temporary until results can be updated.
-    if (is<RenderTableCell>(*o.containingBlock()))
-        y -= floorToInt(downcast<RenderTableCell>(*o.containingBlock()).intrinsicPaddingBefore());
-        
-    ts << "text run at (" << x << "," << y << ") width " << logicalWidth;
-    if (!textRun.isLeftToRightDirection() || textRun.dirOverride()) {
-        ts << (!textRun.isLeftToRightDirection() ? " RTL" : " LTR");
-        if (textRun.dirOverride())
-            ts << " override";
-    }
-    ts << ": "
-        << quoteAndEscapeNonPrintables(textRun.text());
-    if (textRun.hasHyphen())
-        ts << " + hyphen string " << quoteAndEscapeNonPrintables(o.style().hyphenString().string());
-    ts << "\n";
-}
+    auto writeTextRun = [&](auto& textRenderer, auto& textRun)
+    {
+        auto rect = textRun.rect();
+        int x = rect.x();
+        int y = rect.y();
+        // FIXME: Use non-logical width. webkit.org/b/206809.
+        int logicalWidth = ceilf(rect.x() + (textRun.isHorizontal() ? rect.width() : rect.height())) - x;
+        // FIXME: Table cell adjustment is temporary until results can be updated.
+        if (is<RenderTableCell>(*o.containingBlock()))
+            y -= floorToInt(downcast<RenderTableCell>(*o.containingBlock()).intrinsicPaddingBefore());
 
-void write(TextStream& ts, const RenderObject& o, OptionSet<RenderAsTextFlag> behavior)
-{
+        ts << "text run at (" << x << "," << y << ") width " << logicalWidth;
+        if (!textRun.isLeftToRightDirection() || textRun.dirOverride()) {
+            ts << (!textRun.isLeftToRightDirection() ? " RTL" : " LTR");
+            if (textRun.dirOverride())
+                ts << " override";
+        }
+        ts << ": "
+            << quoteAndEscapeNonPrintables(textRun.text());
+        if (textRun.hasHyphen())
+            ts << " + hyphen string " << quoteAndEscapeNonPrintables(textRenderer.style().hyphenString().string());
+        ts << "\n";
+    };
+
     if (is<RenderSVGShape>(o)) {
         write(ts, downcast<RenderSVGShape>(o), behavior);
         return;
@@ -548,7 +548,7 @@
         auto& text = downcast<RenderText>(o);
         for (auto& run : LayoutIntegration::textRunsFor(text)) {
             ts << indent;
-            writeTextRun(ts, text, run);
+            writeTextRun(text, run);
         }
     } else {
         for (auto& child : childrenOfType<RenderObject>(downcast<RenderElement>(o))) {

Modified: trunk/Source/WebCore/rendering/TextPainter.cpp (267968 => 267969)


--- trunk/Source/WebCore/rendering/TextPainter.cpp	2020-10-05 15:40:54 UTC (rev 267968)
+++ trunk/Source/WebCore/rendering/TextPainter.cpp	2020-10-05 15:43:07 UTC (rev 267969)
@@ -24,11 +24,11 @@
 #include "TextPainter.h"
 
 #include "DisplayListReplayer.h"
-#include "DisplayRun.h"
 #include "FilterOperations.h"
 #include "GraphicsContext.h"
 #include "HTMLParserIdioms.h"
 #include "InlineTextBox.h"
+#include "LayoutIntegrationRun.h"
 #include "RenderCombineText.h"
 #include "RenderLayer.h"
 #include "RuntimeEnabledFeatures.h"
@@ -230,7 +230,7 @@
     GlyphDisplayListCache<InlineTextBox>::singleton().clear();
 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
     if (RuntimeEnabledFeatures::sharedFeatures().layoutFormattingContextIntegrationEnabled())
-        GlyphDisplayListCache<Display::Run>::singleton().clear();
+        GlyphDisplayListCache<LayoutIntegration::Run>::singleton().clear();
 #endif
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to