-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
For , "0" should be parsed as number rather than length
#15171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Please make a comment here if you intend to work on this issue. Thank you! |
May I claim this? |
@atheed Please do! Ask questions here if anything is unclear. |
I might be a little confused, but I'm not sure if the |
It turns out that https://dxr.mozilla.org/servo/source/components/style/properties/longhand/border.mako.rs#263 is the only caller, and the |
Ah, I see -- thanks for the heads up! |
Ah, actually I was thinking about |
Ah, I see. So, this would be the relevant code for |
Oh, I checked my list, and I was actually filing this for
|
Thanks. |
The existing inherited_text.rs should be fine for that. |
Parsing "0" as Number for line-height and border-image-outset Fixes #15171 by correctly parsing `0` as `0` (rather than as `0px`, as was the case earlier) for the `line-height` and `border-image-outset` CSS properties. Wrote unit tests for both; `./mach test-unit -p style` passes all tests. --- - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #15171 - [X] There are tests for these changes. --- This change is [https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15278)
The plain zero can be parsed by both length and number, and there is no difference between either way in general. But for serialization, zero length would become
0px
while zero number would stay0
, and the latter looks better as it doesn't changes, and you can always specify0px
to get the zero length.This specific behavior is currently undefined in the spec (see w3c/csswg-drafts#489), but parsing plain zero as number matches all major browsers.
The text was updated successfully, but these errors were encountered: