-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AX VoiceOver: some content on web pages is not displayed on the brail…
…le display. https://bugs.webkit.org/show_bug.cgi?id=259066 rdar://110758833 Reviewed by Tyler Wilcock. AX clients like VoiceOver may request the AttributedString of a TextMarkerRange using the WebArea object. Since we don't cache the AttributedString for the WebArea, this causes a hit to the main thread. Furthermore, since the TextMarkerRange for a given object is created off the main thread and expects to be accessed off the main thread, it may not return the correct AttributedString when used on the main thread. This change ensures that the cached AttributedString for a given object is returned even when it is requested using the WebArea or any other object instead the object that owns the range. Canonical link: https://commits.webkit.org/265957@main
- Loading branch information
1 parent
f438e85
commit 27b8435
Showing
5 changed files
with
88 additions
and
4 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
...ests/accessibility/mac/attributed-string-for-text-marker-range-using-webarea-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
Tests that using the WebArea to retrieve AttributedStrings from element TextMarkerRanges works properly. | ||
|
||
"AXFont - { | ||
AXFontFamily = Times; | ||
AXFontName = "Times-Roman"; | ||
AXFontSize = 16; | ||
}, This is a test." | ||
"AXFont - { | ||
AXFontFamily = Times; | ||
AXFontName = "Times-Roman"; | ||
AXFontSize = 16; | ||
}, This is a test. | ||
|
||
Second" | ||
"AXFont - { | ||
AXFontFamily = Times; | ||
AXFontName = "Times-Roman"; | ||
AXFontSize = 16; | ||
}, This is a test. | ||
|
||
Second paragraph." | ||
|
||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
This is a test. | ||
|
||
Second paragraph. |
38 changes: 38 additions & 0 deletions
38
LayoutTests/accessibility/mac/attributed-string-for-text-marker-range-using-webarea.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<!DOCTYPE HTML> | ||
<html> | ||
<head> | ||
<script src="../../resources/js-test.js"></script> | ||
<script src="../../resources/accessibility-helper.js"></script> | ||
</head> | ||
<body> | ||
|
||
<p id="p1">This is a test.</p> | ||
<p id="p2">Second paragraph.</p> | ||
|
||
<script> | ||
if (accessibilityController) { | ||
let output = "Tests that using the WebArea to retrieve AttributedStrings from element TextMarkerRanges works properly.\n\n"; | ||
|
||
let webArea = accessibilityController.rootElement.childAtIndex(0); | ||
let text = accessibilityController.accessibleElementById("p1").childAtIndex(0); | ||
let range1 = webArea.textMarkerRangeForElement(text); | ||
output += `"${webArea.attributedStringForTextMarkerRange(range1)}"\n`; | ||
|
||
// Include the word Second in p2. | ||
let end = webArea.endTextMarkerForTextMarkerRange(range1); | ||
for (let i = 0; i < 7; ++i) | ||
end = webArea.nextTextMarker(end); | ||
let range = webArea.textMarkerRangeForMarkers(webArea.startTextMarkerForTextMarkerRange(range1), end); | ||
output += `"${webArea.attributedStringForTextMarkerRange(range)}"\n`; | ||
|
||
// Get the string for both paragraphs together. | ||
text = accessibilityController.accessibleElementById("p2").childAtIndex(0); | ||
let range2 = webArea.textMarkerRangeForElement(text); | ||
range = webArea.textMarkerRangeForMarkers(webArea.startTextMarkerForTextMarkerRange(range1), webArea.endTextMarkerForTextMarkerRange(range2)); | ||
output += `"${webArea.attributedStringForTextMarkerRange(range)}"\n`; | ||
|
||
debug(output); | ||
} | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters