Repository navigation
Implement correct corner clipping for background color - #19675
Conversation
|
Heads up! This PR modifies the following files:
|
|
r? @emilio @bors-servo try I need help to also support background images. They already have a clip from CSS as a local clip and the corner clipping should attach another clip. How is this best done? |
Implement correct corner clipping for background color Add one regression ref test. See also #19649 --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] There are tests for these changes <!-- 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/19675) <!-- Reviewable:end -->
|
☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css1, mac-rel-css2, mac-rel-wpt1, mac-rel-wpt2, mac-rel-wpt3, mac-rel-wpt4, windows-msvc-dev |
emilio
left a comment
There was a problem hiding this comment.
LGTM with those comments addressed. Thanks a lot!
|
|
||
| fn calculate_inner_border_radii( | ||
| mut radii: BorderRadii<Au>, | ||
| offsets: SideOffsets2D<Au>) |
| height: 80px; | ||
| border: 20px blue solid; | ||
| border-top-right-radius: 20px; | ||
| background-color: red; |
There was a problem hiding this comment.
Consider using a color other than red for the test? red is usually used to signal failure.
| </style> | ||
| <body> | ||
| <div id="a"></div> | ||
| <div id="shield"></div> |
There was a problem hiding this comment.
Maybe the shield comment is useful here too?
There was a problem hiding this comment.
Well, I guess there's no corner to hide here, so nbd, please ignore this comment.
I think @mrobinson can help you faster than I can, but I can try to look into it if he is busy :) |
|
@pyfisch The right way to do this in WebRender world is to make the corner clip a child of the CSS clip and to ensure that display items for the border use that new clip in the clipping part of their ClipAndScrollInfo. I'm not sure how easy that is to do with our current setup, but creating clips during display list building will be important for the future in order to allow removing the rounded corner API for local clips. |
|
Comments addressed. The shield basically hides the rounded outer border. This is needed because the background usually covers the whole border-box and ends at the same line as the border. Due to anti aliasing the background shines through at this line and causes slightly different output for both the test and the reference. In current servo some white is visible between border and background. After this patch there is no more white. |
| fn calculate_inner_border_radii( | ||
| mut radii: BorderRadii<Au>, | ||
| offsets: SideOffsets2D<Au> | ||
| ) -> BorderRadii<Au> { |
There was a problem hiding this comment.
Minor nit:
I think the indentation @emilio means is
fn calculate_inner_border_radii(
mut radii: BorderRadii<Au>,
offsets: SideOffsets2D<Au>
) -> BorderRadii<Au> {There was a problem hiding this comment.
Yeah, that's right, that's the indentation rustfmt would use for multi-line functions.
Add one regression ref test. See also servo#19649
|
Changed indentation. |
|
@bors-servo r+ |
|
📌 Commit b3b49e3 has been approved by |
Implement correct corner clipping for background color Add one regression ref test. See also #19649 --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] There are tests for these changes <!-- 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/19675) <!-- Reviewable:end -->
|
☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css1, mac-rel-css2, mac-rel-wpt1, mac-rel-wpt2, mac-rel-wpt3, mac-rel-wpt4, windows-msvc-dev |
Add one regression ref test. See also #19649 Upstreamed from servo/servo#19675 [ci skip]


Add one regression ref test.
See also #19649
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThere are tests for these changes
This change is