[patch] [cla] IE8 a11y: dijit/tests/form/robot/Spinner_a11y.html failing
Usually (not every time due to the random() funciton being called in the test) the robot test dijit/tests/form/robot/Spinner_a11y.html fails when comparing the aria valuenow to the text value. The aria value is in exponential notation and the text value is not. I tracked it down to this statement in wai.js:
elem.setAttribute("aria-"+state, value);
The parameter "value" is a number and then doing a getAttribute is munging the number. Just to see what happens, I changed the statement to:
elem.setAttribute("aria-"+state, String(value));
and the testcase seems to pass all the time. I'm not sure if this messes up the WAI stuff or not.
Attachments (1)
-
8796.patch (2.9 KB) - added by Joseph Scheuhammer 12 years ago.
-
For IE8, convert to exponential notation by hand before comparing values.
Download all attachments as: .zip
Change History (9)
Summary: |
dijit/tests/form/robot/Spinner_a11y.html failing on IE8 →
IE8 a11y: dijit/tests/form/robot/Spinner_a11y.html failing
|
Cc: |
Joseph Scheuhammer added
|
Owner: |
changed from Becky Gibson to Joseph Scheuhammer
|
Summary: |
IE8 a11y: dijit/tests/form/robot/Spinner_a11y.html failing →
[patch] [cla] IE8 a11y: dijit/tests/form/robot/Spinner_a11y.html failing
|
Milestone: |
tbd →
1.4
|
Owner: |
changed from Joseph Scheuhammer to bill
|
Status: |
new →
assigned
|
Resolution: |
→ fixed
|
Status: |
assigned →
closed
|
This is caused by a rounding error in IE8.
Passing a relatively large numeric value, e.g., 7532348990799388, to set/getAttribute() results in a value in exponential notation: 7.53234899079939e+15.
Converting the original value to exponential notation with 14 digits "by hand" gives the same result. That is:
(Number(7532348990799388)).toExponential(14); == 7.53234899079939e+15
.A short term solution is to change the tests to (1) convert both the aria-valuenow and the spinner's value to exponential notation with 14 dijits, and then (2) compare them for equality.
The file "8796.patch" implements this solution, but only for IE8. It was tested with FF2, FF3 (Mac/WinXP), IE6, IE7, and IE8.
There is a longer term solution. Aria attributes have different data types: strings (aria-valuetext), booleans (aria-checked), numeric (aria-valuenow), and so on. For a complete list, see the section on Value.
The functions that set/get aria states and properties should be sensitive to data types, in much the same way as
dojo.attr()
.