Incorrect computed value for transform on SVG elements if translate() is specified in percentages
Reported by
leave...@gmail.com,
Dec 15
|
||||
Issue description
Chrome Version : 70.0.3538.110
OS Version: OS X 10.13.6
URLs (if applicable) :
Other browsers tested:
Add OK or FAIL after other browsers where you have tested this issue:
Safari: FAIL
Firefox: OK
IE/Edge: FAIL
Transform values returned by getComputedStyle() seem to quietly ignore any translate()s specified in percentages.
For example, transform: scale(1.1); and transform: scale(1.1) translate(50%, 50%) return the same computed transform of matrix(1.1, 0, 0, 1.1, 0, 0) even though they certainly have an effect on the visual result.
Testcase: http://dabblet.com/gist/c924e5674973af5746b8e4b9422d7647
Safari and Edge seem to have the same issue, Gecko does not.
Possibly related to https://bugs.chromium.org/p/chromium/issues/detail?id=740300
UserAgentString: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36
,
Dec 16
Bisected to aa980a2308ec27984ca69ca26fda64bdf1b68216 "Make getComputedStyle(e).transform return correct values for non-transformable elements" Landed in 47.0.2495.0 via r345506
,
Dec 17
,
Dec 18
,
Dec 18
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/65bf682855238ba823a2bd58215d067ce8c43e6d commit 65bf682855238ba823a2bd58215d067ce8c43e6d Author: Fredrik Söderquist <fs@opera.com> Date: Tue Dec 18 16:21:12 2018 Resolve percentages in computed 'transform' for SVG elements SVG (child; non-root) elements should resolve percentages in computed 'transform' values just like regular boxes. Rename ComputeTransformReferenceBox to ComputeSVGTransformReferenceBox (for clarity) and expose it for a wider audience. Make it apply the effective zoom, since both clients require that. Use ComputeSVGTransformReferenceBox in ComputedStyleUtils to compute the reference box for the LayoutObject in question. Bug: 915426 Change-Id: I5323056cc54ff07e0b3cf943f52a7210ea320c78 Reviewed-on: https://chromium-review.googlesource.com/c/1382433 Commit-Queue: Fredrik Söderquist <fs@opera.com> Reviewed-by: Rune Lillesveen <futhark@chromium.org> Cr-Commit-Position: refs/heads/master@{#617515} [modify] https://crrev.com/65bf682855238ba823a2bd58215d067ce8c43e6d/third_party/blink/renderer/core/css/properties/computed_style_utils.cc [modify] https://crrev.com/65bf682855238ba823a2bd58215d067ce8c43e6d/third_party/blink/renderer/core/css/properties/longhands/transform_custom.cc [modify] https://crrev.com/65bf682855238ba823a2bd58215d067ce8c43e6d/third_party/blink/renderer/core/svg/svg_element.cc [modify] https://crrev.com/65bf682855238ba823a2bd58215d067ce8c43e6d/third_party/blink/renderer/core/svg/svg_element.h [add] https://crrev.com/65bf682855238ba823a2bd58215d067ce8c43e6d/third_party/blink/web_tests/external/wpt/css/css-transforms/transform-percent-009.html
,
Dec 18
|
||||
►
Sign in to add a comment |
||||
Comment 1 by phanindra.mandapaka@chromium.org
, Dec 15