зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 7f1703036acf (bug 1357071) for Browser-chrome failures on accessible/tests/browser/e10s/browser_caching_value.js
This commit is contained in:
Родитель
81427ec070
Коммит
efca664ecd
|
@ -71,11 +71,9 @@ inline bool Accessible::HasGenericType(AccGenericType aType) const {
|
|||
(roleMapEntry && roleMapEntry->IsOfType(aType));
|
||||
}
|
||||
|
||||
inline bool Accessible::NativeHasNumericValue() const {
|
||||
return mStateFlags & eHasNumericValue;
|
||||
}
|
||||
inline bool Accessible::HasNumericValue() const {
|
||||
if (mStateFlags & eHasNumericValue) return true;
|
||||
|
||||
inline bool Accessible::ARIAHasNumericValue() const {
|
||||
const nsRoleMapEntry* roleMapEntry = ARIARoleMap();
|
||||
if (!roleMapEntry || roleMapEntry->valueRule == eNoValue) return false;
|
||||
|
||||
|
@ -85,10 +83,6 @@ inline bool Accessible::ARIAHasNumericValue() const {
|
|||
return true;
|
||||
}
|
||||
|
||||
inline bool Accessible::HasNumericValue() const {
|
||||
return NativeHasNumericValue() || ARIAHasNumericValue();
|
||||
}
|
||||
|
||||
inline bool Accessible::IsDefunct() const {
|
||||
MOZ_ASSERT(mStateFlags & eIsDefunct || IsApplication() || IsDoc() ||
|
||||
mStateFlags & eSharedNode || mContent,
|
||||
|
|
|
@ -1377,12 +1377,8 @@ void Accessible::Value(nsString& aValue) const {
|
|||
|
||||
if (!mContent->AsElement()->GetAttr(kNameSpaceID_None,
|
||||
nsGkAtoms::aria_valuetext, aValue)) {
|
||||
if (!NativeHasNumericValue()) {
|
||||
double checkValue = CurValue();
|
||||
if (!IsNaN(checkValue)) {
|
||||
aValue.AppendFloat(checkValue);
|
||||
}
|
||||
}
|
||||
mContent->AsElement()->GetAttr(kNameSpaceID_None,
|
||||
nsGkAtoms::aria_valuenow, aValue);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -1416,13 +1412,11 @@ void Accessible::Value(nsString& aValue) const {
|
|||
}
|
||||
|
||||
double Accessible::MaxValue() const {
|
||||
double checkValue = AttrNumericValue(nsGkAtoms::aria_valuemax);
|
||||
return IsNaN(checkValue) && !NativeHasNumericValue() ? 100 : checkValue;
|
||||
return AttrNumericValue(nsGkAtoms::aria_valuemax);
|
||||
}
|
||||
|
||||
double Accessible::MinValue() const {
|
||||
double checkValue = AttrNumericValue(nsGkAtoms::aria_valuemin);
|
||||
return IsNaN(checkValue) && !NativeHasNumericValue() ? 0 : checkValue;
|
||||
return AttrNumericValue(nsGkAtoms::aria_valuemin);
|
||||
}
|
||||
|
||||
double Accessible::Step() const {
|
||||
|
@ -1430,13 +1424,7 @@ double Accessible::Step() const {
|
|||
}
|
||||
|
||||
double Accessible::CurValue() const {
|
||||
double checkValue = AttrNumericValue(nsGkAtoms::aria_valuenow);
|
||||
if (IsNaN(checkValue) && !NativeHasNumericValue()) {
|
||||
double minValue = MinValue();
|
||||
return minValue + ((MaxValue() - minValue) / 2);
|
||||
}
|
||||
|
||||
return checkValue;
|
||||
return AttrNumericValue(nsGkAtoms::aria_valuenow);
|
||||
}
|
||||
|
||||
bool Accessible::SetCurValue(double aValue) {
|
||||
|
|
|
@ -900,16 +900,6 @@ class Accessible : public nsISupports {
|
|||
return mContent && !(mStateFlags & eSharedNode);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if native markup has a numeric value.
|
||||
*/
|
||||
bool NativeHasNumericValue() const;
|
||||
|
||||
/**
|
||||
* Return true if ARIA specifies support for a numeric value.
|
||||
*/
|
||||
bool ARIAHasNumericValue() const;
|
||||
|
||||
/**
|
||||
* Return true if the accessible has a numeric value.
|
||||
*/
|
||||
|
|
|
@ -138,7 +138,7 @@
|
|||
// Test initial values
|
||||
testValue("slider_vn", "5", 5, 0, 1000, 0);
|
||||
testValue("slider_vnvt", "plain", 0, 0, 5, 0);
|
||||
testValue("slider_vt", "hi", 1.5, 0, 3, 0);
|
||||
testValue("slider_vt", "hi", 0, 0, 3, 0);
|
||||
testValue("scrollbar", "5", 5, 0, 1000, 0);
|
||||
testValue("splitter", "5", 5, 0, 1000, 0);
|
||||
testValue("progress", "22%", 22, 0, 100, 0);
|
||||
|
|
|
@ -257,7 +257,7 @@
|
|||
<span id="aria_region_has_label" role="region" aria-label="label"/>
|
||||
<span id="aria_region_has_labelledby" role="region" aria-labelledby="label"/><span id="label" aria-label="label">
|
||||
<span id="aria_region_has_title" role="region" title="title"/>
|
||||
<span id="aria_region_empty_name" role="region" aria-label="" title="" aria-labelledby="empty"></span><span id="empty"></span>
|
||||
<span id="aria_region_empty_name" role="region" aria-label="" title="" aria-labelledby="empty"/><span id="empty"/>
|
||||
<span id="aria_row" role="row"/>
|
||||
<span id="aria_rowheader" role="rowheader"/>
|
||||
<span id="aria_scrollbar" role="scrollbar"/>
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
support-files =
|
||||
!/accessible/tests/mochitest/*.js
|
||||
|
||||
[test_ariavalue.html]
|
||||
[test_general.html]
|
||||
[test_number.html]
|
||||
[test_progress.html]
|
||||
|
|
|
@ -1,68 +0,0 @@
|
|||
<html>
|
||||
|
||||
<head>
|
||||
<title>nsIAccessible value testing for implicit aria-value* attributes</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
|
||||
|
||||
<script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
|
||||
<script type="application/javascript" src="../common.js"></script>
|
||||
<script type="application/javascript" src="../value.js"></script>
|
||||
|
||||
<script src="chrome://mochikit/content/chrome-harness.js"></script>
|
||||
|
||||
<script type="application/javascript">
|
||||
function doTest() {
|
||||
for (const role of ["slider", "scrollbar"]) {
|
||||
testValue(`${role}_default`, "50", 50, 0, 100, 0);
|
||||
testValue(`${role}_min1max50`, "25.5", 25.5, 1, 50, 0);
|
||||
testValue(`${role}_max200`, "100", 100, 0, 200, 0);
|
||||
testValue(`${role}_min10`, "55", 55, 10, 100, 0);
|
||||
testValue(`${role}_vt`, "juice", 50, 0, 100, 0);
|
||||
testValue(`${role}_vn`, "6", 6, 0, 100, 0);
|
||||
testValue(`${role}_vtvn`, "juice", 6, 0, 100, 0);
|
||||
}
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addA11yLoadEvent(doTest);
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1357071"
|
||||
title="Add support for implicit values for aria-value* attributes for scrollbar and slider roles">
|
||||
Bug 1357071
|
||||
</a>
|
||||
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
|
||||
<!-- ARIA sliders -->
|
||||
<div id="slider_default" role="slider">vanilla slider</div>
|
||||
<div id="slider_min1max50" role="slider" aria-valuemin="1" aria-valuemax="50">banana slider</div>
|
||||
<div id="slider_max200" role="slider" aria-valuemax="200">cherry slider</div>
|
||||
<div id="slider_min10" role="slider" aria-valuemin="10">strawberry slider</div>
|
||||
<div id="slider_vt" role="slider" aria-valuetext="juice">orange slider</div>
|
||||
<div id="slider_vn" role="slider" aria-valuenow="6">chocolate slider</div>
|
||||
<div id="slider_vtvn" role="slider" aria-valuetext="juice" aria-valuenow="6">apple slider</div>
|
||||
|
||||
<!-- ARIA scrollbars -->
|
||||
<div id="scrollbar_default" role="scrollbar">vanilla scrollbar</div>
|
||||
<div id="scrollbar_min1max50" role="scrollbar" aria-valuemin="1" aria-valuemax="50">banana scrollbar</div>
|
||||
<div id="scrollbar_max200" role="scrollbar" aria-valuemax="200">cherry scrollbar</div>
|
||||
<div id="scrollbar_min10" role="scrollbar" aria-valuemin="10">strawberry scrollbar</div>
|
||||
<div id="scrollbar_vt" role="scrollbar" aria-valuetext="juice">orange scrollbar</div>
|
||||
<div id="scrollbar_vn" role="scrollbar" aria-valuenow="6">chocolate scrollbar</div>
|
||||
<div id="scrollbar_vtvn" role="scrollbar" aria-valuetext="juice" aria-valuenow="6">apple scrollbar</div>
|
||||
</body>
|
||||
|
||||
</html>
|
Загрузка…
Ссылка в новой задаче