Commit 0fce63b
committed
[Cleanup][content-visibility] RenderObject::isSkippedContentRoot has layout dependent state
https://bugs.webkit.org/show_bug.cgi?id=283395
Reviewed by Antti Koivisto.
There are isSkippedContentRoot functions atm.
1. WebCore::isSkippedContentRoot(style, element)
2. and RenderObject::isSkippedContentRoot
(see ContentVisibilityForceLayoutScope, for cases when we need to look inside c-v subtrees for geometry)
and returns false when we are supposed to ignore content-visibility.
This is always scoped to a layout frame (as opposed to painting, hittesting etc)
The codebase is sprinkled with isSkippedContentRoot() calls, some of which exercise #1
while others call into #2 in a seemingly random fashion (e.g. even painting calls the "let's consult the ignore bit" variant).
This patch replaces these 2 functions with
1. LocalFrameViewLayoutContext::isSkippedContentRootForLayout()
2. WebCore::isSkippedContentRoot(renderer)
Where during layout we call layoutContext().isSkippedContentRootForLayout() (surprisingly small number) and the rest simply calls #2.
(Note, there's a highly specific, 3rd use case in StyleAdjuster, which should be moved out to a place where we could use the WebCore::isSkippedContentRoot(renderer) variant).
* Source/WebCore/dom/Document.cpp:
(WebCore::CallbackForContainIntrinsicSize):
(WebCore::Document::caretPositionFromPoint):
* Source/WebCore/editing/TextIterator.cpp:
(WebCore::TextIterator::advance):
* Source/WebCore/page/LocalFrameViewLayoutContext.cpp:
(WebCore::LocalFrameViewLayoutContext::isSkippedContentForLayout const):
(WebCore::LocalFrameViewLayoutContext::isSkippedContentRootForLayout const):
* Source/WebCore/page/LocalFrameViewLayoutContext.h:
* Source/WebCore/rendering/RenderBlock.cpp:
(WebCore::RenderBlock::simplifiedLayout):
(WebCore::RenderBlock::layoutPositionedObject):
(WebCore::RenderBlock::paintContents):
(WebCore::RenderBlock::adjustBorderBoxRectForPainting):
(WebCore::RenderBlock::paintRectToClipOutFromBorder):
(WebCore::RenderBlock::paintExcludedChildrenInBorder):
* Source/WebCore/rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::layoutBlockChildren):
* Source/WebCore/rendering/RenderBox.cpp:
(WebCore::RenderBox::foregroundIsKnownToBeOpaqueInRect const):
(WebCore::RenderBox::explicitIntrinsicInnerWidth const):
(WebCore::RenderBox::explicitIntrinsicInnerHeight const):
* Source/WebCore/rendering/RenderElement.cpp:
(WebCore::RenderElement::styleWillChange):
(WebCore::RenderElement::layoutIfNeeded):
(WebCore::RenderElement::isSkippedContentRoot const): Deleted.
* Source/WebCore/rendering/RenderElement.h:
(WebCore::RenderObject::isSkippedContentRoot const): Deleted.
* Source/WebCore/rendering/RenderElementInlines.h:
(WebCore::RenderElement::shouldApplyInlineSizeContainment const):
(WebCore::RenderElement::shouldApplySizeContainment const):
(WebCore::RenderElement::shouldApplySizeOrInlineSizeContainment const):
(WebCore::isSkippedContentRoot):
* Source/WebCore/rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutPositionedObject):
* Source/WebCore/rendering/RenderObject.cpp:
(WebCore::RenderObject::isSkippedContentForLayout const): Deleted.
* Source/WebCore/rendering/RenderObject.h:
* Source/WebCore/rendering/RenderObjectInlines.h:
(WebCore::RenderObject::layoutContext const):
* Source/WebCore/rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::paint):
* Source/WebCore/rendering/RenderWidget.cpp:
(WebCore::RenderWidget::paint):
* Source/WebCore/rendering/style/RenderStyle.h:
* Source/WebCore/rendering/style/RenderStyleInlines.h:
(WebCore::doesSizeContainmentApplyByStyle):
(WebCore::isSkippedContentRoot): Deleted.
* Source/WebCore/rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateElementRenderer):
* Source/WebCore/style/StyleAdjuster.cpp:
(WebCore::Style::Adjuster::adjust const):
Canonical link: https://commits.webkit.org/286858@main1 parent d217834 commit 0fce63b
File tree
20 files changed
+91
-78
lines changed- Source/WebCore
- dom
- editing
- page
- rendering
- style
- updating
- style
20 files changed
+91
-78
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
| 219 | + | |
219 | 220 | | |
220 | 221 | | |
221 | 222 | | |
| |||
443 | 444 | | |
444 | 445 | | |
445 | 446 | | |
446 | | - | |
| 447 | + | |
447 | 448 | | |
448 | 449 | | |
449 | 450 | | |
| |||
2082 | 2083 | | |
2083 | 2084 | | |
2084 | 2085 | | |
2085 | | - | |
| 2086 | + | |
2086 | 2087 | | |
2087 | 2088 | | |
2088 | 2089 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| |||
488 | 489 | | |
489 | 490 | | |
490 | 491 | | |
491 | | - | |
| 492 | + | |
492 | 493 | | |
493 | | - | |
| 494 | + | |
494 | 495 | | |
495 | 496 | | |
496 | 497 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
577 | 578 | | |
578 | 579 | | |
579 | 580 | | |
580 | | - | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
581 | 596 | | |
582 | 597 | | |
583 | 598 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
99 | 98 | | |
100 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
101 | 103 | | |
102 | 104 | | |
103 | 105 | | |
| |||
174 | 176 | | |
175 | 177 | | |
176 | 178 | | |
| 179 | + | |
| 180 | + | |
177 | 181 | | |
178 | 182 | | |
179 | 183 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
791 | 791 | | |
792 | 792 | | |
793 | 793 | | |
794 | | - | |
| 794 | + | |
795 | 795 | | |
796 | 796 | | |
797 | 797 | | |
| |||
876 | 876 | | |
877 | 877 | | |
878 | 878 | | |
879 | | - | |
| 879 | + | |
880 | 880 | | |
881 | 881 | | |
882 | 882 | | |
| |||
1029 | 1029 | | |
1030 | 1030 | | |
1031 | 1031 | | |
1032 | | - | |
| 1032 | + | |
1033 | 1033 | | |
1034 | 1034 | | |
1035 | 1035 | | |
| |||
3315 | 3315 | | |
3316 | 3316 | | |
3317 | 3317 | | |
3318 | | - | |
| 3318 | + | |
3319 | 3319 | | |
3320 | 3320 | | |
3321 | 3321 | | |
| |||
3338 | 3338 | | |
3339 | 3339 | | |
3340 | 3340 | | |
3341 | | - | |
| 3341 | + | |
3342 | 3342 | | |
3343 | 3343 | | |
3344 | 3344 | | |
| |||
3494 | 3494 | | |
3495 | 3495 | | |
3496 | 3496 | | |
3497 | | - | |
| 3497 | + | |
3498 | 3498 | | |
3499 | 3499 | | |
3500 | 3500 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
759 | 759 | | |
760 | 760 | | |
761 | 761 | | |
762 | | - | |
| 762 | + | |
763 | 763 | | |
764 | 764 | | |
765 | 765 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1851 | 1851 | | |
1852 | 1852 | | |
1853 | 1853 | | |
1854 | | - | |
| 1854 | + | |
1855 | 1855 | | |
1856 | 1856 | | |
1857 | 1857 | | |
| |||
5836 | 5836 | | |
5837 | 5837 | | |
5838 | 5838 | | |
5839 | | - | |
| 5839 | + | |
5840 | 5840 | | |
5841 | 5841 | | |
5842 | 5842 | | |
| |||
5855 | 5855 | | |
5856 | 5856 | | |
5857 | 5857 | | |
5858 | | - | |
| 5858 | + | |
5859 | 5859 | | |
5860 | 5860 | | |
5861 | 5861 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
889 | 889 | | |
890 | 890 | | |
891 | 891 | | |
892 | | - | |
| 892 | + | |
893 | 893 | | |
894 | 894 | | |
895 | 895 | | |
| |||
2527 | 2527 | | |
2528 | 2528 | | |
2529 | 2529 | | |
2530 | | - | |
2531 | | - | |
2532 | | - | |
2533 | | - | |
2534 | | - | |
2535 | 2530 | | |
2536 | 2531 | | |
2537 | 2532 | | |
| |||
2557 | 2552 | | |
2558 | 2553 | | |
2559 | 2554 | | |
2560 | | - | |
| 2555 | + | |
2561 | 2556 | | |
2562 | 2557 | | |
2563 | 2558 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
295 | | - | |
296 | | - | |
297 | 295 | | |
298 | 296 | | |
299 | 297 | | |
| |||
428 | 426 | | |
429 | 427 | | |
430 | 428 | | |
| 429 | + | |
431 | 430 | | |
432 | 431 | | |
433 | 432 | | |
| |||
493 | 492 | | |
494 | 493 | | |
495 | 494 | | |
496 | | - | |
497 | | - | |
498 | | - | |
499 | | - | |
500 | | - | |
501 | | - | |
502 | | - | |
503 | 495 | | |
504 | 496 | | |
505 | 497 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
| 103 | + | |
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
| 108 | + | |
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
145 | 159 | | |
0 commit comments