diff --git a/source b/source index 4b81404aaa4..14ed9a706fb 100644 --- a/source +++ b/source @@ -3121,6 +3121,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • Element interface
  • attachShadow() method.
  • An element's shadow root
  • +
  • A shadow root's mode
  • +
  • A shadow root's declarative member
  • +
  • The attach a shadow root algorithm
  • The retargeting algorithm
  • Node interface
  • NodeList interface
  • @@ -3233,7 +3236,8 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute callback
  • The encoding (herein the character encoding), - mode, and + mode, + allow declarative shadow roots, and content type of a Document
  • The distinction between XML documents and HTML documents
  • @@ -62997,6 +63001,8 @@ not-slash = %x0000-002E / %x0030-10FFFF
    Nothing (for clarification, see example).
    Content attributes:
    Global attributes
    +
    shadowrootmode
    +
    shadowrootdelegatesfocus
    Accessibility considerations:
    For authors.
    @@ -63008,6 +63014,8 @@ interface HTMLTemplateElement : HTMLElement { [HTMLConstructor] constructor(); readonly attribute DocumentFragment content; + [CEReactions] attribute DOMString shadowRootMode; + [CEReactions] attribute boolean shadowRootDelegatesFocus; };
    Uses HTMLTemplateElement.
    @@ -63018,6 +63026,36 @@ interface HTMLTemplateElement : HTMLElement {

    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.

    @@ -63145,8 +63183,19 @@ interface HTMLTemplateElement : HTMLElement {

    The content IDL attribute must return the - template element's template contents.

    + data-x="dom-template-content">content getter steps are to return + 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.


    @@ -95544,6 +95593,10 @@ interface BeforeUnloadEvent : Event {
    about base URL
    creatorBaseURL
    + +
    allow declarative shadow + roots
    +
    true
    @@ -101453,6 +101506,10 @@ location.href = '#foo';
    about base URL
    navigationParams's about base URL
    + +
    allow declarative shadow + roots
    +
    true
    @@ -110340,8 +110397,8 @@ partial interface ShadowRoot { html:

      -
    1. Let newChildren be the result of the HTML fragment parsing algorithm - given contextElement and html.

    2. +
    3. Let newChildren be the result of the HTML fragment parsing + algorithm given contextElement, html, and true.

    4. Let fragment be a new DocumentFragment whose node document is contextElement's node document.

    5. @@ -110369,6 +110426,10 @@ partial interface ShadowRoot { is disabled.

      +
    6. Set document's allow declarative shadow roots to + true.

    7. +
    8. Parse HTML from a string given document and html.

    9. @@ -124287,12 +124348,39 @@ dictionary StorageEventInit : EventInit {
      +

      To insert an element at the adjusted insertion location with an element + element:

      + +
        +
      1. Let the adjusted insertion location be the appropriate place for + inserting a node.

      2. + +
      3. If it is not possible to insert element at the adjusted insertion + location, abort these steps.

      4. + +
      5. 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.

      6. + +
      7. Insert element at the adjusted insertion location.

      8. + +
      9. 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.

      10. +
      + +

      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:

      1. Let the adjusted insertion location be the appropriate place for @@ -124305,27 +124393,8 @@ dictionary StorageEventInit : EventInit { parent being the element in which the adjusted insertion location finds itself.

      2. -
      3. -

        If it is possible to insert element at the adjusted insertion location, - then:

        - -
          -
        1. 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.

        2. - -
        3. Insert element at the adjusted insertion location.

        4. - -
        5. 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.

        6. -
        - -

        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.

        -
      4. +
      5. If onlyAddToElementStack is false, then run insert an element at the + adjusted insertion location with element.

      6. Push element onto the stack of open elements so that it is the new current node.

      7. @@ -124334,8 +124403,8 @@ dictionary StorageEventInit : EventInit {

      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.


      @@ -125033,7 +125102,7 @@ document.body.appendChild(text);
      A start tag whose tag name is "template"
      -

      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.

      @@ -125046,6 +125115,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:

      + + + +

      then insert an HTML element for the token.

      + +

      Otherwise:

      + +
        +
      1. Let declarative shadow host element be adjusted current + node.

      2. + +
      3. Let template be the result of insert a foreign element + for template start tag, with HTML namespace and true.

      4. + +
      5. Let declarative shadow mode be template start tag's + shadowrootmode attribute.

      6. + +
      7. If template start tag had a + shadowrootdelegatesfocus + attribute, then let declarative shadow delegates focus be true. Otherwise let + it be false.

      8. + +
      9. Attach a shadow root with + declarative shadow host element, declarative shadow mode, true, + declarative shadow delegates focus, and "named".

      10. + +
      11. +

        If an exception was thrown by attach a + shadow root, then catch it, and run these steps:

        + +
          +
        1. Report the exception.

        2. + +
        3. Insert an element at the adjusted insertion location with + template.

        4. +
        +
      12. + +
      13. +

        Otherwise:

        + +
          +
        1. Let shadow be declarative shadow host element's + shadow root.

        2. + +
        3. Set shadow's + declarative to true.

        4. + +
        5. Set template's template contents property to + shadow.

        6. + +
        7. Set shadow's available to element internals to true.

        8. +
        +
      14. +
      An end tag whose tag name is "template"
      @@ -126132,8 +126276,8 @@ document.body.appendChild(text);

      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,