Backed out changeset 50d5710ae6c0 (bug 1389650) for eslint failure at browser/modules/PluginContent.jsm:684: 'contentWindow' is assigned a value but never used. r=backout

This commit is contained in:
Sebastian Hengst 2017-09-26 10:48:27 +02:00
parent 5ed0b93c50
commit b3d9e88e3d
4 changed files with 11 additions and 11 deletions

View File

@ -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;

View File

@ -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,

View File

@ -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).

View File

@ -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);