Bug 1409026 - Add missing break statement to find_. r?whimboo draft
authorAndreas Tolfsen <ato@sny.no>
Thu, 05 Oct 2017 12:56:01 +0100
changeset 680888 2bd9c628ed6c4de0ac29c736547861483cc373a3
parent 680782 c6a2643362a67cdf7a87ac165454fce4b383debb
child 736001 222748e1fa27abfa632a2fdb69617dbb594e317e
push id84663
push userbmo:ato@sny.no
push dateMon, 16 Oct 2017 14:23:21 +0000
reviewerswhimboo
bugs1409026
milestone58.0a1
Bug 1409026 - Add missing break statement to find_. r?whimboo MozReview-Commit-ID: 6T78WiNaqNU
testing/marionette/element.js
--- a/testing/marionette/element.js
+++ b/testing/marionette/element.js
@@ -316,27 +316,28 @@ element.find = function(container, strat
 };
 
 function find_(container, strategy, selector, searchFn,
     {startNode = null, all = false} = {}) {
   let rootNode = container.shadowRoot || container.frame.document;
 
   if (!startNode) {
     switch (strategy) {
-      // For anonymous nodes the start node needs to be of type
-      // DOMElement, which will refer to :root in case of a DOMDocument.
+      // For anonymous nodes the default start node must be the
+      // document element, not XULDocument
       case element.Strategy.Anon:
       case element.Strategy.AnonAttribute:
         if (rootNode instanceof Ci.nsIDOMDocument) {
           startNode = rootNode.documentElement;
         }
         break;
 
       default:
         startNode = rootNode;
+        break;
     }
   }
 
   let res;
   try {
     res = searchFn(strategy, selector, rootNode, startNode);
   } catch (e) {
     throw new InvalidSelectorError(