Bug 174285 - SVG element's transform and transform-origin computed values are incorrect
Summary: SVG element's transform and transform-origin computed values are incorrect
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2017-07-07 18:44 PDT by Dima Voytenko
Modified: 2022-07-15 11:05 PDT (History)
1 user (show)

See Also:


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