Bug 1253236 - Reuse element.isXULElement; r=automatedtester
authorAndreas Tolfsen <ato@mozilla.com>
Thu, 03 Mar 2016 14:21:45 +0000
changeset 286882 660bdaf643269e2c157224213b51faf3b7b93553
parent 286881 746ba7188bcfcb4f1c4906a83e0a5eb961cbee57
child 286883 bcc5851a45987beceab0db18233b8a605d40bc67
push id30056
push userryanvm@gmail.com
push dateSun, 06 Mar 2016 00:19:57 +0000
treeherderautoland@fcd55efa0672 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersautomatedtester
bugs1253236
milestone47.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 1253236 - Reuse element.isXULElement; r=automatedtester MozReview-Commit-ID: 7P02xsSLuCl
testing/marionette/element.js
--- a/testing/marionette/element.js
+++ b/testing/marionette/element.js
@@ -813,20 +813,18 @@ element.inViewport = function(el, x = un
  *     the target's bounding box.
  * @param {number=} y
  *     Vertical offset relative to target.  Defaults to the centre of
  *     the target's bounding box.
  */
 element.isVisible = function(el, x = undefined, y = undefined) {
   let win = el.ownerDocument.defaultView;
 
-  // Bug 1094246: Webdriver's isShown doesn't work with content xul
-  let ns = atom.getElementAttribute(el, "namespaceURI", win);
-  if (ns.indexOf("there.is.only.xul") < 0 &&
-      !atom.isElementDisplayed(el, win)) {
+  // Bug 1094246: webdriver's isShown doesn't work with content xul
+  if (!element.isXULElement(el) && !atom.isElementDisplayed(el, win)) {
     return false;
   }
 
   if (el.tagName.toLowerCase() == "body") {
     return true;
   }
 
   if (!element.inViewport(el, x, y)) {