Bug 243091

Summary: filter with primitiveUnits=objectBoundingBox is applied per tile
Product: WebKit Reporter: Johannes Odland <johannes.odland>
Component: SVGAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: sabouhallawa, simon.fraser, webkit-bug-importer, zalan, zimmermann
Priority: P2 Keywords: InRadar
Version: Safari Technology Preview   
Hardware: Mac (Apple Silicon)   
OS: macOS 12   
Attachments:
Description Flags
Screenshot of unexpected result in STP none

Description Johannes Odland 2022-07-21 23:27:51 PDT
Created attachment 461131 [details]
Screenshot of unexpected result in STP

Given an SVG filter that has primitiveUnits set to objectBoundingBox. 
When applying this filter to an element using the CSS filter property, the rendered output is unexpected. 

What seems to happen:

The element is broken along the rendered tiles. 
Each part of the segmented element is assigned coordinates from 0,0 to 1,1, and the filter is applied per segmented element. 

Expected behaviour: 

Length values within the filter should correspond to the whole bounding box of the element, and not to the rendered tile.

"If primitiveUnits is equal to objectBoundingBox, then any length values within the filter definitions represent fractions or percentages of the bounding box on the referencing element"
https://www.w3.org/TR/filter-effects-1/#element-attrdef-filter-primitiveunits

How to reproduce:
The issue is reproduced in the following pen: https://codepen.io/johannesodland/pen/PoRjPJv

It is possible to mitigate the problem by forcing the element to be rendered as a separate layer, using `transform: translateZ(0)` or similar.
Comment 1 Radar WebKit Bug Importer 2022-07-28 23:28:14 PDT
<rdar://problem/97766228>