mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-12 19:19:30 +00:00
Tests: Import WPT html/dom/aria-attribute-reflection.html test
This change imports the WPT html/dom/aria-attribute-reflection.html test
into being an in-tree test — and deletes the related existing test
from a924e8747a
previously “ported” from the WPT with changes to run under our (non-WPT)
in-tree test harness.
This commit is contained in:
parent
d78c81a9fd
commit
58b07bc531
Notes:
github-actions[bot]
2024-10-30 07:48:13 +00:00
Author: https://github.com/sideshowbarker
Commit: 58b07bc531
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2047
4 changed files with 487 additions and 654 deletions
|
@ -1,221 +0,0 @@
|
|||
Element Reflection for ARIA properties
|
||||
Testing: role attribute reflects.
|
||||
✅ PASS: button is equal to button as expected.
|
||||
✅ PASS: checkbox is equal to checkbox as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
Testing: aria-atomic attribute reflects.
|
||||
✅ PASS: true is equal to true as expected.
|
||||
✅ PASS: false is equal to false as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
Testing: aria-autocomplete attribute reflects.
|
||||
✅ PASS: list is equal to list as expected.
|
||||
✅ PASS: inline is equal to inline as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
Testing: aria-braillelabel attribute reflects.
|
||||
✅ PASS: x is equal to x as expected.
|
||||
✅ PASS: y is equal to y as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
Testing: aria-brailleroledescription attribute reflects.
|
||||
✅ PASS: x is equal to x as expected.
|
||||
✅ PASS: y is equal to y as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
Testing: aria-busy attribute reflects.
|
||||
✅ PASS: true is equal to true as expected.
|
||||
✅ PASS: false is equal to false as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
Testing: aria-checked attribute reflects.
|
||||
✅ PASS: mixed is equal to mixed as expected.
|
||||
✅ PASS: true is equal to true as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
Testing: aria-colcount attribute reflects.
|
||||
✅ PASS: 5 is equal to 5 as expected.
|
||||
✅ PASS: 6 is equal to 6 as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
Testing: aria-colindex attribute reflects.
|
||||
✅ PASS: 1 is equal to 1 as expected.
|
||||
✅ PASS: 2 is equal to 2 as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
Testing: aria-colindextext attribute reflects.
|
||||
✅ PASS: x is equal to x as expected.
|
||||
✅ PASS: y is equal to y as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
Testing: aria-colspan attribute reflects.
|
||||
✅ PASS: 2 is equal to 2 as expected.
|
||||
✅ PASS: 3 is equal to 3 as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
Testing: aria-current attribute reflects.
|
||||
✅ PASS: page is equal to page as expected.
|
||||
✅ PASS: step is equal to step as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
Testing: aria-description attribute reflects.
|
||||
✅ PASS: cold as ice is equal to cold as ice as expected.
|
||||
✅ PASS: hot as fire is equal to hot as fire as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
Testing: aria-disabled attribute reflects.
|
||||
✅ PASS: true is equal to true as expected.
|
||||
✅ PASS: false is equal to false as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
Testing: aria-expanded attribute reflects.
|
||||
✅ PASS: true is equal to true as expected.
|
||||
✅ PASS: false is equal to false as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
Testing: aria-haspopup attribute reflects.
|
||||
✅ PASS: menu is equal to menu as expected.
|
||||
✅ PASS: listbox is equal to listbox as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
Testing: aria-hidden attribute reflects.
|
||||
✅ PASS: true is equal to true as expected.
|
||||
✅ PASS: false is equal to false as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
Testing: aria-invalid attribute reflects.
|
||||
✅ PASS: true is equal to true as expected.
|
||||
✅ PASS: grammar is equal to grammar as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
Testing: aria-keyshortcuts attribute reflects.
|
||||
✅ PASS: x is equal to x as expected.
|
||||
✅ PASS: y is equal to y as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
Testing: aria-label attribute reflects.
|
||||
✅ PASS: x is equal to x as expected.
|
||||
✅ PASS: y is equal to y as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
Testing: aria-level attribute reflects.
|
||||
✅ PASS: 1 is equal to 1 as expected.
|
||||
✅ PASS: 2 is equal to 2 as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
Testing: aria-live attribute reflects.
|
||||
✅ PASS: polite is equal to polite as expected.
|
||||
✅ PASS: assertive is equal to assertive as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
Testing: aria-modal attribute reflects.
|
||||
✅ PASS: true is equal to true as expected.
|
||||
✅ PASS: false is equal to false as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
Testing: aria-multiline attribute reflects.
|
||||
✅ PASS: true is equal to true as expected.
|
||||
✅ PASS: false is equal to false as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
Testing: aria-multiselectable attribute reflects.
|
||||
✅ PASS: true is equal to true as expected.
|
||||
✅ PASS: false is equal to false as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
Testing: aria-orientation attribute reflects.
|
||||
✅ PASS: vertical is equal to vertical as expected.
|
||||
✅ PASS: horizontal is equal to horizontal as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
Testing: aria-placeholder attribute reflects.
|
||||
✅ PASS: x is equal to x as expected.
|
||||
✅ PASS: y is equal to y as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
Testing: aria-posinset attribute reflects.
|
||||
✅ PASS: 10 is equal to 10 as expected.
|
||||
✅ PASS: 11 is equal to 11 as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
Testing: aria-pressed attribute reflects.
|
||||
✅ PASS: true is equal to true as expected.
|
||||
✅ PASS: false is equal to false as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
Testing: aria-readonly attribute reflects.
|
||||
✅ PASS: true is equal to true as expected.
|
||||
✅ PASS: false is equal to false as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
Testing: aria-relevant attribute reflects.
|
||||
✅ PASS: text is equal to text as expected.
|
||||
✅ PASS: removals is equal to removals as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
Testing: aria-required attribute reflects.
|
||||
✅ PASS: true is equal to true as expected.
|
||||
✅ PASS: false is equal to false as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
Testing: aria-roledescription attribute reflects.
|
||||
✅ PASS: x is equal to x as expected.
|
||||
✅ PASS: y is equal to y as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
Testing: aria-rowcount attribute reflects.
|
||||
✅ PASS: 10 is equal to 10 as expected.
|
||||
✅ PASS: 11 is equal to 11 as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
Testing: aria-rowindex attribute reflects.
|
||||
✅ PASS: 1 is equal to 1 as expected.
|
||||
✅ PASS: 2 is equal to 2 as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
Testing: aria-rowindextext attribute reflects.
|
||||
✅ PASS: x is equal to x as expected.
|
||||
✅ PASS: y is equal to y as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
Testing: aria-rowspan attribute reflects.
|
||||
✅ PASS: 2 is equal to 2 as expected.
|
||||
✅ PASS: 3 is equal to 3 as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
Testing: aria-selected attribute reflects.
|
||||
✅ PASS: true is equal to true as expected.
|
||||
✅ PASS: false is equal to false as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
Testing: aria-setsize attribute reflects.
|
||||
✅ PASS: 10 is equal to 10 as expected.
|
||||
✅ PASS: 11 is equal to 11 as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
Testing: aria-sort attribute reflects.
|
||||
✅ PASS: descending is equal to descending as expected.
|
||||
✅ PASS: ascending is equal to ascending as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
Testing: aria-valuemax attribute reflects.
|
||||
✅ PASS: 99 is equal to 99 as expected.
|
||||
✅ PASS: 100 is equal to 100 as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
Testing: aria-valuemin attribute reflects.
|
||||
✅ PASS: 3 is equal to 3 as expected.
|
||||
✅ PASS: 2 is equal to 2 as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
Testing: aria-valuenow attribute reflects.
|
||||
✅ PASS: 50 is equal to 50 as expected.
|
||||
✅ PASS: 51 is equal to 51 as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
Testing: aria-valuetext attribute reflects.
|
||||
✅ PASS: 50% is equal to 50% as expected.
|
||||
✅ PASS: 51% is equal to 51% as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
||||
✅ PASS: null is equal to null as expected.
|
|
@ -0,0 +1,51 @@
|
|||
Summary
|
||||
|
||||
Harness status: OK
|
||||
|
||||
Rerun
|
||||
|
||||
Found 41 tests
|
||||
|
||||
41 Pass
|
||||
Details
|
||||
Result Test Name MessagePass role attribute reflects.
|
||||
Pass aria-atomic attribute reflects.
|
||||
Pass aria-autocomplete attribute reflects.
|
||||
Pass aria-braillelabel attribute reflects.
|
||||
Pass aria-brailleroledescription attribute reflects.
|
||||
Pass aria-busy attribute reflects.
|
||||
Pass aria-checked attribute reflects.
|
||||
Pass aria-colcount attribute reflects.
|
||||
Pass aria-colindex attribute reflects.
|
||||
Pass aria-colspan attribute reflects.
|
||||
Pass aria-current attribute reflects.
|
||||
Pass aria-disabled attribute reflects.
|
||||
Pass aria-expanded attribute reflects.
|
||||
Pass aria-haspopup attribute reflects.
|
||||
Pass aria-hidden attribute reflects.
|
||||
Pass aria-invalid attribute reflects.
|
||||
Pass aria-keyshortcuts attribute reflects.
|
||||
Pass aria-label attribute reflects.
|
||||
Pass aria-level attribute reflects.
|
||||
Pass aria-live attribute reflects.
|
||||
Pass aria-modal attribute reflects.
|
||||
Pass aria-multiline attribute reflects.
|
||||
Pass aria-multiselectable attribute reflects.
|
||||
Pass aria-orientation attribute reflects.
|
||||
Pass aria-placeholder attribute reflects.
|
||||
Pass aria-posinset attribute reflects.
|
||||
Pass aria-pressed attribute reflects.
|
||||
Pass aria-readonly attribute reflects.
|
||||
Pass aria-relevant attribute reflects.
|
||||
Pass aria-required attribute reflects.
|
||||
Pass aria-roledescription attribute reflects.
|
||||
Pass aria-rowcount attribute reflects.
|
||||
Pass aria-rowindex attribute reflects.
|
||||
Pass aria-rowspan attribute reflects.
|
||||
Pass aria-selected attribute reflects.
|
||||
Pass aria-setsize attribute reflects.
|
||||
Pass aria-sort attribute reflects.
|
||||
Pass aria-valuemax attribute reflects.
|
||||
Pass aria-valuemin attribute reflects.
|
||||
Pass aria-valuenow attribute reflects.
|
||||
Pass aria-valuetext attribute reflects.
|
|
@ -1,433 +0,0 @@
|
|||
<!DOCTYPE html><meta charset=utf-8>
|
||||
<script src="include.js"></script>
|
||||
<script>
|
||||
function run_test(callback, description) {
|
||||
println(`Testing: ${description}`);
|
||||
callback();
|
||||
}
|
||||
function assert_false(expression) {
|
||||
if (expression) {
|
||||
println(" ❌ FAIL: Expected false but got true.");
|
||||
}
|
||||
}
|
||||
function assert_equals(a, b) {
|
||||
if (a == b) {
|
||||
println(` ✅ PASS: ${a} is equal to ${b} as expected.`);
|
||||
} else {
|
||||
println(` ❌ FAIL: ${a} is not equal to ${b}.`);
|
||||
}
|
||||
}
|
||||
function testNullable(element, jsAttr, contentAttr) {
|
||||
var originalValue = element[jsAttr];
|
||||
assert_false(originalValue === null);
|
||||
element[jsAttr] = null;
|
||||
assert_equals(element[jsAttr], null);
|
||||
assert_false(element.hasAttribute(contentAttr));
|
||||
// Setting to undefined results in same state as setting to null.
|
||||
element[jsAttr] = originalValue;
|
||||
element[jsAttr] = undefined;
|
||||
assert_equals(element[jsAttr], null);
|
||||
assert_false(element.hasAttribute(contentAttr));
|
||||
}
|
||||
</script>
|
||||
|
||||
<div id="role" role="button"></div>
|
||||
<div id="atomic" aria-atomic="true"></div>
|
||||
<div id="autocomplete" aria-autocomplete="list"></div>
|
||||
<div id="braillelabel" aria-braillelabel="x"></div>
|
||||
<div id="brailleroledescription" aria-brailleroledescription="x"></div>
|
||||
<div id="busy" aria-busy="true"></div>
|
||||
<div id="checked" aria-checked="mixed"></div>
|
||||
<div id="colcount" aria-colcount="5"></div>
|
||||
<div id="colindex" aria-colindex="1"></div>
|
||||
<div id="colindextext" aria-colindextext="x"></div>
|
||||
<div id="colspan" aria-colspan="2"></div>
|
||||
<div id="current" aria-current="page"></div>
|
||||
<div id="description" aria-description="cold as ice"></div>
|
||||
<div id="disabled" aria-disabled="true"></div>
|
||||
<div id="expanded" aria-expanded="true"></div>
|
||||
<div id="haspopup" aria-haspopup="menu"></div>
|
||||
<div id="hidden" aria-hidden="true" tabindex="-1"></div>
|
||||
<div id="invalid" aria-invalid="true"></div>
|
||||
<div id="keyshortcuts" aria-keyshortcuts="x"></div>
|
||||
<div id="label" aria-label="x"></div>
|
||||
<div id="level" aria-level="1"></div>
|
||||
<div id="live" aria-live="polite"></div>
|
||||
<div id="modal" aria-modal="true"></div>
|
||||
<div id="multiline" aria-multiline="true"></div>
|
||||
<div id="multiselectable" aria-multiselectable="true"></div>
|
||||
<div id="orientation" aria-orientation="vertical"></div>
|
||||
<div id="placeholder" aria-placeholder="x"></div>
|
||||
<div id="posinset" aria-posinset="10"></div>
|
||||
<button id="pressed" aria-pressed="true" style="display: none"></button>
|
||||
<div id="readonly" aria-readonly="true"></div>
|
||||
<div id="relevant" aria-relevant="text"></div>
|
||||
<div id="required" aria-required="true"></div>
|
||||
<div id="roledescription" aria-roledescription="x"></div>
|
||||
<div id="rowcount" aria-rowcount="10"></div>
|
||||
<div id="rowindex" aria-rowindex="1"></div>
|
||||
<div id="rowindextext" aria-rowindextext="x"></div>
|
||||
<div id="rowspan" aria-rowspan="2"></div>
|
||||
<div id="selected" aria-selected="true"></div>
|
||||
<div id="setsize" aria-setsize="10"></div>
|
||||
<div id="sort" aria-sort="descending"></div>
|
||||
<div id="valuemax" aria-valuemax="99"></div>
|
||||
<div id="valuemin" aria-valuemin="3"></div>
|
||||
<div id="valuenow" aria-valuenow="50"></div>
|
||||
<div id="valuetext" aria-valuetext="50%"></div>
|
||||
<script>
|
||||
test(() => {
|
||||
println("Element Reflection for ARIA properties");
|
||||
run_test(function(t) {
|
||||
var element = document.getElementById("role");
|
||||
assert_equals(element.role, "button");
|
||||
element.role = "checkbox";
|
||||
assert_equals(element.getAttribute("role"), "checkbox");
|
||||
testNullable(element, "role", "role");
|
||||
}, "role attribute reflects.");
|
||||
|
||||
run_test(function(t) {
|
||||
var element = document.getElementById("atomic");
|
||||
assert_equals(element.ariaAtomic, "true");
|
||||
element.ariaAtomic = "false";
|
||||
assert_equals(element.getAttribute("aria-atomic"), "false");
|
||||
testNullable(element, "ariaAtomic", "aria-atomic");
|
||||
}, "aria-atomic attribute reflects.");
|
||||
|
||||
run_test(function(t) {
|
||||
var element = document.getElementById("autocomplete");
|
||||
assert_equals(element.ariaAutoComplete, "list");
|
||||
element.ariaAutoComplete = "inline";
|
||||
assert_equals(element.getAttribute("aria-autocomplete"), "inline");
|
||||
testNullable(element, "ariaAutoComplete", "aria-autocomplete");
|
||||
}, "aria-autocomplete attribute reflects.");
|
||||
|
||||
run_test(function(t) {
|
||||
var element = document.getElementById("braillelabel");
|
||||
assert_equals(element.ariaBrailleLabel, "x");
|
||||
element.ariaBrailleLabel = "y";
|
||||
assert_equals(element.getAttribute("aria-braillelabel"), "y");
|
||||
testNullable(element, "ariaBrailleLabel", "aria-braillelabel");
|
||||
}, "aria-braillelabel attribute reflects.");
|
||||
|
||||
run_test(function(t) {
|
||||
var element = document.getElementById("brailleroledescription");
|
||||
assert_equals(element.ariaBrailleRoleDescription, "x");
|
||||
element.ariaBrailleRoleDescription = "y";
|
||||
assert_equals(element.getAttribute("aria-brailleroledescription"), "y");
|
||||
testNullable(element, "ariaBrailleRoleDescription", "aria-brailleroledescription");
|
||||
}, "aria-brailleroledescription attribute reflects.");
|
||||
|
||||
run_test(function(t) {
|
||||
var element = document.getElementById("busy");
|
||||
assert_equals(element.ariaBusy, "true");
|
||||
element.ariaBusy = "false";
|
||||
assert_equals(element.getAttribute("aria-busy"), "false");
|
||||
testNullable(element, "ariaBusy", "aria-busy");
|
||||
}, "aria-busy attribute reflects.");
|
||||
|
||||
run_test(function(t) {
|
||||
var element = document.getElementById("checked");
|
||||
assert_equals(element.ariaChecked, "mixed");
|
||||
element.ariaChecked = "true";
|
||||
assert_equals(element.getAttribute("aria-checked"), "true");
|
||||
testNullable(element, "ariaChecked", "aria-checked");
|
||||
}, "aria-checked attribute reflects.");
|
||||
|
||||
run_test(function(t) {
|
||||
var element = document.getElementById("colcount");
|
||||
assert_equals(element.ariaColCount, "5");
|
||||
element.ariaColCount = "6";
|
||||
assert_equals(element.getAttribute("aria-colcount"), "6");
|
||||
testNullable(element, "ariaColCount", "aria-colcount");
|
||||
}, "aria-colcount attribute reflects.");
|
||||
|
||||
run_test(function(t) {
|
||||
var element = document.getElementById("colindex");
|
||||
assert_equals(element.ariaColIndex, "1");
|
||||
element.ariaColIndex = "2";
|
||||
assert_equals(element.getAttribute("aria-colindex"), "2");
|
||||
testNullable(element, "ariaColIndex", "aria-colindex");
|
||||
}, "aria-colindex attribute reflects.");
|
||||
|
||||
run_test(function(t) {
|
||||
var element = document.getElementById("colindextext");
|
||||
assert_equals(element.ariaColIndexText, "x");
|
||||
element.ariaColIndexText = "y";
|
||||
assert_equals(element.getAttribute("aria-colindextext"), "y");
|
||||
testNullable(element, "ariaColIndexText", "aria-colindextext");
|
||||
}, "aria-colindextext attribute reflects.");
|
||||
|
||||
run_test(function(t) {
|
||||
var element = document.getElementById("colspan");
|
||||
assert_equals(element.ariaColSpan, "2");
|
||||
element.ariaColSpan = "3";
|
||||
assert_equals(element.getAttribute("aria-colspan"), "3");
|
||||
testNullable(element, "ariaColSpan", "aria-colspan");
|
||||
}, "aria-colspan attribute reflects.");
|
||||
|
||||
run_test(function(t) {
|
||||
var element = document.getElementById("current");
|
||||
assert_equals(element.ariaCurrent, "page");
|
||||
element.ariaCurrent = "step";
|
||||
assert_equals(element.getAttribute("aria-current"), "step");
|
||||
testNullable(element, "ariaCurrent", "aria-current");
|
||||
}, "aria-current attribute reflects.");
|
||||
|
||||
run_test(function(t) {
|
||||
var element = document.getElementById("description");
|
||||
assert_equals(element.ariaDescription, "cold as ice");
|
||||
element.ariaDescription = "hot as fire";
|
||||
assert_equals(element.getAttribute("aria-description"), "hot as fire");
|
||||
testNullable(element, "ariaDescription", "aria-description");
|
||||
}, "aria-description attribute reflects.");
|
||||
|
||||
run_test(function(t) {
|
||||
var element = document.getElementById("disabled");
|
||||
assert_equals(element.ariaDisabled, "true");
|
||||
element.ariaDisabled = "false";
|
||||
assert_equals(element.getAttribute("aria-disabled"), "false");
|
||||
testNullable(element, "ariaDisabled", "aria-disabled");
|
||||
}, "aria-disabled attribute reflects.");
|
||||
|
||||
run_test(function(t) {
|
||||
var element = document.getElementById("expanded");
|
||||
assert_equals(element.ariaExpanded, "true");
|
||||
element.ariaExpanded = "false";
|
||||
assert_equals(element.getAttribute("aria-expanded"), "false");
|
||||
testNullable(element, "ariaExpanded", "aria-expanded");
|
||||
}, "aria-expanded attribute reflects.");
|
||||
|
||||
run_test(function(t) {
|
||||
var element = document.getElementById("haspopup");
|
||||
assert_equals(element.ariaHasPopup, "menu");
|
||||
element.ariaHasPopup = "listbox";
|
||||
assert_equals(element.getAttribute("aria-haspopup"), "listbox");
|
||||
testNullable(element, "ariaHasPopup", "aria-haspopup");
|
||||
}, "aria-haspopup attribute reflects.");
|
||||
|
||||
run_test(function(t) {
|
||||
var element = document.getElementById("hidden");
|
||||
assert_equals(element.ariaHidden, "true");
|
||||
element.ariaHidden = "false";
|
||||
assert_equals(element.getAttribute("aria-hidden"), "false");
|
||||
testNullable(element, "ariaHidden", "aria-hidden");
|
||||
}, "aria-hidden attribute reflects.");
|
||||
|
||||
run_test(function(t) {
|
||||
var element = document.getElementById("invalid");
|
||||
assert_equals(element.ariaInvalid, "true");
|
||||
element.ariaInvalid = "grammar";
|
||||
assert_equals(element.getAttribute("aria-invalid"), "grammar");
|
||||
testNullable(element, "ariaInvalid", "aria-invalid");
|
||||
}, "aria-invalid attribute reflects.");
|
||||
|
||||
run_test(function(t) {
|
||||
var element = document.getElementById("keyshortcuts");
|
||||
assert_equals(element.ariaKeyShortcuts, "x");
|
||||
element.ariaKeyShortcuts = "y";
|
||||
assert_equals(element.getAttribute("aria-keyshortcuts"), "y");
|
||||
testNullable(element, "ariaKeyShortcuts", "aria-keyshortcuts");
|
||||
}, "aria-keyshortcuts attribute reflects.");
|
||||
|
||||
run_test(function(t) {
|
||||
var element = document.getElementById("label");
|
||||
assert_equals(element.ariaLabel, "x");
|
||||
element.ariaLabel = "y";
|
||||
assert_equals(element.getAttribute("aria-label"), "y");
|
||||
testNullable(element, "ariaLabel", "aria-label");
|
||||
}, "aria-label attribute reflects.");
|
||||
|
||||
run_test(function(t) {
|
||||
var element = document.getElementById("level");
|
||||
assert_equals(element.ariaLevel, "1");
|
||||
element.ariaLevel = "2";
|
||||
assert_equals(element.getAttribute("aria-level"), "2");
|
||||
testNullable(element, "ariaLevel", "aria-level");
|
||||
}, "aria-level attribute reflects.");
|
||||
|
||||
run_test(function(t) {
|
||||
var element = document.getElementById("live");
|
||||
assert_equals(element.ariaLive, "polite");
|
||||
element.ariaLive = "assertive";
|
||||
assert_equals(element.getAttribute("aria-live"), "assertive");
|
||||
testNullable(element, "ariaLive", "aria-live");
|
||||
}, "aria-live attribute reflects.");
|
||||
|
||||
run_test(function(t) {
|
||||
var element = document.getElementById("modal");
|
||||
assert_equals(element.ariaModal, "true");
|
||||
element.ariaModal = "false";
|
||||
assert_equals(element.getAttribute("aria-modal"), "false");
|
||||
testNullable(element, "ariaModal", "aria-modal");
|
||||
}, "aria-modal attribute reflects.");
|
||||
|
||||
run_test(function(t) {
|
||||
var element = document.getElementById("multiline");
|
||||
assert_equals(element.ariaMultiLine, "true");
|
||||
element.ariaMultiLine = "false";
|
||||
assert_equals(element.getAttribute("aria-multiline"), "false");
|
||||
testNullable(element, "ariaMultiLine", "aria-multiline");
|
||||
}, "aria-multiline attribute reflects.");
|
||||
|
||||
run_test(function(t) {
|
||||
var element = document.getElementById("multiselectable");
|
||||
assert_equals(element.ariaMultiSelectable, "true");
|
||||
element.ariaMultiSelectable = "false";
|
||||
assert_equals(element.getAttribute("aria-multiselectable"), "false");
|
||||
testNullable(element, "ariaMultiSelectable", "aria-multiselectable");
|
||||
}, "aria-multiselectable attribute reflects.");
|
||||
|
||||
run_test(function(t) {
|
||||
var element = document.getElementById("orientation");
|
||||
assert_equals(element.ariaOrientation, "vertical");
|
||||
element.ariaOrientation = "horizontal";
|
||||
assert_equals(element.getAttribute("aria-orientation"), "horizontal");
|
||||
testNullable(element, "ariaOrientation", "aria-orientation");
|
||||
}, "aria-orientation attribute reflects.");
|
||||
|
||||
run_test(function(t) {
|
||||
var element = document.getElementById("placeholder");
|
||||
assert_equals(element.ariaPlaceholder, "x");
|
||||
element.ariaPlaceholder = "y";
|
||||
assert_equals(element.getAttribute("aria-placeholder"), "y");
|
||||
testNullable(element, "ariaPlaceholder", "aria-placeholder");
|
||||
}, "aria-placeholder attribute reflects.");
|
||||
|
||||
run_test(function(t) {
|
||||
var element = document.getElementById("posinset");
|
||||
assert_equals(element.ariaPosInSet, "10");
|
||||
element.ariaPosInSet = "11";
|
||||
assert_equals(element.getAttribute("aria-posinset"), "11");
|
||||
testNullable(element, "ariaPosInSet", "aria-posinset");
|
||||
}, "aria-posinset attribute reflects.");
|
||||
|
||||
run_test(function(t) {
|
||||
var element = document.getElementById("pressed");
|
||||
assert_equals(element.ariaPressed, "true");
|
||||
element.ariaPressed = "false";
|
||||
assert_equals(element.getAttribute("aria-pressed"), "false");
|
||||
testNullable(element, "ariaPressed", "aria-pressed");
|
||||
}, "aria-pressed attribute reflects.");
|
||||
|
||||
run_test(function(t) {
|
||||
var element = document.getElementById("readonly");
|
||||
assert_equals(element.ariaReadOnly, "true");
|
||||
element.ariaReadOnly = "false";
|
||||
assert_equals(element.getAttribute("aria-readonly"), "false");
|
||||
testNullable(element, "ariaReadOnly", "aria-readonly");
|
||||
}, "aria-readonly attribute reflects.");
|
||||
|
||||
run_test(function(t) {
|
||||
var element = document.getElementById("relevant");
|
||||
assert_equals(element.ariaRelevant, "text");
|
||||
element.ariaRelevant = "removals";
|
||||
assert_equals(element.getAttribute("aria-relevant"), "removals");
|
||||
testNullable(element, "ariaRelevant", "aria-relevant");
|
||||
}, "aria-relevant attribute reflects.");
|
||||
|
||||
run_test(function(t) {
|
||||
var element = document.getElementById("required");
|
||||
assert_equals(element.ariaRequired, "true");
|
||||
element.ariaRequired = "false";
|
||||
assert_equals(element.getAttribute("aria-required"), "false");
|
||||
testNullable(element, "ariaRequired", "aria-required");
|
||||
}, "aria-required attribute reflects.");
|
||||
|
||||
run_test(function(t) {
|
||||
var element = document.getElementById("roledescription");
|
||||
assert_equals(element.ariaRoleDescription, "x");
|
||||
element.ariaRoleDescription = "y";
|
||||
assert_equals(element.getAttribute("aria-roledescription"), "y");
|
||||
testNullable(element, "ariaRoleDescription", "aria-roledescription");
|
||||
}, "aria-roledescription attribute reflects.");
|
||||
|
||||
run_test(function(t) {
|
||||
var element = document.getElementById("rowcount");
|
||||
assert_equals(element.ariaRowCount, "10");
|
||||
element.ariaRowCount = "11";
|
||||
assert_equals(element.getAttribute("aria-rowcount"), "11");
|
||||
testNullable(element, "ariaRowCount", "aria-rowcount");
|
||||
}, "aria-rowcount attribute reflects.");
|
||||
|
||||
run_test(function(t) {
|
||||
var element = document.getElementById("rowindex");
|
||||
assert_equals(element.ariaRowIndex, "1");
|
||||
element.ariaRowIndex = "2";
|
||||
assert_equals(element.getAttribute("aria-rowindex"), "2");
|
||||
testNullable(element, "ariaRowIndex", "aria-rowindex");
|
||||
}, "aria-rowindex attribute reflects.");
|
||||
|
||||
run_test(function(t) {
|
||||
var element = document.getElementById("rowindextext");
|
||||
assert_equals(element.ariaRowIndexText, "x");
|
||||
element.ariaRowIndexText = "y";
|
||||
assert_equals(element.getAttribute("aria-rowindextext"), "y");
|
||||
testNullable(element, "ariaRowIndexText", "aria-rowindextext");
|
||||
}, "aria-rowindextext attribute reflects.");
|
||||
|
||||
run_test(function(t) {
|
||||
var element = document.getElementById("rowspan");
|
||||
assert_equals(element.ariaRowSpan, "2");
|
||||
element.ariaRowSpan = "3";
|
||||
assert_equals(element.getAttribute("aria-rowspan"), "3");
|
||||
testNullable(element, "ariaRowSpan", "aria-rowspan");
|
||||
}, "aria-rowspan attribute reflects.");
|
||||
|
||||
run_test(function(t) {
|
||||
var element = document.getElementById("selected");
|
||||
assert_equals(element.ariaSelected, "true");
|
||||
element.ariaSelected = "false";
|
||||
assert_equals(element.getAttribute("aria-selected"), "false");
|
||||
testNullable(element, "ariaSelected", "aria-selected");
|
||||
}, "aria-selected attribute reflects.");
|
||||
|
||||
run_test(function(t) {
|
||||
var element = document.getElementById("setsize");
|
||||
assert_equals(element.ariaSetSize, "10");
|
||||
element.ariaSetSize = "11";
|
||||
assert_equals(element.getAttribute("aria-setsize"), "11");
|
||||
testNullable(element, "ariaSetSize", "aria-setsize");
|
||||
}, "aria-setsize attribute reflects.");
|
||||
|
||||
run_test(function(t) {
|
||||
var element = document.getElementById("sort");
|
||||
assert_equals(element.ariaSort, "descending");
|
||||
element.ariaSort = "ascending";
|
||||
assert_equals(element.getAttribute("aria-sort"), "ascending");
|
||||
testNullable(element, "ariaSort", "aria-sort");
|
||||
}, "aria-sort attribute reflects.");
|
||||
|
||||
run_test(function(t) {
|
||||
var element = document.getElementById("valuemax");
|
||||
assert_equals(element.ariaValueMax, "99");
|
||||
element.ariaValueMax = "100";
|
||||
assert_equals(element.getAttribute("aria-valuemax"), "100");
|
||||
testNullable(element, "ariaValueMax", "aria-valuemax");
|
||||
}, "aria-valuemax attribute reflects.");
|
||||
|
||||
run_test(function(t) {
|
||||
var element = document.getElementById("valuemin");
|
||||
assert_equals(element.ariaValueMin, "3");
|
||||
element.ariaValueMin = "2";
|
||||
assert_equals(element.getAttribute("aria-valuemin"), "2");
|
||||
testNullable(element, "ariaValueMin", "aria-valuemin");
|
||||
}, "aria-valuemin attribute reflects.");
|
||||
|
||||
run_test(function(t) {
|
||||
var element = document.getElementById("valuenow");
|
||||
assert_equals(element.ariaValueNow, "50");
|
||||
element.ariaValueNow = "51";
|
||||
assert_equals(element.getAttribute("aria-valuenow"), "51");
|
||||
testNullable(element, "ariaValueNow", "aria-valuenow");
|
||||
}, "aria-valuenow attribute reflects.");
|
||||
|
||||
run_test(function(t) {
|
||||
var element = document.getElementById("valuetext");
|
||||
assert_equals(element.ariaValueText, "50%");
|
||||
element.ariaValueText = "51%";
|
||||
assert_equals(element.getAttribute("aria-valuetext"), "51%");
|
||||
testNullable(element, "ariaValueText", "aria-valuetext");
|
||||
}, "aria-valuetext attribute reflects.");
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,436 @@
|
|||
<!DOCTYPE HTML>
|
||||
|
||||
<meta charset="utf-8"/>
|
||||
<title>Element Reflection for ARIA properties</title>
|
||||
<link href="https://wicg.github.io/aom/spec/aria-reflection.html" rel="help"/>
|
||||
<link href="meredithl@chromium.org" rel="author" title="Meredith Lane"/>
|
||||
<script src="../../resources/testharness.js"></script>
|
||||
<script src="../../resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
function testNullable(element, jsAttr, contentAttr) {
|
||||
var originalValue = element[jsAttr];
|
||||
assert_false(originalValue === null);
|
||||
element[jsAttr] = null;
|
||||
assert_equals(element[jsAttr], null);
|
||||
assert_false(element.hasAttribute(contentAttr));
|
||||
// Setting to undefined results in same state as setting to null.
|
||||
element[jsAttr] = originalValue;
|
||||
element[jsAttr] = undefined;
|
||||
assert_equals(element[jsAttr], null);
|
||||
assert_false(element.hasAttribute(contentAttr));
|
||||
}
|
||||
</script>
|
||||
<div id="role" role="button"></div>
|
||||
<script>
|
||||
test(function(t) {
|
||||
var element = document.getElementById("role");
|
||||
assert_equals(element.role, "button");
|
||||
element.role = "checkbox";
|
||||
assert_equals(element.getAttribute("role"), "checkbox");
|
||||
testNullable(element, "role", "role");
|
||||
}, "role attribute reflects.");
|
||||
</script>
|
||||
<div aria-atomic="true" id="atomic"></div>
|
||||
<script>
|
||||
test(function(t) {
|
||||
var element = document.getElementById("atomic");
|
||||
assert_equals(element.ariaAtomic, "true");
|
||||
element.ariaAtomic = "false";
|
||||
assert_equals(element.getAttribute("aria-atomic"), "false");
|
||||
testNullable(element, "ariaAtomic", "aria-atomic");
|
||||
}, "aria-atomic attribute reflects.");
|
||||
</script>
|
||||
<div aria-autocomplete="list" id="autocomplete"></div>
|
||||
<script>
|
||||
test(function(t) {
|
||||
var element = document.getElementById("autocomplete");
|
||||
assert_equals(element.ariaAutoComplete, "list");
|
||||
element.ariaAutoComplete = "inline";
|
||||
assert_equals(element.getAttribute("aria-autocomplete"), "inline");
|
||||
testNullable(element, "ariaAutoComplete", "aria-autocomplete");
|
||||
}, "aria-autocomplete attribute reflects.");
|
||||
</script>
|
||||
<div aria-braillelabel="x" id="braillelabel"></div>
|
||||
<script>
|
||||
test(function(t) {
|
||||
var element = document.getElementById("braillelabel");
|
||||
assert_equals(element.ariaBrailleLabel, "x");
|
||||
element.ariaBrailleLabel = "y";
|
||||
assert_equals(element.getAttribute("aria-braillelabel"), "y");
|
||||
testNullable(element, "ariaBrailleLabel", "aria-braillelabel");
|
||||
}, "aria-braillelabel attribute reflects.");
|
||||
</script>
|
||||
<div aria-brailleroledescription="x" id="brailleroledescription"></div>
|
||||
<script>
|
||||
test(function(t) {
|
||||
var element = document.getElementById("brailleroledescription");
|
||||
assert_equals(element.ariaBrailleRoleDescription, "x");
|
||||
element.ariaBrailleRoleDescription = "y";
|
||||
assert_equals(element.getAttribute("aria-brailleroledescription"), "y");
|
||||
testNullable(element, "ariaBrailleRoleDescription", "aria-brailleroledescription");
|
||||
}, "aria-brailleroledescription attribute reflects.");
|
||||
</script>
|
||||
<div aria-busy="true" id="busy"></div>
|
||||
<script>
|
||||
test(function(t) {
|
||||
var element = document.getElementById("busy");
|
||||
assert_equals(element.ariaBusy, "true");
|
||||
element.ariaBusy = "false";
|
||||
assert_equals(element.getAttribute("aria-busy"), "false");
|
||||
testNullable(element, "ariaBusy", "aria-busy");
|
||||
}, "aria-busy attribute reflects.");
|
||||
</script>
|
||||
<div aria-checked="mixed" id="checked"></div>
|
||||
<script>
|
||||
test(function(t) {
|
||||
var element = document.getElementById("checked");
|
||||
assert_equals(element.ariaChecked, "mixed");
|
||||
element.ariaChecked = "true";
|
||||
assert_equals(element.getAttribute("aria-checked"), "true");
|
||||
testNullable(element, "ariaChecked", "aria-checked");
|
||||
}, "aria-checked attribute reflects.");
|
||||
</script>
|
||||
<div aria-colcount="5" id="colcount"></div>
|
||||
<script>
|
||||
test(function(t) {
|
||||
var element = document.getElementById("colcount");
|
||||
assert_equals(element.ariaColCount, "5");
|
||||
element.ariaColCount = "6";
|
||||
assert_equals(element.getAttribute("aria-colcount"), "6");
|
||||
testNullable(element, "ariaColCount", "aria-colcount");
|
||||
}, "aria-colcount attribute reflects.");
|
||||
</script>
|
||||
<div aria-colindex="1" id="colindex"></div>
|
||||
<script>
|
||||
test(function(t) {
|
||||
var element = document.getElementById("colindex");
|
||||
assert_equals(element.ariaColIndex, "1");
|
||||
element.ariaColIndex = "2";
|
||||
assert_equals(element.getAttribute("aria-colindex"), "2");
|
||||
testNullable(element, "ariaColIndex", "aria-colindex");
|
||||
}, "aria-colindex attribute reflects.");
|
||||
</script>
|
||||
<!-- colindextext -> aria-attribute-reflection.tentative.html -->
|
||||
<div aria-colspan="2" id="colspan"></div>
|
||||
<script>
|
||||
test(function(t) {
|
||||
var element = document.getElementById("colspan");
|
||||
assert_equals(element.ariaColSpan, "2");
|
||||
element.ariaColSpan = "3";
|
||||
assert_equals(element.getAttribute("aria-colspan"), "3");
|
||||
testNullable(element, "ariaColSpan", "aria-colspan");
|
||||
}, "aria-colspan attribute reflects.");
|
||||
</script>
|
||||
<div aria-current="page" id="current"></div>
|
||||
<script>
|
||||
test(function(t) {
|
||||
var element = document.getElementById("current");
|
||||
assert_equals(element.ariaCurrent, "page");
|
||||
element.ariaCurrent = "step";
|
||||
assert_equals(element.getAttribute("aria-current"), "step");
|
||||
testNullable(element, "ariaCurrent", "aria-current");
|
||||
}, "aria-current attribute reflects.");
|
||||
</script>
|
||||
<!-- description -> aria-attribute-reflection.tentative.html -->
|
||||
<div aria-disabled="true" id="disabled"></div>
|
||||
<script>
|
||||
test(function(t) {
|
||||
var element = document.getElementById("disabled");
|
||||
assert_equals(element.ariaDisabled, "true");
|
||||
element.ariaDisabled = "false";
|
||||
assert_equals(element.getAttribute("aria-disabled"), "false");
|
||||
testNullable(element, "ariaDisabled", "aria-disabled");
|
||||
}, "aria-disabled attribute reflects.");
|
||||
</script>
|
||||
<div aria-expanded="true" id="expanded"></div>
|
||||
<script>
|
||||
test(function(t) {
|
||||
var element = document.getElementById("expanded");
|
||||
assert_equals(element.ariaExpanded, "true");
|
||||
element.ariaExpanded = "false";
|
||||
assert_equals(element.getAttribute("aria-expanded"), "false");
|
||||
testNullable(element, "ariaExpanded", "aria-expanded");
|
||||
}, "aria-expanded attribute reflects.");
|
||||
</script>
|
||||
<div aria-haspopup="menu" id="haspopup"></div>
|
||||
<script>
|
||||
test(function(t) {
|
||||
var element = document.getElementById("haspopup");
|
||||
assert_equals(element.ariaHasPopup, "menu");
|
||||
element.ariaHasPopup = "listbox";
|
||||
assert_equals(element.getAttribute("aria-haspopup"), "listbox");
|
||||
testNullable(element, "ariaHasPopup", "aria-haspopup");
|
||||
}, "aria-haspopup attribute reflects.");
|
||||
</script>
|
||||
<div aria-hidden="true" id="hidden" tabindex="-1"></div>
|
||||
<script>
|
||||
test(function(t) {
|
||||
var element = document.getElementById("hidden");
|
||||
assert_equals(element.ariaHidden, "true");
|
||||
element.ariaHidden = "false";
|
||||
assert_equals(element.getAttribute("aria-hidden"), "false");
|
||||
testNullable(element, "ariaHidden", "aria-hidden");
|
||||
}, "aria-hidden attribute reflects.");
|
||||
</script>
|
||||
<div aria-invalid="true" id="invalid"></div>
|
||||
<script>
|
||||
test(function(t) {
|
||||
var element = document.getElementById("invalid");
|
||||
assert_equals(element.ariaInvalid, "true");
|
||||
element.ariaInvalid = "grammar";
|
||||
assert_equals(element.getAttribute("aria-invalid"), "grammar");
|
||||
testNullable(element, "ariaInvalid", "aria-invalid");
|
||||
}, "aria-invalid attribute reflects.");
|
||||
</script>
|
||||
<div aria-keyshortcuts="x" id="keyshortcuts"></div>
|
||||
<script>
|
||||
test(function(t) {
|
||||
var element = document.getElementById("keyshortcuts");
|
||||
assert_equals(element.ariaKeyShortcuts, "x");
|
||||
element.ariaKeyShortcuts = "y";
|
||||
assert_equals(element.getAttribute("aria-keyshortcuts"), "y");
|
||||
testNullable(element, "ariaKeyShortcuts", "aria-keyshortcuts");
|
||||
}, "aria-keyshortcuts attribute reflects.");
|
||||
</script>
|
||||
<div aria-label="x" id="label"></div>
|
||||
<script>
|
||||
test(function(t) {
|
||||
var element = document.getElementById("label");
|
||||
assert_equals(element.ariaLabel, "x");
|
||||
element.ariaLabel = "y";
|
||||
assert_equals(element.getAttribute("aria-label"), "y");
|
||||
testNullable(element, "ariaLabel", "aria-label");
|
||||
}, "aria-label attribute reflects.");
|
||||
</script>
|
||||
<div aria-level="1" id="level"></div>
|
||||
<script>
|
||||
test(function(t) {
|
||||
var element = document.getElementById("level");
|
||||
assert_equals(element.ariaLevel, "1");
|
||||
element.ariaLevel = "2";
|
||||
assert_equals(element.getAttribute("aria-level"), "2");
|
||||
testNullable(element, "ariaLevel", "aria-level");
|
||||
}, "aria-level attribute reflects.");
|
||||
</script>
|
||||
<div aria-live="polite" id="live"></div>
|
||||
<script>
|
||||
test(function(t) {
|
||||
var element = document.getElementById("live");
|
||||
assert_equals(element.ariaLive, "polite");
|
||||
element.ariaLive = "assertive";
|
||||
assert_equals(element.getAttribute("aria-live"), "assertive");
|
||||
testNullable(element, "ariaLive", "aria-live");
|
||||
}, "aria-live attribute reflects.");
|
||||
</script>
|
||||
<div aria-modal="true" id="modal"></div>
|
||||
<script>
|
||||
test(function(t) {
|
||||
var element = document.getElementById("modal");
|
||||
assert_equals(element.ariaModal, "true");
|
||||
element.ariaModal = "false";
|
||||
assert_equals(element.getAttribute("aria-modal"), "false");
|
||||
testNullable(element, "ariaModal", "aria-modal");
|
||||
}, "aria-modal attribute reflects.");
|
||||
</script>
|
||||
<div aria-multiline="true" id="multiline"></div>
|
||||
<script>
|
||||
test(function(t) {
|
||||
var element = document.getElementById("multiline");
|
||||
assert_equals(element.ariaMultiLine, "true");
|
||||
element.ariaMultiLine = "false";
|
||||
assert_equals(element.getAttribute("aria-multiline"), "false");
|
||||
testNullable(element, "ariaMultiLine", "aria-multiline");
|
||||
}, "aria-multiline attribute reflects.");
|
||||
</script>
|
||||
<div aria-multiselectable="true" id="multiselectable"></div>
|
||||
<script>
|
||||
test(function(t) {
|
||||
var element = document.getElementById("multiselectable");
|
||||
assert_equals(element.ariaMultiSelectable, "true");
|
||||
element.ariaMultiSelectable = "false";
|
||||
assert_equals(element.getAttribute("aria-multiselectable"), "false");
|
||||
testNullable(element, "ariaMultiSelectable", "aria-multiselectable");
|
||||
}, "aria-multiselectable attribute reflects.");
|
||||
</script>
|
||||
<div aria-orientation="vertical" id="orientation"></div>
|
||||
<script>
|
||||
test(function(t) {
|
||||
var element = document.getElementById("orientation");
|
||||
assert_equals(element.ariaOrientation, "vertical");
|
||||
element.ariaOrientation = "horizontal";
|
||||
assert_equals(element.getAttribute("aria-orientation"), "horizontal");
|
||||
testNullable(element, "ariaOrientation", "aria-orientation");
|
||||
}, "aria-orientation attribute reflects.");
|
||||
</script>
|
||||
<div aria-placeholder="x" id="placeholder"></div>
|
||||
<script>
|
||||
test(function(t) {
|
||||
var element = document.getElementById("placeholder");
|
||||
assert_equals(element.ariaPlaceholder, "x");
|
||||
element.ariaPlaceholder = "y";
|
||||
assert_equals(element.getAttribute("aria-placeholder"), "y");
|
||||
testNullable(element, "ariaPlaceholder", "aria-placeholder");
|
||||
}, "aria-placeholder attribute reflects.");
|
||||
</script>
|
||||
<div aria-posinset="10" id="posinset"></div>
|
||||
<script>
|
||||
test(function(t) {
|
||||
var element = document.getElementById("posinset");
|
||||
assert_equals(element.ariaPosInSet, "10");
|
||||
element.ariaPosInSet = "11";
|
||||
assert_equals(element.getAttribute("aria-posinset"), "11");
|
||||
testNullable(element, "ariaPosInSet", "aria-posinset");
|
||||
}, "aria-posinset attribute reflects.");
|
||||
</script>
|
||||
<button aria-pressed="true" id="pressed"></button>
|
||||
<script>
|
||||
test(function(t) {
|
||||
var element = document.getElementById("pressed");
|
||||
assert_equals(element.ariaPressed, "true");
|
||||
element.ariaPressed = "false";
|
||||
assert_equals(element.getAttribute("aria-pressed"), "false");
|
||||
testNullable(element, "ariaPressed", "aria-pressed");
|
||||
}, "aria-pressed attribute reflects.");
|
||||
</script>
|
||||
<div aria-readonly="true" id="readonly"></div>
|
||||
<script>
|
||||
test(function(t) {
|
||||
var element = document.getElementById("readonly");
|
||||
assert_equals(element.ariaReadOnly, "true");
|
||||
element.ariaReadOnly = "false";
|
||||
assert_equals(element.getAttribute("aria-readonly"), "false");
|
||||
testNullable(element, "ariaReadOnly", "aria-readonly");
|
||||
}, "aria-readonly attribute reflects.");
|
||||
</script>
|
||||
<div aria-relevant="text" id="relevant"></div>
|
||||
<script>
|
||||
test(function(t) {
|
||||
var element = document.getElementById("relevant");
|
||||
assert_equals(element.ariaRelevant, "text");
|
||||
element.ariaRelevant = "removals";
|
||||
assert_equals(element.getAttribute("aria-relevant"), "removals");
|
||||
testNullable(element, "ariaRelevant", "aria-relevant");
|
||||
}, "aria-relevant attribute reflects.");
|
||||
</script>
|
||||
<div aria-required="true" id="required"></div>
|
||||
<script>
|
||||
test(function(t) {
|
||||
var element = document.getElementById("required");
|
||||
assert_equals(element.ariaRequired, "true");
|
||||
element.ariaRequired = "false";
|
||||
assert_equals(element.getAttribute("aria-required"), "false");
|
||||
testNullable(element, "ariaRequired", "aria-required");
|
||||
}, "aria-required attribute reflects.");
|
||||
</script>
|
||||
<div aria-roledescription="x" id="roledescription"></div>
|
||||
<script>
|
||||
test(function(t) {
|
||||
var element = document.getElementById("roledescription");
|
||||
assert_equals(element.ariaRoleDescription, "x");
|
||||
element.ariaRoleDescription = "y";
|
||||
assert_equals(element.getAttribute("aria-roledescription"), "y");
|
||||
testNullable(element, "ariaRoleDescription", "aria-roledescription");
|
||||
}, "aria-roledescription attribute reflects.");
|
||||
</script>
|
||||
<div aria-rowcount="10" id="rowcount"></div>
|
||||
<script>
|
||||
test(function(t) {
|
||||
var element = document.getElementById("rowcount");
|
||||
assert_equals(element.ariaRowCount, "10");
|
||||
element.ariaRowCount = "11";
|
||||
assert_equals(element.getAttribute("aria-rowcount"), "11");
|
||||
testNullable(element, "ariaRowCount", "aria-rowcount");
|
||||
}, "aria-rowcount attribute reflects.");
|
||||
</script>
|
||||
<div aria-rowindex="1" id="rowindex"></div>
|
||||
<script>
|
||||
test(function(t) {
|
||||
var element = document.getElementById("rowindex");
|
||||
assert_equals(element.ariaRowIndex, "1");
|
||||
element.ariaRowIndex = "2";
|
||||
assert_equals(element.getAttribute("aria-rowindex"), "2");
|
||||
testNullable(element, "ariaRowIndex", "aria-rowindex");
|
||||
}, "aria-rowindex attribute reflects.");
|
||||
</script>
|
||||
<!-- rowindextext -> aria-attribute-reflection.tentative.html -->
|
||||
<div aria-rowspan="2" id="rowspan"></div>
|
||||
<script>
|
||||
test(function(t) {
|
||||
var element = document.getElementById("rowspan");
|
||||
assert_equals(element.ariaRowSpan, "2");
|
||||
element.ariaRowSpan = "3";
|
||||
assert_equals(element.getAttribute("aria-rowspan"), "3");
|
||||
testNullable(element, "ariaRowSpan", "aria-rowspan");
|
||||
}, "aria-rowspan attribute reflects.");
|
||||
</script>
|
||||
<div aria-selected="true" id="selected"></div>
|
||||
<script>
|
||||
test(function(t) {
|
||||
var element = document.getElementById("selected");
|
||||
assert_equals(element.ariaSelected, "true");
|
||||
element.ariaSelected = "false";
|
||||
assert_equals(element.getAttribute("aria-selected"), "false");
|
||||
testNullable(element, "ariaSelected", "aria-selected");
|
||||
}, "aria-selected attribute reflects.");
|
||||
</script>
|
||||
<div aria-setsize="10" id="setsize"></div>
|
||||
<script>
|
||||
test(function(t) {
|
||||
var element = document.getElementById("setsize");
|
||||
assert_equals(element.ariaSetSize, "10");
|
||||
element.ariaSetSize = "11";
|
||||
assert_equals(element.getAttribute("aria-setsize"), "11");
|
||||
testNullable(element, "ariaSetSize", "aria-setsize");
|
||||
}, "aria-setsize attribute reflects.");
|
||||
</script>
|
||||
<div aria-sort="descending" id="sort"></div>
|
||||
<script>
|
||||
test(function(t) {
|
||||
var element = document.getElementById("sort");
|
||||
assert_equals(element.ariaSort, "descending");
|
||||
element.ariaSort = "ascending";
|
||||
assert_equals(element.getAttribute("aria-sort"), "ascending");
|
||||
testNullable(element, "ariaSort", "aria-sort");
|
||||
}, "aria-sort attribute reflects.");
|
||||
</script>
|
||||
<div aria-valuemax="99" id="valuemax"></div>
|
||||
<script>
|
||||
test(function(t) {
|
||||
var element = document.getElementById("valuemax");
|
||||
assert_equals(element.ariaValueMax, "99");
|
||||
element.ariaValueMax = "100";
|
||||
assert_equals(element.getAttribute("aria-valuemax"), "100");
|
||||
testNullable(element, "ariaValueMax", "aria-valuemax");
|
||||
}, "aria-valuemax attribute reflects.");
|
||||
</script>
|
||||
<div aria-valuemin="3" id="valuemin"></div>
|
||||
<script>
|
||||
test(function(t) {
|
||||
var element = document.getElementById("valuemin");
|
||||
assert_equals(element.ariaValueMin, "3");
|
||||
element.ariaValueMin = "2";
|
||||
assert_equals(element.getAttribute("aria-valuemin"), "2");
|
||||
testNullable(element, "ariaValueMin", "aria-valuemin");
|
||||
}, "aria-valuemin attribute reflects.");
|
||||
</script>
|
||||
<div aria-valuenow="50" id="valuenow"></div>
|
||||
<script>
|
||||
test(function(t) {
|
||||
var element = document.getElementById("valuenow");
|
||||
assert_equals(element.ariaValueNow, "50");
|
||||
element.ariaValueNow = "51";
|
||||
assert_equals(element.getAttribute("aria-valuenow"), "51");
|
||||
testNullable(element, "ariaValueNow", "aria-valuenow");
|
||||
}, "aria-valuenow attribute reflects.");
|
||||
</script>
|
||||
<div aria-valuetext="50%" id="valuetext"></div>
|
||||
<script>
|
||||
test(function(t) {
|
||||
var element = document.getElementById("valuetext");
|
||||
assert_equals(element.ariaValueText, "50%");
|
||||
element.ariaValueText = "51%";
|
||||
assert_equals(element.getAttribute("aria-valuetext"), "51%");
|
||||
testNullable(element, "ariaValueText", "aria-valuetext");
|
||||
}, "aria-valuetext attribute reflects.");
|
||||
</script>
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue