New issue
Advanced search Search tips

Issue 807588 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 788585
Owner: ----
Closed: Jan 2018
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 3
Type: Bug



Sign in to add a comment

CSS Transform-origin refered to viewBox instead of Dom target element

Reported by ansi...@gmail.com, Jan 31 2018

Issue description

Chrome Version       : 64.0.3282.119
URLs (if applicable) :
Other browsers tested:
  Chrome Version       : 63.??? (it was working fine before update)

What steps will reproduce the problem?
1. make a SVG with several elements (a square or a rectangle bigger than the viewBox and not centered)
2. decrare the svg inline in a html page
3. animate a rotate 45deg with CSS targetting the square ex : svg rectangle {    transform: rotate(45deg);}
4. change the transform-origin of the rectangle (try diferents x/y params : 0 0; then 50% 50%; or 100% 100%). 

What is the expected result?
The rotate axis nead to be calculated on the reactangle targetted without interference of the viewBox size, 0 0 correspond to top left of the square and 100% 100% correspond to the bottom right corner of the square. It was working fine in version 63 of chrome.

What happens instead?
In version 64 of chrome the origin is the viewbox instead of the square himself, the rotation is totally unprevisible.


Please provide any additional information below. Attach a screenshot if
possible.


For graphics-related bugs, please copy/paste the contents of the about:gpu
page at the end of this report.

 
chrome-64-rotate-origin-issue.png
4.2 KB View Download

Comment 1 by f...@opera.com, Jan 31 2018

Mergedinto: 788585
Status: Duplicate (was: Unconfirmed)
Summary: CSS Transform-origin refered to viewBox instead of Dom target element (was: CSS Trasform-origin refered to viewBox instead of Dom target element)
This is due to supporting the 'transform-box' property, and thus fixing up the old non-standard behavior where percentage values in 'transform-origin' would refer to the bounding box of the object, and not the viewport of the element.
So the behavior you are observing is as specified, and should match what Firefox and Safari (11+) does.

You can get the old behavior by making the following property apply to the element:

 transform-box: fill-box;

(This will then also fix rendering in Firefox and Safari.)

Sorry for the inconvenience.

Comment 2 by f...@opera.com, Jan 31 2018

Components: Blink>SVG

Comment 3 Deleted

Comment 4 by ansi...@gmail.com, Jan 31 2018

Thank you, the transform-box propertie work !

Sign in to add a comment