Bug 1404277 - Retrieve namespaceURI as property and not attribute. r=ato
authorHenrik Skupin <mail@hskupin.info>
Fri, 29 Sep 2017 12:54:03 +0200
changeset 383889 65a1e4064a52ebd60ec55fdf0380405b97f78a8e
parent 383888 e900a3d074b81b7617e6a65bcd18a02450652990
child 383890 562b8f9ed39c21bbb30e75fdff6376ff18b3fd9e
push id52420
push userhskupin@mozilla.com
push dateSat, 30 Sep 2017 22:13:58 +0000
treeherderautoland@65a1e4064a52 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersato
bugs1404277
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1404277 - Retrieve namespaceURI as property and not attribute. r=ato With newer Selenium atoms which do not conflate attributes and properties, the retrieval via getElementAttribute will fail. By retrieving it directly as property will fix it. MozReview-Commit-ID: CFy3JZDeUWq
testing/marionette/element.js
--- a/testing/marionette/element.js
+++ b/testing/marionette/element.js
@@ -20,17 +20,19 @@ const {
 } = Cu.import("chrome://marionette/content/error.js", {});
 Cu.import("chrome://marionette/content/wait.js");
 
 const logger = Log.repository.getLogger("Marionette");
 
 this.EXPORTED_SYMBOLS = ["element"];
 
 const DOCUMENT_POSITION_DISCONNECTED = 1;
+
 const XMLNS = "http://www.w3.org/1999/xhtml";
+const XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
 
 const uuidGen = Cc["@mozilla.org/uuid-generator;1"]
     .getService(Ci.nsIUUIDGenerator);
 
 /**
  * This module provides shared functionality for dealing with DOM-
  * and web elements in Marionette.
  *
@@ -941,18 +943,17 @@ element.isKeyboardInteractable = functio
  */
 element.scrollIntoView = function(el) {
   if (el.scrollIntoView) {
     el.scrollIntoView({block: "end", inline: "nearest", behavior: "instant"});
   }
 };
 
 element.isXULElement = function(el) {
-  let ns = atom.getElementAttribute(el, "namespaceURI");
-  return ns.indexOf("there.is.only.xul") >= 0;
+  return el.namespaceURI === XULNS;
 };
 
 const boolEls = {
   audio: ["autoplay", "controls", "loop", "muted"],
   button: ["autofocus", "disabled", "formnovalidate"],
   details: ["open"],
   dialog: ["open"],
   fieldset: ["disabled"],