From 2b020e9bbbc54f9c1bb44ef94a8e4382ca0a6558 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 13 Mar 2018 00:59:23 -0400 Subject: Bug 1444231 - Fix QI implementation for FragmentOrElement. r=mccr8, a=RyanVM MozReview-Commit-ID: 9mPO2ezk2Y7 --HG-- extra : source : 060024fa93121d878d27f329c959757e6f71017a extra : intermediate-source : 925d5693c5a1a73806062947b18c98ed13efc6c3 --- dom/base/Element.cpp | 6 ++++++ dom/base/FragmentOrElement.cpp | 1 - 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'dom') diff --git a/dom/base/Element.cpp b/dom/base/Element.cpp index 9ced64c0d..8b9808aa3 100644 --- a/dom/base/Element.cpp +++ b/dom/base/Element.cpp @@ -183,6 +183,12 @@ Element::DoGetClasses() const NS_IMETHODIMP Element::QueryInterface(REFNSIID aIID, void** aInstancePtr) { + if (aIID.Equals(NS_GET_IID(Element))) { + NS_ADDREF_THIS(); + *aInstancePtr = this; + return NS_OK; + } + NS_ASSERTION(aInstancePtr, "QueryInterface requires a non-NULL destination!"); nsresult rv = FragmentOrElement::QueryInterface(aIID, aInstancePtr); diff --git a/dom/base/FragmentOrElement.cpp b/dom/base/FragmentOrElement.cpp index 79f6cff51..b22a0d4ff 100644 --- a/dom/base/FragmentOrElement.cpp +++ b/dom/base/FragmentOrElement.cpp @@ -1937,7 +1937,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END NS_INTERFACE_MAP_BEGIN(FragmentOrElement) NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY NS_INTERFACE_MAP_ENTRIES_CYCLE_COLLECTION(FragmentOrElement) - NS_INTERFACE_MAP_ENTRY(Element) NS_INTERFACE_MAP_ENTRY(nsIContent) NS_INTERFACE_MAP_ENTRY(nsINode) NS_INTERFACE_MAP_ENTRY(nsIDOMEventTarget) -- cgit v1.2.3