DescriptionCompute a more correct "screen scope" transform for SVGSVGElement
For getScreenCTM, only the position (translation) of the outermost svg
element was computed - any additional transform data was dropped.
Use LayoutObject::localToAbsoluteTransform to compute the full transform
rather than just the position of the layout box. Since using this method
works for any (attached) element, implement getScreenCTM without using
computeCTM, and get rid of the ScreenScope variant of the latter. This
also allows us to simplify SVGSVGElement::localCoordinateSpaceTransform
a bit, and drop the CTMScope argument from the
localCoordinateSpaceTransform declaration(s).
It's not clear from [1] how elements which are not in the rendering tree
(i.e has 'display: none' or similar) should be handled. With this
implementation we will return an identity matrix in those cases, which
doesn't seem unreasonable. (The option would be to return 'null', which
is how elements not in the document should be treated, but we don't have
that semantic implemented yet.)
[1] https://svgwg.org/svg2-draft/types.html#__svg__SVGGraphicsElement__getScreenCTM
BUG=678167
Review-Url: https://codereview.chromium.org/2711503002
Cr-Commit-Position: refs/heads/master@{#451938}
Committed: https://chromium.googlesource.com/chromium/src/+/2ad2a9bf7205ec77843cf27a7964fda92df386b2
Patch Set 1 #Patch Set 2 : Tweak test #Messages
Total messages: 19 (13 generated)
|