зеркало из https://github.com/mozilla/gecko-dev.git
Bug 670853 - undetermined progressmeters should expose mixed state, r=surkov, f=eeejay
This commit is contained in:
Родитель
f2ec9d9ab0
Коммит
5b1c387da0
|
@ -80,6 +80,22 @@ ProgressMeterAccessible<Max>::NativeRole()
|
|||
return roles::PROGRESSBAR;
|
||||
}
|
||||
|
||||
template<int Max>
|
||||
PRUint64
|
||||
ProgressMeterAccessible<Max>::NativeState()
|
||||
{
|
||||
PRUint64 state = nsFormControlAccessible::NativeState();
|
||||
|
||||
// An undetermined progressbar (i.e. without a value) has a mixed state.
|
||||
nsAutoString attrValue;
|
||||
mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::value, attrValue);
|
||||
|
||||
if (attrValue.IsEmpty())
|
||||
state |= states::MIXED;
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// ProgressMeterAccessible<Max>: Widgets
|
||||
|
||||
|
|
|
@ -63,6 +63,7 @@ public:
|
|||
|
||||
// nsAccessible
|
||||
virtual mozilla::a11y::role NativeRole();
|
||||
virtual PRUint64 NativeState();
|
||||
|
||||
// Widgets
|
||||
virtual bool IsWidget() const;
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
|
||||
<script type="application/javascript"
|
||||
src="../common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../role.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../states.js"></script>
|
||||
<script type="application/javascript"
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
|
||||
<script type="application/javascript"
|
||||
src="../common.js" />
|
||||
<script type="application/javascript"
|
||||
src="../role.js" />
|
||||
<script type="application/javascript"
|
||||
src="../states.js" />
|
||||
<script type="application/javascript"
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
|
||||
<script type="application/javascript"
|
||||
src="../common.js" />
|
||||
<script type="application/javascript"
|
||||
src="../role.js" />
|
||||
<script type="application/javascript"
|
||||
src="../states.js" />
|
||||
<script type="application/javascript"
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
|
||||
<script type="application/javascript"
|
||||
src="../common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../role.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../states.js"></script>
|
||||
<script type="application/javascript"
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
|
||||
<script type="application/javascript"
|
||||
src="../common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../role.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../states.js"></script>
|
||||
<script type="application/javascript"
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
|
||||
<script type="application/javascript"
|
||||
src="../common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../role.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../states.js"></script>
|
||||
<script type="application/javascript"
|
||||
|
|
|
@ -12,6 +12,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=429547
|
|||
|
||||
<script type="application/javascript"
|
||||
src="../common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../role.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../states.js"></script>
|
||||
<script type="application/javascript"
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
|
||||
<script type="application/javascript"
|
||||
src="../common.js" />
|
||||
<script type="application/javascript"
|
||||
src="../role.js" />
|
||||
<script type="application/javascript"
|
||||
src="../states.js" />
|
||||
<script type="application/javascript"
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
src="../common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../events.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../role.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../states.js"></script>
|
||||
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
|
||||
<script type="application/javascript"
|
||||
src="../common.js" />
|
||||
<script type="application/javascript"
|
||||
src="../role.js" />
|
||||
<script type="application/javascript"
|
||||
src="../states.js" />
|
||||
<script type="application/javascript"
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
src="../common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../events.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../role.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../states.js"></script>
|
||||
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
src="../common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../events.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../role.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../states.js"></script>
|
||||
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
src="../common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../events.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../role.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../states.js"></script>
|
||||
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
|
||||
<script type="application/javascript"
|
||||
src="../common.js" />
|
||||
<script type="application/javascript"
|
||||
src="../role.js" />
|
||||
<script type="application/javascript"
|
||||
src="../states.js" />
|
||||
<script type="application/javascript"
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
|
||||
<script type="application/javascript"
|
||||
src="../common.js" />
|
||||
<script type="application/javascript"
|
||||
src="../role.js" />
|
||||
<script type="application/javascript"
|
||||
src="../states.js" />
|
||||
<script type="application/javascript"
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
|
||||
<script type="application/javascript"
|
||||
src="../common.js" />
|
||||
<script type="application/javascript"
|
||||
src="../role.js" />
|
||||
<script type="application/javascript"
|
||||
src="../states.js" />
|
||||
<script type="application/javascript"
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
src="../common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../events.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../role.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../states.js"></script>
|
||||
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
|
||||
<script type="application/javascript"
|
||||
src="../common.js" />
|
||||
<script type="application/javascript"
|
||||
src="../role.js" />
|
||||
<script type="application/javascript"
|
||||
src="../states.js" />
|
||||
<script type="application/javascript"
|
||||
|
|
|
@ -18,6 +18,8 @@
|
|||
|
||||
<script type="application/javascript"
|
||||
src="../common.js" />
|
||||
<script type="application/javascript"
|
||||
src="../role.js" />
|
||||
<script type="application/javascript"
|
||||
src="../states.js" />
|
||||
<script type="application/javascript"
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
src="../common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../events.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../role.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../states.js"></script>
|
||||
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
|
||||
<script type="application/javascript"
|
||||
src="../common.js" />
|
||||
<script type="application/javascript"
|
||||
src="../role.js" />
|
||||
<script type="application/javascript"
|
||||
src="../states.js" />
|
||||
<script type="application/javascript"
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
src="../common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../events.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../role.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../states.js"></script>
|
||||
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
src="../common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../events.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../role.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../states.js"></script>
|
||||
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
|
||||
<script type="application/javascript"
|
||||
src="../common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../role.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../states.js"></script>
|
||||
<script type="application/javascript"
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
|
||||
<script type="application/javascript"
|
||||
src="../common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../role.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../states.js"></script>
|
||||
<script type="application/javascript"
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
|
||||
<script type="application/javascript"
|
||||
src="../common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../role.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../states.js"></script>
|
||||
<script type="application/javascript"
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
|
||||
<script type="application/javascript"
|
||||
src="../common.js" />
|
||||
<script type="application/javascript"
|
||||
src="../role.js" />
|
||||
<script type="application/javascript"
|
||||
src="../states.js" />
|
||||
<script type="application/javascript"
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
//
|
||||
// requires:
|
||||
// common.js
|
||||
// role.js
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
@ -71,7 +72,7 @@ function testStates(aAccOrElmOrID, aState, aExtraState, aAbsentState,
|
|||
aAbsentExtraState, aTestName)
|
||||
{
|
||||
var [state, extraState] = getStates(aAccOrElmOrID);
|
||||
|
||||
var role = getRole(aAccOrElmOrID);
|
||||
var id = prettyName(aAccOrElmOrID) + (aTestName ? " [" + aTestName + "]": "");
|
||||
|
||||
// Primary test.
|
||||
|
@ -135,7 +136,7 @@ function testStates(aAccOrElmOrID, aState, aExtraState, aAbsentState,
|
|||
}
|
||||
|
||||
// checked/mixed/checkable
|
||||
if (state & STATE_CHECKED || state & STATE_MIXED)
|
||||
if (state & STATE_CHECKED || state & STATE_MIXED && role != ROLE_PROGRESSBAR)
|
||||
isState(state & STATE_CHECKABLE, STATE_CHECKABLE, false,
|
||||
"Checked or mixed element must be checkable!");
|
||||
|
||||
|
|
|
@ -50,6 +50,7 @@ _TEST_FILES =\
|
|||
test_aria_imgmap.html \
|
||||
test_aria_widgetitems.html \
|
||||
test_buttons.html \
|
||||
test_controls.html \
|
||||
test_controls.xul \
|
||||
test_doc.html \
|
||||
test_docarticle.html \
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
|
||||
<script type="application/javascript"
|
||||
src="../common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../role.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../states.js"></script>
|
||||
<script type="application/javascript"
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
<script type="application/javascript"
|
||||
src="../common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../role.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../states.js"></script>
|
||||
|
||||
|
|
|
@ -0,0 +1,53 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>HTML control states</title>
|
||||
<link rel="stylesheet" type="text/css"
|
||||
href="chrome://mochikit/content/tests/SimpleTest/test.css" />
|
||||
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
|
||||
<script type="application/javascript"
|
||||
src="../common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../role.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../states.js"></script>
|
||||
|
||||
<script type="application/javascript">
|
||||
function doTest()
|
||||
{
|
||||
// Undetermined progressbar (no value or aria-value attribute): mixed state
|
||||
testStates("progress", STATE_MIXED);
|
||||
// Determined progressbar (has value): shouldn't have mixed state
|
||||
testStates("progress2", 0, 0, STATE_MIXED);
|
||||
// Determined progressbar (has aria-value): shouldn't have mixed state
|
||||
// testStates("progress3", 0, 0, STATE_MIXED);
|
||||
todo(false, "we should respect ARIA");
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addA11yLoadEvent(doTest);
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=670853"
|
||||
title="Bug 670853 - undetermined progressmeters should expose mixed state">
|
||||
Mozilla Bug 670853
|
||||
</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
|
||||
<progress id="progress"></progress>
|
||||
<progress id="progress2" value="1"></progress>
|
||||
<progress id="progress3" aria-valuenow="1"></progress>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -11,6 +11,8 @@
|
|||
|
||||
<script type="application/javascript"
|
||||
src="../common.js" />
|
||||
<script type="application/javascript"
|
||||
src="../role.js" />
|
||||
<script type="application/javascript"
|
||||
src="../states.js" />
|
||||
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
<script type="application/javascript"
|
||||
src="../common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../role.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../states.js"></script>
|
||||
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
<script type="application/javascript"
|
||||
src="../common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../role.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../states.js"></script>
|
||||
|
||||
|
|
|
@ -12,6 +12,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=454997
|
|||
|
||||
<script type="application/javascript"
|
||||
src="../common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../role.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../states.js"></script>
|
||||
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
|
||||
<script type="application/javascript"
|
||||
src="../common.js" />
|
||||
<script type="application/javascript"
|
||||
src="../role.js" />
|
||||
<script type="application/javascript"
|
||||
src="../states.js" />
|
||||
<script type="application/javascript"
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
|
||||
<script type="application/javascript"
|
||||
src="../common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../role.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../states.js"></script>
|
||||
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
<script type="application/javascript"
|
||||
src="../common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../role.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../states.js"></script>
|
||||
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
|
||||
<script type="application/javascript"
|
||||
src="../common.js" />
|
||||
<script type="application/javascript"
|
||||
src="../role.js" />
|
||||
<script type="application/javascript"
|
||||
src="../states.js" />
|
||||
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../role.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../states.js"></script>
|
||||
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
<script type="application/javascript"
|
||||
src="../common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../role.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../states.js"></script>
|
||||
<script type="application/javascript"
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
|
||||
<script type="application/javascript"
|
||||
src="../common.js" />
|
||||
<script type="application/javascript"
|
||||
src="../role.js" />
|
||||
<script type="application/javascript"
|
||||
src="../states.js" />
|
||||
<script type="application/javascript"
|
||||
|
|
|
@ -13,6 +13,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=410052
|
|||
|
||||
<script type="application/javascript"
|
||||
src="../common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../role.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../states.js"></script>
|
||||
<script type="application/javascript"
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
|
||||
<script type="application/javascript"
|
||||
src="../common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../role.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../states.js"></script>
|
||||
<script type="application/javascript"
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
src="../common.js" />
|
||||
<script type="application/javascript"
|
||||
src="../events.js" />
|
||||
<script type="application/javascript"
|
||||
src="../role.js" />
|
||||
<script type="application/javascript"
|
||||
src="../states.js" />
|
||||
<script type="application/javascript"
|
||||
|
|
Загрузка…
Ссылка в новой задаче