The default bug view has changed. See this FAQ.

"ASSERTION: Calling InvertSign with an unsupported unit"

RESOLVED FIXED in mozilla11

Status

()

Core
SVG
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: Jesse Ruderman, Assigned: dholbert)

Tracking

(Blocks: 1 bug, {assertion, testcase})

Trunk
mozilla11
assertion, testcase
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(4 attachments)

(Reporter)

Description

5 years ago
Created attachment 580998 [details]
testcase

###!!! ASSERTION: Calling InvertSign with an unsupported unit: 'Not Reached', file content/smil/nsSMILCSSValueType.cpp, line 154
(Reporter)

Comment 1

5 years ago
Created attachment 580999 [details]
stack trace
(Assignee)

Comment 2

5 years ago
The unsupported unit in question is "eUnit_Dasharray", added in bug 523355, which nsSMILCSSValueType::InvertSign doesn't know about.

Rather than trying to teach nsSMILCSSValueType::InvertSign about the inner-workings of dash-array-valued nsStyleAnimation::Value objects, I think we should move InvertSign into nsStyleAnimation::Value (where it'll have access to private data, and where it'll be clearer that it needs updating if numeric/number-like types are added/modified in the future.
(Assignee)

Updated

5 years ago
OS: Mac OS X → All
Hardware: x86_64 → All
(Assignee)

Comment 3

5 years ago
Actually, I take that back -- I think we need to explicitly opt out stroke-dasharray from this negative-checking / inverting hack right now.

Basically what we do now is:
  if (value looks like "-[digit][anything]") {
    Strip off the "-" and try to parse the string after that as our property-value.
    If that parse succeeded {
       try to negate the resulting parsed value
    } else, parse failed --> fail.

This isn't sensitive enough for stroke-dasharray, though.  Supposing someone wants to animate by "-1, 2, 3, 4", then the above logic would end up trying to parse the value "1, 2, 3, 4", and then we'd "negate" that and use the resulting value.  But there's no clear way to negate "1, 2, 3, 4" (which values should we negate?)

For stroke-dasharray, we really need to do this checking / negation per-array-value, which our current logic doesn't really support.  So I think we should just opt stroke-dasharray out of this chunk.
(Assignee)

Comment 4

5 years ago
Created attachment 581400 [details] [diff] [review]
fix v1

As the comment at the top of the contextual code hints, bug 501188 would really the cleanest way to fix this -- given that, I don't think it's worth trying to add hackarounds to make stroke-dasharray work with negative values here.

So, this patch just disables the negative-value-screening logic for stroke-dasharray (so we pass the negative value along to the parser, and it'll fail to parse, which is probably fine).

Just for reference, in case it's not clear -- negative numbers would in theory be useful for something like:
  <rect stroke-dasharray="10, 10" ...>
    <animate attributeName="stroke-dasharray" by="-2, -2" ..>
  </rect>
The author's intention there would be to get a resulting animation towards "8, 8", but we'll fail to animate that right now, because "-2, -2" is an invalid value for stroke-dahsarray.
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
(Assignee)

Comment 5

5 years ago
Created attachment 581401 [details] [diff] [review]
fix v1 (diff -w version)
Attachment #581401 - Flags: review?(dbaron)
Comment on attachment 581401 [details] [diff] [review]
fix v1 (diff -w version)

r=dbaron, though I'm not sure if I'm the best reviewer for this
Attachment #581401 - Flags: review?(dbaron) → review+
(Assignee)

Comment 7

5 years ago
(In reply to David Baron [:dbaron] from comment #6)
> r=dbaron

Thanks! :)

> though I'm not sure if I'm the best reviewer for this

I'm not concerned -- I mostly wanted a sanity-check, and I picked you since you wrote the code to add the unit in question ("eUnit_Dasharray", bug 523355), in case there was something obvious about it that I was missing.
(Assignee)

Updated

5 years ago
Depends on: 523355
(Assignee)

Comment 8

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/b278df809c4b
Target Milestone: --- → mozilla11
(Assignee)

Updated

5 years ago
Flags: in-testsuite+
https://hg.mozilla.org/mozilla-central/rev/b278df809c4b
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.