Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: fada263bd12885ac2d60422b539da003d5531e9c
https://github.com/WebKit/WebKit/commit/fada263bd12885ac2d60422b539da003d5531e9c
Author: Cathie Chen <[email protected]>
Date: 2026-03-02 (Mon, 02 Mar 2026)
Changed paths:
A
LayoutTests/imported/w3c/web-platform-tests/selection/drag-selection-extend-to-user-select-none-expected.txt
A
LayoutTests/imported/w3c/web-platform-tests/selection/drag-selection-extend-to-user-select-none.html
A
LayoutTests/platform/ios/imported/w3c/web-platform-tests/selection/drag-selection-extend-to-user-select-none-expected.txt
M Source/WebCore/dom/Position.cpp
M Source/WebCore/dom/Position.h
M Source/WebCore/html/HTMLElement.cpp
Log Message:
-----------
Selection jumps around when selecting absolutely-positioned content inside
element with user-select:none
https://bugs.webkit.org/show_bug.cgi?id=307340
Reviewed by Simon Fraser.
In this scenario the content with user-select:text and its container with
user-select:none are not in a same flow.
If a selection starts from the content then extend to its unselectable
container, the selection jumps. To avoid it,
this patch stops extending the selection to an element with user-select:none if
they are not in a same flow.
Test:
imported/w3c/web-platform-tests/selection/drag-selection-extend-to-user-select-none.html
*
LayoutTests/imported/w3c/web-platform-tests/selection/drag-selection-extend-to-user-select-none-expected.txt:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/selection/drag-selection-extend-to-user-select-none.html:
Added.
*
LayoutTests/platform/ios/imported/w3c/web-platform-tests/selection/drag-selection-extend-to-user-select-none-expected.txt:
Added.
* Source/WebCore/html/HTMLElement.cpp:
(WebCore::haveSameOutOfFlowAncestor): Return true if target node and anchor
node have same nearest out-of-flow ancestor.
(WebCore::HTMLElement::shouldExtendSelectionToTargetNode):
Canonical link: https://commits.webkit.org/308451@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications