diff --git a/source b/source index 877761a9424..0e878d8a30a 100644 --- a/source +++ b/source @@ -4131,6 +4131,13 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
scrollend
eventDocumentOrShadowRoot
Interface Mixin:
+ The following features and terms are defined in CSS Syntax: @@ -18513,6 +18520,7 @@ people expect to have work and what is necessary.
media
blocking
specifier
title
attribute has special semantics on this element.The blocking
attribute is a blocking attribute.
The specifier
+ attribute defines an exportable specifier.
The title
attribute on style
elements defines
CSS style sheet sets. If the style
element
@@ -18831,7 +18844,76 @@ console.log(style.disabled); // false
+
The user agent must run the create a declarative CSS module script algorithm when + all of the following conditions are true:
+ +The element is popped off the stack of open elements of an HTML + parser or XML parser.
The element is not on the stack of open elements of an HTML + parser or XML parser, and it becomes connected.
The create a declarative CSS module script algorithm is as follows:
+ +Let element be the style
element.
If element is not connected, then return.
If element's type
attribute is not present
+ or its value is not an ASCII case-insensitive match for
+ "module
", then return.
If element's specifier
attribute
+ is not present or its value is an empty string, then return.
If the Should element's inline behavior be blocked by Content Security
+ Policy? algorithm returns "Blocked
" when executed upon the
+ style
element, "style
", and the style
+ element's child text content, then return. CSP
Let styleDataURI be the string "data:text/css,
"
+ appended with the result of running UTF-8 percent-encode
+ on the child text content of the style
element.
Create a JSON string jsonString with a single key of "imports
"
+ whose value is a single JSON string containing a module specifier map with a key consisting
+ of the value of the specifier attribute and a value of
+ styleDataURI.
Create an import map parse result with input as jsonString + and baseURL as the document base URL.
Register an import map using element's relevant global + object and the resulting import map parse result from the prior step.
For example, a style
element defined as follows:
+<style type="module" specifier="foo">body { background: navy; color: yellow; }</style>
+
+
+ Is equivalent to the following import map definition:
+ +
+<script type="importmap">
+{
+ "imports": {
+ "foo": "data:text/css,body%20%7B%20background%3A%20navy%3B%20color%3A%20yellow%3B%20%7D"
+ }
+}
+</script>
+ shadowrootclonable
shadowrootserializable
shadowrootcustomelementregistry
shadowrootadoptedstylesheets
HTMLTemplateElement
.The shadowrootadoptedstylesheets
content
+ contributes to the host's
+ adoptedStyleSheets.
The template contents of a template
element are not children of the element itself.
The stylesheet adopting steps for template
elements are:
If the value of + shadowrootadoptedstylesheets is + empty, then return.
Let adoptedStyleSheets be an empty array.
For each unordered set of unique space-separated tokens specifier in + shadowrootadoptedstylesheets:
+Let url be the result of resolving + a module specifier given moduleScript and specifier.
If + any errors occur, then continue.Let settingsObject be the current settings object.
Let moduleType be "css
".
Let moduleMap be settingsObject's module map.
Let moduleScript be + moduleMap[(url, moduleType)].
If moduleScript is null, then continue.
Extract the CSSStyleSheet
from moduleScript's
+ record and append it to
+ adoptedStyleSheets. If any error occurs, then continue.
Extend adoptedStyleSheets to the + host's adoptedStyleSheets.
This example demonstrates two equivalent methods to import CSS module scripts, the
+ first using the JavaScript import
method and the second using the
+ shadowrootadoptedstylesheets
+ attribute.
+<script type="importmap">
+{
+ "imports": {
+ "foo": "data:text/css,div {color:blue}"
+ }
+}
+</script>
+<div id="host">
+ <template shadowrootmode="open">
+ <script type="module">
+ import styles from "foo" with { type: "css"};
+ document.getElementById("host").shadowRoot.adoptedStyleSheets = [styles];
+ </script>
+ <div>test</div>
+ </template>
+</div>
+<div id="host_shadowrootadoptedstylesheets_attribute">
+ <template shadowrootmode="open" shadowrootadoptedstylesheets="foo">
+ <div>test</div>
+ </template>
+</div>
+
+ If templateStartTag has a shadowrootadoptedstylesheets
+ attribute, then perform stylesheet adopting steps on template.
media
;
- blocking
blocking
;
+ specifier
HTMLStyleElement
shadowrootdelegatesfocus
;
shadowrootclonable
;
shadowrootserializable
;
- shadowrootcustomelementregistry
+ shadowrootcustomelementregistry
;
+ shadowrootadoptedstylesheets
HTMLTemplateElement
option
shadowrootadoptedstylesheets
+ template
+ shadowrootclonable
template
@@ -153391,6 +153555,11 @@ interface External {
true
";
"false
";
the empty string
+ specifier
+ style
+ src
audio
;
@@ -156406,6 +156575,7 @@ INSERT INTERFACES HERE
Kristof Zelechovski,
Krzysztof Maczyński,
黒澤剛志 (Kurosawa Takeshi),
+ Kurt Catti-Schmidt,
Kyle Barnhart,
Kyle Hofmann,
Kyle Huey,