diff options
author | bors-servo <servo-ops@mozilla.com> | 2020-05-02 10:24:16 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-02 10:24:16 -0400 |
commit | 73abf56e9954cd3efc86ae5bc3857ae07c2a6da6 (patch) | |
tree | 3aeac8f8b9c025747e5d0b9021df6eb035399280 /components/layout | |
parent | d08c4fff15cb5f6a8840621e848c9de22fcc3439 (diff) | |
parent | 1d9d55ce27a25a9fd24f7c9fcdcc8c2ce8a2639b (diff) | |
download | servo-73abf56e9954cd3efc86ae5bc3857ae07c2a6da6.tar.gz servo-73abf56e9954cd3efc86ae5bc3857ae07c2a6da6.zip |
Auto merge of #26215 - dralley:fix-image-border, r=jdm
Fix combination of border and border-radius being drawn incorrectly
fixes #20922
Manual testcase in the attached issue
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #20922
<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because ___
Diffstat (limited to 'components/layout')
-rw-r--r-- | components/layout/display_list/builder.rs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/components/layout/display_list/builder.rs b/components/layout/display_list/builder.rs index 2c0f6d612e1..e4d20d48de7 100644 --- a/components/layout/display_list/builder.rs +++ b/components/layout/display_list/builder.rs @@ -1733,8 +1733,18 @@ impl Fragment { build_border_radius_for_inner_rect(stacking_relative_border_box, &self.style); if !radii.is_zero() { - let clip_id = - state.add_late_clip_node(stacking_relative_border_box.to_layout(), radii); + // This is already calculated inside of build_border_radius_for_inner_rect(), it would be + // nice if it were only calculated once. + let border_widths = self + .style + .logical_border_width() + .to_physical(self.style.writing_mode); + let clip_id = state.add_late_clip_node( + stacking_relative_border_box + .inner_rect(border_widths) + .to_layout(), + radii, + ); state.current_clipping_and_scrolling = ClippingAndScrolling::simple(clip_id); } |