[webkit-changes] [WebKit/WebKit] d9b88a: AX: AXTextOperation performs an incorrect selectio...
Samar Sunkaria
noreply at github.com
Fri Jan 17 17:28:49 PST 2025
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: d9b88a76d943a0a4e1a73c0051447b73ab7d2119
https://github.com/WebKit/WebKit/commit/d9b88a76d943a0a4e1a73c0051447b73ab7d2119
Author: Samar Sunkaria <sameesunkaria at me.com>
Date: 2025-01-17 (Fri, 17 Jan 2025)
Changed paths:
A LayoutTests/accessibility/mac/text-operation/text-operation-replace-slotted-shadow-expected.txt
A LayoutTests/accessibility/mac/text-operation/text-operation-replace-slotted-shadow.html
M LayoutTests/platform/mac-wk1/TestExpectations
M Source/WebCore/accessibility/AccessibilityObject.cpp
Log Message:
-----------
AX: AXTextOperation performs an incorrect selection on some shadow elements.
https://bugs.webkit.org/show_bug.cgi?id=285848
rdar://142814532
Reviewed by Tyler Wilcock.
AXTextOperation was performing an incorrect selection when the provided range was
contained in a slotted element in the light DOM, rendered via the shadow DOM of the
parent <div>. A test case with such a document has been added.
The call to `characterRange` from `textOperationRangeFromRange` was returning an
incorrect result when the boundary points for the `scope` range were contained in the
parent <div>. In that scenario, `characterCount` (used by `characterRange`) from the
start of the scope to the start of the range incorrectly computes that the start of the
scope is *ordered greater than* the start of the range and swaps the ranges before
computing the character count.
While I expected a correct implementation of `characterRange` to properly handle this
case, in this patch, we are working around the issue by using the first and last positions
*within* the editable container (instead of the positions of the container) as our scope
to compute the character ranges. This helps us ensure that if our editable container is
slotted in the shadow DOM, our scope is also contained in the shadow DOM.
* LayoutTests/accessibility/mac/text-operation/text-operation-replace-slotted-shadow-expected.txt: Added.
* LayoutTests/accessibility/mac/text-operation/text-operation-replace-slotted-shadow.html: Added.
* LayoutTests/platform/mac-wk1/TestExpectations:
* Source/WebCore/accessibility/AccessibilityObject.cpp:
(WebCore::textOperationRangeFromRange):
Canonical link: https://commits.webkit.org/289092@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list