make CSS parser use nsresult for |aErrorCode|

RESOLVED FIXED in mozilla1.6beta

Status

()

Core
CSS Parsing and Computation
P3
normal
RESOLVED FIXED
15 years ago
15 years ago

People

(Reporter: dbaron, Assigned: dbaron)

Tracking

Trunk
mozilla1.6beta
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [patch])

Attachments

(1 attachment)

(Assignee)

Description

15 years ago
The CSS parser has long had a TODO comment that it should use nsresult for its
|aErrorCode| values.

The following patch is largely the result of:

s/PRInt32& aErrorCode/nsresult& aErrorCode/
s/PRInt32 errorCode/nsresult errorCode/

but also:
 * removes three checks for -1 error code meaning EOF and replaces them with
assertions, since I can't find any place that sets the error code to -1 on EOF
 * removes the TODO comment
(Assignee)

Comment 2

15 years ago
I tested that the "test styles" bookmarklet at
http://www.squarefree.com/bookmarklets/webdevel.html still works as I type.
(Assignee)

Comment 3

15 years ago
(I should really do that in a debug build, though.)
(Assignee)

Updated

15 years ago
Status: NEW → ASSIGNED
Priority: -- → P3
Whiteboard: [patch]
Target Milestone: --- → mozilla1.6beta
Are the callers who used to check for -1 likely to throw exceptions on EOF when
we don't want them to?  (I guess no, since the scanner does not set rv to -1 on
EOF....)
(Assignee)

Comment 5

15 years ago
No assertions in the same test in a debug build, so I don't think anything is
returning -1 in aErrorCode for EOF.
(Assignee)

Updated

15 years ago
Attachment #134542 - Flags: superreview?(bz-vacation)
Attachment #134542 - Flags: review?(bz-vacation)
I'll try to get to this sometime this week...
Comment on attachment 134542 [details] [diff] [review]
patch

r+sr=bzbarsky; I'm sorry this took so long...  The EOF thing is indeed not a -1
anymore, since we just use rv from the stream for that error code, and streams
return NS_OK and 0 bytes for a read at EOF.
Attachment #134542 - Flags: superreview?(bz-vacation)
Attachment #134542 - Flags: superreview+
Attachment #134542 - Flags: review?(bz-vacation)
Attachment #134542 - Flags: review+
(Assignee)

Comment 8

15 years ago
Fix checked in to trunk, 2003-11-13 14:48 -0800.
Status: ASSIGNED → RESOLVED
Last Resolved: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.