Bug 1387678 - Check if element is passed in is actually an element; r?ato
When we traverse up a shadow DOM we pass in null as an indicator to
move upwards. We now check that it is really an element and if not
assume that it is null and move up the tree
MozReview-Commit-ID: AK9eOLFDAgB
--- a/testing/marionette/listener.js
+++ b/testing/marionette/listener.js
@@ -1322,17 +1322,17 @@ async function sendKeysToElement(el, val
/** Clear the text of an element. */
function clearElement(el) {
interaction.clearElement(el);
}
/** Switch the current context to the specified host's Shadow DOM. */
function switchToShadowRoot(el) {
- if (!el) {
+ if (!element.isElement(el)) {
// If no host element is passed, attempt to find a parent shadow
// root or, if none found, unset the current shadow root
if (curContainer.shadowRoot) {
let parent;
try {
parent = curContainer.shadowRoot.host;
} catch (e) {
// There is a chance that host element is dead and we are trying to