Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML: Add manual accessibility tests for fieldset #12691

Merged
merged 10 commits into from Mar 3, 2019

Conversation

@zcorpan
Copy link
Member

@zcorpan zcorpan commented Aug 27, 2018

No description provided.

============================

These tests are intended to test the accessibility of the fieldset and legend elements. They do not
yet have pass conditions or a clear way to run them. This is expected to be addressed later.

This comment has been minimized.

@annevk

annevk Aug 28, 2018
Member

This makes them rather hard to review, no?

This comment has been minimized.

@zcorpan

zcorpan Aug 28, 2018
Author Member

Yeah. :/ I don't know yet what expected behavior should be.

This comment has been minimized.

@zcorpan

zcorpan Aug 28, 2018
Author Member

Also see w3c/html-aam#145

@zcorpan
Copy link
Member Author

@zcorpan zcorpan commented Aug 29, 2018

If https://github.com/WICG/aom/blob/gh-pages/explainer.md#full-introspection-of-an-accessibility-tree---computedaccessiblenode is implemented, it could be used by these tests as normal testharness.js tests.

@zcorpan
Copy link
Member Author

@zcorpan zcorpan commented Sep 2, 2018

I see accname/ has some tests for accessible name (but not for fieldset), and although the tests are marked as manual, they have some script to formalize the expected result. I'm not familiar with that. @halindrome @joanmarie should these tests be in accname/ with that convention? How are those tests run?

@zcorpan
Copy link
Member Author

@zcorpan zcorpan commented Sep 7, 2018

@joanmarie
Copy link
Contributor

@joanmarie joanmarie commented Sep 12, 2018

The tests are run via tools created by the ARIA working group which we hope to integrate into WPT, but which are not yet ready for general consumption due to bugs, lack of documentation, etc.

As for where the tests should live, we should get @stevefaulkner and @scottaohara to chime in. The HTML AAM has normative content regarding Accessible Name calculation specific to HTML and which overrides what is in the Acc Name spec.

@zcorpan
Copy link
Member Author

@zcorpan zcorpan commented Sep 12, 2018

OK, thank you. Maybe we can leave these tests as manual until those tools are ready?

@zcorpan
Copy link
Member Author

@zcorpan zcorpan commented Sep 17, 2018

@mcking65 are you able to take a look at this?

Copy link

@asurkov asurkov left a comment

overall it looks good, sorry it took that long

@@ -0,0 +1,7 @@
<!doctype html>
<title>fieldset accessibility test: ARIA</title>
<div role=group aria-labelledby=legend>

This comment has been minimized.

@asurkov

asurkov Oct 18, 2018

It appears people tends to put attribute values into quotes in this repo, see for example [1]. I'd say it makes sense to keep that style here too, unless you have a reason for this.

[1] https://github.com/web-platform-tests/wpt/blob/master/html/semantics/edits/the-del-element/del_effect.html

This comment has been minimized.

@zcorpan

zcorpan Oct 18, 2018
Author Member

We don't have a style guide, and unquoted attributes certainly are used elsewhere in wpt.

<div id=legend>Foo</div>
<input>
</div>
<p>Expected accessible name: "Foo"

This comment has been minimized.

@asurkov

asurkov Oct 18, 2018

It'd be nice to be explicit here and point out which accessible object you refer to. For example,

Expected accessible name for div@role=group: Also you may want to give @id to div@role=group and use it instead, like

Expected accessible name for @id=fieldset:

I'm sure HTML allow to not close < p > element, but I sort of like to keep explicit

. I'm not sure though what policies of this repo are, so I leave it to you.

This comment has been minimized.

@asurkov

asurkov Oct 18, 2018

I'm also curious why the test are restricted to fieldset accessible name only. Should it have accessible role as well?

</style>
<fieldset>
<div>
<legend>Foo</legend>

This comment has been minimized.

@asurkov

asurkov Oct 18, 2018

According to HTML spec [1], legend has to be a first child of fieldset. So you're right the browsers shouldn't pick up accessible name from a legend, which is not a direct child. I'd be nice to have a comment in the test or extend <title> to reflect this.

[1] https://html.spec.whatwg.org/multipage/form-elements.html#the-legend-element

This comment has been minimized.

@zcorpan

zcorpan Oct 18, 2018
Author Member

That is an authoring conformance requirement. The UA conformance requirement is

https://w3c.github.io/html-aam/#fieldset-element-accessible-name-computation

step 2

<!doctype html>
<title>fieldset accessibility test: legend child display: none</title>
<style>
legend > span { display: none; }

This comment has been minimized.

@asurkov

asurkov Oct 18, 2018

I'd say the test is not legend specific, but it's ok to have it if you want

<!doctype html>
<title>fieldset accessibility test: legend role=group aria-labelledby=fieldset</title>
<fieldset id=fieldset>
<legend role=group aria-labelledby=fieldset>Foo</legend>

This comment has been minimized.

@asurkov

asurkov Oct 18, 2018

a tricky one, the output looks reasonable, but I didn't run it through the spec name computation alg

This comment has been minimized.

@zcorpan

zcorpan Oct 18, 2018
Author Member

Yeah the spec side is pretty messy. I filed an issue but can't find it now. Basically I think accname should have hooks for html-aam to use when defining fieldset/legend.

<title>fieldset accessibility test: multiple legends</title>
<fieldset>
<legend>Foo</legend>
<legend>Bar</legend>

This comment has been minimized.

@asurkov

asurkov Oct 18, 2018

a good one, might be worth to have a test where legend is not a first child

<legend slot="my-text">Foo</legend>
</my-fieldset>

<p>Expected accessible name: ""

This comment has been minimized.

This comment has been minimized.

@zcorpan

zcorpan Oct 18, 2018
Author Member

Accessible name computation works on the DOM tree, not the flat tree.

<!doctype html>
<title>fieldset accessibility test: legend visibility: hidden</title>
<style>
legend { visibility: hidden; }

This comment has been minimized.

@asurkov

asurkov Oct 18, 2018

might be worth to have display:none/visibility:hidden placed on fieldset element. Also might worth testing visibility:collapsed and visibility:visible

@zcorpan
Copy link
Member Author

@zcorpan zcorpan commented Oct 18, 2018

I can't find the spec for accessible name and descriptions anymore... w3c/accname#34

@zcorpan
Copy link
Member Author

@zcorpan zcorpan commented Oct 18, 2018

OK addressed comments, thank you @asurkov

@zcorpan zcorpan force-pushed the zcorpan/fieldset-accessibility branch from 664d570 to a21fc6c Mar 3, 2019
@zcorpan
Copy link
Member Author

@zcorpan zcorpan commented Mar 3, 2019

Rebased on latest master. Should be good to merge if bots are green.

@sideshowbarker sideshowbarker merged commit 7b032f0 into master Mar 3, 2019
11 checks passed
11 checks passed
Azure Pipelines Build #20190303.11 succeeded
Details
Azure Pipelines (./wpt test-jobs) ./wpt test-jobs succeeded
Details
Azure Pipelines (affected tests (Safari Technology Preview)) affected tests (Safari Technology Preview) succeeded
Details
Azure Pipelines (affected tests without changes (Safari Technology Preview)) affected tests without changes (Safari Technology Preview) succeeded
Details
Azure Pipelines (wpt.fyi hook: safari-preview-affected-tests) wpt.fyi hook: safari-preview-affected-tests succeeded
Details
Azure Pipelines (wpt.fyi hook: safari-preview-affected-tests-without-changes) wpt.fyi hook: safari-preview-affected-tests-without-changes succeeded
Details
Taskcluster (pull_request) TaskGroup: success
Details
Travis CI - Pull Request Build Passed
Details
wpt.fyi - chrome[experimental] Chrome results
Details
wpt.fyi - firefox[experimental] Firefox results
Details
wpt.fyi - safari[experimental] Safari results
Details
@sideshowbarker sideshowbarker deleted the zcorpan/fieldset-accessibility branch Mar 3, 2019
@zcorpan
Copy link
Member Author

@zcorpan zcorpan commented Mar 3, 2019

Thanks Mike!

@sideshowbarker
Copy link
Member

@sideshowbarker sideshowbarker commented Mar 3, 2019

Cheers 🍫

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants
You can’t perform that action at this time.