SVG - Incorrect element height

UNCONFIRMED
Unassigned

Status

()

Core
SVG
UNCONFIRMED
3 years ago
3 years ago

People

(Reporter: anders.willsson@exopen.se, Unassigned)

Tracking

35 Branch
x86_64
Windows 7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

3 years ago
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0
Build ID: 20150122214805

Steps to reproduce:

<!doctype html><body><svg><path d="M1 0 L100 0" stroke-width="1" stroke="#000000"></path></svg></body>



Actual results:

Firefox 35.0.1 renders a 1px line but the element height is 8px.


Expected results:

The height of the path element should be 1px.
Who says it's 8px. I don't think this is an SVG bug, it's a bug in whatever tool is saying it's 8px high.
I'm assuming Mozilla is the tool, and it's our getBBox implementation that expands the bounds for the stroke-miterlimit default.

Anders, a minimal testcase attached to the bug using the "Add an attachment" link is always useful.
getBBox won't include the stroke-width so it will report 0.
(Reporter)

Comment 4

3 years ago
Created attachment 8557037 [details]
ff-svgbug.html
(Reporter)

Comment 5

3 years ago
Sorry for the short description. I posted a html-file just now to show you guys what i meant.
I checked the height using the firefox dev tools inspector thingee. Also tried getClientBoundingRect().height.
Set stroke-linejoin: bevel; to workaround this.
(Reporter)

Comment 7

3 years ago
Nice workaround. Thank you Robert.
You need to log in before you can comment on or make changes to this bug.