RESOLVED CONFIGURATION CHANGED205733
Unitless zero should not always be allowed
https://bugs.webkit.org/show_bug.cgi?id=205733
Summary Unitless zero should not always be allowed
Simon Fraser (smfr)
Reported 2020-01-03 10:24:31 PST
inline bool shouldAcceptUnitlessValue(double value, CSSParserMode cssParserMode, UnitlessQuirk unitless) { // FIXME: Presentational HTML attributes shouldn't use the CSS parser for lengths return value == 0 || isUnitLessValueParsingEnabledForMode(cssParserMode) || (cssParserMode == HTMLQuirksMode && unitless == UnitlessQuirk::Allow); } Note the "value == 0". This is wrong; unitless zero should only be accepted in some legacy situations. See https://www.w3.org/TR/css3-values/#angles and related.
Attachments
Ahmad Saleem
Comment 1 2022-08-07 05:52:30 PDT
Anne van Kesteren
Comment 2 2023-05-28 09:37:38 PDT
Comment 0 is addressed due to: (value == 0 && unitlessZero == UnitlessZeroQuirk::Allow) I.e., comparison to 0 is no longer done unconditionally. The FIXME is a separate issue and sounds like it relates to callers of this method. Best tackled separately.
Note You need to log in before you can comment on or make changes to this bug.