Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 2de88792d97aa8e4f13a2e76e9613142875035dc
https://github.com/WebKit/WebKit/commit/2de88792d97aa8e4f13a2e76e9613142875035dc
Author: Franco Vieira de Souza <[email protected]>
Date: 2026-08-05 (Wed, 05 Aug 2026)
Changed paths:
A
LayoutTests/fast/images/text-recognition/image-overlay-text-is-not-editable-expected.txt
A
LayoutTests/fast/images/text-recognition/image-overlay-text-is-not-editable.html
A
LayoutTests/fast/images/text-recognition/image-overlay-user-select-expected.txt
A LayoutTests/fast/images/text-recognition/image-overlay-user-select.html
M Source/WebCore/css/CSSPseudoSelectors.json
M Source/WebCore/dom/ImageOverlay.cpp
M Source/WebCore/style/StyleAdjuster.cpp
Log Message:
-----------
ImageOverlay text style should be set by the style adjuster and never be
editable
https://bugs.webkit.org/show_bug.cgi?id=321055
rdar://184083714
Reviewed by Wenson Hsieh and Abrar Rahman Protyasha.
We now apply the user-select override logic for recognized text overlay
in Adjuster::adjust() instead of baking it in
ImageOverlay::updateWithTextRecognitionResult(). This ensures it gets
recalculated if the shadow host's value is modified after the overlay is
built.
To recognize the appropriate elements to adjust, these were tagged with
a new user-agent-part, `-internal-image-overlay-text`. This also had
the (desirable) side-effect of ensuring that the overlaid text isn't
made editable due to a contenteditable shadow host (see the preexisting
!element->userAgentPart().isNull() check in the adjuster).
New tests:
* fast/images/text-recognition/image-overlay-text-is-not-editable.html
* fast/images/text-recognition/image-overlay-user-select.html
*
LayoutTests/fast/images/text-recognition/image-overlay-text-is-not-editable-expected.txt:
Added.
*
LayoutTests/fast/images/text-recognition/image-overlay-text-is-not-editable.html:
Added.
*
LayoutTests/fast/images/text-recognition/image-overlay-user-select-expected.txt:
Added.
* LayoutTests/fast/images/text-recognition/image-overlay-user-select.html:
Added.
* Source/WebCore/css/CSSPseudoSelectors.json:
* Source/WebCore/dom/ImageOverlay.cpp:
(WebCore::ImageOverlay::updateSubtree):
(WebCore::ImageOverlay::updateWithTextRecognitionResult):
* Source/WebCore/style/StyleAdjuster.cpp:
(WebCore::Style::Adjuster::adjust const):
Canonical link: https://commits.webkit.org/318677@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications