Closed
Bug 329192
Opened 19 years ago
Closed 19 years ago
[FIX]Use nsINode in nsEventListenerManager::CompileEventHandlerInternal
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
mozilla1.9alpha1
People
(Reporter: bzbarsky, Assigned: bzbarsky)
References
Details
Attachments
(1 file)
(deleted),
patch
|
sicking
:
review+
sicking
:
superreview+
|
Details | Diff | Splinter Review |
Can remove some code like:
1558 nsCOMPtr<nsIDocument> doc = do_QueryInterface(aCurrentTarget);
1559 if (!doc) {
1560 nsCOMPtr<nsIContent> content = do_QueryInterface(aCurrentTarget);
1561 if (content)
1562 doc = content->GetOwnerDoc();
1563 }
Assignee | ||
Comment 1•19 years ago
|
||
There're various other places in this file too (eg AddScriptEventListener).
Assignee | ||
Comment 2•19 years ago
|
||
Have a fix for this, but it depends on bug 335911.
Depends on: 335911
Assignee | ||
Comment 3•19 years ago
|
||
Attachment #220938 -
Flags: superreview?(bugmail)
Attachment #220938 -
Flags: review?(bugmail)
Assignee | ||
Updated•19 years ago
|
Summary: Use nsINode in nsEventListenerManager::CompileEventHandlerInternal → [FIX]Use nsINode in nsEventListenerManager::CompileEventHandlerInternal
Target Milestone: --- → mozilla1.9alpha
Comment on attachment 220938 [details] [diff] [review]
Patch
>Index: content/events/src/nsEventListenerManager.cpp
>@@ -1326,18 +1319,20 @@ nsEventListenerManager::AddScriptEventLi
...
>- if (content)
>+ if (node && node->IsNodeOfType(nsINode::eCONTENT)) {
>+ nsCOMPtr<nsIContent> content = do_QueryInterface(node);
> nameSpace = content->GetNameSpaceID();
>+ }
Just use NS_STATIC_CAST here IMHO. We rely elsewhere on that these interfaces are only implemented once per object. (in nsGenericHTMLElement::FromContent for example)
r+sr=me
Attachment #220938 -
Flags: superreview?(bugmail)
Attachment #220938 -
Flags: superreview+
Attachment #220938 -
Flags: review?(bugmail)
Attachment #220938 -
Flags: review+
Assignee | ||
Comment 5•19 years ago
|
||
Fixed, with that change.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
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
•