Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: fa206e3d4d47ac4bdaa02e271c06b18708d5218f
https://github.com/WebKit/WebKit/commit/fa206e3d4d47ac4bdaa02e271c06b18708d5218f
Author: Ahmad Saleem <[email protected]>
Date: 2026-09-21 (Mon, 21 Sep 2026)
Changed paths:
M
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-container-expected.txt
M Source/WebCore/CMakeLists.txt
M Source/WebCore/DerivedSources-input.xcfilelist
M Source/WebCore/DerivedSources-output.xcfilelist
M Source/WebCore/DerivedSources.make
M Source/WebCore/Headers.cmake
M Source/WebCore/Sources.txt
M Source/WebCore/WebCore.xcodeproj/project.pbxproj
M Source/WebCore/dom/Element.cpp
M Source/WebCore/page/LocalFrameView.cpp
A Source/WebCore/page/ScrollIntoViewContainer.h
A Source/WebCore/page/ScrollIntoViewContainer.idl
M Source/WebCore/page/ScrollIntoViewOptions.h
M Source/WebCore/page/ScrollIntoViewOptions.idl
M Source/WebCore/rendering/RenderLayer.h
Log Message:
-----------
Support the container option ("all" | "nearest") in scrollIntoView()
https://bugs.webkit.org/show_bug.cgi?id=324383
rdar://187616355
Reviewed by Simon Fraser.
CSSOM View defines [1] a `container` member on ScrollIntoViewOptions that
controls how far a scroll propagates: "all" (the default) walks every
ancestor scroll container up to the viewport, while "nearest" stops at
the nearest scroll container of the target.
Add the ScrollIntoViewContainer enum and thread it from the options
dictionary down through scrollRectToVisible. When "nearest" is
requested we stop after scrolling the first scroll container and do not
propagate the scroll to ancestor scrollers or out to an embedding
frame.
[1] https://drafts.csswg.org/cssom-view/#dictdef-scrollintoviewoptions
* Source/WebCore/CMakeLists.txt:
* Source/WebCore/DerivedSources-input.xcfilelist:
* Source/WebCore/DerivedSources-output.xcfilelist:
* Source/WebCore/DerivedSources.make:
* Source/WebCore/Headers.cmake:
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
Register the new ScrollIntoViewContainer IDL enum and generated
bindings.
* Source/WebCore/page/ScrollIntoViewContainer.h: Added.
* Source/WebCore/page/ScrollIntoViewContainer.idl: Added.
New enum with "all" and "nearest" values.
* Source/WebCore/page/ScrollIntoViewOptions.h:
* Source/WebCore/page/ScrollIntoViewOptions.idl:
Add the `container` member, defaulting to "all".
* Source/WebCore/rendering/RenderLayer.h:
Carry the container option on ScrollRectToVisibleOptions.
* Source/WebCore/dom/Element.cpp:
(WebCore::Element::scrollIntoView): Pass options.container through.
*
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-container-expected.txt:
Progression
* Source/WebCore/page/LocalFrameView.cpp:
(WebCore::LocalFrameView::scrollRectToVisible): For "nearest", stop
after the nearest scroll container instead of propagating to ancestors.
(WebCore::LocalFrameView::scrollRectToVisibleInChildView): For
"nearest", don't propagate the scroll out to the embedding frame.
Canonical link: https://commits.webkit.org/321526@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications