Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d27b7fd89ebf9a1280e0cb284c0ae780ab71d8ea
      
https://github.com/WebKit/WebKit/commit/d27b7fd89ebf9a1280e0cb284c0ae780ab71d8ea
  Author: Franco Vieira de Souza <[email protected]>
  Date:   2026-08-17 (Mon, 17 Aug 2026)

  Changed paths:
    M 
LayoutTests/editing/execCommand/indent-user-select-all-blockquotes-expected.txt
    A 
LayoutTests/editing/execCommand/indent-user-select-all-blockquotes-legacy-expected.txt
    A 
LayoutTests/editing/execCommand/indent-user-select-all-blockquotes-legacy.html
    M LayoutTests/editing/execCommand/indent-user-select-all-blockquotes.html
    M 
LayoutTests/editing/pasteboard/copy-content-with-user-select-none-expected.txt
    A 
LayoutTests/editing/pasteboard/copy-content-with-user-select-none-legacy-expected.txt
    A 
LayoutTests/editing/pasteboard/copy-content-with-user-select-none-legacy.html
    M LayoutTests/editing/pasteboard/copy-content-with-user-select-none.html
    M LayoutTests/editing/selection/user-select-all-selection-expected.txt
    A 
LayoutTests/editing/selection/user-select-all-selection-legacy-expected.txt
    A LayoutTests/editing/selection/user-select-all-selection-legacy.html
    M LayoutTests/editing/selection/user-select-all-selection.html
    A 
LayoutTests/editing/selection/user-select-auto-in-modal-dialog-inside-inert-expected.txt
    A 
LayoutTests/editing/selection/user-select-auto-in-modal-dialog-inside-inert.html
    M LayoutTests/editing/selection/user-select-in-text-control-expected.txt
    A 
LayoutTests/editing/selection/user-select-in-text-control-legacy-expected.txt
    A LayoutTests/editing/selection/user-select-in-text-control-legacy.html
    A 
LayoutTests/editing/selection/user-select-in-text-control-unprefixed-expected.txt
    A 
LayoutTests/editing/selection/user-select-in-text-control-unprefixed-legacy-expected.txt
    A 
LayoutTests/editing/selection/user-select-in-text-control-unprefixed-legacy.html
    A LayoutTests/editing/selection/user-select-in-text-control-unprefixed.html
    M LayoutTests/editing/selection/user-select-in-text-control.html
    A 
LayoutTests/editing/selection/user-select-supersedes-webkit-user-select-expected.txt
    A 
LayoutTests/editing/selection/user-select-supersedes-webkit-user-select-legacy-expected.txt
    A 
LayoutTests/editing/selection/user-select-supersedes-webkit-user-select-legacy.html
    A 
LayoutTests/editing/selection/user-select-supersedes-webkit-user-select.html
    M LayoutTests/fast/css/style-change-draggable-text-expected.txt
    A LayoutTests/fast/css/style-change-draggable-text-legacy-expected.txt
    A LayoutTests/fast/css/style-change-draggable-text-legacy.html
    M LayoutTests/platform/ios/TestExpectations
    M Source/WTF/wtf/cocoa/RuntimeApplicationChecksCocoa.h
    M Source/WTF/wtf/cocoa/RuntimeApplicationChecksCocoa.mm
    M Source/WebCore/css/CSSProperties.json
    M Source/WebCore/style/StyleAdjuster.cpp
    M Source/WebCore/style/computed/StyleComputedStyleBase+GettersInlines.h
    M Source/WebCore/style/computed/StyleComputedStyleBase.h
    M Source/WebCore/style/computed/data/StyleInheritedRareData.cpp
    M Source/WebCore/style/computed/data/StyleInheritedRareData.h
    M Source/WebCore/style/computed/data/StyleNonInheritedMiscData.cpp
    M Source/WebCore/style/computed/data/StyleNonInheritedMiscData.h
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/CopyRTF.mm

  Log Message:
  -----------
  [CSS] Implement unprefixed user-select
https://bugs.webkit.org/show_bug.cgi?id=321782
rdar://184903788

Reviewed by Megan Gardner and Ryosuke Niwa.

This patch adds some behavior to the CSSUserSelectEnabled flag, which
used to be mostly inert. The flag now causes user-select to be
considered along with -webkit-user-select for determining
usedUserSelect(), and makes usedUserSelect() behavior more closely match
the spec. When the flag is off, legacy -webkit-user-select behavior is
preserved. To avoid changes in behavior in already linked code that
expects legacy behavior, a LoA gate was added.

Here's a breakdown of differences between the legacy and the new
behavior (see https://www.w3.org/TR/css-ui-4/#content-selection):
* user-select is no longer ignored
* -webkit-user-select: all used to disallow the element from being
  edited. Now it's the other way around: editability overrides 'all'
  to 'text'
* If an element is editable, it now always overrides none to
  text. Previously, this only happened if the element were non-draggable
* -webkit-user-select: initial used to always produce text as the used
  value. It now behaves as user-select: auto
* getComputedStyle() no longer matches usedUserSelect()

Under the new behavior, the prefixed and unprefixed properties are not
aliases: if -webkit-user-select and user-select are explicitly defined
for an element, user-select takes precedence. To determine this, each
property has its own has-explicitly-set flag. Note that, while
-webkit-user-select is still inherited, its has-explicitly-set flag is
not (see color-scheme for precedent).

Most of the described behavior lives in Adjuster::adjustUsedUserSelect().

The change did not affect WPT tests, but it did flip the following tests
inside LayoutTests/editing and LayoutTests/fast/css (non-specced
behavior):
* LayoutTests/editing/execCommand/indent-user-select-all-blockquotes.html
* LayoutTests/editing/selection/user-select-in-text-control.html
* LayoutTests/editing/selection/user-select-all-selection.html
* LayoutTests/editing/pasteboard/copy-content-with-user-select-none.html
* LayoutTests/fast/css/style-change-draggable-text.html

These tests received a -legacy variant that disables the feature flag
in order to ensure the legacy behavior is untouched.

Other test changes:
* LayoutTests/editing/selection/user-select-in-text-control.html: was
  considered tricky, so this became 4 separate tests checking the
  "legacy VS new" and "prefixed VS unprefixed" combinations
* 
LayoutTests/editing/selection/user-select-supersedes-webkit-user-select[-legacy].html:
  documents cascade behavior (prefixed VS unprefixed)
* 
LayoutTests/editing/selection/user-select-auto-in-modal-dialog-inside-inert.html:
  verifies how usedUserSelect() interacts with effectivelyInert()
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/CopyRTF.mm: received a
  test variant for legacy behavior
* editing/selection/user-select-all-selection-legacy.html: original was
  skipped on iOS so it was skipped as well

Canonical link: https://commits.webkit.org/319334@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to