Bug 1409026 - Add missing break statement to find_. r?whimboo
MozReview-Commit-ID: 6T78WiNaqNU
--- 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(