Closed Bug 329192 Opened 19 years ago Closed 19 years ago

[FIX]Use nsINode in nsEventListenerManager::CompileEventHandlerInternal

Categories

(Core :: DOM: Core & HTML, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9alpha1

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

Attachments

(1 file)

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 }
There're various other places in this file too (eg AddScriptEventListener).
Have a fix for this, but it depends on bug 335911.
Depends on: 335911
Attached patch Patch (deleted) — Splinter Review
Attachment #220938 - Flags: superreview?(bugmail)
Attachment #220938 - Flags: review?(bugmail)
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+
Fixed, with that change.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: