Bug 1400256 - Add missing break statement to find_. r?whimboo draft
authorAndreas Tolfsen <ato@sny.no>
Thu, 05 Oct 2017 12:56:01 +0100
changeset 680840 c253d69de6d29203228ca75203cab2f62a20c72e
parent 680782 c6a2643362a67cdf7a87ac165454fce4b383debb
child 680841 98ad41aacc749e76e7713d465213d36295bf6300
push id84656
push userbmo:ato@sny.no
push dateMon, 16 Oct 2017 14:02:26 +0000
reviewerswhimboo
bugs1400256
milestone58.0a1
Bug 1400256 - 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(