Bug 1387678 - Call elementsFromPoint on the correct document node; r?ato draft
authorDavid Burns <dburns@mozilla.com>
Sat, 28 Apr 2018 00:24:58 +0100
changeset 801164 01157e7f5fa6d6fd8a96e1611d2794f2ada17cb3
parent 801163 5b9e4b3adc7d407c6db78bae85e5f42a15681b33
child 801165 da48b40ae5f2294a7599eb7135e4c8ec7f909c7e
push id111602
push userbmo:dburns@mozilla.com
push dateTue, 29 May 2018 22:11:56 +0000
reviewersato
bugs1387678
milestone62.0a1
Bug 1387678 - Call elementsFromPoint on the correct document node; r?ato elementsFromPoint will return the top level element of a shadow DOM and not the elements within. If we are on the top level document we need to make sure to use the correct rootNode. MozReview-Commit-ID: ATvCidAFEeM
testing/marionette/element.js
--- a/testing/marionette/element.js
+++ b/testing/marionette/element.js
@@ -1201,17 +1201,17 @@ element.getPointerInteractablePaintTree 
   if (rects.length == 0) {
     return [];
   }
 
   // step 4
   let centre = element.getInViewCentrePoint(rects[0], win);
 
   // step 5
-  return doc.elementsFromPoint(centre.x, centre.y);
+  return rootNode.elementsFromPoint(centre.x, centre.y);
 };
 
 // TODO(ato): Not implemented.
 // In fact, it's not defined in the spec.
 element.isKeyboardInteractable = () => true;
 
 /**
  * Attempts to scroll into view |el|.