Closed
Bug 296237
Opened 20 years ago
Closed 18 years ago
remove assert in getElementById, use the console service to provide feedback
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla1.9alpha1
People
(Reporter: mconnor, Assigned: asqueella)
References
Details
(Keywords: assertion)
Attachments
(2 files, 3 obsolete files)
6.10 KB,
patch
|
Details | Diff | Splinter Review | |
3.12 KB,
patch
|
Details | Diff | Splinter Review |
document.getElementById("") asserts currently, and going into a "asserts crash"
future, this would seem to be a Bad Thing. Instead of asserting, or a warning
that's only of value to debug builds, we should output a message to the console
service. Patch upcoming.
Reporter | ||
Comment 1•20 years ago
|
||
Assignee: general → mconnor
Status: NEW → ASSIGNED
Attachment #185033 -
Flags: superreview?(jst)
Attachment #185033 -
Flags: review?(jst)
Comment 2•20 years ago
|
||
Comment on attachment 185033 [details] [diff] [review]
remove asserts, add console warning
I guess it'd be nice to split this code into a global function (i.e. PRBool
CheckGetElementByIdArg(const nsAString& aId)) in some file, say nsDocument.cpp
and just call that from all these places. If not for code size, for easier code
maintainability.
r+sr=jst if you do that.
Attachment #185033 -
Flags: superreview?(jst)
Attachment #185033 -
Flags: superreview+
Attachment #185033 -
Flags: review?(jst)
Attachment #185033 -
Flags: review+
Comment 3•19 years ago
|
||
What's the status on this bug?
Comment 4•19 years ago
|
||
*** Bug 324151 has been marked as a duplicate of this bug. ***
Reporter | ||
Comment 5•19 years ago
|
||
Need to clean up and land this patch
Target Milestone: --- → mozilla1.9alpha
Comment 6•19 years ago
|
||
*** Bug 161855 has been marked as a duplicate of this bug. ***
Updated•18 years ago
|
Severity: normal → critical
Assignee | ||
Comment 7•18 years ago
|
||
Attachment #185033 -
Attachment is obsolete: true
Attachment #241640 -
Flags: superreview?(jst)
Attachment #241640 -
Flags: review?(jst)
Assignee | ||
Comment 8•18 years ago
|
||
(Need to fix the line endings before checking in.)
Reporter | ||
Updated•18 years ago
|
Assignee: mconnor → asqueella
Status: ASSIGNED → NEW
Comment 9•18 years ago
|
||
Comment on attachment 241640 [details] [diff] [review]
updated patch
- In nsDocument.cpp:
+PRBool CheckGetElementByIdArg(const nsAString& aId)
This should IMO be a static member method in the class nsDocument, it's only relevant to document objects. And put the return type declaration on its own line to follow the rest of the code around here. r+sr=jst with that fixed.
Attachment #241640 -
Flags: superreview?(jst)
Attachment #241640 -
Flags: superreview+
Attachment #241640 -
Flags: review?(jst)
Attachment #241640 -
Flags: review+
Assignee | ||
Comment 10•18 years ago
|
||
Fixed the review comment.
Attachment #241640 -
Attachment is obsolete: true
Assignee | ||
Updated•18 years ago
|
Status: NEW → ASSIGNED
Whiteboard: [checkin needed]
Comment 11•18 years ago
|
||
Checked in on trunk:
Checking in base/src/nsDocument.cpp;
/cvsroot/mozilla/content/base/src/nsDocument.cpp,v <-- nsDocument.cpp
new revision: 3.685; previous revision: 3.684
done
Checking in base/src/nsDocument.h;
/cvsroot/mozilla/content/base/src/nsDocument.h,v <-- nsDocument.h
new revision: 3.316; previous revision: 3.315
done
Checking in html/document/src/nsHTMLDocument.cpp;
/cvsroot/mozilla/content/html/document/src/nsHTMLDocument.cpp,v <-- nsHTMLDocu
ment.cpp
new revision: 3.698; previous revision: 3.697
done
Checking in xml/document/src/nsXMLDocument.cpp;
/cvsroot/mozilla/content/xml/document/src/nsXMLDocument.cpp,v <-- nsXMLDocumen
t.cpp
new revision: 1.250; previous revision: 1.249
done
Checking in xul/document/src/nsXULDocument.cpp;
/cvsroot/mozilla/content/xul/document/src/nsXULDocument.cpp,v <-- nsXULDocumen
t.cpp
new revision: 1.735; previous revision: 1.734
done
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Whiteboard: [checkin needed]
Comment 12•18 years ago
|
||
why's this new message not localizable?
Assignee | ||
Comment 13•18 years ago
|
||
Because it wasn't localizable in mconnor's patch and I didn't remember it should be made localizable. I'll fix it.
Assignee | ||
Comment 14•18 years ago
|
||
Attachment #242323 -
Flags: superreview?(jst)
Attachment #242323 -
Flags: review?(jst)
Comment 15•18 years ago
|
||
Comment on attachment 242323 [details] [diff] [review]
make the message localizable
nit re dom.properties, fix the newline? I'll let jst cover the nsDocument part.
Assignee | ||
Comment 16•18 years ago
|
||
Yes, biesi also mentioned it on IRC. I am going to fix it before the checkin.
Comment 17•18 years ago
|
||
Comment on attachment 242323 [details] [diff] [review]
make the message localizable
r+sr=jst with the missing newline added.
Attachment #242323 -
Flags: superreview?(jst)
Attachment #242323 -
Flags: superreview+
Attachment #242323 -
Flags: review?(jst)
Attachment #242323 -
Flags: review+
Assignee | ||
Comment 18•18 years ago
|
||
Attachment #242323 -
Attachment is obsolete: true
Assignee | ||
Updated•18 years ago
|
Whiteboard: [checkin needed]
Assignee | ||
Updated•18 years ago
|
Attachment #242268 -
Attachment description: patch v1.1 → patch v1.1 (checked in)
Comment 19•18 years ago
|
||
Comment on attachment 242708 [details] [diff] [review]
make the message localizable, v1.1
Checked in on trunk:
Checking in content/base/src/nsDocument.cpp;
/cvsroot/mozilla/content/base/src/nsDocument.cpp,v <-- nsDocument.cpp
new revision: 3.687; previous revision: 3.686
done
Checking in dom/locales/en-US/chrome/dom/dom.properties;
/cvsroot/mozilla/dom/locales/en-US/chrome/dom/dom.properties,v <-- dom.properties
new revision: 1.7; previous revision: 1.6
done
Updated•18 years ago
|
Whiteboard: [checkin needed]
You need to log in
before you can comment on or make changes to this bug.
Description
•