Bug 260342 - clip-path on SVG content should default to using the border-box (aka stroke-box)
Summary: clip-path on SVG content should default to using the border-box (aka stroke-box)
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-08-17 04:34 PDT by Philip Rogers
Modified: 2024-08-23 15:50 PDT (History)
6 users (show)

See Also:


Attachments
Testcase showing two clip-paths that should render the same (349 bytes, text/html)
2023-08-17 04:34 PDT, Philip Rogers
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Philip Rogers 2023-08-17 04:34:24 PDT
Created attachment 467305 [details]
Testcase showing two clip-paths that should render the same

In the attached testcase we have 2 stroked green boxes with clip-paths of "inset(0)" and "inset(0) border-box". These should render the same due to the following lines in http://www.w3.org/TR/css-masking-1/#the-clip-path:
1. If no reference box is specified, the border-box will be used as
  reference box.
2. For SVG elements without an associated CSS layout box, the used
  value for ... border-box and margin-box is stroke-box.

I found this while working on bringing Chromium's clip-path implementation up to speed and found no engines agree on this. I plan to land two new WPT tests covering this behavior (css/css-masking/clip-path-svg-content/clip-path-inset-stroke-001.svg and css/css-masking/clip-path-svg-content/clip-path-inset-stroke-002.svg).
Comment 1 Radar WebKit Bug Importer 2023-08-24 04:35:15 PDT
<rdar://problem/114375393>
Comment 2 Ahmad Saleem 2024-08-23 15:50:45 PDT
Both of these WPT test cases are passing - https://wpt.fyi/results/css/css-masking/clip-path-svg-content?label=master&label=experimental&aligned&q=clip-path-inset-stroke-00

as nearest as November 2023