Accessibility/WebAccessibilityAPI: Difference between revisions

Line 2,058: Line 2,058:
   }
   }
};
};
document.accessibleElement.import("role", taxa);
document.a11ement.import("role", taxa);
</pre>
</pre>


<pre>
<pre>
var taxon = document.accessibleElement.taxonOf("role", "checklistitem");
var taxon = document.a11ement.taxonOf("role", "checklistitem");
if (taxon.is("menuitem")) {
if (taxon.is("menuitem")) {
   // process menuitem selection
   // process menuitem selection
Line 2,071: Line 2,071:


<pre>
<pre>
var taxon = document.accessibleDocument.taxonOf("role", "main");
var taxon = document.a11ement.taxonOf("role", "main");
var isLandmark = taxon.attributes.has("landmark");
var isLandmark = taxon.attributes.has("landmark");
</pre>
</pre>
Line 2,078: Line 2,078:


<pre>
<pre>
var taxon = document.accessibleDocument.taxonOf("role", "listbox");
var taxon = document.a11ement.taxonOf("role", "listbox");
print(listboxRole.relations.get("states"))); // prints "focusable"
print(listboxRole.relations.get("states"))); // prints "focusable"
</pre>
</pre>
Line 2,128: Line 2,128:


<div id="TaxonomyTypes">
<div id="TaxonomyTypes">
===Taxonomy types===
===Taxonomy types===
</div>
</div>
Confirmed users
1,396

edits