Make the SVG elements' BuildPath methods return nullptr when the element is disabled

RESOLVED FIXED in mozilla28

Status

()

Core
SVG
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: jwatt, Assigned: jwatt)

Tracking

Trunk
mozilla28
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
I should have made the SVG elements' BuildPath methods return nullptr when the element is disabled in bug 932761. It's more efficient, but more to the point it turns out some of the Moz2D backends can end up returning stroke bounds with NaN values in the case that no path is emitted. :/

This also fixes a bug with the width/height checking in SVGImageElement::BuildPath where the logic was the wrong way around.
(Assignee)

Comment 1

5 years ago
Created attachment 826342 [details] [diff] [review]
patch
Attachment #826342 - Flags: review?(dholbert)
(Assignee)

Updated

5 years ago
Blocks: 934183
(Assignee)

Updated

5 years ago
Depends on: 932761
Comment on attachment 826342 [details] [diff] [review]
patch

(In reply to Jonathan Watt [:jwatt] from comment #0)
> it turns out some of the Moz2D backends can end up returning stroke
> bounds with NaN values in the case that no path is emitted. :/

Are there automated testcases somewhere (maybe some random already-in-the-tree tests) that fail due to this when using those backends?

r=me
Attachment #826342 - Flags: review?(dholbert) → review+
Also: Please update the BuildPath() header-comment here...
http://mxr.mozilla.org/mozilla-central/source/content/svg/content/src/nsSVGPathGeometryElement.h?rev=e05ec9f34435&mark=63-65#63
...to mention that the method may return null, in cases where the element has no valid path. (or something like that)
(Assignee)

Comment 4

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/f2f5e3c75e15

(In reply to Daniel Holbert [:dholbert] from comment #2)
> Are there automated testcases somewhere (maybe some random
> already-in-the-tree tests) that fail due to this when using those backends?

Yes, quite a few.

(In reply to Daniel Holbert [:dholbert] from comment #3)
> Also: Please update the BuildPath() header-comment

Done.
https://hg.mozilla.org/mozilla-central/rev/f2f5e3c75e15
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
You need to log in before you can comment on or make changes to this bug.