Closed
Bug 52724
Opened 24 years ago
Closed 24 years ago
unused nsAutoString in nsHTMLDocument::CreateElement
Categories
(Core :: DOM: Core & HTML, defect, P2)
Core
DOM: Core & HTML
Tracking
()
VERIFIED
FIXED
M18
People
(Reporter: dbaron, Assigned: jst)
Details
(Whiteboard: [nsbeta3+] dbaron, could you verify please?)
In nsHTMLDocument::CreateElement, I see the lines:
1427 nsAutoString tmp(aTagName);
1428 tmp.ToLowerCase();
The string |tmp| is not used again in the function. This is either:
* a waste of two lines, and some string copying and munching
* obscuring some other bug because you *should* have used tmp later on.
I'm filing this bug to suggest that you either remove the two lines or use tmp
somewhere else in the function, whichever is right. :-)
Assignee | ||
Comment 1•24 years ago
|
||
Ooohh, good catch David, tmp should be used, but in stead aTagName was used,
this patch fixes the problem:
Index: html/document/src/nsHTMLDocument.cpp
===================================================================
RCS file: /cvsroot/mozilla/layout/html/document/src/nsHTMLDocument.cpp,v
retrieving revision 3.283
diff -u -r3.283 nsHTMLDocument.cpp
--- nsHTMLDocument.cpp 2000/09/19 05:11:59 3.283
+++ nsHTMLDocument.cpp 2000/09/19 07:39:35
@@ -1425,7 +1425,7 @@
nsAutoString tmp(aTagName);
tmp.ToLowerCase();
- mNodeInfoManager->GetNodeInfo(aTagName, nsnull, kNameSpaceID_None,
+ mNodeInfoManager->GetNodeInfo(tmp, nsnull, kNameSpaceID_None,
*getter_AddRefs(nodeInfo));
nsCOMPtr<nsIHTMLContent> content;
Nominating nsbeta3, this makes document.createElement("a") and
document.createElement("A") create elements that behave differently, and we
don't want that. This is a trivial low risk fix.
Severity: minor → major
Status: NEW → ASSIGNED
Keywords: correctness,
nsbeta3
Priority: P3 → P2
Target Milestone: --- → M18
Comment 2•24 years ago
|
||
Yes, this is a trivial, extremely low risk fix. Marking nsbeta3+
Whiteboard: [nsbeta3+]
Assignee | ||
Comment 3•24 years ago
|
||
Fixed
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Comment 4•24 years ago
|
||
dbaron, could you verify please?
Updated•24 years ago
|
Whiteboard: [nsbeta3+] → [nsbeta3+] dbaron, could you verify please?
Reporter | ||
Updated•24 years ago
|
Status: RESOLVED → VERIFIED
Reporter | ||
Comment 5•24 years ago
|
||
Verified by looking at source
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•