Bug 174285

Summary: SVG element's transform and transform-origin computed values are incorrect
Product: WebKit Reporter: Dima Voytenko <dvoytenko>
Component: CSSAssignee: Nobody <webkit-unassigned>
Severity: Normal CC: bfulgham
Priority: P2    
Version: Safari Technology Preview   
Hardware: Unspecified   
OS: Unspecified   

Description Dima Voytenko 2017-07-07 18:44:19 PDT
An SVG element styled with `transform` and `transform-origin` renders correctly, but returns wrong computed values.

See http://jsbin.com/yuhoxum/edit?html,js,output

It styles an SVG rect shape with `transform-origin: 50% 50%; transform: scale(0.5)`. The rendering appears to be fully correct. However, reading styles and computed values yields:

computed transform: none
computed origin: 0px 0px
style transform: scale(0.5)
style origin: 50% 50%

Styles are correct, but computed value for origin = `0px 0px` and transform = `none` are both wrong.
Comment 1 Dima Voytenko 2017-07-13 14:30:02 PDT
It appears, per transform-box spec, the current rendering is also incorrect. The implied transform-origin should be referenced against SVG's viewbox and not the element's border-box. See https://developer.mozilla.org/en-US/docs/Web/CSS/transform-box
Comment 2 Brent Fulgham 2022-07-15 11:05:21 PDT
Safari, Chrome, and Firefox all agree on rendering for this test case. I don't believe there is any remaining compatibility issue.