Bug 209220

Summary: [LegacySVG] SVG2: getScreenCTM(): ancestor CSS transform scale not applied
Product: WebKit Reporter: Martin <martin.aumair>
Component: SVGAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: ahmad.saleem792, ian, michaeldo, rbuis, sabouhallawa, simon.fraser, webkit-bug-importer, zalan, zimmermann
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: iPhone / iPad   
OS: iOS 12   
Attachments:
Description Flags
run demo on ios device and check console output
none
Expected result (Chrome) none

Description Martin 2020-03-18 02:49:27 PDT
Created attachment 393829 [details]
run demo on ios device and check console output

Steps to reproduce the problem:
1. Visit https://jsfiddle.net/Lxj0cuso/2 or run attached demo with open console

What is the expected behavior?
Expected output:
ctm.a= 2
ctm.d= 2
scale: 2

What went wrong?
ios output:
ctm.a= 1
ctm.d= 1
scale: 2

On windows running chrome the a and d value of the matrix represent the scale factor (2) 
On iOS the values are both 1 but the scale is applied correctly,

Chrome version: 76.0.3809.81
Comment 1 Alexey Proskuryakov 2020-03-18 17:55:50 PDT
I'm getting the reportedly incorrect output from Safari on macOS too.
Comment 2 Radar WebKit Bug Importer 2020-03-18 17:55:58 PDT
<rdar://problem/60611550>
Comment 3 ian 2020-06-19 07:06:35 PDT
Created attachment 402280 [details]
Expected result (Chrome)

https://jsfiddle.net/z8y6bcrg/3/
Comment 4 ian 2020-06-19 07:07:03 PDT
I think I've run into the same issue but with a rotation on the ancestor.
Comment 5 ian 2020-06-20 11:59:34 PDT
I may be wrong about this, but given that both getScreenCTM() and getBoundingClientRect() fail under one condition or another (https://bugs.webkit.org/show_bug.cgi?id=212640), there doesn't appear to be any way to reliably translate a coordinate from a responsive SVG to client space...
Comment 6 michaeldo 2022-06-27 11:25:33 PDT
This still appears broken in iOS 15.5. Have there been any updates on rdar://problem/60611550 which can be shared here?
Comment 7 Ahmad Saleem 2022-09-21 23:18:10 PDT
*** Safari 16 on macOS 12.6 ***

ctm.a= 1
ctm.d= 1
scale: 2

*** Safari Technology Preview 154 ***

ctm.a= 1
ctm.d= 1
scale: 2

*** Firefox Nightly 107 ***

ctm.a= 1
ctm.d= 1
scale: 2

*** Chrome Canary 108 ***

ctm.a= 2
ctm.d= 2
scale: 2

____

Just wanted to share updated results. Thanks!

Is it something LBSE might fix?
Comment 8 Nikolas Zimmermann 2022-09-22 00:29:27 PDT
Indeed fully fixed in LBSE - but not upstreamed yet. I also have new test cases for various scenarios. Stay tuned