Closed dlockhart closed 6 years ago
I think this is actually a Chrome bug. This rule in the UA stylesheet for SVG doesn't match <svg>
elements which are the children of ShadowRoots: it should also have :host(html|*) > svg
.
Isn't @robdodson playing around in the Chromium code these days? :focus-visible
can wait... ;)
Filed as https://crbug.com/808228.
Description
When
<iron-iconset-svg>
is used in a page with right-to-left (dir="rtl"
) direction, with an icon that mirrors itself, on a browser which supports native Shadow DOM, the icon is mirrored from the incorrect origin. This results in it being positioned outside its container.Right-to-left (incorrect origin)![iconset-rtl](https://user-images.githubusercontent.com/5491151/35463742-2fa4106a-02c0-11e8-9155-bd90c81ddda3.png)
Left-to-right (correct origin)![iconset-ltr](https://user-images.githubusercontent.com/5491151/35463759-41676c52-02c0-11e8-9810-1493d1a96b90.png)
Expected outcome
The icon should mirror along its center horizontal and vertical axes.
Actual outcome
The icon mirrors
Live Demo
Make sure you're using Chrome: https://jsbin.com/jotojuzuru/edit?html,output
Steps to reproduce
<iron-iconset-svg>
withrtl-mirror="true"
mirror-in-rtl="true"
attributedir="rtl"
on the<body>
or<html>
elements)Sample code:
Browsers Affected
Possible Fix
Add
transform-origin: center;
to the CSS which is performing the transform.