Outlines should paint along the border-shape path for all outline styles

#582385059 CL 8777667 Assigned / P4 / Blink>Paint

What

When an element has a border-shape (such as circle(50px at 50px 50px)) the outline should follow that shape. BorderShapePainter::PaintOutline() only handled outline-style: solid and double; every other style returned false and the rectangular outline painter took over, so the outline drew an axis-aligned box around the element's border box instead of following the shape.

Before / after

Six targets, each a 100×100 element with border-shape: circle(50px at 50px 50px) and a different outline-style. Captured with headless_shell, one build at origin/main and one with the patch applied.

beforerectangular outline
Before: dotted/dashed/inset/outset/groove/ridge outlines paint as axis-aligned rectangles around the lightblue circle.
afterfollows the shape
After: every outline style follows the circular border-shape.

Live sampler

Each card renders live in your browser (Rendered), next to the pre-fix (Before) and post-fix (After) baselines. On a build with the fix, Rendered should match After; on pre-fix Chrome it matches Before.

outline: 10px dotted hotpink
before: rectangular outline
after: outline follows the shape
outline: 10px dashed hotpink
before: rectangular outline
after: outline follows the shape
outline: 8px inset hotpink
before: rectangular outline
after: outline follows the shape
outline: 8px outset hotpink
before: rectangular outline
after: outline follows the shape
outline: 8px groove hotpink
before: rectangular outline
after: outline follows the shape
outline: 8px ridge hotpink
before: rectangular outline
after: outline follows the shape

Repro HTML

<div style="width:100px; height:100px; background:lightblue;
            border-shape: circle(50px at 50px 50px);
            outline: 10px dotted hotpink;"></div>

Pre-fix Chrome paints a dotted rectangle around the 100×100 border box; with the patch the outline follows the circle. Full demo: demo.html.

Links

CL 8777667 · Issue 582385059 · CSS Borders 4 - border-shape · CSS UI - outline