Bug 243091 - filter with primitiveUnits=objectBoundingBox is applied per tile
Summary: filter with primitiveUnits=objectBoundingBox is applied per tile
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: Safari Technology Preview
Hardware: Mac (Apple Silicon) macOS 12
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-07-21 23:27 PDT by Johannes Odland
Modified: 2022-07-28 23:28 PDT (History)
5 users (show)

See Also:


Attachments
Screenshot of unexpected result in STP (34.07 KB, image/png)
2022-07-21 23:27 PDT, Johannes Odland
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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>