Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
zcorpan authored and Marcos Cáceres committed Jul 23, 2019
1 parent 1569bbc commit ad2ac85
Show file tree
Hide file tree
Showing 26 changed files with 114 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ These tests are intended to test the accessibility of the fieldset and legend el

To run these tests, open the browser's developer tools and navigate to the Accessibility pane (may
need to activate it in Settings), or use an OS-level accessibility inspector, and verify that the
accessible name matches the expected accessible name.
accessible name/role matches the expected accessible name/role.

The following issue discusses ways to automate these tests:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!doctype html>
<title>fieldset accessibility test: ARIA</title>
<div role=group aria-labelledby=legend>
<div id=fieldset role=group aria-labelledby=legend>
<div id=legend>Foo</div>
<input>
</div>
<p>Expected accessible name: "Foo"
<p>Expected accessible name for id=fieldset: "Foo"
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<!doctype html>
<title>fieldset accessibility test: baseline</title>
<fieldset>
<link rel=help href=https://w3c.github.io/html-aam/#fieldset-element-accessible-name-computation>
<fieldset id=fieldset>
<legend>Foo</legend>
<input>
</fieldset>
<p>Expected accessible name: "Foo"
<p>Expected accessible name for id=fieldset: "Foo"
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<!doctype html>
<title>fieldset accessibility test: fieldset -webkit-appearance: none</title>
<link rel=help href=https://w3c.github.io/html-aam/#fieldset-element-accessible-name-computation>
<style>
fieldset { -webkit-appearance: none; }
</style>
<fieldset>
<fieldset id=fieldset>
<legend>Foo</legend>
<input>
</fieldset>
<p>Expected accessible name: "Foo"
<p>Expected accessible name for id=fieldset: "Foo"
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<!doctype html>
<title>fieldset accessibility test: fieldset display: contents</title>
<link rel=help href=https://w3c.github.io/html-aam/#fieldset-element-accessible-name-computation>
<style>
fieldset { display: contents; }
</style>
<fieldset>
<fieldset id=fieldset>
<legend>Foo</legend>
<input>
</fieldset>
<p>Expected accessible name: "Foo"
<p>Expected accessible name for id=fieldset: "Foo"
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!doctype html>
<title>fieldset accessibility test: fieldset display: none</title>
<link rel=help href=https://w3c.github.io/html-aam/#fieldset-element-accessible-name-computation>
<style>
fieldset { display: none; }
</style>
<fieldset id=fieldset>
<legend>Foo</legend>
<input>
</fieldset>
<p>Expected no accessible node for id=fieldset.
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<!doctype html>
<title>fieldset accessibility test: fieldset div display: contents</title>
<link rel=help href=https://w3c.github.io/html-aam/#fieldset-element-accessible-name-computation>
<style>
div { display: contents; }
</style>
<fieldset>
<fieldset id=fieldset>
<div>
<legend>Foo</legend>
<input>
</div>
</fieldset>
<p>Expected accessible name: ""
<p>Expected accessible name for id=fieldset: ""
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<!doctype html>
<title>fieldset accessibility test: fieldset role=none</title>
<fieldset role=none>
<link rel=help href=http://w3c.github.io/aria/#none>
<fieldset id=fieldset role=none>
<legend>Foo</legend>
<input>
</fieldset>
<p>Expected no accessible node for the fieldset.
<p>Expected no accessible node for id=fieldset.
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<!doctype html>
<title>fieldset accessibility test: fieldset role=none</title>
<fieldset role=presentation>
<title>fieldset accessibility test: fieldset role=presentation</title>
<link rel=help href=http://w3c.github.io/aria/#presentation>
<fieldset id=fieldset role=presentation>
<legend>Foo</legend>
<input>
</fieldset>
<p>Expected no accessible node for the fieldset.
<p>Expected no accessible node for id=fieldset.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!doctype html>
<title>fieldset accessibility test: fieldset visibility: collapse</title>
<link rel=help href=https://w3c.github.io/html-aam/#fieldset-element-accessible-name-computation>
<style>
fieldset { visibility: collapse; }
</style>
<fieldset id=fieldset>
<legend>Foo</legend>
<input>
</fieldset>
<p>Expected no accessible node for id=fieldset.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!doctype html>
<title>fieldset accessibility test: fieldset visibility: hidden</title>
<link rel=help href=https://w3c.github.io/html-aam/#fieldset-element-accessible-name-computation>
<style>
fieldset { visibility: hidden; }
legend, input { visibility: visible; }
</style>
<fieldset id=fieldset>
<legend>Foo</legend>
<input>
</fieldset>
<p>Expected no accessible node for id=fieldset.
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<!doctype html>
<title>fieldset accessibility test: flexbox</title>
<link rel=help href=https://w3c.github.io/html-aam/#fieldset-element-accessible-name-computation>
<style>
fieldset { display: flex; }
legend { float: left; flex: auto; }
input { display: block; flex: auto; }
</style>
<fieldset>
<fieldset id=fieldset>
<legend>Foo</legend>
<input>
</fieldset>
<p>Expected accessible name: "Foo"
<p>Expected accessible name for id=fieldset: "Foo"
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<!doctype html>
<title>fieldset accessibility test: grid</title>
<link rel=help href=https://w3c.github.io/html-aam/#fieldset-element-accessible-name-computation>
<style>
fieldset { display: grid; grid-template-columns: auto auto; }
legend { float: left; }
</style>
<fieldset>
<fieldset id=fieldset>
<legend>Foo</legend>
<input>
</fieldset>
<p>Expected accessible name: "Foo"
<p>Expected accessible name for id=fieldset: "Foo"
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<!doctype html>
<title>fieldset accessibility test: position: absolute legend</title>
<link rel=help href=https://w3c.github.io/html-aam/#fieldset-element-accessible-name-computation>
<style>
legend { position: absolute; }
</style>
<fieldset>
<fieldset id=fieldset>
<legend>Foo</legend>
<input>
</fieldset>
<p>Expected accessible name: "Foo"
<p>Expected accessible name for id=fieldset: "Foo"
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<!doctype html>
<title>fieldset accessibility test: legend child display: none</title>
<link rel=help href=https://w3c.github.io/html-aam/#fieldset-element-accessible-name-computation>
<style>
legend > span { display: none; }
</style>
<fieldset>
<fieldset id=fieldset>
<legend>Foo<span>Bar</span></legend>
<input>
</fieldset>
<p>Expected accessible name: "Foo"
<p>Expected accessible name for id=fieldset: "Foo"
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<!doctype html>
<title>fieldset accessibility test: legend visibility: hidden</title>
<link rel=help href=https://w3c.github.io/html-aam/#fieldset-element-accessible-name-computation>
<style>
legend > span { visibility: hidden; }
</style>
<fieldset>
<fieldset id=fieldset>
<legend>Foo<span>Bar</span></legend>
<input>
</fieldset>
<p>Expected accessible name: "Foo"
<p>Expected accessible name for id=fieldset: "Foo"
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<!doctype html>
<title>fieldset accessibility test: legend display: contents</title>
<link rel=help href=https://w3c.github.io/html-aam/#fieldset-element-accessible-name-computation>
<style>
legend { display: contents; }
</style>
<fieldset>
<fieldset id=fieldset>
<legend>Foo</legend>
<input>
</fieldset>
<p>Expected accessible name: "Foo"
<p>Expected accessible name for id=fieldset: "Foo"
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<!doctype html>
<title>fieldset accessibility test: legend display: none</title>
<link rel=help href=https://w3c.github.io/html-aam/#fieldset-element-accessible-name-computation>
<style>
legend { display: none; }
</style>
<fieldset>
<fieldset id=fieldset>
<legend>Foo</legend>
<input>
</fieldset>
<p>Expected accessible name: ""
<p>Expected accessible name for id=fieldset: ""
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<!doctype html>
<title>fieldset accessibility test: floating legend</title>
<link rel=help href=https://w3c.github.io/html-aam/#fieldset-element-accessible-name-computation>
<style>
legend { float: left; }
</style>
<fieldset>
<fieldset id=fieldset>
<legend>Foo</legend>
<input>
</fieldset>
<p>Expected accessible name: "Foo"
<p>Expected accessible name for id=fieldset: "Foo"
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<!doctype html>
<title>fieldset accessibility test: legend role=group aria-labelledby=fieldset</title>
<link rel=help href=https://w3c.github.io/html-aam/#fieldset-element-accessible-name-computation>
<fieldset id=fieldset>
<legend role=group aria-labelledby=fieldset>Foo</legend>
<input>
</fieldset>
<p>Expected accessible name: ""
<p>Expected accessible name for id=fieldset: ""
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!doctype html>
<title>fieldset accessibility test: legend visibility: collapse</title>
<link rel=help href=https://w3c.github.io/html-aam/#fieldset-element-accessible-name-computation>
<style>
legend { visibility: collapse; }
</style>
<fieldset id=fieldset>
<legend>Foo</legend>
<input>
</fieldset>
<p>Expected accessible name for id=fieldset: ""
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<!doctype html>
<title>fieldset accessibility test: legend visibility: hidden</title>
<link rel=help href=https://w3c.github.io/html-aam/#fieldset-element-accessible-name-computation>
<style>
legend { visibility: hidden; }
</style>
<fieldset>
<fieldset id=fieldset>
<legend>Foo</legend>
<input>
</fieldset>
<p>Expected accessible name: ""
<p>Expected accessible name for id=fieldset: ""
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<!doctype html>
<title>fieldset accessibility test: multiple legends</title>
<fieldset>
<link rel=help href=https://w3c.github.io/html-aam/#fieldset-element-accessible-name-computation>
<fieldset id=fieldset>
<div></div>
<legend>Foo</legend>
<legend>Bar</legend>
<input>
</fieldset>
<p>Expected accessible name: "Foo"
<p>Expected accessible name for id=fieldset: "Foo"
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!doctype html>
<title>fieldset accessibility test: role</title>
<fieldset id=fieldset>
<legend id=legend>Foo</legend>
<input>
</fieldset>
<p>Expected accessible role for id=fieldset: "group"
<p>Expected accessible role for id=legend: No corresponding role
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<!DOCTYPE html>
<title>fieldset accessibility test: shadow DOM</title>
<link rel=help href=https://w3c.github.io/html-aam/#fieldset-element-accessible-name-computation>
<template id="my-fieldset">
<fieldset>
<fieldset id=fieldset>
<slot name="my-text"></slot>
<input>
</fieldset>
Expand All @@ -11,7 +12,7 @@
<legend slot="my-text">Foo</legend>
</my-fieldset>

<p>Expected accessible name: ""
<p>Expected accessible name for id=fieldset: ""

<script>
customElements.define('my-fieldset',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<!doctype html>
<title>fieldset accessibility test: title attribute and empty legend</title>
<fieldset title="Foo">
<link rel=help href=https://w3c.github.io/html-aam/#fieldset-element-accessible-name-computation>
<fieldset id=fieldset title="Foo">
<legend></legend>
<input>
</fieldset>
<p>Expected accessible name: "Foo"
<p>Expected accessible name for id=fieldset: "Foo"

0 comments on commit ad2ac85

Please sign in to comment.