Fix accessible/tests/mochitest/elm/test_HTMLSpec.html to work with ::details-content element
Categories
(Core :: Disability Access APIs, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox143 | --- | fixed |
People
(Reporter: dholbert, Assigned: dholbert)
References
Details
Attachments
(1 file)
Right now, the mochitest accessible/tests/mochitest/elm/test_HTMLSpec.html fails if we enable the ::details-content pseudo-element (about:config pref layout.css.details-content.enabled), per bug 1941406 comment 20.
Sample failure log: https://treeherder.mozilla.org/logviewer?job_id=520594076&repo=autoland&lineNumber=2415
TEST-UNEXPECTED-FAIL | accessible/tests/mochitest/elm/test_HTMLSpec.html | Wrong value of property 'role' for ['slot node', address: [object HTMLSlotElement], role: text container, address: [xpconnect wrapped nsIAccessible]].got 'text container', expected 'paragraph'
I think the failure is just indicating that we're adding a layer of wrapper pseudo-elements in there, which gets categorized as "text container" (which seems reasonable I think? I don't know precisely what these roles represent).
The test is expecting "paragraph" because the <details> element here does actually have a p child in the DOM tree (and now that child is a child of a ::details-content box, in the layout tree).
The test passes if I adjust the expectation to expect the child to be "text container" and to expect it to have a child which is a paragraph; I suspect that's the right adjustment here.
Filing this bug on making that edit and for forcing on this pref for this test (so that it stays green regardless of layout.css.details-content.enabled pref default changes).
| Assignee | ||
Comment 1•3 months ago
|
||
I tried adding this to doTest to force-enable the pref:
await SpecialPowers.pushPrefEnv({"set": [
["layout.css.details-content.enabled", true],
]});
But that doesn't seem to happen in time, possibly because <details> is hardcoded in the HTML and is present before that pushPrefEnv gets a chance to complete.
So let's just set the pref in the manifest file. Most-likely this pref won't exist for too long anyway (and will be default-enabled quite soon), so there's no big need to worry too much about setting it just for this one test.
| Assignee | ||
Comment 2•3 months ago
|
||
Also, force-enable support for that new wrapper-box in this mochitest's
directory, so that the test's results will remain consistent regardless of when
we toggle the pref default to true/false.
Updated•2 months ago
|
Description
•