[svgwg] SVGElement.getBoundingClientRect(): which bounding box?

progers has just created a new issue for https://github.com/w3c/svgwg:

== SVGElement.getBoundingClientRect(): which bounding box? ==
The CSSOM spec states (https://drafts.csswg.org/cssom-view/#dom-element-getclientrects):

> If the element has an associated SVG layout box return a sequence containing a single DOMRect object that describes the bounding box of the element as defined by the SVG specification, applying the transforms that apply to the element and its ancestors.

The SVG spec now has a definition of the bounding box but there are three versions: object, stroke, and decorated (https://svgwg.org/svg2-draft/single-page.html#coords-BoundingBoxes).

This has been discussed before:
https://lists.w3.org/Archives/Public/www-svg/2011Jul/0054.html

Testcase: http://output.jsbin.com/fuxuqav/1/quiet
- Chromium61.0.3163.13/blink: does not include stroke
- Safari/WebKit: does not include stroke
- Edge25.10586.272.0: does include stroke
- Firefox54.0.1/Gecko: does include stroke

I know the code and this is easy to implement either way in both Blink and WebKit. I'm slightly leaning towards including strokes because Element.getBoundingClientRect includes CSS borders (testcase: http://output.jsbin.com/padijom/quiet). I'm slightly worried about the compatibility issues of changing Blink and WebKit.

Please view or discuss this issue at https://github.com/w3c/svgwg/issues/339 using your GitHub account

Received on Wednesday, 2 August 2017 19:04:16 UTC