WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED CONFIGURATION CHANGED
205733
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
Add attachment
proposed patch, testcase, etc.
Ahmad Saleem
Comment 1
2022-08-07 05:52:30 PDT
This FIXME is present but the code is bit changed.
https://github.com/WebKit/WebKit/blob/10224b907dbca4a066401003bd0734bdefbadf1c/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp#L93
Is this still required? Thanks!
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.
Top of Page
Format For Printing
XML
Clone This Bug