diff --git a/source b/source index 877761a9424..fcab0e82a65 100644 --- a/source +++ b/source @@ -3123,6 +3123,7 @@ 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 +18521,7 @@ people expect to have work and what is necessary.
mediablockingspecifiertitle 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 +18845,86 @@ 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 styleBlob be the result of creating a Blob object representing
+ a file containing the style element's child text content with a
+ type of "text/css".
Let styleBlobURL be the blob URL entry + associated with styleBlob.
Create a JSON object jsonObject with a single key of "imports"
+ whose value is a single JSON object containing a module specifier map with a key consisting
+ of the value of the specifier attribute and a value of
+ styleBlobURL.
Let jsonString be the result of calling JSON.stringify on + jsonObject.
Let importMapParseResult be the result of Create an import map parse result + with input as jsonString and baseURL as the document base URL.
If importMapParseResult's error to rethrow is + not null, then continue.
Register an import map using element's relevant global object + and importMapParseResult.
For example, a style element defined as follows:
+<style type="module" specifier="foo">body { background: navy; color: yellow; }</style>
+
+
+ Is equivalent to the following dynamically created import map definition:
+ +
+<script>
+ const blob_url = URL.createObjectURL(new Blob(["body { background: navy; color: yellow; }"], {type: "text/css"}));
+ const import_map = document.createElement("script");
+ import_map.setAttribute("type", "importmap");
+ const json_string = "{ \"imports\": { \"foo\": \"" + blob_url + "\" }}";
+ import_map.innerText = json_string;
+ document.body.appendChild(import_map);
+</script>
+ shadowrootclonableshadowrootserializableshadowrootcustomelementregistryshadowrootadoptedstylesheetsHTMLTemplateElement.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 host's + adoptedStyleSheets with 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 the stylesheet adopting steps on template.
script elements that is the empty string or a JavaScript MIME type
essence match. Instead, they should omit the attribute, which has the same effect.
- Authors should not specify a type attribute on a
- style element. If the attribute is present, its value must be an ASCII
- case-insensitive match for "text/css".
Authors should not specify a value for the type
+ attribute on style elements that is an ASCII case-insensitive match for
+ "text/css". Instead, they should omit the attribute, which has the same effect.
Authors should not specify the name attribute on
a elements. If the attribute is present, its value must not be the empty string and
@@ -151699,7 +151867,8 @@ interface External {
media;
- blockingblocking;
+ specifier
HTMLStyleElementshadowrootdelegatesfocus;
shadowrootclonable;
shadowrootserializable;
- shadowrootcustomelementregistry
+ shadowrootcustomelementregistry;
+ shadowrootadoptedstylesheets
HTMLTemplateElementoption
shadowrootadoptedstylesheets
+ template
+ shadowrootclonable
template
@@ -153391,6 +153566,11 @@ interface External {
true";
"false";
the empty string
+ specifier
+ style
+ src
audio;
@@ -156406,6 +156586,7 @@ INSERT INTERFACES HERE
Kristof Zelechovski,
Krzysztof Maczyński,
黒澤剛志 (Kurosawa Takeshi),
+ Kurt Catti-Schmidt,
Kyle Barnhart,
Kyle Hofmann,
Kyle Huey,