Closed Bug 973847 Opened 11 years ago Closed 10 years ago

Erroneous position of the text in SVG

Categories

(Core :: SVG, defect)

27 Branch
x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: torbasow, Unassigned)

Details

Attachments

(1 file)

Attached file test.html
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0 (Beta/Release) Build ID: 20140212131424 Steps to reproduce: 1) Load HTML (preferences svg.text.css-frames.enabled should be true as in Fx25 and newer by default): <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8"/> <title>Minus pixel</title> <script src="test.js" type="application/x-javascript;version=1.8"></script> </head> <body> <p><span>Header</span></p> <svg xmlns="http://www.w3.org/2000/svg" style="border: 1px solid red;"> <rect x="0" y="0" width="100" height="30" fill="yellow"></rect> <text x="0" y="0" text-rendering="geometricPrecision" text-anchor="start" dominant-baseline="text-before-edge">Header</text> </svg> </body> </html> 2) Look at SVG width (document.querySelector("svg").getBoundingClientRect().width). 3) Compare left positions of the text (document.querySelector("svg>text").getBoundingClientRect().left) and the rect (document.querySelector("svg>rect").getBoundingClientRect().left). Actual results: SVG width is 101px. Text left position is 1px less than rect left position. Expected results: SVG width must be 100px. Text left position must equals rect left position.
Component: Untriaged → SVG
Product: Firefox → Core
This is certainly possible, it's not a bug if it happens though. The serifs of fonts can stick out.
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: