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
inner_radii needs to normalize radii to avoid overlapping curves #29685
Labels
A-layout/2020
https://github.com/servo/servo/wiki/Layout-2020
Comments
Loirooriol
added
the
A-layout/2020
https://github.com/servo/servo/wiki/Layout-2020
label
Apr 29, 2023
5 tasks
bors-servo
added a commit
that referenced
this issue
Apr 29, 2023
Normalize corner radii that add up to > 100% WebRender already seems to be doing this normalization, but this is needed by inner_radii in order to properly compute the reduced radii when background-clip is content-box or padding-box. This will also be needed for expanding the radii for box-shadow or outline. <!-- Please describe your changes on the following line: --> --- <!-- 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 #29685 (GitHub issue number if applicable) <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
bors-servo
added a commit
that referenced
this issue
Apr 29, 2023
Normalize corner radii that add up to > 100% WebRender already seems to be doing this normalization, but this is needed by inner_radii in order to properly compute the reduced radii when background-clip is content-box or padding-box. This will also be needed for expanding the radii for box-shadow or outline. Test: css/css-backgrounds/background-rounded-image-clip-002.html <!-- Please describe your changes on the following line: --> --- <!-- 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 #29685 (GitHub issue number if applicable) <!-- Either: --> - [X] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
bors-servo
added a commit
that referenced
this issue
Apr 29, 2023
Normalize corner radii that add up to > 100% WebRender already seems to be doing this normalization, but this is needed by inner_radii in order to properly compute the reduced radii when background-clip is content-box or padding-box. This will also be needed for expanding the radii for box-shadow or outline. Test: css/css-backgrounds/background-rounded-image-clip-002.html <!-- Please describe your changes on the following line: --> --- <!-- 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 #29685 (GitHub issue number if applicable) <!-- Either: --> - [X] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
bors-servo
added a commit
that referenced
this issue
Apr 29, 2023
Normalize corner radii that add up to > 100% WebRender already seems to be doing this normalization, but this is needed by inner_radii in order to properly compute the reduced radii when background-clip is content-box or padding-box. This will also be needed for expanding the radii for box-shadow or outline. Test: css/css-backgrounds/background-rounded-image-clip-002.html <!-- Please describe your changes on the following line: --> --- <!-- 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 #29685 (GitHub issue number if applicable) <!-- Either: --> - [X] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
bors-servo
added a commit
that referenced
this issue
Apr 30, 2023
Normalize corner radii that add up to > 100% WebRender already seems to be doing this normalization, but this is needed by inner_radii in order to properly compute the reduced radii when background-clip is content-box or padding-box. This will also be needed for expanding the radii for box-shadow or outline. Test: css/css-backgrounds/background-rounded-image-clip-002.html <!-- Please describe your changes on the following line: --> --- <!-- 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 #29685 (GitHub issue number if applicable) <!-- Either: --> - [X] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
bors-servo
added a commit
that referenced
this issue
Apr 30, 2023
Normalize corner radii that add up to > 100% WebRender already seems to be doing this normalization, but this is needed by inner_radii in order to properly compute the reduced radii when background-clip is content-box or padding-box. This will also be needed for expanding the radii for box-shadow or outline. Test: css/css-backgrounds/background-rounded-image-clip-002.html <!-- Please describe your changes on the following line: --> --- <!-- 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 #29685 (GitHub issue number if applicable) <!-- Either: --> - [X] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
bors-servo
added a commit
that referenced
this issue
Apr 30, 2023
Normalize corner radii that add up to > 100% WebRender already seems to be doing this normalization, but this is needed by inner_radii in order to properly compute the reduced radii when background-clip is content-box or padding-box. This will also be needed for expanding the radii for box-shadow or outline. Test: css/css-backgrounds/background-rounded-image-clip-002.html <!-- Please describe your changes on the following line: --> --- <!-- 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 #29685 (GitHub issue number if applicable) <!-- Either: --> - [X] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
bors-servo
added a commit
that referenced
this issue
May 1, 2023
Normalize corner radii that add up to > 100% WebRender already seems to be doing this normalization, but this is needed by inner_radii in order to properly compute the reduced radii when background-clip is content-box or padding-box. This will also be needed for expanding the radii for box-shadow or outline. Test: css/css-backgrounds/background-rounded-image-clip-002.html <!-- Please describe your changes on the following line: --> --- <!-- 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 #29685 (GitHub issue number if applicable) <!-- Either: --> - [X] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
bors-servo
added a commit
that referenced
this issue
May 1, 2023
Normalize corner radii that add up to > 100% WebRender already seems to be doing this normalization, but this is needed by inner_radii in order to properly compute the reduced radii when background-clip is content-box or padding-box. This will also be needed for expanding the radii for box-shadow or outline. Test: css/css-backgrounds/background-rounded-image-clip-002.html <!-- Please describe your changes on the following line: --> --- <!-- 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 #29685 (GitHub issue number if applicable) <!-- Either: --> - [X] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
inner_radii
is very naive:servo/components/layout_2020/display_list/mod.rs
Lines 669 to 682 in 4339b3b
The problem is with overlapping radii: https://drafts.csswg.org/css-backgrounds-3/#corner-overlap
For example:
The border area is 120x120, so
border-radius
behaves like20px 10px 10px 10px / 60px 10px 10px 60px
.Then when we shrink by 10px, the padding should use
10px 0 0 0 / 50px 0 0 50px
.However, since
inner_radii
doesn't normalize, it produces90px 40px 40px 40px / 290px 40px 40px 290px
.When normalized to fit into 100x100, that becomes
50px calc(200px/9) calc(200px/9) calc(200px/9) / calc(1450px/9) calc(200px/9) calc(200px/9) calc(1450px/9)
, which is considerably different:There should be no red.
The text was updated successfully, but these errors were encountered: