Closed
Bug 1109860
Opened 10 years ago
Closed 9 years ago
SVG `getBBox` dimensions include hidden characters pertaining to bidirectional text
Categories
(Core :: SVG, defect)
Tracking
()
RESOLVED
FIXED
mozilla37
People
(Reporter: matt, Assigned: longsonr)
References
Details
(Keywords: regression)
Attachments
(1 file, 1 obsolete file)
2.76 KB,
patch
|
heycam
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:36.0) Gecko/20100101 Firefox/36.0 Build ID: 20141210004006 Steps to reproduce: 1. Generate string with left-to-right mark (\u200E, although other characters such as \u202A cause the same problem) prepended. 2. Add aforementioned string to an SVG text node. 3. Call text node's `getBBox` method. Actual results: Different `x`, `y`, `height`, and `width` values are returned than the same node without the prepended bidirectional mark(s). A working example can be found at http://jsfiddle.net/mwistrand/aph95n4s/ Expected results: The `x`, `y`, `height`, and `width` values returned by `getBBox` should be calculated as if the bidirectional mark(s) were not present.
Assignee | ||
Updated•10 years ago
|
Component: Untriaged → SVG
Product: Firefox → Core
Regression range: http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=e85b0372cece&tochange=3ad5ecf34c9e Robert Longson — Bug 919900 - Correct bounding box calculations for empty text elements with svg.text.css-frames.enabled. r=heycam
Assignee | ||
Comment 2•10 years ago
|
||
Did we really get it right before bug 919900 or did we get both cases identically wrong at that time?
Assignee | ||
Updated•10 years ago
|
Flags: needinfo?(epinal99-bugzilla2)
Assignee | ||
Comment 3•10 years ago
|
||
Assignee: nobody → longsonr
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attachment #8535069 -
Flags: review?(cam)
Assignee | ||
Comment 4•10 years ago
|
||
FWIW the !r.IsEmpty() is the fix (length == 0 is an optimisation)
(In reply to Robert Longson from comment #2) > Did we really get it right before bug 919900 or did we get both cases > identically wrong at that time? Yes, it was right before bug 919900, same values in both cases (from the reporter's testcase).
Flags: needinfo?(epinal99-bugzilla2)
Before bug 919900 in both cases: x: 30 y: 16.399999618530273 width: 166.61666870117188 height: 17.600000381469727
Comment 7•9 years ago
|
||
Should we instead be checking !fill.IsEmpty()? Otherwise, if we have some real text and aFlags == eIncludeStroke, we'll end up returning an empty bbox rather than the bbox that just takes into account the stroke.
Assignee | ||
Comment 8•9 years ago
|
||
Attachment #8535069 -
Attachment is obsolete: true
Attachment #8535069 -
Flags: review?(cam)
Attachment #8543232 -
Flags: review?(cam)
Updated•9 years ago
|
Attachment #8543232 -
Flags: review?(cam) → review+
Assignee | ||
Comment 9•9 years ago
|
||
https://tbpl.mozilla.org/?tree=Try&rev=babb3e805a9e
Assignee | ||
Comment 10•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/35141bed8113
Flags: in-testsuite+
Comment 11•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/35141bed8113
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla37
You need to log in
before you can comment on or make changes to this bug.
Description
•