Open Bug 1882838 Opened 1 year ago Updated 11 months ago

getBoundingClientRect should work the same for tspan as it does for text

Categories

(Core :: SVG, defect)

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.

Severity: -- → S3

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.)

You need to log in before you can comment on or make changes to this bug.