diff --git a/browser/modules/PluginContent.jsm b/browser/modules/PluginContent.jsm index 9dcb266a3442..678369d7e3ec 100644 --- a/browser/modules/PluginContent.jsm +++ b/browser/modules/PluginContent.jsm @@ -175,7 +175,7 @@ PluginContent.prototype = { }, _getPluginInfo(pluginElement) { - if (ChromeUtils.getClassName(pluginElement) === "HTMLAnchorElement") { + if (pluginElement instanceof Ci.nsIDOMHTMLAnchorElement) { // Anchor elements are our place holders, and we only have them for Flash let pluginHost = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost); return { @@ -649,7 +649,7 @@ PluginContent.prototype = { let doc = plugin.ownerDocument; let pluginHost = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost); let permissionString; - if (ChromeUtils.getClassName(plugin) === "HTMLAnchorElement") { + if (plugin instanceof Ci.nsIDOMHTMLAnchorElement) { // We only have replacement content for Flash installs permissionString = pluginHost.getPermissionStringForType(FLASH_MIME_TYPE); } else { @@ -684,7 +684,7 @@ PluginContent.prototype = { let contentWindow = plugin.ownerGlobal.top; let overlay = this.getPluginUI(plugin, "main"); // Have to check that the target is not the link to update the plugin - if (!(ChromeUtils.getClassName(event.originalTarget) === "HTMLAnchorElement") && + if (!(event.originalTarget instanceof contentWindow.HTMLAnchorElement) && (event.originalTarget.getAttribute("anonid") != "closeIcon") && !overlay.hasAttribute("dismissed") && event.button == 0 && @@ -730,7 +730,7 @@ PluginContent.prototype = { } if (pluginInfo.permissionString == pluginHost.getPermissionStringForType(plugin.actualType)) { let overlay = this.getPluginUI(plugin, "main"); - if (ChromeUtils.getClassName(plugin) === "HTMLAnchorElement") { + if (plugin instanceof Ci.nsIDOMHTMLAnchorElement) { placeHolderFound = true; } else { pluginFound = true; diff --git a/dom/browser-element/BrowserElementChildPreload.js b/dom/browser-element/BrowserElementChildPreload.js index 5c24b2b5827c..fc796ea71535 100644 --- a/dom/browser-element/BrowserElementChildPreload.js +++ b/dom/browser-element/BrowserElementChildPreload.js @@ -666,7 +666,7 @@ BrowserElementChild.prototype = { _ClickHandler: function(e) { let isHTMLLink = node => - ((ChromeUtils.getClassName(node) === "HTMLAnchorElement" && node.href) || + ((node instanceof Ci.nsIDOMHTMLAnchorElement && node.href) || (node instanceof Ci.nsIDOMHTMLAreaElement && node.href) || node instanceof Ci.nsIDOMHTMLLinkElement); @@ -855,7 +855,7 @@ BrowserElementChild.prototype = { _getSystemCtxMenuData: function(elem) { let documentURI = docShell.QueryInterface(Ci.nsIWebNavigation).currentURI.spec; - if ((ChromeUtils.getClassName(elem) === "HTMLAnchorElement" && elem.href) || + if ((elem instanceof Ci.nsIDOMHTMLAnchorElement && elem.href) || (elem instanceof Ci.nsIDOMHTMLAreaElement && elem.href)) { return {uri: elem.href, documentURI: documentURI, diff --git a/dom/ipc/remote-test.js b/dom/ipc/remote-test.js index 58e2e74b2b95..dd21415cd740 100644 --- a/dom/ipc/remote-test.js +++ b/dom/ipc/remote-test.js @@ -26,7 +26,7 @@ var dshell = content.QueryInterface(Ci.nsIInterfaceRequestor) addEventListener("click", function(e) { dump(e.target + "\n"); - if (ChromeUtils.getClassName(e.target) === "HTMLAnchorElement" && + if (e.target instanceof Components.interfaces.nsIDOMHTMLAnchorElement && dshell == docShell) { var retval = docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor). getInterface(Components.interfaces.nsIContentFrameMessageManager). diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js index 09956f92cc4c..db27d2da945a 100644 --- a/mobile/android/chrome/content/browser.js +++ b/mobile/android/chrome/content/browser.js @@ -2735,7 +2735,7 @@ var NativeWindow = { */ _getContextType: function(element) { // For anchor nodes, we try to use the scheme to pick a string - if (ChromeUtils.getClassName(element) === "HTMLAnchorElement") { + if (element instanceof Ci.nsIDOMHTMLAnchorElement) { let uri = this.makeURI(this._getLinkURL(element)); try { return Strings.browser.GetStringFromName("browser.menu.context." + uri.scheme); @@ -2820,7 +2820,7 @@ var NativeWindow = { // Returns a url associated with a node _getUrl: function(node) { - if ((ChromeUtils.getClassName(node) === "HTMLAnchorElement" && node.href) || + if ((node instanceof Ci.nsIDOMHTMLAnchorElement && node.href) || (node instanceof Ci.nsIDOMHTMLAreaElement && node.href)) { return this._getLinkURL(node); } else if (node instanceof Ci.nsIImageLoadingContent && node.currentURI) { @@ -3051,7 +3051,7 @@ var NativeWindow = { _getLink: function(aElement) { if (aElement.nodeType == Ci.nsIDOMNode.ELEMENT_NODE && - ((ChromeUtils.getClassName(aElement) === "HTMLAnchorElement" && aElement.href) || + ((aElement instanceof Ci.nsIDOMHTMLAnchorElement && aElement.href) || (aElement instanceof Ci.nsIDOMHTMLAreaElement && aElement.href) || aElement instanceof Ci.nsIDOMHTMLLinkElement || aElement.getAttributeNS(kXLinkNamespace, "type") == "simple")) { @@ -4775,7 +4775,7 @@ var BrowserEventHandler = { _getLinkURI: function(aElement) { if (aElement.nodeType == Ci.nsIDOMNode.ELEMENT_NODE && - ((ChromeUtils.getClassName(aElement) === "HTMLAnchorElement" && aElement.href) || + ((aElement instanceof Ci.nsIDOMHTMLAnchorElement && aElement.href) || (aElement instanceof Ci.nsIDOMHTMLAreaElement && aElement.href))) { try { return Services.io.newURI(aElement.href);