Chrome Version: 62.0.3202.18 (Official Build) dev (64-bit)
OS: Ubuntu 17.10 beta
What steps will reproduce the problem?
(1) Visit https://jsfiddle.net/201qvyw8/
What is the expected result?
alert() should appear which shows "TEST PASSED" -- in particular, both tested <svg> element should return a 123px-wide rect from getBoundingClientRect.
What happens instead?
alert() shows "TEST FAILED", because the inner SVG element returned a 0px-wide rect from getBoundingClientRect.
Please use labels and text to provide additional information.
Spec references:
- getBoundingClientRect is defined here (in terms of "getClientRects"), and it's supposed to include the element's "SVG layout box":
https://www.w3.org/TR/cssom-view-1/#dom-element-getclientrects
Inner SVG elements do absolutely have their own "layout box", which you can demonstrate visually if you e.g. give them an explicit width, height, and viewBox attribute (which will then prompt their own children to fit the viewBox's particular region of "SVG fragment space" into their layout box). So I don't see any spec support for Chrome's behavior here.
Comment 1 by f...@opera.com
, Sep 15 2017