You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.
The axs.utils.isLargeFont() function fails on font sizes with float values.
I saw this first when testing a value of 10pt, which gets a computed value of 13.3333px in Chrome. The current function evaluates this incorrectly as a large font with a value of "3333px". Or conversely, a font value of 30.1px evaluates incorrectly as a small font with a value of "1px"
A small chunk of testable code extracted from isLargeFont() shows the issue:
var fontSize = "13.3333px"
var matches = fontSize.match(/(\d+)px/);
if (matches) {
var fontSizePx = parseInt(matches[1], 10); // parses as 3333, not 13
console.log(fontSizePx)
}
I'll submit a pull request with a suggested fix.
This is also causing a failure in Khan Academy's tota11y toolkit.
The text was updated successfully, but these errors were encountered:
timmhayes
added a commit
to timmhayes/accessibility-developer-tools
that referenced
this issue
Apr 28, 2017
The
axs.utils.isLargeFont()
function fails on font sizes with float values.I saw this first when testing a value of 10pt, which gets a computed value of 13.3333px in Chrome. The current function evaluates this incorrectly as a large font with a value of "3333px". Or conversely, a font value of 30.1px evaluates incorrectly as a small font with a value of "1px"
See a working example here: http://jsbin.com/cehiben/edit?html,output
A small chunk of testable code extracted from isLargeFont() shows the issue:
I'll submit a pull request with a suggested fix.
This is also causing a failure in Khan Academy's tota11y toolkit.
The text was updated successfully, but these errors were encountered: