Closed Bug 1541668 Opened 6 years ago Closed 6 years ago

AT should expose untransformed text for full-size-kana and full-width text-transforms

Categories

(Core :: Disability Access APIs, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla68
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.

Status: NEW → UNCONFIRMED
Ever confirmed: false

Confirmed.

STR:

  1. Open this test case: data:text/html,<p style="text-transform: full-width;">a</p>
  2. Right click on the text and select Inspect Accessibility Properties.
  3. In the accessibility tree, expand the paragraph.
  4. 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.)

Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P3
Keywords: parity-chrome
Blocks: texta11y

My bad. Chrome doesn't seem to support full-width at all, which is why this appeared to behave as expected there.

Keywords: parity-chrome

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.

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.

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.

Sounds reasonable, I agree with that.

Attachment #9055852 - Attachment description: Bug 1541668 - Make nsTextFrame::GetRenderedText ignore full-width and full-size-kana transforms. r=jamie → Bug 1541668 - Make nsTextFrame::GetRenderedText ignore full-width and full-size-kana transforms. r=jamie,mats
Pushed by jkew@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d7d6faf624f3 Add a11y gettext tests for content that uses CSS text-transform. r=Jamie https://hg.mozilla.org/integration/autoland/rev/34c20181c54f Make nsTextFrame::GetRenderedText ignore full-width and full-size-kana transforms. r=Jamie,mats
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
Assignee: nobody → jfkthame
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: