зеркало из https://github.com/mozilla/gecko-dev.git
Bug 477599 - Expose ARIA semantics for HTML 5 draggable; r=MarcoZ, r=surkov
This commit is contained in:
Родитель
43ef3e73fd
Коммит
d297e5219e
|
@ -164,6 +164,7 @@ ACCESSIBILITY_ATOM(_class, "class")
|
|||
ACCESSIBILITY_ATOM(cycles, "cycles") // used for XUL cycler attribute
|
||||
ACCESSIBILITY_ATOM(curpos, "curpos") // XUL
|
||||
ACCESSIBILITY_ATOM(data, "data")
|
||||
ACCESSIBILITY_ATOM(draggable, "draggable")
|
||||
ACCESSIBILITY_ATOM(droppable, "droppable") // XUL combo box
|
||||
ACCESSIBILITY_ATOM(editable, "editable")
|
||||
ACCESSIBILITY_ATOM(_for, "for")
|
||||
|
|
|
@ -1837,6 +1837,17 @@ nsAccessible::GetAttributesInternal(nsIPersistentProperties *aAttributes)
|
|||
nsAccUtils::SetAccAttr(aAttributes, nsAccessibilityAtoms::textIndent,
|
||||
value);
|
||||
|
||||
// Expose draggable object attribute?
|
||||
nsCOMPtr<nsIDOMNSHTMLElement> htmlElement = do_QueryInterface(content);
|
||||
if (htmlElement) {
|
||||
PRBool draggable = PR_FALSE;
|
||||
htmlElement->GetDraggable(&draggable);
|
||||
if (draggable) {
|
||||
nsAccUtils::SetAccAttr(aAttributes, nsAccessibilityAtoms::draggable,
|
||||
NS_LITERAL_STRING("true"));
|
||||
}
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=391829
|
|||
testAttrs("checkedOption", {"checkable" : "true"}, true);
|
||||
testAttrs("checkedRadio", {"checkable" : "true"}, true);
|
||||
testAttrs("checkedTreeitem", {"checkable" : "true"}, true);
|
||||
testAttrs("grabbed", {"grabbed" : "true"}, true);
|
||||
testAttrs("dropeffect", {"dropeffect" : "copy"}, true);
|
||||
testAttrs("sortAscending", {"sort" : "ascending"}, true);
|
||||
testAttrs("sortDescending", {"sort" : "descending"}, true);
|
||||
|
@ -76,6 +77,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=391829
|
|||
// html
|
||||
testAttrs("radio", {"checkable" : "true"}, true);
|
||||
testAttrs("checkbox", {"checkable" : "true"}, true);
|
||||
testAttrs("draggable", {"draggable" : "true"}, true);
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
@ -110,6 +112,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=391829
|
|||
<div id="checkedOption" role="option" aria-checked="true"></div>
|
||||
<div id="checkedRadio" role="radio" aria-checked="true"></div>
|
||||
<div id="checkedTreeitem" role="treeitem" aria-checked="true"></div>
|
||||
<div id="grabbed" aria-grabbed="true"></div>
|
||||
<div id="dropeffect" aria-dropeffect="copy"></div>
|
||||
<div id="sortAscending" role="columnheader" aria-sort="ascending"></div>
|
||||
<div id="sortDescending" role="columnheader" aria-sort="descending"></div>
|
||||
|
@ -132,5 +135,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=391829
|
|||
<!-- html -->
|
||||
<input id="radio" type="radio"/>
|
||||
<input id="checkbox" type="checkbox"/>
|
||||
<div id="draggable" draggable="true">Draggable div</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Загрузка…
Ссылка в новой задаче