Skip to content

Commit 30ee8b0

Browse files
johannesodlandAhmad Saleem
authored andcommitted
IntersectionObserver root rect with padding is incorrect if there's overflow clipping.
https://bugs.webkit.org/show_bug.cgi?id=263316 Reviewed by Simon Fraser. Switch from using contentBoxRect to paddingBoxRect according to discussion in w3c/IntersectionObserver#504 * LayoutTests/imported/w3c/web-platform-tests/intersection-observer/padding-clip-expected.txt: * Source/WebCore/page/IntersectionObserver.cpp: (WebCore::IntersectionObserver::computeIntersectionState const): Canonical link: https://commits.webkit.org/304296@main
1 parent f5a0bda commit 30ee8b0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11

2-
FAIL Scrollport is used rather than content rect to compute intersection ratio assert_equals: Should be completely visible. expected 1 but got 0.6399999856948853
2+
PASS Scrollport is used rather than content rect to compute intersection ratio
33

Source/WebCore/page/IntersectionObserver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ auto IntersectionObserver::computeIntersectionState(const IntersectionObserverRe
442442
if (root() == &target.document())
443443
intersectionState.rootBounds = layoutViewportRectForIntersection();
444444
else if (rootRenderer->hasNonVisibleOverflow())
445-
intersectionState.rootBounds = rootRenderer->contentBoxRect();
445+
intersectionState.rootBounds = rootRenderer->paddingBoxRect();
446446
else
447447
intersectionState.rootBounds = { FloatPoint(), rootRenderer->size() };
448448

0 commit comments

Comments
 (0)