Commit ba441a1
committed
Consider overflowX/Y in applyCachedClipAndScrollPosition()
https://bugs.webkit.org/show_bug.cgi?id=249693
rdar://103734614
Reviewed by Simon Fraser.
Up to now, applyCachedClipAndScrollPosition() doesn't take
in consideration that the overflow for an axis can be visible
when computing the interection with the given target.
Now, if overflow is visible in one of the axis, we expand the
target within this axis.
Imagine a case where a children box with absolute position is placed
below its parent. Before, this children box would not be considered
visible even if it would have overflow-y : visible, because there would
not be intersection between parent and children. For this case, we
would now expand the parent into the Y axis when calculating intersection,
resulting in the intersecion rect to be the children box itself.
* LayoutTests/imported/w3c/web-platform-tests/intersection-observer/v2/position-absolute-overflow-visible-and-not-visible-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/intersection-observer/v2/position-absolute-overflow-visible-and-not-visible.html: Added.
* Source/WebCore/platform/graphics/LayoutRect.cpp:
(WebCore::LayoutRect::expandToInfiniteY):
(WebCore::LayoutRect::expandToInfiniteX):
* Source/WebCore/platform/graphics/LayoutRect.h:
Functions for expanding the Rect to infinite in each axis.
* Source/WebCore/rendering/RenderBox.cpp:
(WebCore::RenderBox::applyCachedClipAndScrollPosition const):
(WebCore::RenderBox::overflowClipRect const):
* Source/WebCore/rendering/svg/RenderSVGModelObject.cpp:
(WebCore::RenderSVGModelObject::applyCachedClipAndScrollPosition const):
Canonical link: https://commits.webkit.org/259007@main1 parent 9833f67 commit ba441a1
File tree
6 files changed
+82
-9
lines changed- LayoutTests/imported/w3c/web-platform-tests/intersection-observer/v2
- Source/WebCore
- platform/graphics
- rendering
- svg
6 files changed
+82
-9
lines changedLines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
Lines changed: 51 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
167 | 181 | | |
168 | 182 | | |
169 | 183 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| 96 | + | |
| 97 | + | |
96 | 98 | | |
97 | 99 | | |
98 | 100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1165 | 1165 | | |
1166 | 1166 | | |
1167 | 1167 | | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
1168 | 1172 | | |
1169 | 1173 | | |
1170 | 1174 | | |
| |||
2109 | 2113 | | |
2110 | 2114 | | |
2111 | 2115 | | |
2112 | | - | |
2113 | | - | |
2114 | | - | |
2115 | | - | |
2116 | | - | |
2117 | | - | |
2118 | | - | |
2119 | | - | |
2120 | | - | |
| 2116 | + | |
| 2117 | + | |
| 2118 | + | |
| 2119 | + | |
2121 | 2120 | | |
2122 | 2121 | | |
2123 | 2122 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
254 | 258 | | |
255 | 259 | | |
256 | 260 | | |
| |||
0 commit comments