diff --git a/source b/source index 9d0696e5ef7..9d3965bf3bc 100644 --- a/source +++ b/source @@ -3121,6 +3121,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
Element
interfaceattachShadow()
method.Node
interfaceNodeList
interfaceDocument
shadowrootmode
shadowrootdelegatesfocus
HTMLTemplateElement
.In a rendering, the template
element represents nothing.
The shadowrootmode
content attribute is an
+ enumerated attribute with the following keywords and states:
Keyword + | State + | Brief description + |
---|---|---|
open
+ | open + | The template element represents an open declarative shadow root. + |
closed
+ | closed + | The template element represents a closed declarative shadow root. + |
The shadowrootmode
attribute's invalid value default and missing value default are both the none state.
The shadowrootdelegatesfocus
content
+ attribute is a boolean attribute.
The template contents of a template
element are not children of the element itself.
The content
IDL attribute must return the
- template
element's template contents.
template
's template contents, if the template contents is
+ not a ShadowRoot
node; otherwise null.
+
+ The shadowRootMode
IDL attribute
+ must reflect the shadowrootmode
+ content attribute, limited to only known values.
The shadowRootDelegatesFocus
IDL attribute
+ must reflect the shadowrootdelegatesfocus
content
+ attribute.
Let newChildren be the result of the HTML fragment parsing algorithm - given contextElement and html.
Let newChildren be the result of the HTML fragment parsing + algorithm given contextElement, html, and true.
Let fragment be a new DocumentFragment
whose node
document is contextElement's node document.
Set document's allow declarative shadow roots to + true.
Parse HTML from a string given document and html.
To insert an element at the adjusted insertion location with an element + element:
+ +Let the adjusted insertion location be the appropriate place for + inserting a node.
If it is not possible to insert element at the adjusted insertion + location, abort these steps.
If the parser was not created as part of the HTML fragment parsing + algorithm, then push a new element queue onto element's + relevant agent's custom element reactions stack.
Insert element at the adjusted insertion location.
If the parser was not created as part of the HTML fragment parsing + algorithm, then pop the element queue from element's + relevant agent's custom element reactions stack, and invoke + custom element reactions in that queue.
If the adjusted insertion location cannot accept more elements, e.g.,
+ because it's a Document
that already has an element child, then element is
+ dropped on the floor.
When the steps below require the user agent to insert a foreign element for a token - in a given namespace, the user agent must run these steps:
+ in a given namespace and with a boolean onlyAddToElementStack, the user agent must run + these steps:Let the adjusted insertion location be the appropriate place for @@ -123660,27 +123748,8 @@ dictionary StorageEventInit : EventInit { parent being the element in which the adjusted insertion location finds itself.
If it is possible to insert element at the adjusted insertion location, - then:
- -If the parser was not created as part of the HTML fragment parsing - algorithm, then push a new element queue onto element's - relevant agent's custom element reactions stack.
Insert element at the adjusted insertion location.
If the parser was not created as part of the HTML fragment parsing - algorithm, then pop the element queue from element's - relevant agent's custom element reactions stack, and invoke - custom element reactions in that queue.
If the adjusted insertion location cannot accept more
- elements, e.g. because it's a Document
that already has an element child, then
- element is dropped on the floor.
If onlyAddToElementStack is false, then run insert an element at the + adjusted insertion location with element.
Push element onto the stack of open elements so that it is the new current node.
When the steps below require the user agent to insert an HTML element for a token, - the user agent must insert a foreign element for the token, in the HTML - namespace.
+ the user agent must insert a foreign element for the token, with the HTML + namespace and false.Insert an HTML element for the token.
+Let template start tag be the start tag.
Insert a marker at the end of the list of active formatting elements.
@@ -124401,6 +124470,81 @@ document.body.appendChild(text);Push "in template" onto the stack of template insertion modes so that it is the new current template insertion mode.
+ +Let the adjusted insertion location be the appropriate place for inserting + a node.
+ +Let intended parent be the element in which the adjusted insertion + location finds itself.
+ +Let document be intended parent's node document.
+ +If any of the following are false:
+ +shadowrootmode
is not in
+ the none state;then insert an HTML element for the token.
+ +Otherwise:
+ +Let declarative shadow host element be adjusted current + node.
Let template be the result of insert a foreign element + for template start tag, with HTML namespace and true.
Let declarative shadow mode be template start tag's
+ shadowrootmode
attribute.
If template start tag had a
+ shadowrootdelegatesfocus
+ attribute, then let declarative shadow delegates focus be true. Otherwise let
+ it be false.
Attach a shadow root with
+ declarative shadow host element, declarative shadow mode, true,
+ declarative shadow delegates focus, and "named
".
If an exception was thrown by attach a + shadow root, then catch it, and run these steps:
+ +Report the exception.
Insert an element at the adjusted insertion location with + template.
Otherwise:
+ +Let shadow be declarative shadow host element's + shadow root.
Set shadow's + declarative to true.
Set template's template contents property to + shadow.
Set shadow's available to element internals to true.
Adjust foreign attributes for the token. (This fixes the use of namespaced attributes, in particular XLink.)
-Insert a foreign element for the token, in the MathML - namespace.
+Insert a foreign element for the token, with MathML namespace + and false.
Mason Mize, Mathias Bynens, Mathieu Henri,