1 <!DOCTYPE HTML PUBLIC
"-//IETF//DTD HTML//EN">
6 <p id=
"description">This tests that if both aria-labeledby and aria-labelledby are used (for reasons best known to the page author), then aria-labelledby is preferred.
</p>
8 <button id=
"using-labelledby" aria-labelledby=
"epsilon" aria-label=
"Zeta">Delta
</button>
9 <button id=
"using-labeledby" aria-labeledby=
"theta" aria-label=
"Iota">Eta
</button>
10 <button id=
"using-labeledby-and-labelledby" aria-labelledby=
"epsilon" aria-labeledby=
"theta" aria-label=
"Iota">Eta
</button>
11 <span id=
"epsilon">Using aria-labelledby
</span>
12 <span id=
"theta">Using aria-labeledby
</span>
14 <ul id=
"results"></ul>
15 <div id=
"console"></div>
18 function getAccessibilityObject(id
) {
19 var element
= document
.getElementById(id
);
21 return accessibilityController
.focusedElement
;
24 function output(str
) {
25 var results
= document
.getElementById("results");
26 var li
= document
.createElement("li");
27 li
.appendChild(document
.createTextNode(str
));
28 results
.appendChild(li
);
31 if (window
.testRunner
)
32 testRunner
.dumpAsText();
34 if (window
.accessibilityController
) {
35 var usingLabelledby
= getAccessibilityObject("using-labelledby");
36 output("usingLabelledby.deprecatedTitle: [" + usingLabelledby
.deprecatedTitle
+ "]");
37 output("usingLabelledby.deprecatedDescription: [" + usingLabelledby
.deprecatedDescription
+ "]");
39 var usingLabeledby
= getAccessibilityObject("using-labeledby");
40 output("usingLabeledby.deprecatedTitle: [" + usingLabeledby
.deprecatedTitle
+ "]");
41 output("usingLabeledby.deprecatedDescription: [" + usingLabeledby
.deprecatedDescription
+ "]");
43 var usingLabeledbyAndLabelledby
= getAccessibilityObject("using-labeledby-and-labelledby");
44 output("usingLabeledbyAndLabelledby.deprecatedTitle: [" + usingLabeledbyAndLabelledby
.deprecatedTitle
+ "]");
45 output("usingLabeledbyAndLabelledby.deprecatedDescription: [" + usingLabeledbyAndLabelledby
.deprecatedDescription
+ "]");
49 successfullyParsed
= true;