Bug 1605381 - Handle missing root element in test-wait, r=maja_zf

Depends on D57995

Differential Revision: https://phabricator.services.mozilla.com/D57996

--HG--
extra : moz-landing-system : lando
This commit is contained in:
James Graham 2019-12-20 22:05:14 +00:00
parent 3d492f5489
commit 06c38cab2e

View File

@ -32,7 +32,8 @@ function wait_paints() {
}
function screenshot_if_ready() {
if (root.classList.contains("%(classname)s") &&
if (root &&
root.classList.contains("%(classname)s") &&
observer === null) {
observer = new MutationObserver(wait_paints);
observer.observe(root, {attributes: true});