зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1455674 part 16. Remove most use of nsIDOMElement in dom. r=qdot
This commit is contained in:
Родитель
21f3e98292
Коммит
25aa42d9a4
|
@ -6,7 +6,7 @@
|
|||
|
||||
/*
|
||||
* Base class for all element classes; this provides an implementation
|
||||
* of DOM Core's nsIDOMElement, implements nsIContent, provides
|
||||
* of DOM Core's Element, implements nsIContent, provides
|
||||
* utility methods for subclasses, and so forth.
|
||||
*/
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
/*
|
||||
* Base class for all element classes; this provides an implementation
|
||||
* of DOM Core's nsIDOMElement, implements nsIContent, provides
|
||||
* of DOM Core's Element, implements nsIContent, provides
|
||||
* utility methods for subclasses, and so forth.
|
||||
*/
|
||||
|
||||
|
@ -18,7 +18,6 @@
|
|||
#include "mozilla/EventStates.h" // for member
|
||||
#include "mozilla/ServoTypes.h"
|
||||
#include "mozilla/dom/DirectionalityUtils.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsILinkHandler.h"
|
||||
#include "nsINodeList.h"
|
||||
#include "nsNodeUtils.h"
|
||||
|
|
|
@ -5,9 +5,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
/*
|
||||
* Base class for all element classes; this provides an implementation
|
||||
* of DOM Core's nsIDOMElement, implements nsIContent, provides
|
||||
* utility methods for subclasses, and so forth.
|
||||
* Base class for all element classes and DocumentFragment.
|
||||
*/
|
||||
|
||||
#include "mozilla/ArrayUtils.h"
|
||||
|
|
|
@ -70,8 +70,8 @@ private:
|
|||
};
|
||||
|
||||
/**
|
||||
* A generic base class for DOM elements, implementing many nsIContent,
|
||||
* nsIDOMNode and nsIDOMElement methods.
|
||||
* A generic base class for DOM elements and document fragments,
|
||||
* implementing many nsIContent, nsIDOMNode and Element methods.
|
||||
*/
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#include "nsEscape.h"
|
||||
#include "nsXBLPrototypeBinding.h"
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
|
||||
#include <map>
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIPrincipal.h"
|
||||
#include "mozilla/dom/ContentChild.h"
|
||||
#include "mozilla/dom/ContentParent.h"
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
#include "nsContentPolicy.h"
|
||||
#include "nsIURI.h"
|
||||
#include "nsIDocShell.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsIDOMWindow.h"
|
||||
#include "nsITabChild.h"
|
||||
|
|
|
@ -134,7 +134,6 @@
|
|||
#include "nsIDocumentEncoder.h"
|
||||
#include "nsIDOMChromeWindow.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsIDOMWindowUtils.h"
|
||||
#include "nsIDragService.h"
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
#include "nsPIDOMWindow.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIHTMLDocument.h"
|
||||
#include "nsGkAtoms.h"
|
||||
|
|
|
@ -113,7 +113,6 @@
|
|||
|
||||
#include "nsIDOMWindow.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsFocusManager.h"
|
||||
|
||||
// for radio group stuff
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
#include "nsIContentSerializer.h"
|
||||
#include "mozilla/Encoding.h"
|
||||
#include "nsIOutputStream.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsRange.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsGkAtoms.h"
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
#include "nsIContentParent.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsIDOMChromeWindow.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMRange.h"
|
||||
#include "nsIHTMLDocument.h"
|
||||
|
|
|
@ -64,7 +64,7 @@ public:
|
|||
|
||||
/**
|
||||
* A faster version of nsIFocusManager::GetFocusedElement, returning a
|
||||
* raw Element pointer (instead of having AddRef-ed nsIDOMElement
|
||||
* raw Element pointer (instead of having AddRef-ed Element
|
||||
* pointer filled in to an out-parameter).
|
||||
*/
|
||||
mozilla::dom::Element* GetFocusedElement() { return mFocusedElement; }
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
#include "nsGlobalWindowCommands.h"
|
||||
|
||||
#include "nsIComponentManager.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIInterfaceRequestor.h"
|
||||
#include "nsIInterfaceRequestorUtils.h"
|
||||
#include "nsCRT.h"
|
||||
|
|
|
@ -111,7 +111,6 @@
|
|||
#include "nsIDocument.h"
|
||||
#include "Crypto.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDOMOfflineResourceList.h"
|
||||
#include "nsDOMString.h"
|
||||
#include "nsIEmbeddingSiteWindow.h"
|
||||
|
@ -4974,28 +4973,6 @@ nsGlobalWindowInner::GetDefaultComputedStyle(Element& aElt,
|
|||
return GetComputedStyleHelper(aElt, aPseudoElt, true, aError);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsGlobalWindowInner::GetComputedStyleHelper(nsIDOMElement* aElt,
|
||||
const nsAString& aPseudoElt,
|
||||
bool aDefaultStylesOnly,
|
||||
nsICSSDeclaration** aReturn)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aReturn);
|
||||
*aReturn = nullptr;
|
||||
|
||||
nsCOMPtr<dom::Element> element = do_QueryInterface(aElt);
|
||||
if (!element) {
|
||||
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
|
||||
}
|
||||
|
||||
ErrorResult rv;
|
||||
nsCOMPtr<nsICSSDeclaration> cs =
|
||||
GetComputedStyleHelper(*element, aPseudoElt, aDefaultStylesOnly, rv);
|
||||
cs.forget(aReturn);
|
||||
|
||||
return rv.StealNSResult();
|
||||
}
|
||||
|
||||
already_AddRefed<nsICSSDeclaration>
|
||||
nsGlobalWindowInner::GetComputedStyleHelper(Element& aElt,
|
||||
const nsAString& aPseudoElt,
|
||||
|
|
|
@ -1241,10 +1241,6 @@ protected:
|
|||
const nsAString& aPseudoElt,
|
||||
bool aDefaultStylesOnly,
|
||||
mozilla::ErrorResult& aError);
|
||||
nsresult GetComputedStyleHelper(nsIDOMElement* aElt,
|
||||
const nsAString& aPseudoElt,
|
||||
bool aDefaultStylesOnly,
|
||||
nsICSSDeclaration** aReturn);
|
||||
|
||||
nsGlobalWindowInner* InnerForSetTimeoutOrInterval(mozilla::ErrorResult& aError);
|
||||
|
||||
|
|
|
@ -108,7 +108,6 @@
|
|||
#include "nsIDocument.h"
|
||||
#include "Crypto.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDOMOfflineResourceList.h"
|
||||
#include "nsDOMString.h"
|
||||
#include "nsIEmbeddingSiteWindow.h"
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
|
||||
#include "nsHTMLContentSerializer.h"
|
||||
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsElementTable.h"
|
||||
|
|
|
@ -94,7 +94,6 @@ class nsIDocShellTreeItem;
|
|||
class nsIDocumentEncoder;
|
||||
class nsIDocumentObserver;
|
||||
class nsIDOMDocument;
|
||||
class nsIDOMElement;
|
||||
class nsIHTMLCollection;
|
||||
class nsILayoutHistoryState;
|
||||
class nsILoadContext;
|
||||
|
|
|
@ -42,7 +42,6 @@ class nsDOMAttributeMap;
|
|||
class nsIAnimationObserver;
|
||||
class nsIContent;
|
||||
class nsIDocument;
|
||||
class nsIDOMElement;
|
||||
class nsIFrame;
|
||||
class nsIMutationObserver;
|
||||
class nsINode;
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
#include "nsIScriptContext.h"
|
||||
#include "nsIClassInfo.h"
|
||||
#include "nsIDocShell.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsCOMArray.h"
|
||||
#include "nsIRunnable.h"
|
||||
#include "nsIGlobalObject.h"
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
|
||||
#include "nsXHTMLContentSerializer.h"
|
||||
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsElementTable.h"
|
||||
|
|
|
@ -134,8 +134,7 @@ function test4() {
|
|||
'<child xmlns:b="ns2" xmlns:a="ns3">'+
|
||||
'<child2/></child></root>');
|
||||
root = doc.documentElement;
|
||||
// Have to QI here -- no classinfo flattening in xpcshell, apparently
|
||||
var node = root.firstChild.firstChild.QueryInterface(nsIDOMElement);
|
||||
var node = root.firstChild.firstChild;
|
||||
node.setAttributeNS("ns4", "l1", "v1");
|
||||
node.setAttributeNS("ns4", "p2:l2", "v2");
|
||||
node.setAttributeNS("", "l3", "v3");
|
||||
|
@ -251,8 +250,7 @@ function test7() {
|
|||
'<child1 xmlns=""><child2/></child1></root>')
|
||||
root = doc.documentElement;
|
||||
|
||||
// No interface flattening in xpcshell
|
||||
var child1 = root.firstChild.QueryInterface(nsIDOMElement);
|
||||
var child1 = root.firstChild;
|
||||
child1.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns",
|
||||
"http://www.w3.org/1999/xhtml");
|
||||
do_check_serialize(doc);
|
||||
|
@ -265,9 +263,8 @@ function test7() {
|
|||
'<child2 xmlns="http://www.w3.org/1999/xhtml"></child2>' +
|
||||
'</child1></root>')
|
||||
root = doc.documentElement;
|
||||
// No interface flattening in xpcshell
|
||||
child1 = root.firstChild.QueryInterface(nsIDOMElement);
|
||||
var child2 = child1.firstChild.QueryInterface(nsIDOMElement);
|
||||
child1 = root.firstChild;
|
||||
var child2 = child1.firstChild;
|
||||
child1.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns",
|
||||
"http://www.w3.org/1999/xhtml");
|
||||
child2.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns", "");
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
#include "nsTArray.h"
|
||||
#include "nsIVariant.h"
|
||||
#include "nsIPrincipal.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDragService.h"
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
|
||||
|
|
|
@ -3353,13 +3353,10 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext,
|
|||
}
|
||||
|
||||
if (activeContent) {
|
||||
// The nearest enclosing element goes into the
|
||||
// :active state. If we fail the QI to DOMElement,
|
||||
// then we know we're only a node, and that we need
|
||||
// to obtain our parent element and put it into :active
|
||||
// instead.
|
||||
nsCOMPtr<nsIDOMElement> elt(do_QueryInterface(activeContent));
|
||||
if (!elt) {
|
||||
// The nearest enclosing element goes into the :active state. If
|
||||
// we're not an element (so we're text or something) we need to obtain
|
||||
// our parent element and put it into :active instead.
|
||||
if (!activeContent->IsElement()) {
|
||||
nsIContent* par = activeContent->GetParent();
|
||||
if (par)
|
||||
activeContent = par;
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include "nsIContentPolicy.h"
|
||||
#include "nsContentPolicyUtils.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsError.h"
|
||||
#include "nsURILoader.h"
|
||||
#include "nsIDocShell.h"
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
|
||||
#include "nsComponentManagerUtils.h"
|
||||
#include "nsFrameLoader.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIMozBrowserFrame.h"
|
||||
#include "nsINode.h"
|
||||
#include "nsIPrincipal.h"
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
#include "nsIPresShell.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsIDOMNode.h" // for Find
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsDOMString.h"
|
||||
#include "nsIStreamListener.h"
|
||||
|
|
|
@ -54,7 +54,6 @@
|
|||
#include "nsIContent.h"
|
||||
#include "nsIDocShell.h"
|
||||
#include "nsIDocShellTreeOwner.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDOMWindow.h"
|
||||
#include "nsIDOMWindowUtils.h"
|
||||
#include "nsIInterfaceRequestorUtils.h"
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
#include "nsIDocument.h"
|
||||
#include "nsIXPConnect.h"
|
||||
#include "xpcpublic.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsPluginInstanceOwner.h"
|
||||
#include "nsWrapperCacheInlines.h"
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#include "nsPluginsDir.h"
|
||||
#include "nsPluginLogging.h"
|
||||
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsGlobalWindow.h"
|
||||
#include "nsIDocument.h"
|
||||
|
@ -38,7 +37,9 @@
|
|||
#include "nsIPrincipal.h"
|
||||
#include "nsWildCard.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/dom/ScriptSettings.h"
|
||||
#include "mozilla/dom/ToJSValue.h"
|
||||
#include "nsIXULRuntime.h"
|
||||
#include "nsIXPConnect.h"
|
||||
|
||||
|
@ -713,7 +714,7 @@ _getpluginelement(NPP npp)
|
|||
if (!inst)
|
||||
return nullptr;
|
||||
|
||||
nsCOMPtr<nsIDOMElement> element;
|
||||
RefPtr<dom::Element> element;
|
||||
inst->GetDOMElement(getter_AddRefs(element));
|
||||
|
||||
if (!element)
|
||||
|
@ -733,10 +734,16 @@ _getpluginelement(NPP npp)
|
|||
nsCOMPtr<nsIXPConnect> xpc(do_GetService(nsIXPConnect::GetCID()));
|
||||
NS_ENSURE_TRUE(xpc, nullptr);
|
||||
|
||||
JS::RootedObject obj(cx);
|
||||
xpc->WrapNative(cx, ::JS::CurrentGlobalOrNull(cx), element,
|
||||
NS_GET_IID(nsIDOMElement), obj.address());
|
||||
NS_ENSURE_TRUE(obj, nullptr);
|
||||
JS::RootedValue val(cx);
|
||||
if (!ToJSValue(cx, element, &val)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (NS_WARN_IF(!val.isObject())) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
JS::RootedObject obj(cx, &val.toObject());
|
||||
|
||||
return nsJSObjWrapper::GetNewOrUsed(npp, obj);
|
||||
}
|
||||
|
@ -1451,18 +1458,13 @@ _getvalue(NPP npp, NPNVariable variable, void *result)
|
|||
return NPERR_GENERIC_ERROR;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMElement> element;
|
||||
RefPtr<dom::Element> element;
|
||||
inst->GetDOMElement(getter_AddRefs(element));
|
||||
if (!element) {
|
||||
return NPERR_GENERIC_ERROR;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIContent> content(do_QueryInterface(element));
|
||||
if (!content) {
|
||||
return NPERR_GENERIC_ERROR;
|
||||
}
|
||||
|
||||
nsIPrincipal* principal = content->NodePrincipal();
|
||||
nsIPrincipal* principal = element->NodePrincipal();
|
||||
|
||||
nsAutoString utf16Origin;
|
||||
res = nsContentUtils::GetUTFOrigin(principal, utf16Origin);
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
#include "nsPluginInstanceOwner.h"
|
||||
|
||||
#include "nsThreadUtils.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDocShell.h"
|
||||
#include "nsIScriptGlobalObject.h"
|
||||
|
@ -33,6 +32,7 @@
|
|||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/Unused.h"
|
||||
#include "nsILoadContext.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/dom/HTMLObjectElementBinding.h"
|
||||
#include "AudioChannelService.h"
|
||||
|
||||
|
@ -1088,7 +1088,7 @@ nsNPAPIPluginInstance::ConvertPoint(double sourceX, double sourceY, NPCoordinate
|
|||
}
|
||||
|
||||
nsresult
|
||||
nsNPAPIPluginInstance::GetDOMElement(nsIDOMElement* *result)
|
||||
nsNPAPIPluginInstance::GetDOMElement(Element** result)
|
||||
{
|
||||
if (!mOwner) {
|
||||
*result = nullptr;
|
||||
|
|
|
@ -31,6 +31,12 @@ class nsIPluginInstanceOwner;
|
|||
class nsIOutputStream;
|
||||
class nsPluginInstanceOwner;
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
class Element;
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
#if defined(OS_WIN)
|
||||
const NPDrawingModel kDefaultDrawingModel = NPDrawingModelSyncWin;
|
||||
#elif defined(MOZ_X11)
|
||||
|
@ -190,7 +196,7 @@ public:
|
|||
|
||||
nsresult IsPrivateBrowsing(bool *aEnabled);
|
||||
|
||||
nsresult GetDOMElement(nsIDOMElement* *result);
|
||||
nsresult GetDOMElement(mozilla::dom::Element* *result);
|
||||
|
||||
nsNPAPITimer* TimerWithID(uint32_t id, uint32_t* index);
|
||||
uint32_t ScheduleTimer(uint32_t interval, NPBool repeat, void (*timerFunc)(NPP npp, uint32_t timerID));
|
||||
|
|
|
@ -52,6 +52,7 @@
|
|||
#include "nsPluginStreamListenerPeer.h"
|
||||
#include "mozilla/dom/ContentChild.h"
|
||||
#include "mozilla/dom/ContentParent.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/dom/FakePluginTagInitBinding.h"
|
||||
#include "mozilla/ClearOnShutdown.h"
|
||||
#include "mozilla/LoadInfo.h"
|
||||
|
@ -70,7 +71,6 @@
|
|||
|
||||
// for the dialog
|
||||
#include "nsIWindowWatcher.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDOMWindow.h"
|
||||
|
||||
#include "nsNetCID.h"
|
||||
|
@ -3297,15 +3297,14 @@ nsresult nsPluginHost::NewPluginURLStream(const nsString& aURL,
|
|||
rv = listenerPeer->Initialize(url, aInstance, aListener);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsIDOMElement> element;
|
||||
RefPtr<dom::Element> element;
|
||||
nsCOMPtr<nsIDocument> doc;
|
||||
if (owner) {
|
||||
owner->GetDOMElement(getter_AddRefs(element));
|
||||
owner->GetDocument(getter_AddRefs(doc));
|
||||
}
|
||||
|
||||
nsCOMPtr<nsINode> requestingNode(do_QueryInterface(element));
|
||||
NS_ENSURE_TRUE(requestingNode, NS_ERROR_FAILURE);
|
||||
NS_ENSURE_TRUE(element, NS_ERROR_FAILURE);
|
||||
|
||||
nsCOMPtr<nsIChannel> channel;
|
||||
// @arg loadgroup:
|
||||
|
@ -3314,7 +3313,7 @@ nsresult nsPluginHost::NewPluginURLStream(const nsString& aURL,
|
|||
// form |nsDocShell::OnLinkClickSync| bug 166613
|
||||
rv = NS_NewChannel(getter_AddRefs(channel),
|
||||
url,
|
||||
requestingNode,
|
||||
element,
|
||||
nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_INHERITS |
|
||||
nsILoadInfo::SEC_FORCE_INHERIT_PRINCIPAL,
|
||||
nsIContentPolicy::TYPE_OBJECT_SUBREQUEST,
|
||||
|
@ -3857,7 +3856,7 @@ nsPluginHost::PluginCrashed(nsNPAPIPlugin* aPlugin,
|
|||
if (instance->GetPlugin() == aPlugin) {
|
||||
// notify the content node (nsIObjectLoadingContent) that the
|
||||
// plugin has crashed
|
||||
nsCOMPtr<nsIDOMElement> domElement;
|
||||
RefPtr<dom::Element> domElement;
|
||||
instance->GetDOMElement(getter_AddRefs(domElement));
|
||||
nsCOMPtr<nsIObjectLoadingContent> objectContent(do_QueryInterface(domElement));
|
||||
if (objectContent) {
|
||||
|
@ -3952,7 +3951,7 @@ nsPluginHost::DestroyRunningInstances(nsPluginTag* aPluginTag)
|
|||
nsPluginTag* pluginTag = TagForPlugin(instance->GetPlugin());
|
||||
instance->SetWindow(nullptr);
|
||||
|
||||
nsCOMPtr<nsIDOMElement> domElement;
|
||||
RefPtr<dom::Element> domElement;
|
||||
instance->GetDOMElement(getter_AddRefs(domElement));
|
||||
nsCOMPtr<nsIObjectLoadingContent> objectContent =
|
||||
do_QueryInterface(domElement);
|
||||
|
|
|
@ -52,6 +52,7 @@ using mozilla::DefaultXDisplay;
|
|||
#include "mozilla/MouseEvents.h"
|
||||
#include "mozilla/TextEvents.h"
|
||||
#include "mozilla/dom/DragEvent.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/dom/Event.h"
|
||||
#include "mozilla/dom/HTMLObjectElementBinding.h"
|
||||
#include "mozilla/dom/TabChild.h"
|
||||
|
@ -387,7 +388,7 @@ void nsPluginInstanceOwner::GetAttributes(nsTArray<MozPluginParameter>& attribut
|
|||
loadingContent->GetPluginAttributes(attributes);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsPluginInstanceOwner::GetDOMElement(nsIDOMElement* *result)
|
||||
NS_IMETHODIMP nsPluginInstanceOwner::GetDOMElement(Element** result)
|
||||
{
|
||||
return CallQueryReferent(mContent.get(), result);
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@ class gfxContext;
|
|||
namespace mozilla {
|
||||
class TextComposition;
|
||||
namespace dom {
|
||||
class Element;
|
||||
class Event;
|
||||
struct MozPluginParameter;
|
||||
} // namespace dom
|
||||
|
@ -95,7 +96,7 @@ public:
|
|||
* @param aDOMElement - resulting DOM element
|
||||
* @result - NS_OK if this operation was successful
|
||||
*/
|
||||
NS_IMETHOD GetDOMElement(nsIDOMElement* * aResult);
|
||||
NS_IMETHOD GetDOMElement(mozilla::dom::Element** aResult);
|
||||
|
||||
// nsIDOMEventListener interfaces
|
||||
NS_DECL_NSIDOMEVENTLISTENER
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
#include "nsPluginStreamListenerPeer.h"
|
||||
#include "nsIContentPolicy.h"
|
||||
#include "nsContentPolicyUtils.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIStreamConverterService.h"
|
||||
#include "nsIStreamLoader.h"
|
||||
#include "nsIHttpChannel.h"
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#include "nsNPAPIPluginInstance.h"
|
||||
#include "nsPluginInstanceOwner.h"
|
||||
#include "nsFocusManager.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#ifdef MOZ_X11
|
||||
#include "gfxXlibSurface.h"
|
||||
#endif
|
||||
|
@ -2222,11 +2221,10 @@ PluginInstanceParent::AnswerPluginFocusChange(const bool& gotFocus)
|
|||
nsPluginInstanceOwner* owner = GetOwner();
|
||||
if (owner) {
|
||||
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||
nsCOMPtr<nsIDOMElement> element;
|
||||
RefPtr<dom::Element> element;
|
||||
owner->GetDOMElement(getter_AddRefs(element));
|
||||
if (fm && element) {
|
||||
nsCOMPtr<dom::Element> domElement(do_QueryInterface(element));
|
||||
fm->SetFocus(domElement, 0);
|
||||
fm->SetFocus(element, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include "mozilla/dom/ContentChild.h"
|
||||
#include "mozilla/ipc/CrashReporterClient.h"
|
||||
#include "mozilla/ipc/CrashReporterHost.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/ipc/GeckoChildProcessHost.h"
|
||||
#include "mozilla/ipc/MessageChannel.h"
|
||||
#include "mozilla/ipc/ProtocolUtils.h"
|
||||
|
@ -2472,10 +2473,10 @@ PluginModuleParent::NPP_NewInternal(NPMIMEType pluginType, NPP instance,
|
|||
// Any IPC messages for the PluginInstance actor should be dispatched to the
|
||||
// DocGroup for the plugin's document.
|
||||
RefPtr<nsPluginInstanceOwner> owner = parentInstance->GetOwner();
|
||||
nsCOMPtr<nsIDOMElement> elt;
|
||||
RefPtr<dom::Element> elt;
|
||||
owner->GetDOMElement(getter_AddRefs(elt));
|
||||
if (nsCOMPtr<nsINode> node = do_QueryInterface(elt)) {
|
||||
nsCOMPtr<nsIDocument> doc = node->OwnerDoc();
|
||||
if (elt) {
|
||||
nsCOMPtr<nsIDocument> doc = elt->OwnerDoc();
|
||||
if (doc) {
|
||||
nsCOMPtr<nsIEventTarget> eventTarget = doc->EventTargetFor(TaskCategory::Other);
|
||||
SetEventTargetForActor(parentInstance, eventTarget);
|
||||
|
|
|
@ -317,7 +317,7 @@ nsSMILTimedElement::GetTargetElement()
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMElementTimeControl methods
|
||||
// ElementTimeControl methods
|
||||
//
|
||||
// The definition of the ElementTimeControl interface differs between SMIL
|
||||
// Animation and SVG 1.1. In SMIL Animation all methods have a void return
|
||||
|
|
|
@ -63,7 +63,7 @@ public:
|
|||
mozilla::dom::Element* GetTargetElement();
|
||||
|
||||
/**
|
||||
* Methods for supporting the nsIDOMElementTimeControl interface.
|
||||
* Methods for supporting the ElementTimeControl interface.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
|
|
@ -32,10 +32,10 @@ var domWindowUtils = SpecialPowers.getDOMWindowUtils(window);
|
|||
|
||||
var gTests = [
|
||||
/*
|
||||
nsIDOMElement elementFromPoint(in long aX,
|
||||
in long aY,
|
||||
in boolean aIgnoreRootScrollFrame,
|
||||
in boolean aFlushLayout);
|
||||
Element elementFromPoint(in long aX,
|
||||
in long aY,
|
||||
in boolean aIgnoreRootScrollFrame,
|
||||
in boolean aFlushLayout);
|
||||
*/
|
||||
async function testElementFromPoint() {
|
||||
let onscreen = document.getElementById("onscreen");
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
#include "plstr.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsIContentInlines.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsIPresShell.h"
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#include "nsIInputStream.h"
|
||||
#include "nsNameSpaceManager.h"
|
||||
#include "nsIURI.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIURL.h"
|
||||
#include "nsIChannel.h"
|
||||
#include "nsString.h"
|
||||
|
@ -616,7 +615,8 @@ nsXBLService::AttachGlobalKeyHandler(EventTarget* aTarget)
|
|||
if (contentNode && contentNode->GetProperty(nsGkAtoms::listener))
|
||||
return NS_OK;
|
||||
|
||||
nsCOMPtr<nsIDOMElement> elt(do_QueryInterface(contentNode));
|
||||
Element* elt =
|
||||
contentNode && contentNode->IsElement() ? contentNode->AsElement() : nullptr;
|
||||
|
||||
// Create the key handler
|
||||
RefPtr<nsXBLWindowKeyHandler> handler =
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#include "nsIServiceManager.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsXBLDocumentInfo.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsFocusManager.h"
|
||||
#include "nsIURI.h"
|
||||
#include "nsNetUtil.h"
|
||||
|
@ -162,7 +161,7 @@ nsXBLWindowKeyHandler::EnsureSpecialDocInfo()
|
|||
sXBLSpecialDocInfo->LoadDocInfo();
|
||||
}
|
||||
|
||||
nsXBLWindowKeyHandler::nsXBLWindowKeyHandler(nsIDOMElement* aElement,
|
||||
nsXBLWindowKeyHandler::nsXBLWindowKeyHandler(Element* aElement,
|
||||
EventTarget* aTarget)
|
||||
: mTarget(aTarget),
|
||||
mHandler(nullptr),
|
||||
|
@ -953,7 +952,7 @@ nsXBLWindowKeyHandler::IsExecutableElement(Element* aElement) const
|
|||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
already_AddRefed<nsXBLWindowKeyHandler>
|
||||
NS_NewXBLWindowKeyHandler(nsIDOMElement* aElement, EventTarget* aTarget)
|
||||
NS_NewXBLWindowKeyHandler(Element* aElement, EventTarget* aTarget)
|
||||
{
|
||||
RefPtr<nsXBLWindowKeyHandler> result =
|
||||
new nsXBLWindowKeyHandler(aElement, aTarget);
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#include "nsIDOMEventListener.h"
|
||||
|
||||
class nsAtom;
|
||||
class nsIDOMElement;
|
||||
class nsXBLPrototypeHandler;
|
||||
|
||||
namespace mozilla {
|
||||
|
@ -35,7 +34,8 @@ class nsXBLWindowKeyHandler : public nsIDOMEventListener
|
|||
typedef mozilla::dom::KeyboardEvent KeyboardEvent;
|
||||
|
||||
public:
|
||||
nsXBLWindowKeyHandler(nsIDOMElement* aElement, mozilla::dom::EventTarget* aTarget);
|
||||
nsXBLWindowKeyHandler(mozilla::dom::Element* aElement,
|
||||
mozilla::dom::EventTarget* aTarget);
|
||||
|
||||
void InstallKeyboardEventListenersTo(
|
||||
EventListenerManager* aEventListenerManager);
|
||||
|
@ -138,7 +138,7 @@ protected:
|
|||
};
|
||||
|
||||
already_AddRefed<nsXBLWindowKeyHandler>
|
||||
NS_NewXBLWindowKeyHandler(nsIDOMElement* aElement,
|
||||
NS_NewXBLWindowKeyHandler(mozilla::dom::Element* aElement,
|
||||
mozilla::dom::EventTarget* aTarget);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
#include "nsIDocShell.h"
|
||||
#include "nsHTMLParts.h"
|
||||
#include "nsIComponentManager.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIBaseWindow.h"
|
||||
#include "nsIDOMWindow.h"
|
||||
#include "nsCOMPtr.h"
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
#include "nsIObserver.h"
|
||||
#include "nsSyncLoadService.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
#include "nsAtom.h"
|
||||
#include "nsIAttribute.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsINode.h"
|
||||
#include "nsPrintfCString.h"
|
||||
#include "nsReadableUtils.h"
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
#include "nsError.h"
|
||||
#include "nsIChannel.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIIOService.h"
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#include "nsFocusManager.h"
|
||||
#include "nsIControllers.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDOMWindow.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsPresContext.h"
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
#include "nsIContent.h"
|
||||
#include "nsICollation.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDOMXULCommandDispatcher.h"
|
||||
#include "nsIRDFService.h"
|
||||
#include "nsIServiceManager.h"
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#include "nsString.h"
|
||||
|
||||
#include "nsIControllers.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsXULControllers.h"
|
||||
#include "nsIController.h"
|
||||
|
||||
|
|
|
@ -650,11 +650,6 @@ protected:
|
|||
// Implementation methods
|
||||
nsresult EnsureContentsGenerated(void) const;
|
||||
|
||||
nsresult ExecuteOnBroadcastHandler(nsIDOMElement* anElement, const nsAString& attrName);
|
||||
|
||||
static nsresult
|
||||
ExecuteJSCode(nsIDOMElement* anElement, mozilla::WidgetEvent* aEvent);
|
||||
|
||||
// Helper routine that crawls a parent chain looking for a tree element.
|
||||
NS_IMETHOD GetParentTree(nsIDOMXULMultiSelectControlElement** aTreeElement);
|
||||
|
||||
|
|
|
@ -220,7 +220,6 @@ nsXULPopupListener::FireFocusOnTargetContent(nsIDOMNode* aTargetNode, bool aIsTo
|
|||
nsCOMPtr<nsIContent> content = do_QueryInterface(aTargetNode);
|
||||
nsCOMPtr<nsIDocument> doc = content->OwnerDoc();
|
||||
|
||||
// Get nsIDOMElement for targetNode
|
||||
// strong reference to keep this from going away between events
|
||||
// XXXbz between what events? We don't use this local at all!
|
||||
RefPtr<nsPresContext> context = doc->GetPresContext();
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#include "nsCOMPtr.h"
|
||||
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDOMEventListener.h"
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsGkAtoms.h"
|
||||
|
|
Загрузка…
Ссылка в новой задаче