AT should expose untransformed text for full-size-kana and full-width text-transforms
Categories
(Core :: Disability Access APIs, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox68 | --- | fixed |
People
(Reporter: fantasai.bugs, Assigned: jfkthame)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
I've gotten reports that Gecko's accessibility tree is returning the text after application of 'text-transform: full-size-kana' or 'text-transform: full-width' rather than exposing the original text. I unfortunately can't verify this because I have no idea how, but the AT should be returning the untransformed text here.
In particular, full-size-kana was introduced primarily for the purpose of allowing authors to provide the original text in the document so that it can be read properly by AT, since it's a lossy transformation that shifts one kana letter to another and will result in words being read incorrectly. So exposing the untransformed text is really important here.
Comment 1•6 years ago
|
||
Confirmed.
STR:
- Open this test case:
data:text/html,<p style="text-transform: full-width;">a</p>
- Right click on the text and select Inspect Accessibility Properties.
- In the accessibility tree, expand the paragraph.
- Examine the text leaf.
- Expected: text leaf:"a"
- Actual: text leaf:"a"
Note that Chrome exposes this as expected.
This is going to be tricky to fix, as we call nsTextFrame::GetRenderedText and it doesn't provide any way for us to disable specific transforms. (We don't want to disable all styling related text changes.)
Updated•6 years ago
|
Comment 2•6 years ago
|
||
My bad. Chrome doesn't seem to support full-width at all, which is why this appeared to behave as expected there.
Assignee | ||
Comment 3•6 years ago
|
||
According to fgrep -r text-transform accessible/tests/
, we don't seem to have any test coverage for how text-transform is handled through the accessibility APIs. So it'd be good to start by introducing a test, to confirm what our current behavior is and to verify a fix here once we come up with one.
Assignee | ||
Comment 4•6 years ago
|
||
We don't seem to have any current test coverage for this. This patch adds simple
testcases to confirm that the text returned by gettext is transformed according
to CSS text-transform case transformations.
For text-transform:full-width and full-size-kana, the content should be returned
without the transformation applied. These tests are marked as TODO, as currently
we return the transformed text.
Assignee | ||
Comment 5•6 years ago
|
||
Assignee | ||
Comment 6•6 years ago
|
||
Note that the above patch will also affect the result of HTMLElement.innerText. There's no current test coverage for this, nor does the draft spec explicitly address it; it talks of innerText returning the transformed text, but predates the implementation of the full-size-kana (and full-width?) values, so it's unclear whether these were considered at all.
I've asked about this in https://github.com/w3c/csswg-drafts/issues/3775#issuecomment-479898517, to see what people think. If .innerText should continue to reflect the full-width/full-size-kana transforms, we'd need to do a bit more work to pass the appropriate parameter down to nsTextFrame::GetRenderedText depending on what API is being used. But I'm inclined not to do this until there's some kind of consensus that it's the right way to go; to me, it seems like having subtly different behavior between what the accessibility APIs and the DOM innerText attribute return is probably undesirable, as it will only serve to confuse people further.
So unless someone makes a strong argument for splitting them, I'd prefer to let them share the same behavior here. Once people have had a chance to express opinions, we should also add test coverage for these values to web-platform/tests//html/dom/elements/the-innertext-idl-attribute/getter-tests.js.
Comment 7•6 years ago
|
||
Sounds reasonable, I agree with that.
Updated•6 years ago
|
Comment 9•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/d7d6faf624f3
https://hg.mozilla.org/mozilla-central/rev/34c20181c54f
Updated•6 years ago
|
Description
•