Diff
Modified: trunk/Source/WebCore/ChangeLog (252414 => 252415)
--- trunk/Source/WebCore/ChangeLog 2019-11-13 18:39:27 UTC (rev 252414)
+++ trunk/Source/WebCore/ChangeLog 2019-11-13 18:39:44 UTC (rev 252415)
@@ -1,3 +1,41 @@
+2019-11-13 Zalan Bujtas <[email protected]>
+
+ [LFC][Invalidation] Introduce InvalidationState and Context
+ https://bugs.webkit.org/show_bug.cgi?id=204140
+ <rdar://problem/57142106>
+
+ Reviewed by Antti Koivisto.
+
+ InvalidationContext take style/content changes and turn them into "dirty layout boxes" (stored in InvalidationState).
+ InvalidationState is the input to the (partial)subsequent layout.
+
+ * Sources.txt:
+ * WebCore.xcodeproj/project.pbxproj:
+ * layout/Invalidation.h: Removed.
+ * layout/LayoutContext.cpp:
+ (WebCore::Layout::LayoutContext::layout):
+ (WebCore::Layout::LayoutContext::layoutFormattingContextSubtree):
+ (WebCore::Layout::LayoutContext::runLayout):
+ (WebCore::Layout::LayoutContext::styleChanged): Deleted.
+ (WebCore::Layout::LayoutContext::markNeedsUpdate): Deleted.
+ * layout/LayoutContext.h:
+ (WebCore::Layout::LayoutContext::updateAll): Deleted.
+ * layout/blockformatting/BlockInvalidation.cpp: Removed.
+ * layout/blockformatting/BlockInvalidation.h: Removed.
+ * layout/invalidation/InvalidationContext.cpp: Renamed from Source/WebCore/layout/inlineformatting/InlineInvalidation.cpp.
+ (WebCore::Layout::InvalidationContext::InvalidationContext):
+ (WebCore::Layout::InvalidationContext::styleChanged):
+ (WebCore::Layout::InvalidationContext::contentChanged):
+ (WebCore::Layout::InvalidationContext::subtreeChanged):
+ * layout/invalidation/InvalidationContext.h: Renamed from Source/WebCore/layout/inlineformatting/InlineInvalidation.h.
+ * layout/invalidation/InvalidationState.cpp: Renamed from Source/WebCore/layout/tableformatting/TableInvalidation.cpp.
+ (WebCore::Layout::InvalidationState::InvalidationState):
+ (WebCore::Layout::InvalidationState::markNeedsUpdate):
+ * layout/invalidation/InvalidationState.h: Renamed from Source/WebCore/layout/tableformatting/TableInvalidation.h.
+ (WebCore::Layout::InvalidationState::formattingContextRoots const):
+ * layout/layouttree/LayoutTreeBuilder.cpp:
+ (WebCore::Layout::printLayoutTreeForLiveDocuments):
+
2019-11-13 Commit Queue <[email protected]>
Unreviewed, rolling out r252402.
Modified: trunk/Source/WebCore/Sources.txt (252414 => 252415)
--- trunk/Source/WebCore/Sources.txt 2019-11-13 18:39:27 UTC (rev 252414)
+++ trunk/Source/WebCore/Sources.txt 2019-11-13 18:39:44 UTC (rev 252415)
@@ -1435,7 +1435,6 @@
layout/blockformatting/BlockFormattingContextQuirks.cpp
layout/blockformatting/BlockFormattingState.cpp
layout/blockformatting/BlockMarginCollapse.cpp
-layout/blockformatting/BlockInvalidation.cpp
layout/displaytree/DisplayBox.cpp
layout/displaytree/DisplayPainter.cpp
layout/floats/FloatAvoider.cpp
@@ -1446,7 +1445,6 @@
layout/inlineformatting/InlineFormattingContextGeometry.cpp
layout/inlineformatting/InlineFormattingContextQuirks.cpp
layout/inlineformatting/InlineFormattingState.cpp
-layout/inlineformatting/InlineInvalidation.cpp
layout/inlineformatting/InlineItem.cpp
layout/inlineformatting/InlineLine.cpp
layout/inlineformatting/InlineLineBreaker.cpp
@@ -1453,6 +1451,8 @@
layout/inlineformatting/InlineLineLayout.cpp
layout/inlineformatting/InlineTextItem.cpp
layout/inlineformatting/text/TextUtil.cpp
+layout/invalidation/InvalidationContext.cpp
+layout/invalidation/InvalidationState.cpp
layout/layouttree/LayoutBox.cpp
layout/layouttree/LayoutContainer.cpp
layout/layouttree/LayoutReplaced.cpp
@@ -1461,7 +1461,6 @@
layout/tableformatting/TableFormattingContextGeometry.cpp
layout/tableformatting/TableFormattingState.cpp
layout/tableformatting/TableGrid.cpp
-layout/tableformatting/TableInvalidation.cpp
loader/AdClickAttribution.cpp
loader/CanvasActivityRecord.cpp
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (252414 => 252415)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2019-11-13 18:39:27 UTC (rev 252414)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2019-11-13 18:39:44 UTC (rev 252415)
@@ -370,7 +370,6 @@
0FFD4D6118651FA300512F6E /* AsyncScrollingCoordinator.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FFD4D5F18651FA300512F6E /* AsyncScrollingCoordinator.h */; settings = {ATTRIBUTES = (Private, ); }; };
10FB084B14E15C7E00A3DB98 /* PublicURLManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 10FB084A14E15C7E00A3DB98 /* PublicURLManager.h */; };
112B34D51E60B98300BB310A /* SimpleLineLayoutPagination.h in Headers */ = {isa = PBXBuildFile; fileRef = 112B34D41E60B98300BB310A /* SimpleLineLayoutPagination.h */; };
- 11310CF120BA4A1B0065A8D0 /* Invalidation.h in Headers */ = {isa = PBXBuildFile; fileRef = 115F7805209CBCBD00739C13 /* Invalidation.h */; settings = {ATTRIBUTES = (Private, ); }; };
11310CF220BA4A320065A8D0 /* LayoutTreeBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 11100FD7209514DF0081AA6C /* LayoutTreeBuilder.h */; settings = {ATTRIBUTES = (Private, ); }; };
11310CF320BA4A370065A8D0 /* LayoutReplaced.h in Headers */ = {isa = PBXBuildFile; fileRef = 111C615620AD1AE1005B82FA /* LayoutReplaced.h */; settings = {ATTRIBUTES = (Private, ); }; };
11310CF420BA4A3D0065A8D0 /* LayoutIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = 11100FC72092764C0081AA6C /* LayoutIterator.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -377,8 +376,6 @@
11310CF520BA4A4C0065A8D0 /* LayoutDescendantIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = 11B042FB20B0E21400828A6B /* LayoutDescendantIterator.h */; settings = {ATTRIBUTES = (Private, ); }; };
11310CF620BA4A560065A8D0 /* LayoutChildIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = 11100FC920927CBC0081AA6C /* LayoutChildIterator.h */; settings = {ATTRIBUTES = (Private, ); }; };
11310CF720BA4A620065A8D0 /* LayoutAncestorIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = 11100FCA2092868D0081AA6C /* LayoutAncestorIterator.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 11310CF820BA4A6A0065A8D0 /* InlineInvalidation.h in Headers */ = {isa = PBXBuildFile; fileRef = 1123AFDC209ABBBA00736ACC /* InlineInvalidation.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 11310CF920BA4A7D0065A8D0 /* BlockInvalidation.h in Headers */ = {isa = PBXBuildFile; fileRef = 1123AFD9209ABB2000736ACC /* BlockInvalidation.h */; settings = {ATTRIBUTES = (Private, ); }; };
113409DA203E038000C66915 /* RenderTreeBuilderContinuation.h in Headers */ = {isa = PBXBuildFile; fileRef = 113409D8203E038000C66915 /* RenderTreeBuilderContinuation.h */; };
113D0B521F9FDD2B00F611BB /* FrameViewLayoutContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 113D0B501F9FDD2B00F611BB /* FrameViewLayoutContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
115CFA6A208AF7D0001E6991 /* FormattingContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 115CFA68208AF7D0001E6991 /* FormattingContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -2030,6 +2027,8 @@
6F77868823491AD8004D9636 /* DisplayPainter.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F77868723491AD7004D9636 /* DisplayPainter.h */; settings = {ATTRIBUTES = (Private, ); }; };
6F7CA3C6208C2957002F29AB /* LayoutState.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F7CA3C4208C2956002F29AB /* LayoutState.h */; settings = {ATTRIBUTES = (Private, ); }; };
6F7CA3CA208C2B2E002F29AB /* InlineFormattingContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F7CA3C8208C2B2E002F29AB /* InlineFormattingContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 6F95DE4D237B889C00E517E1 /* InvalidationContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F95DE4B237B889B00E517E1 /* InvalidationContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 6F95DE4E237B889C00E517E1 /* InvalidationState.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F95DE4C237B889C00E517E1 /* InvalidationState.h */; settings = {ATTRIBUTES = (Private, ); }; };
6F995A161A70756200A735F4 /* WebGLSync.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F995A141A70756200A735F4 /* WebGLSync.h */; };
6F995A201A7078B100A735F4 /* WebGLQuery.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F995A181A7078B100A735F4 /* WebGLQuery.h */; };
6F995A221A7078B100A735F4 /* WebGLSampler.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F995A1A1A7078B100A735F4 /* WebGLSampler.h */; };
@@ -5860,10 +5859,6 @@
11100FD7209514DF0081AA6C /* LayoutTreeBuilder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LayoutTreeBuilder.h; sourceTree = "<group>"; };
111C615620AD1AE1005B82FA /* LayoutReplaced.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LayoutReplaced.h; sourceTree = "<group>"; };
111C615720AD1AE1005B82FA /* LayoutReplaced.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = LayoutReplaced.cpp; sourceTree = "<group>"; };
- 1123AFD9209ABB2000736ACC /* BlockInvalidation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BlockInvalidation.h; sourceTree = "<group>"; };
- 1123AFDA209ABB2000736ACC /* BlockInvalidation.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = BlockInvalidation.cpp; sourceTree = "<group>"; };
- 1123AFDC209ABBBA00736ACC /* InlineInvalidation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = InlineInvalidation.h; sourceTree = "<group>"; };
- 1123AFDD209ABBBA00736ACC /* InlineInvalidation.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = InlineInvalidation.cpp; sourceTree = "<group>"; };
112B34D01E60B8A700BB310A /* SimpleLineLayoutPagination.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SimpleLineLayoutPagination.cpp; sourceTree = "<group>"; };
112B34D41E60B98300BB310A /* SimpleLineLayoutPagination.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleLineLayoutPagination.h; sourceTree = "<group>"; };
113409D7203E038000C66915 /* RenderTreeBuilderContinuation.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = RenderTreeBuilderContinuation.cpp; sourceTree = "<group>"; };
@@ -5888,7 +5883,6 @@
115CFA89208B921A001E6991 /* BlockMarginCollapse.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = BlockMarginCollapse.cpp; sourceTree = "<group>"; };
115CFA95208B952B001E6991 /* LayoutBox.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LayoutBox.h; sourceTree = "<group>"; };
115CFA96208B952B001E6991 /* LayoutBox.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = LayoutBox.cpp; sourceTree = "<group>"; };
- 115F7805209CBCBD00739C13 /* Invalidation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Invalidation.h; sourceTree = "<group>"; };
119340761FE8B92300935F1E /* RenderTreeBuilderTable.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = RenderTreeBuilderTable.cpp; sourceTree = "<group>"; };
119340771FE8B92300935F1E /* RenderTreeBuilderTable.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RenderTreeBuilderTable.h; sourceTree = "<group>"; };
119340871FEB355D00935F1E /* RenderTreeBuilderRuby.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = RenderTreeBuilderRuby.cpp; sourceTree = "<group>"; };
@@ -9273,6 +9267,8 @@
6F7CA3C9208C2B2E002F29AB /* InlineFormattingContext.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = InlineFormattingContext.cpp; sourceTree = "<group>"; };
6F8F460121B03BB40041AC3A /* FormattingContextQuirks.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FormattingContextQuirks.cpp; sourceTree = "<group>"; };
6F8F460321B03BC60041AC3A /* BlockFormattingContextQuirks.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = BlockFormattingContextQuirks.cpp; sourceTree = "<group>"; };
+ 6F95DE4B237B889B00E517E1 /* InvalidationContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InvalidationContext.h; sourceTree = "<group>"; };
+ 6F95DE4C237B889C00E517E1 /* InvalidationState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InvalidationState.h; sourceTree = "<group>"; };
6F995A091A7070E600A735F4 /* WebGLQuery.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebGLQuery.idl; sourceTree = "<group>"; };
6F995A0A1A7070E600A735F4 /* WebGLSampler.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebGLSampler.idl; sourceTree = "<group>"; };
6F995A0B1A7070E600A735F4 /* WebGLSync.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebGLSync.idl; sourceTree = "<group>"; };
@@ -9305,11 +9301,9 @@
6FB5E212221F2447003989CF /* ContentChangeObserver.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ContentChangeObserver.h; sourceTree = "<group>"; };
6FBB860520B464B600DAD938 /* FormattingContextGeometry.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FormattingContextGeometry.cpp; sourceTree = "<group>"; };
6FC5CA9222E3599300B13E11 /* TableFormattingState.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TableFormattingState.cpp; sourceTree = "<group>"; };
- 6FC5CA9322E3599300B13E11 /* TableInvalidation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TableInvalidation.h; sourceTree = "<group>"; };
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>"; };
- 6FC5CA9722E3599500B13E11 /* TableInvalidation.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TableInvalidation.cpp; sourceTree = "<group>"; };
6FCE1A1822618AB3004F0343 /* DisplayRun.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DisplayRun.h; sourceTree = "<group>"; };
6FD9CD52227E21C800E53957 /* DisplayRect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DisplayRect.h; sourceTree = "<group>"; };
6FE198132178397B00446F08 /* InlineLineBreaker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InlineLineBreaker.cpp; sourceTree = "<group>"; };
@@ -9316,6 +9310,8 @@
6FE198152178397C00446F08 /* InlineLineBreaker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InlineLineBreaker.h; sourceTree = "<group>"; };
6FE7AA2621C37B6300296DCD /* MarginTypes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MarginTypes.h; sourceTree = "<group>"; };
6FE7CFA02177EEF1005B1573 /* InlineItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InlineItem.h; sourceTree = "<group>"; };
+ 6FE8E6F7237BA5E800758D26 /* InvalidationContext.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = InvalidationContext.cpp; sourceTree = "<group>"; };
+ 6FE8E6F8237BA6B200758D26 /* InvalidationState.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = InvalidationState.cpp; sourceTree = "<group>"; };
6FE9F09222211035004C5082 /* ContentChangeObserver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ContentChangeObserver.cpp; sourceTree = "<group>"; };
6FEFE81D22F9D22A00114927 /* LayoutPhase.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LayoutPhase.h; sourceTree = "<group>"; };
6FFDC43E212EFF1600A9CA91 /* FloatAvoider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FloatAvoider.cpp; sourceTree = "<group>"; };
@@ -16614,6 +16610,7 @@
1199FA58208E3C4C002358CC /* displaytree */,
6FCFC055212DACC2007695D2 /* floats */,
115CFA9A208BC140001E6991 /* inlineformatting */,
+ 6F95DE4A237B883000E517E1 /* invalidation */,
115CFA90208B9441001E6991 /* layouttree */,
6FC5CA9122E3593300B13E11 /* tableformatting */,
115CFA69208AF7D0001E6991 /* FormattingContext.cpp */,
@@ -16622,7 +16619,6 @@
6F8F460121B03BB40041AC3A /* FormattingContextQuirks.cpp */,
115CFA75208AFE30001E6991 /* FormattingState.cpp */,
115CFA74208AFE30001E6991 /* FormattingState.h */,
- 115F7805209CBCBD00739C13 /* Invalidation.h */,
6F26BB6923343E5A002F2BEA /* LayoutContext.cpp */,
6F26BB6B23343E5B002F2BEA /* LayoutContext.h */,
6F4A5BD522F9F16B00A80F25 /* LayoutPhase.cpp */,
@@ -16665,8 +16661,6 @@
6F8F460321B03BC60041AC3A /* BlockFormattingContextQuirks.cpp */,
115CFA79208B8D9D001E6991 /* BlockFormattingState.cpp */,
115CFA78208B8D9D001E6991 /* BlockFormattingState.h */,
- 1123AFDA209ABB2000736ACC /* BlockInvalidation.cpp */,
- 1123AFD9209ABB2000736ACC /* BlockInvalidation.h */,
115CFA89208B921A001E6991 /* BlockMarginCollapse.cpp */,
);
path = blockformatting;
@@ -16682,8 +16676,6 @@
6F10B08622B8568D0090E69C /* InlineFormattingContextQuirks.cpp */,
115CFA7D208B8E10001E6991 /* InlineFormattingState.cpp */,
115CFA7C208B8E10001E6991 /* InlineFormattingState.h */,
- 1123AFDD209ABBBA00736ACC /* InlineInvalidation.cpp */,
- 1123AFDC209ABBBA00736ACC /* InlineInvalidation.h */,
6F7B8CEC23626E6600C9FF15 /* InlineItem.cpp */,
6FE7CFA02177EEF1005B1573 /* InlineItem.h */,
6F0CD692229ED31900C5994E /* InlineLine.cpp */,
@@ -20796,6 +20788,17 @@
path = angle;
sourceTree = "<group>";
};
+ 6F95DE4A237B883000E517E1 /* invalidation */ = {
+ isa = PBXGroup;
+ children = (
+ 6FE8E6F7237BA5E800758D26 /* InvalidationContext.cpp */,
+ 6F95DE4B237B889B00E517E1 /* InvalidationContext.h */,
+ 6FE8E6F8237BA6B200758D26 /* InvalidationState.cpp */,
+ 6F95DE4C237B889C00E517E1 /* InvalidationState.h */,
+ );
+ path = invalidation;
+ sourceTree = "<group>";
+ };
6FC5CA9122E3593300B13E11 /* tableformatting */ = {
isa = PBXGroup;
children = (
@@ -20806,8 +20809,6 @@
6FC5CA9622E3599500B13E11 /* TableFormattingState.h */,
6F5B7EAA2300A79E0067D9C3 /* TableGrid.cpp */,
6FB22E30230097E300C20866 /* TableGrid.h */,
- 6FC5CA9722E3599500B13E11 /* TableInvalidation.cpp */,
- 6FC5CA9322E3599300B13E11 /* TableInvalidation.h */,
);
path = tableformatting;
sourceTree = "<group>";
@@ -29017,7 +29018,6 @@
976D6C7F122B8A3D001FD1F7 /* BlobURL.h in Headers */,
115CFA6E208AFAB7001E6991 /* BlockFormattingContext.h in Headers */,
115CFA7A208B8D9D001E6991 /* BlockFormattingState.h in Headers */,
- 11310CF920BA4A7D0065A8D0 /* BlockInvalidation.h in Headers */,
BC5EB5E10E81BE8700B25965 /* BorderData.h in Headers */,
589556ED18D4A44000764B03 /* BorderEdge.h in Headers */,
BC5EB5DB0E81B7EA00B25965 /* BorderValue.h in Headers */,
@@ -30165,7 +30165,6 @@
A8CFF5E30A155A05000A4234 /* InlineFlowBox.h in Headers */,
6F7CA3CA208C2B2E002F29AB /* InlineFormattingContext.h in Headers */,
115CFA7E208B8E10001E6991 /* InlineFormattingState.h in Headers */,
- 11310CF820BA4A6A0065A8D0 /* InlineInvalidation.h in Headers */,
6FE7CFA22177EEF2005B1573 /* InlineItem.h in Headers */,
BCE789161120D6080060ECE5 /* InlineIterator.h in Headers */,
6F0CD695229ED32700C5994E /* InlineLine.h in Headers */,
@@ -30236,7 +30235,8 @@
E134F5AB12EE343F004EC58D /* IntRectHash.h in Headers */,
B27535750B053814002CE64F /* IntSize.h in Headers */,
B27535760B053814002CE64F /* IntSizeHash.h in Headers */,
- 11310CF120BA4A1B0065A8D0 /* Invalidation.h in Headers */,
+ 6F95DE4D237B889C00E517E1 /* InvalidationContext.h in Headers */,
+ 6F95DE4E237B889C00E517E1 /* InvalidationState.h in Headers */,
2D0B4AAB18DA1CCD00434DE1 /* IOSurface.h in Headers */,
1C21E57D183ED1FF001C289D /* IOSurfacePool.h in Headers */,
CD5FF4992162E2BE004BD86F /* ISOBox.h in Headers */,
Deleted: trunk/Source/WebCore/layout/Invalidation.h (252414 => 252415)
--- trunk/Source/WebCore/layout/Invalidation.h 2019-11-13 18:39:27 UTC (rev 252414)
+++ trunk/Source/WebCore/layout/Invalidation.h 2019-11-13 18:39:44 UTC (rev 252415)
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2018 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)
-
-namespace WebCore {
-namespace Layout {
-
-class Container;
-
-struct InvalidationResult {
- const Container* root;
-};
-
-}
-}
-#endif
Modified: trunk/Source/WebCore/layout/LayoutContext.cpp (252414 => 252415)
--- trunk/Source/WebCore/layout/LayoutContext.cpp 2019-11-13 18:39:27 UTC (rev 252414)
+++ trunk/Source/WebCore/layout/LayoutContext.cpp 2019-11-13 18:39:44 UTC (rev 252415)
@@ -30,17 +30,17 @@
#include "BlockFormattingContext.h"
#include "BlockFormattingState.h"
-#include "BlockInvalidation.h"
#include "DisplayBox.h"
#include "DisplayPainter.h"
#include "InlineFormattingContext.h"
#include "InlineFormattingState.h"
-#include "InlineInvalidation.h"
-#include "Invalidation.h"
+#include "InvalidationContext.h"
+#include "InvalidationState.h"
#include "LayoutBox.h"
#include "LayoutContainer.h"
#include "LayoutPhase.h"
#include "LayoutTreeBuilder.h"
+#include "RenderStyleConstants.h"
#include "RenderView.h"
#include "TableFormattingContext.h"
#include "TableFormattingState.h"
@@ -56,46 +56,24 @@
{
}
-void LayoutContext::layout()
+void LayoutContext::layout(const InvalidationState& invalidationState)
{
PhaseScope scope(Phase::Type::Layout);
- ASSERT(!m_formattingContextRootListForLayout.computesEmpty());
- for (auto& layoutRoot : m_formattingContextRootListForLayout)
- layoutFormattingContextSubtree(layoutRoot);
- m_formattingContextRootListForLayout.clear();
+ auto& formattingContextRootsForLayout = invalidationState.formattingContextRoots();
+ ASSERT(!formattingContextRootsForLayout.computesEmpty());
+ for (auto& formattingContextRoot : formattingContextRootsForLayout)
+ layoutFormattingContextSubtree(formattingContextRoot);
}
-void LayoutContext::layoutFormattingContextSubtree(const Container& layoutRoot)
+void LayoutContext::layoutFormattingContextSubtree(const Container& formattingContextRoot)
{
- RELEASE_ASSERT(layoutRoot.establishesFormattingContext());
- auto formattingContext = createFormattingContext(layoutRoot, layoutState());
+ RELEASE_ASSERT(formattingContextRoot.establishesFormattingContext());
+ auto formattingContext = createFormattingContext(formattingContextRoot, layoutState());
formattingContext->layoutInFlowContent();
formattingContext->layoutOutOfFlowContent();
}
-void LayoutContext::styleChanged(const Box& layoutBox, StyleDiff styleDiff)
-{
- PhaseScope scope(Phase::Type::Invalidation);
-
- auto& formattingState = layoutState().formattingStateForBox(layoutBox);
- const Container* invalidationRoot = nullptr;
- if (is<BlockFormattingState>(formattingState))
- invalidationRoot = BlockInvalidation::invalidate(layoutBox, styleDiff, *this, downcast<BlockFormattingState>(formattingState)).root;
- else if (is<InlineFormattingState>(formattingState))
- invalidationRoot = InlineInvalidation::invalidate(layoutBox, styleDiff, *this, downcast<InlineFormattingState>(formattingState)).root;
- else
- ASSERT_NOT_IMPLEMENTED_YET();
- ASSERT(invalidationRoot);
- m_formattingContextRootListForLayout.add(invalidationRoot);
-}
-
-void LayoutContext::markNeedsUpdate(const Box& layoutBox, OptionSet<UpdateType>)
-{
- // FIXME: This should trigger proper invalidation instead of just adding the formatting context root to the dirty list.
- m_formattingContextRootListForLayout.add(&(layoutBox.isInitialContainingBlock() ? downcast<Container>(layoutBox) : layoutBox.formattingContextRoot()));
-}
-
std::unique_ptr<FormattingContext> LayoutContext::createFormattingContext(const Container& formattingContextRoot, LayoutState& layoutState)
{
ASSERT(formattingContextRoot.establishesFormattingContext());
@@ -156,9 +134,11 @@
displayBox.setContentBoxHeight(LayoutUnit(layoutRoot.style().logicalHeight().value()));
displayBox.setContentBoxWidth(LayoutUnit(layoutRoot.style().logicalWidth().value()));
- auto layoutContext = LayoutContext(layoutState);
- layoutContext.markNeedsUpdate(layoutRoot);
- layoutContext.layout();
+ auto invalidationState = InvalidationState { };
+ auto invalidationContext = InvalidationContext { invalidationState };
+ invalidationContext.styleChanged(*layoutRoot.firstChild(), StyleDifference::Layout);
+
+ LayoutContext(layoutState).layout(invalidationState);
}
std::unique_ptr<LayoutState> LayoutContext::runLayoutAndVerify(const RenderView& renderView)
Modified: trunk/Source/WebCore/layout/LayoutContext.h (252414 => 252415)
--- trunk/Source/WebCore/layout/LayoutContext.h 2019-11-13 18:39:27 UTC (rev 252414)
+++ trunk/Source/WebCore/layout/LayoutContext.h 2019-11-13 18:39:44 UTC (rev 252415)
@@ -29,7 +29,6 @@
#include <wtf/IsoMalloc.h>
#include <wtf/OptionSet.h>
-#include <wtf/WeakHashSet.h>
namespace WebCore {
@@ -39,9 +38,8 @@
namespace Layout {
-enum class StyleDiff;
-class Box;
class Container;
+class InvalidationState;
class LayoutState;
class FormattingContext;
@@ -59,19 +57,8 @@
static void paint(const LayoutState&, GraphicsContext&, const IntRect& dirtyRect);
LayoutContext(LayoutState&);
- void layout();
+ void layout(const InvalidationState&);
- enum class UpdateType {
- Overflow = 1 << 0,
- Position = 1 << 1,
- Size = 1 << 2
- };
- static constexpr OptionSet<UpdateType> updateAll() { return { UpdateType::Overflow, UpdateType::Position, UpdateType::Size }; }
- void markNeedsUpdate(const Box&, OptionSet<UpdateType> = updateAll());
- bool needsUpdate(const Box&) const;
-
- void styleChanged(const Box&, StyleDiff);
-
static std::unique_ptr<FormattingContext> createFormattingContext(const Container& formattingContextRoot, LayoutState&);
private:
@@ -83,7 +70,6 @@
static void runLayout(LayoutState&);
LayoutState& m_layoutState;
- WeakHashSet<const Container> m_formattingContextRootListForLayout;
};
}
Deleted: trunk/Source/WebCore/layout/blockformatting/BlockInvalidation.cpp (252414 => 252415)
--- trunk/Source/WebCore/layout/blockformatting/BlockInvalidation.cpp 2019-11-13 18:39:27 UTC (rev 252414)
+++ trunk/Source/WebCore/layout/blockformatting/BlockInvalidation.cpp 2019-11-13 18:39:44 UTC (rev 252415)
@@ -1,76 +0,0 @@
-/*
- * Copyright (C) 2018 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 "BlockInvalidation.h"
-
-#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
-
-#include "BlockFormattingState.h"
-#include "Invalidation.h"
-#include "LayoutBox.h"
-#include "LayoutContainer.h"
-#include <wtf/IsoMallocInlines.h>
-
-namespace WebCore {
-namespace Layout {
-
-WTF_MAKE_ISO_ALLOCATED_IMPL(BlockInvalidation);
-
-static bool invalidationStopsAtFormattingContextBoundary(const Container& formattingContextRoot, const Box&, StyleDiff)
-{
- UNUSED_PARAM(formattingContextRoot);
-
- ASSERT(formattingContextRoot.establishesFormattingContext());
- return true;
-}
-
-static OptionSet<LayoutContext::UpdateType> computeUpdateType(const Box&, StyleDiff, BlockFormattingState&)
-{
- return LayoutContext::updateAll();
-}
-
-static OptionSet<LayoutContext::UpdateType> computeUpdateTypeForAncestor(const Container&, StyleDiff, BlockFormattingState&)
-{
- return LayoutContext::updateAll();
-}
-
-InvalidationResult BlockInvalidation::invalidate(const Box& layoutBox, StyleDiff styleDiff, LayoutContext& layoutContext, BlockFormattingState& formattingState)
-{
- // Invalidate this box and the containing block chain all the way up to the formatting context root (and beyond if needed).
- layoutContext.markNeedsUpdate(layoutBox, computeUpdateType(layoutBox, styleDiff, formattingState));
- for (auto* containingBlock = layoutBox.containingBlock(); containingBlock; containingBlock = containingBlock->containingBlock()) {
- if (containingBlock->establishesFormattingContext() && invalidationStopsAtFormattingContextBoundary(*containingBlock, layoutBox, styleDiff))
- return { containingBlock };
- layoutContext.markNeedsUpdate(*containingBlock, computeUpdateTypeForAncestor(*containingBlock, styleDiff, formattingState));
- }
- // Invalidation always stops at the initial containing block.
- ASSERT_NOT_REACHED();
- return { nullptr };
-}
-
-}
-}
-#endif
Deleted: trunk/Source/WebCore/layout/blockformatting/BlockInvalidation.h (252414 => 252415)
--- trunk/Source/WebCore/layout/blockformatting/BlockInvalidation.h 2019-11-13 18:39:27 UTC (rev 252414)
+++ trunk/Source/WebCore/layout/blockformatting/BlockInvalidation.h 2019-11-13 18:39:44 UTC (rev 252415)
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2018 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 <wtf/IsoMalloc.h>
-
-namespace WebCore {
-namespace Layout {
-
-class Box;
-class BlockFormattingState;
-class LayoutContext;
-struct InvalidationResult;
-enum class StyleDiff;
-
-// This class implements box invalidation for block formatting context.
-class BlockInvalidation {
- WTF_MAKE_ISO_ALLOCATED(BlockInvalidation);
-public:
- static InvalidationResult invalidate(const Box&, StyleDiff, LayoutContext&, BlockFormattingState&);
-};
-
-}
-}
-#endif
Deleted: trunk/Source/WebCore/layout/inlineformatting/InlineInvalidation.cpp (252414 => 252415)
--- trunk/Source/WebCore/layout/inlineformatting/InlineInvalidation.cpp 2019-11-13 18:39:27 UTC (rev 252414)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineInvalidation.cpp 2019-11-13 18:39:44 UTC (rev 252415)
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2018 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 "InlineInvalidation.h"
-
-#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
-
-#include "InlineFormattingState.h"
-#include "Invalidation.h"
-#include "LayoutBox.h"
-#include "LayoutContext.h"
-#include <wtf/IsoMallocInlines.h>
-
-namespace WebCore {
-namespace Layout {
-
-WTF_MAKE_ISO_ALLOCATED_IMPL(InlineInvalidation);
-
-InvalidationResult InlineInvalidation::invalidate(const Box& layoutBox, StyleDiff, LayoutContext& layoutContext, InlineFormattingState&)
-{
- layoutContext.markNeedsUpdate(layoutBox);
- return { nullptr };
-}
-
-}
-}
-#endif
Deleted: trunk/Source/WebCore/layout/inlineformatting/InlineInvalidation.h (252414 => 252415)
--- trunk/Source/WebCore/layout/inlineformatting/InlineInvalidation.h 2019-11-13 18:39:27 UTC (rev 252414)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineInvalidation.h 2019-11-13 18:39:44 UTC (rev 252415)
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2018 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 <wtf/IsoMalloc.h>
-
-namespace WebCore {
-namespace Layout {
-
-class Box;
-class Container;
-class InlineFormattingState;
-class LayoutContext;
-struct InvalidationResult;
-enum class StyleDiff;
-
-// This class implements box invalidation for inline formatting context.
-class InlineInvalidation {
- WTF_MAKE_ISO_ALLOCATED(InlineInvalidation);
-public:
- static InvalidationResult invalidate(const Box&, StyleDiff, LayoutContext&, InlineFormattingState&);
-};
-
-}
-}
-#endif
Copied: trunk/Source/WebCore/layout/invalidation/InvalidationContext.cpp (from rev 252412, trunk/Source/WebCore/layout/inlineformatting/InlineInvalidation.cpp) (0 => 252415)
--- trunk/Source/WebCore/layout/invalidation/InvalidationContext.cpp (rev 0)
+++ trunk/Source/WebCore/layout/invalidation/InvalidationContext.cpp 2019-11-13 18:39:44 UTC (rev 252415)
@@ -0,0 +1,59 @@
+/*
+ * 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 "InvalidationContext.h"
+
+#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
+
+#include "InvalidationState.h"
+#include <wtf/IsoMallocInlines.h>
+
+namespace WebCore {
+namespace Layout {
+
+WTF_MAKE_ISO_ALLOCATED_IMPL(InvalidationContext);
+
+InvalidationContext::InvalidationContext(InvalidationState& invalidationState)
+ : m_invalidationState(invalidationState)
+{
+}
+
+void InvalidationContext::styleChanged(const Box& layoutBox, StyleDifference)
+{
+ m_invalidationState.markNeedsUpdate(layoutBox);
+}
+
+void InvalidationContext::contentChanged(const Box&)
+{
+}
+
+void InvalidationContext::subtreeChanged(const Box&)
+{
+}
+
+}
+}
+#endif
Copied: trunk/Source/WebCore/layout/invalidation/InvalidationContext.h (from rev 252412, trunk/Source/WebCore/layout/tableformatting/TableInvalidation.h) (0 => 252415)
--- trunk/Source/WebCore/layout/invalidation/InvalidationContext.h (rev 0)
+++ trunk/Source/WebCore/layout/invalidation/InvalidationContext.h 2019-11-13 18:39:44 UTC (rev 252415)
@@ -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.
+ */
+
+#pragma once
+
+#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
+
+#include <wtf/IsoMalloc.h>
+
+namespace WebCore {
+enum class StyleDifference;
+
+namespace Layout {
+class Box;
+class InvalidationState;
+
+class InvalidationContext {
+ WTF_MAKE_ISO_ALLOCATED(InvalidationContext);
+public:
+ InvalidationContext(InvalidationState&);
+
+ void styleChanged(const Box&, StyleDifference);
+ // FIXME: We might just merge this with subtreeChanged.
+ void contentChanged(const Box&);
+ // FIXME: This is just a placeholder for tree changes like gaining and losing descendants.
+ void subtreeChanged(const Box&);
+
+private:
+ InvalidationState& m_invalidationState;
+};
+
+}
+}
+#endif
Copied: trunk/Source/WebCore/layout/invalidation/InvalidationState.cpp (from rev 252412, trunk/Source/WebCore/layout/tableformatting/TableInvalidation.cpp) (0 => 252415)
--- trunk/Source/WebCore/layout/invalidation/InvalidationState.cpp (rev 0)
+++ trunk/Source/WebCore/layout/invalidation/InvalidationState.cpp 2019-11-13 18:39:44 UTC (rev 252415)
@@ -0,0 +1,52 @@
+/*
+ * 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 "InvalidationState.h"
+
+#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
+
+#include <wtf/IsoMallocInlines.h>
+
+namespace WebCore {
+namespace Layout {
+
+WTF_MAKE_ISO_ALLOCATED_IMPL(InvalidationState);
+
+InvalidationState::InvalidationState()
+{
+}
+
+void InvalidationState::markNeedsUpdate(const Box& layoutBox)
+{
+ // We never lay out the initial containing block. It always has pre-determined geometry.
+ ASSERT(!layoutBox.isInitialContainingBlock());
+ // FIXME: This is just a placeholder implementation.
+ m_formattingContextRoots.add(&layoutBox.formattingContextRoot());
+}
+
+}
+}
+#endif
Copied: trunk/Source/WebCore/layout/invalidation/InvalidationState.h (from rev 252412, trunk/Source/WebCore/layout/inlineformatting/InlineInvalidation.h) (0 => 252415)
--- trunk/Source/WebCore/layout/invalidation/InvalidationState.h (rev 0)
+++ trunk/Source/WebCore/layout/invalidation/InvalidationState.h 2019-11-13 18:39:44 UTC (rev 252415)
@@ -0,0 +1,55 @@
+/*
+ * 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 "LayoutBox.h"
+#include "LayoutContainer.h"
+#include <wtf/IsoMalloc.h>
+#include <wtf/WeakHashSet.h>
+
+namespace WebCore {
+namespace Layout {
+
+class InvalidationState {
+ WTF_MAKE_ISO_ALLOCATED(InvalidationState);
+public:
+ InvalidationState();
+
+ void markNeedsUpdate(const Box&);
+
+ using FormattingContextRoots = WeakHashSet<const Container>;
+ // FIXME: We currently do full formatting context layouts (no partial layout within a formatting context).
+ const FormattingContextRoots& formattingContextRoots() const { return m_formattingContextRoots; }
+
+private:
+ FormattingContextRoots m_formattingContextRoots;
+};
+
+}
+}
+#endif
Modified: trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp (252414 => 252415)
--- trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp 2019-11-13 18:39:27 UTC (rev 252414)
+++ trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp 2019-11-13 18:39:44 UTC (rev 252415)
@@ -34,6 +34,8 @@
#include "HTMLTableCellElement.h"
#include "HTMLTableColElement.h"
#include "InlineFormattingState.h"
+#include "InvalidationContext.h"
+#include "InvalidationState.h"
#include "LayoutBox.h"
#include "LayoutChildIterator.h"
#include "LayoutContainer.h"
@@ -403,8 +405,14 @@
auto& renderView = *document->renderView();
auto layoutState = LayoutState { TreeBuilder::createLayoutTree(renderView) };
layoutState.setQuirksMode(renderView.document().inLimitedQuirksMode() ? LayoutState::QuirksMode::Limited : (renderView.document().inQuirksMode() ? LayoutState::QuirksMode::Yes : LayoutState::QuirksMode::No));
- LayoutContext(layoutState).layout();
- showLayoutTree(layoutState.root(), &layoutState);
+
+ auto& layoutRoot = layoutState.root();
+ auto invalidationState = InvalidationState { };
+ auto invalidationContext = InvalidationContext { invalidationState };
+ invalidationContext.styleChanged(*layoutRoot.firstChild(), StyleDifference::Layout);
+
+ LayoutContext(layoutState).layout(invalidationState);
+ showLayoutTree(layoutRoot, &layoutState);
}
}
#endif
Deleted: trunk/Source/WebCore/layout/tableformatting/TableInvalidation.cpp (252414 => 252415)
--- trunk/Source/WebCore/layout/tableformatting/TableInvalidation.cpp 2019-11-13 18:39:27 UTC (rev 252414)
+++ trunk/Source/WebCore/layout/tableformatting/TableInvalidation.cpp 2019-11-13 18:39:44 UTC (rev 252415)
@@ -1,50 +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"
-#include "TableInvalidation.h"
-
-#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
-
-#include "Invalidation.h"
-#include "LayoutBox.h"
-#include "LayoutContext.h"
-#include "TableFormattingState.h"
-#include <wtf/IsoMallocInlines.h>
-
-namespace WebCore {
-namespace Layout {
-
-WTF_MAKE_ISO_ALLOCATED_IMPL(TableInvalidation);
-
-InvalidationResult TableInvalidation::invalidate(const Box& layoutBox, StyleDiff, LayoutContext& layoutContext, TableFormattingState&)
-{
- layoutContext.markNeedsUpdate(layoutBox);
- return { nullptr };
-}
-
-}
-}
-#endif
Deleted: trunk/Source/WebCore/layout/tableformatting/TableInvalidation.h (252414 => 252415)
--- trunk/Source/WebCore/layout/tableformatting/TableInvalidation.h 2019-11-13 18:39:27 UTC (rev 252414)
+++ trunk/Source/WebCore/layout/tableformatting/TableInvalidation.h 2019-11-13 18:39:44 UTC (rev 252415)
@@ -1,50 +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 <wtf/IsoMalloc.h>
-
-namespace WebCore {
-namespace Layout {
-
-class Box;
-class TableFormattingState;
-class LayoutContext;
-struct InvalidationResult;
-enum class StyleDiff;
-
-// This class implements box invalidation for table formatting context.
-class TableInvalidation {
- WTF_MAKE_ISO_ALLOCATED(TableInvalidation);
-public:
- static InvalidationResult invalidate(const Box&, StyleDiff, LayoutContext&, TableFormattingState&);
-};
-
-}
-}
-#endif