HTMLStyleElement: blocking property
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
The blocking property of the HTMLStyleElement interface is a string indicating that certain operations should be blocked on the fetching of critical subresources.
It reflects the blocking attribute of the <style> element.
Value
A string. Must be a space-separated list of blocking tokens listed below indicating the operations that are to be blocked:
render-
The rendering of content on the screen is blocked.
Note: Only
styleelements in the document's<head>can possibly block rendering. By default, astyleelement in the<head>blocks rendering when the browser discovers it during parsing. If such astyleelement is added dynamically via script, you must additionally setblocking = "render"for it to block rendering.
Examples
<style id="el" blocking="render">
p {
color: blue;
}
</style>
const el = document.getElementById("el");
console.log(el.blocking); // Output: "render"
Specifications
| Specification |
|---|
| HTML> # dom-style-blocking> |
Browser compatibility
Loading…