Open Bug 1893883 Opened 2 months ago Updated 2 months ago

SVG positioning differs from other browsers when using rotated <text> elements

Categories

(Core :: SVG, defect)

Firefox 125
defect

Tracking

()

People

(Reporter: cengels, Unassigned)

References

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0

Steps to reproduce:

See the following codepen: https://codepen.io/cengels/pen/GRLLNXy

An SVG must be constructed, and from what I can tell the following conditions must be met:

  • There must be a parent <g> element.
  • The <g> element must contain an arbitrary element and a sibling <text> element.
  • The <g> element must have a CSS transform translation and rotation.
  • The <text> element must also have a rotation.
  • transform-box: fill-box or content-box must be set on both the <text> and the <g> element.

Actual results:

In Firefox (both stable 125 and Nightly 127.0a1), the black rectangle is shifted slightly towards the top left.

Expected results:

The rectangle should be perfectly centered within the SVG. This is the result in most if not all modern browsers (tested on Edge, Chrome, Brave, Vivaldi, and Opera).

I did some rudimentary version testing and found that the SVG was rendered correctly prior to Firefox 68.

The Bugbug bot thinks this bug should belong to the 'Core::Web Painting' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Web Painting
Product: Firefox → Core

almost certainly a duplicate of bug 1612347

See Also: → 1612347
Component: Web Painting → SVG

Mark S3, just like Bug 1612347. (And we could fix either one first, and verify the other one.)

Severity: -- → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: