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
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-07 18:44 PDT by Dima Voytenko
Modified: 2017-07-13 14:30 PDT (History)
0 users

See Also:


Attachments

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