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 ___
This commit is contained in:
bors-servo 2020-05-02 10:24:16 -04:00 committed by GitHub
commit 73abf56e99
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 52 additions and 2 deletions

View file

@ -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);
}