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
/** * @param {string} colorString The color string from CSS. * @return {?axs.color.Color} */axs.color.parseColor=function(colorString){varrgbRegex=/^rgb\((\d+), (\d+), (\d+)\)$/;varmatch=colorString.match(rgbRegex);if(match){varr=parseInt(match[1],10);varg=parseInt(match[2],10);varb=parseInt(match[3],10);vara=1;returnnewaxs.color.Color(r,g,b,a);}varrgbaRegex=/^rgba\((\d+), (\d+), (\d+), (\d*(\.\d+)?)\)/;match=colorString.match(rgbaRegex);if(match){varr=parseInt(match[1],10);varg=parseInt(match[2],10);varb=parseInt(match[3],10);vara=parseFloat(match[4]);returnnewaxs.color.Color(r,g,b,a);}returnnull;};
When this method returns null, the getBgColor method that's used to compute the contrast ratio will also return null - which is causing the error.
This method expects to find rgb(...) and rgba(...) values for the CSSStyleDeclaration's backgroundColor property. In Firefox, unstyled elements have a backgroundColor of "transparent", while on Chrome the value is "rgba(0, 0, 0, 0)".
This might be worth reporting upstream, but in the meantime I can see if this is an isolated edge case and put up a quick patch.
The text was updated successfully, but these errors were encountered:
Related to #32. This may not be specific to FF.
Tracing through GoogleChrome/accessibility-developer-tools on FF, the following
parseColor
method:When this method returns
null
, thegetBgColor
method that's used to compute the contrast ratio will also returnnull
- which is causing the error.This method expects to find
rgb(...)
andrgba(...)
values for the CSSStyleDeclaration'sbackgroundColor
property. In Firefox, unstyled elements have abackgroundColor
of"transparent"
, while on Chrome the value is"rgba(0, 0, 0, 0)"
.This might be worth reporting upstream, but in the meantime I can see if this is an isolated edge case and put up a quick patch.
The text was updated successfully, but these errors were encountered: