New issue
Advanced search Search tips

Issue 841972 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner: ----
Closed: Aug 9
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug
Team-Accessibility



Sign in to add a comment

aria-valuenow with values that have more points after the decimal than 1 will result in floating point math funnyness

Project Member Reported by katie@chromium.org, May 10 2018

Issue description

Setting aria-valuenow less than .1 (i.e. anything with .0*) will result in floating point weirdness with Chromevox.

These two read the aria-value now as expected:
<div role="progressbar" aria-valuenow="5"></div>
<div role="progressbar" aria-valuenow=".5"></div>

But this one reads out: 0.0500000007450586
<div role="progressbar" aria-valuenow=".05"></div>

Similarly with aria-valuenow="1.05", but not "1.5".
 
Project Member

Comment 2 by bugdroid1@chromium.org, May 17 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/81ef19c2843b4fe44a01da714291825f72fc5992

commit 81ef19c2843b4fe44a01da714291825f72fc5992
Author: David Tseng <dtseng@chromium.org>
Date: Thu May 17 00:02:55 2018

Explicitly compute precision of floating point numbers

In Blink, we parse floating point numbers such as those from ARIA value now from strings to doubles.

In the midst of conversions, we incur some amount of errors (trailing garbage) when converting from doubles to floats.

To see this, within Blink,

LOG(ERROR) << "Float valueNow=" << base::NumberToString(float_value);

for the snippet:
<div role="progressbar" aria-valuenow=0.05>

You will see:
0.05000000074505806

V8 uses doubles in its underlying number type.

For the purposes of automation, default to a precision of 2 decimal places.

Since the underlying data is always available, we can consider exposing a more full featured api like GetFloatAttribute(int precision) to the wrapping js and on up to chrome.automation.AutomationNode, if needed.

Bug:  841972 
Change-Id: Ideb979d43d7ed28bae8a5293f0f40fb2a7c79199
Reviewed-on: https://chromium-review.googlesource.com/1058448
Reviewed-by: Dominic Mazzoni <dmazzoni@chromium.org>
Commit-Queue: David Tseng <dtseng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#559347}
[modify] https://crrev.com/81ef19c2843b4fe44a01da714291825f72fc5992/chrome/renderer/extensions/automation_internal_custom_bindings.cc
[modify] https://crrev.com/81ef19c2843b4fe44a01da714291825f72fc5992/chrome/test/data/extensions/api_test/automation/sites/attributes.html
[modify] https://crrev.com/81ef19c2843b4fe44a01da714291825f72fc5992/chrome/test/data/extensions/api_test/automation/tests/tabs/attributes.js

Status: fixed (was: Available)

Sign in to add a comment