Commit 5d93330
committed
AX: ::first-letter text not exposed in the accessibility tree if no other text accompanies it
https://bugs.webkit.org/show_bug.cgi?id=305787
rdar://168458291
Reviewed by Joshua Hoffman.
When a ::first-letter pseudo-element consumes all text in an element
(e.g., <div>h</div> with div::first-letter styling), the text node's
renderer becomes an empty RenderTextFragment. The hasRenderedText()
check in computeIsIgnored() returns false for this empty fragment,
causing the text to be incorrectly ignored in the accessibility tree.
Fix this by checking if an empty RenderTextFragment has an associated
first-letter container. If so, don't ignore it because its text content
can still be retrieved from the associated DOM Text node.
* LayoutTests/accessibility/first-letter-single-character-expected.txt: Added.
* LayoutTests/accessibility/first-letter-single-character.html: Added.
* Source/WebCore/accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::computeIsIgnored const):
Canonical link: https://commits.webkit.org/305884@main1 parent a6c1ed4 commit 5d93330
File tree
4 files changed
+64
-4
lines changed- LayoutTests
- accessibility
- platform/glib
- Source/WebCore/accessibility
4 files changed
+64
-4
lines changedLines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
Lines changed: 38 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
823 | 823 | | |
824 | 824 | | |
825 | 825 | | |
826 | | - | |
| 826 | + | |
827 | 827 | | |
828 | 828 | | |
829 | 829 | | |
830 | 830 | | |
| 831 | + | |
831 | 832 | | |
832 | 833 | | |
833 | 834 | | |
| |||
Lines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1268 | 1268 | | |
1269 | 1269 | | |
1270 | 1270 | | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
1271 | 1278 | | |
1272 | 1279 | | |
1273 | 1280 | | |
1274 | 1281 | | |
1275 | 1282 | | |
1276 | 1283 | | |
1277 | | - | |
1278 | | - | |
1279 | | - | |
1280 | 1284 | | |
1281 | 1285 | | |
1282 | 1286 | | |
| |||
0 commit comments