Closed Bug 573316 Opened 15 years ago Closed 15 years ago

isspace assertion failure [@ nsSVGLength::SetValueAsString]

Categories

(Core :: SVG, defect)

x86
Windows 7
defect
Not set
critical

Tracking

()

RESOLVED FIXED

People

(Reporter: jruderman, Assigned: jruderman)

References

Details

(Keywords: assertion, testcase)

Attachments

(2 files, 1 obsolete file)

On Windows, isspace asserts if you give it a negative number (other then EOF?).
Attached patch minimal patch (obsolete) — Splinter Review
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?
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).
http://mxr.mozilla.org/mozilla-central/source/content/svg/content/src/nsSVGNumber.cpp#140 also uses isspace. What definition of "space" does it want? ;)
nsSVGNumber and nsSVGLength want the same definition, that of comment 2. I think there's a function in nsSVGUtils.h for that - IsSVGWhitespace.
Attached patch patchSplinter Review
Assignee: nobody → jruderman
Attachment #452526 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #452609 - Flags: review?(dholbert)
Excellent, thanks Robert. IsSVGWhitespace is apparently unused at the moment, but that's easily remedied ;)
Attachment #452609 - Flags: review?(dholbert) → review+
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
Filed Bug 573489 on the nsCharSeparatedTokenizer issue described in comment 7.
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: