Opened 10 years ago

Closed 10 years ago

#8796 closed defect (fixed)

[patch] [cla] IE8 a11y: dijit/tests/form/robot/Spinner_a11y.html failing

Reported by: Douglas Hays Owned by: bill
Priority: high Milestone: 1.4
Component: Accessibility Version: 1.3.0b2
Keywords: Cc: Joseph Scheuhammer, Becky Gibson
Blocked By: Blocking:

Description

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 10 years ago.
For IE8, convert to exponential notation by hand before comparing values.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 10 years ago by Douglas Hays

Summary: dijit/tests/form/robot/Spinner_a11y.html failing on IE8IE8 a11y: dijit/tests/form/robot/Spinner_a11y.html failing

comment:2 Changed 10 years ago by Joseph Scheuhammer

Cc: Joseph Scheuhammer added
Owner: changed from Becky Gibson to Joseph Scheuhammer

comment:3 Changed 10 years ago by Joseph Scheuhammer

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().

Changed 10 years ago by Joseph Scheuhammer

Attachment: 8796.patch added

For IE8, convert to exponential notation by hand before comparing values.

comment:4 Changed 10 years ago by Joseph Scheuhammer

Cc: Becky Gibson added

comment:5 Changed 10 years ago by bill

Summary: IE8 a11y: dijit/tests/form/robot/Spinner_a11y.html failing[patch] [cla] IE8 a11y: dijit/tests/form/robot/Spinner_a11y.html failing

comment:6 Changed 10 years ago by Adam Peller

bump

comment:7 Changed 10 years ago by bill

Milestone: tbd1.4
Owner: changed from Joseph Scheuhammer to bill
Status: newassigned

Looks like the patch is already checked in, but still getting the diffs. I'll fix this, just get rid of the random() call.

comment:8 Changed 10 years ago by bill

Resolution: fixed
Status: assignedclosed

(In [20442]) Avoid rouding problem in reporting aria-valuenow by always using small value for test. Also did a bunch of general test cleanup. Fixes #8796.

Note: See TracTickets for help on using tickets.