Closed
Bug 573316
Opened 14 years ago
Closed 14 years ago
isspace assertion failure [@ nsSVGLength::SetValueAsString]
Categories
(Core :: SVG, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: jruderman, Assigned: jruderman)
References
Details
(Keywords: assertion, testcase)
Attachments
(2 files, 1 obsolete file)
(deleted),
image/svg+xml
|
Details | |
(deleted),
patch
|
jwatt
:
review+
|
Details | Diff | Splinter Review |
On Windows, isspace asserts if you give it a negative number (other then EOF?).
Assignee | ||
Comment 1•14 years ago
|
||
1) NS_IS_SPACE(*number)
2) isspace((unsigned char)(*number))
3) Custom IsSpace like at
http://mxr.mozilla.org/mozilla-central/source/content/smil/nsSMILParserUtils.cpp#67
I implemented (1) because it was the first thing I thought of. (3) is probably best because it lets us match the spec. Do SMIL and SVG have the same concept of what is a space character?
Comment 2•14 years ago
|
||
White space in lists is defined as one or more of the following consecutive characters: "space" (Unicode code 32), "tab" (9), "line feed" (10), "carriage return" (13) and "form-feed" (12).
Assignee | ||
Comment 3•14 years ago
|
||
http://mxr.mozilla.org/mozilla-central/source/content/svg/content/src/nsSVGNumber.cpp#140 also uses isspace. What definition of "space" does it want? ;)
Comment 4•14 years ago
|
||
nsSVGNumber and nsSVGLength want the same definition, that of comment 2. I think there's a function in nsSVGUtils.h for that - IsSVGWhitespace.
Assignee | ||
Comment 5•14 years ago
|
||
Assignee: nobody → jruderman
Attachment #452526 -
Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #452609 -
Flags: review?(dholbert)
Assignee | ||
Comment 6•14 years ago
|
||
Excellent, thanks Robert. IsSVGWhitespace is apparently unused at the moment, but that's easily remedied ;)
Updated•14 years ago
|
Attachment #452609 -
Flags: review?(dholbert) → review+
Comment 7•14 years ago
|
||
Looks good to me. :)
FWIW, regarding IsSVGWhitespace being unused -- I initially used IsSVGWhitespace() in the parsing code for <animateMotion>, but I later outsourced that parsing to nsCharSeparatedTokenizer in Bug 562310. And, unfortunately, nsCharSeparatedTokenizer has its own "isWhitespace" method that doesn't catch linefeeds.[1]
We probably need to also make nsCharSeparatedTokenizer (and its sibling nsCCharSeparatedTokenizer) have an "SVG mode" to make its isWhitespace method check for linefeeds. That can be a separate bug, though.
[1] http://hg.mozilla.org/mozilla-central/annotate/e0c8f11c3892/xpcom/ds/nsCharSeparatedTokenizer.h#l157
Comment 8•14 years ago
|
||
Filed Bug 573489 on the nsCharSeparatedTokenizer issue described in comment 7.
Assignee | ||
Comment 9•14 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•