getBoundingClientRect should work the same for tspan as it does for text
Categories
(Core :: SVG, defect)
Tracking
()
People
(Reporter: longsonr, Unassigned)
Details
Bug 1426594 introduced a test for this but did so with fuzziness. That fuzziness is required because for a text element (as with other SVG elements) getBoundingClientRect includes the stroke, any text decorations and any text-shadow. For tspan elements it does not.
For a text element we store the ink overflow boundary in the text frame's mRect and we just return this. For tspan elements we treat the text as non-SVG really and thereby ignore any stroke/decorations/shadows.
Updated•11 months ago
|
Comment 1•11 months ago
•
|
||
permalink to the testcase referenced in comment 0, in case the test gets moved or amended:
https://searchfox.org/mozilla-central/rev/ff6e63804e6f7b548a26338708663093ce16be11/dom/svg/test/test_bug1426594.html
(If I'm understanding correctly, this bug here is tracking the // TODO: tspan bounds should account for stroke, decorations and text-shadow
code-comment in the test there.)
Description
•