diff --git a/components/layout/display_list/mod.rs b/components/layout/display_list/mod.rs index 83c249426ce..0db279cb10e 100644 --- a/components/layout/display_list/mod.rs +++ b/components/layout/display_list/mod.rs @@ -1553,13 +1553,19 @@ impl<'a> BuilderForBoxFragment<'a> { if width == 0.0 { return; } - let offset = outline - .outline_offset - .px() - .max(-self.border_rect.width() / 2.0) - .max(-self.border_rect.height() / 2.0) + - width; - let outline_rect = self.border_rect.inflate(offset, offset); + // + // > Negative values must cause the outline to shrink into the border box. Both + // > the height and the width of outside of the shape drawn by the outline should + // > not become smaller than twice the computed value of the outline-width + // > property, to make sure that an outline can be rendered even with large + // > negative values. User agents should apply this constraint independently in + // > each dimension. If the outline is drawn as multiple disconnected shapes, this + // > constraint applies to each shape separately. + let offset = outline.outline_offset.px() + width; + let outline_rect = self.border_rect.inflate( + offset.max(-self.border_rect.width() / 2.0 + width), + offset.max(-self.border_rect.height() / 2.0 + width), + ); let common = builder.common_properties(outline_rect, &self.fragment.style); let widths = SideOffsets2D::new_all_same(width); let border_style = match outline.outline_style { diff --git a/tests/wpt/meta/css/css-ui/negative-outline-offset.html.ini b/tests/wpt/meta/css/css-ui/negative-outline-offset.html.ini deleted file mode 100644 index 5883faa6763..00000000000 --- a/tests/wpt/meta/css/css-ui/negative-outline-offset.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[negative-outline-offset.html] - expected: FAIL diff --git a/tests/wpt/meta/css/css-ui/outline-014.html.ini b/tests/wpt/meta/css/css-ui/outline-014.html.ini deleted file mode 100644 index 0069f95dc85..00000000000 --- a/tests/wpt/meta/css/css-ui/outline-014.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[outline-014.html] - expected: FAIL diff --git a/tests/wpt/meta/css/css-ui/outline-015.html.ini b/tests/wpt/meta/css/css-ui/outline-015.html.ini deleted file mode 100644 index d49131e63f4..00000000000 --- a/tests/wpt/meta/css/css-ui/outline-015.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[outline-015.html] - expected: FAIL