Closed
Bug 384507
Opened 17 years ago
Closed 17 years ago
nsContentSink.h contains static non-member functions and globals.
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
People
(Reporter: jst, Assigned: sayrer)
Details
Attachments
(1 file, 1 obsolete file)
12.46 KB,
patch
|
jst
:
review+
jst
:
superreview+
|
Details | Diff | Splinter Review |
Bug 340554 added: static nsIAtom** const kDefaultAllowedTags [] ... static nsIAtom** const kDefaultAllowedAttributes [] ... and static PRBool IsAttrURI(nsIAtom *aName) { ... } to nsContentSink.h. That means that every file that includes nsContentSink.h gets its own copy of those globals and that function. The linker *may* be smart enough to eliminate the duplicates, but we really don't want those there. The function could be a non-static inline function, or a non-static function defined elsewhere, and the globals should also be elsewhere (read nsContentSink.cpp), and the header file should only have extern declarations of the above. Robert, since you introduced this, I'm giving you this bug :)
Reporter | ||
Updated•17 years ago
|
Whiteboard: [wanted-1.9]
Assignee | ||
Comment 1•17 years ago
|
||
Attachment #268836 -
Flags: superreview?(jst)
Attachment #268836 -
Flags: review?(jst)
Assignee | ||
Updated•17 years ago
|
Attachment #268836 -
Attachment is patch: true
Attachment #268836 -
Attachment mime type: text/x-patch → text/plain
Reporter | ||
Comment 2•17 years ago
|
||
Comment on attachment 268836 [details] [diff] [review] like so? +extern nsIAtom** const kDefaultAllowedTags [74]; +extern nsIAtom** const kDefaultAllowedAttributes [76]; The size of the arrays shouldn't need to be declared here, I'd hate to have to keep those in sync with the actual lists. How about loosing the size declarations and the code that depends on it, and null terminating the lists instead? r- based on that, but if that's not an option I could be swayed the other way :)
Attachment #268836 -
Flags: superreview?(jst)
Attachment #268836 -
Flags: superreview-
Attachment #268836 -
Flags: review?(jst)
Attachment #268836 -
Flags: review-
Assignee | ||
Comment 3•17 years ago
|
||
Attachment #268836 -
Attachment is obsolete: true
Attachment #268860 -
Flags: superreview?
Attachment #268860 -
Flags: review?
Assignee | ||
Updated•17 years ago
|
Attachment #268860 -
Flags: superreview?(jst)
Attachment #268860 -
Flags: superreview?
Attachment #268860 -
Flags: review?(jst)
Attachment #268860 -
Flags: review?
Reporter | ||
Comment 4•17 years ago
|
||
Comment on attachment 268860 [details] [diff] [review] null terminate +nsIAtom** const kDefaultAllowedTags [] = { + &nsGkAtoms::a, + &nsGkAtoms::abbr, [...] + &nsGkAtoms::var, + '\0' +}; Use nsnull instead of '\0' here, and in kDefaultAllowedAttributes. r+sr=jst
Attachment #268860 -
Flags: superreview?(jst)
Attachment #268860 -
Flags: superreview+
Attachment #268860 -
Flags: review?(jst)
Attachment #268860 -
Flags: review+
Assignee | ||
Comment 5•17 years ago
|
||
Checked in. This did reduce codesize.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•17 years ago
|
Flags: in-testsuite-
Updated•17 years ago
|
Flags: wanted1.9+
Whiteboard: [wanted-1.9]
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•