diff --git a/html/dom/render-blocking/remove-attr-script-keeps-blocking.tentative.html b/html/dom/render-blocking/remove-attr-script-keeps-blocking.tentative.html new file mode 100644 index 00000000000000..be955366ba9ea8 --- /dev/null +++ b/html/dom/render-blocking/remove-attr-script-keeps-blocking.tentative.html @@ -0,0 +1,25 @@ + +Synchronous script element still blocks rendering after removing `blocking=render` + + + + + + + diff --git a/html/dom/render-blocking/remove-attr-style-keeps-blocking.tentative.html b/html/dom/render-blocking/remove-attr-style-keeps-blocking.tentative.html new file mode 100644 index 00000000000000..54d45b4dee0278 --- /dev/null +++ b/html/dom/render-blocking/remove-attr-style-keeps-blocking.tentative.html @@ -0,0 +1,28 @@ + +Parser-inserted style element still blocks rendering after removing `blocking=render` + + + + + + + + +
Some text
diff --git a/html/dom/render-blocking/remove-attr-stylesheet-link-keeps-blocking.tentative.html b/html/dom/render-blocking/remove-attr-stylesheet-link-keeps-blocking.tentative.html new file mode 100644 index 00000000000000..9fcf2684746638 --- /dev/null +++ b/html/dom/render-blocking/remove-attr-stylesheet-link-keeps-blocking.tentative.html @@ -0,0 +1,27 @@ + +Parser-inserted stylesheet link still blocks rendering after removing `blocking=render` + + + + + + + + +
Some text
diff --git a/html/dom/render-blocking/support/test-render-blocking.js b/html/dom/render-blocking/support/test-render-blocking.js index 7fa2462046b02d..71d0d680966127 100644 --- a/html/dom/render-blocking/support/test-render-blocking.js +++ b/html/dom/render-blocking/support/test-render-blocking.js @@ -30,6 +30,22 @@ class LoadObserver { } } +// Observes the insertion of a script/parser-blocking element into DOM via +// MutationObserver, so that we can access the element before it's loaded. +function nodeInserted(parentNode, predicate) { + return new Promise(resolve => { + function callback(mutationList) { + for (let mutation of mutationList) { + for (let node of mutation.addedNodes) { + if (predicate(node)) + resolve(node); + } + } + } + new MutationObserver(callback).observe(parentNode, {childList: true}); + }); +} + function createAutofocusTarget() { const autofocusTarget = document.createElement('textarea'); autofocusTarget.setAttribute('autofocus', '');