Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 479d9f28f354fadfa0172787f21905975e8fa3f6
https://github.com/WebKit/WebKit/commit/479d9f28f354fadfa0172787f21905975e8fa3f6
Author: Ahmad Saleem <[email protected]>
Date: 2026-09-21 (Mon, 21 Sep 2026)
Changed paths:
M LayoutTests/TestExpectations
M
LayoutTests/imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-vs-scrollIntoView-003-expected.txt
M Source/WebCore/dom/ContentVisibilityDocumentState.cpp
M Source/WebCore/page/IntersectionObserver.cpp
M Source/WebCore/page/IntersectionObserver.h
Log Message:
-----------
content-visibility: auto element stuck relevant after scrollIntoView() of
clipped descendant
https://bugs.webkit.org/show_bug.cgi?id=324202
rdar://187417053
Reviewed by Simon Fraser.
scrollIntoView() of a descendant of a content-visibility:auto element forces the
element's viewport proximity to Near (out-of-band, not via the intersection
observer) so the skipped content can be scrolled to. When the descendant is
clipped and cannot actually be revealed, the element ends up outside the
viewport
after scrolling and should return to hidden.
That never happened: the internal IntersectionObserver's previousThresholdIndex
still reflected the pre-scroll non-intersecting state (0), so when it recomputed
the still-non-intersecting element it saw no change, never ran its callback, and
never reset the proximity to Far. The element stayed relevant forever and the
"hidden again" contentvisibilityautostatechange event never fired, hanging the
test.
Clear the observer's cached threshold index for the target when forcing Near, so
the next intersection computation is treated as a first observation and re-syncs
the proximity with reality.
* LayoutTests/TestExpectations: Progression
*
LayoutTests/imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-vs-scrollIntoView-003-expected.txt:
Ditto
* Source/WebCore/dom/ContentVisibilityDocumentState.cpp:
(WebCore::ContentVisibilityDocumentState::updateContentRelevancyForScrollIfNeeded):
* Source/WebCore/page/IntersectionObserver.cpp:
(WebCore::IntersectionObserver::resetPreviousThresholdIndexForTarget):
* Source/WebCore/page/IntersectionObserver.h:
Canonical link: https://commits.webkit.org/321533@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications