Closed
Bug 83612
Opened 23 years ago
Closed 23 years ago
Correct/cleanup style loading code in content
Categories
(Core :: XML, defect, P1)
Core
XML
Tracking
()
VERIFIED
FIXED
mozilla0.9.2
People
(Reporter: rbs, Assigned: peterv)
References
Details
Attachments
(5 files)
1.50 KB,
patch
|
Details | Diff | Splinter Review | |
11.63 KB,
patch
|
Details | Diff | Splinter Review | |
12.55 KB,
patch
|
Details | Diff | Splinter Review | |
12.53 KB,
patch
|
Details | Diff | Splinter Review | |
12.75 KB,
patch
|
Details | Diff | Splinter Review |
Compilation gives a warning that a 'namespaceID' variable is being used without
being initialized on line 1098 in nsXMLContentSink.cpp. Not sure how serious
this is. But I thought I will file this bug since namespace issues are
sensitive.
nsXMLContentSink.cpp(1098) : warning C4700: local variable 'namespaceID' used
without having been initialized
Assignee | ||
Comment 1•23 years ago
|
||
The relevant part of my patch for bug 7515 (which changed this code) is this:
nsAutoString title;
nsAutoString type;
nsAutoString media;
+ nsCOMPtr<nsIAtom> name, prefix;
+ PRInt32 namespaceID;
+
+ if (NS_FAILED(mStyleElement->GetAttribute(namespaceID,
*getter_AddRefs(name),src)))
+ return rv;
+ src.StripWhitespace();
+
for (i = 0; i < count; i++) {
- PRInt32 namespaceID;
- nsCOMPtr<nsIAtom> name, prefix;
mStyleElement->GetAttributeNameAt(i,namespaceID,*getter_AddRefs(name),*getter_AddRefs(prefix));
- if (name.get() == nsHTMLAtoms::src) {
- mStyleElement->GetAttribute(namespaceID,name,src);
- src.StripWhitespace();
- }
- else if (name.get() == nsHTMLAtoms::title) {
+ if (name.get() == nsHTMLAtoms::title) {
mStyleElement->GetAttribute(namespaceID,name,title);
title.CompressWhitespace();
}
I think we should set namespaceID to kNameSpaceID_None, as that is what
GetAttributeNameAt does, and that's what initialized namespaceID in the old code
(see
http://lxr.mozilla.org/seamonkey/source/content/html/content/src/nsGenericHTMLElement.cpp#1866).
I'll attach a patch.
Status: NEW → ASSIGNED
OS: Windows 2000 → All
Priority: -- → P4
Hardware: PC → All
Target Milestone: --- → mozilla0.9.2
Assignee | ||
Comment 2•23 years ago
|
||
I'll use this bug to do some cleanup and corrections for the style-loading code.
First patch coming up, one or two more will follow.
Priority: P4 → P3
Summary: 'namespaceID' used without having been initialized → Correct/cleanup style loading code in content
Assignee | ||
Comment 3•23 years ago
|
||
Assignee | ||
Comment 5•23 years ago
|
||
Assignee | ||
Comment 6•23 years ago
|
||
I now always set the mParser (in nsStyleLinkElement) to nsnull when setting
mDontLoadStyle to PR_TRUE. This ensures that we don't leak the parser when not
loading stylesheets. Looking for an r and sr.
Assignee | ||
Comment 7•23 years ago
|
||
Assignee | ||
Comment 8•23 years ago
|
||
Comment 9•23 years ago
|
||
sr=jst
Um, near the end of the last patch we bail out if there is a src attribute. I
think we should just ignore the src attribute and not bail out if it exists (so
you can also avoid GetAttribute for src). This is of course only for XHTML.
Assignee | ||
Comment 11•23 years ago
|
||
We could do that, it does make some sense. Note that we didn't support that
before. Is the patch ok otherwise?
Yeah, r=heikki.
Assignee | ||
Comment 13•23 years ago
|
||
Have you checked that there aren't any regressions in
http://www.bath.ac.uk/~py8ieh/internet/importtest/ ?
Updated•23 years ago
|
Priority: P3 → P1
Comment 15•23 years ago
|
||
a= asa@mozilla.org for checkin to the trunk.
(on behalf of drivers)
Assignee | ||
Comment 16•23 years ago
|
||
Checked in.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•