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
{background,mask,object}-position incorrectly accepts several invalid three-value forms #15488
Comments
Hi! If you have any questions regarding this issue, feel free to make a comment here, or ask it in the If you intend to work on this issue, then add |
The same code would also affect |
The same code affects |
can i do this ? |
@karan1276 Do you mind leaving this open to other contributors? You've already claimed a few issues, and you still have to address review comments in #15468. |
@KiChjang Okay, ill land all other commits first :) |
Can I take a go at this? |
Please do! |
Invalid three value positions are no longer accepted <!-- Please describe your changes on the following line: --> - Position parse no longer accepts invalid three value positions --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #15488 . <!-- Either: --> - [X] There are tests for these changes OR <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15702) <!-- Reviewable:end -->
|
Invalid three value positions are no longer accepted <!-- Please describe your changes on the following line: --> - Position parse no longer accepts invalid three value positions --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #15488 . <!-- Either: --> - [X] There are tests for these changes OR <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15702) <!-- Reviewable:end -->
The formal syntax of
background-position
's<position>
value is:In which the following values are invalid but accepted (and can be serialized to) in Servo:
50% bottom 10%
right 10% 50%
20% 30% 40%
Spec: https://drafts.csswg.org/css-backgrounds-3/#the-background-position
The relevant code is https://github.com/servo/servo/blob/master/components/style/values/specified/position.rs#L177-L223 for parsing and https://github.com/servo/servo/blob/master/components/style/values/specified/position.rs#L34-L57 for serialization.
Probably and easy one.
The text was updated successfully, but these errors were encountered: