Skip to content

Commit

Permalink
Add serializable to ShadowRoot and "attach a shadow root"
Browse files Browse the repository at this point in the history
Corresponding HTML PR & issue: whatwg/html#10139 & whatwg/html#8867.
  • Loading branch information
mfreed7 authored Apr 4, 2024
1 parent 3de55b3 commit 2d890bd
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion dom.bs
Original file line number Diff line number Diff line change
Expand Up @@ -4511,6 +4511,7 @@ dom-Range-extractContents, dom-Range-cloneContents -->

<li><p>Run <a>attach a shadow root</a> with <var>copy</var>, <var>node</var>'s
<a for=Element>shadow root</a>'s <a for=ShadowRoot>mode</a>, true, <var>node</var>'s
<a for=Element>shadow root</a>'s <a for=ShadowRoot>serializable</a>, <var>node</var>'s
<a for=Element>shadow root</a>'s <a for=ShadowRoot>delegates focus</a>, and <var>node</var>'s
<a for=Element>shadow root</a>'s <a for=ShadowRoot>slot assignment</a>.

Expand Down Expand Up @@ -5888,6 +5889,7 @@ interface ShadowRoot : DocumentFragment {
readonly attribute boolean delegatesFocus;
readonly attribute SlotAssignmentMode slotAssignment;
readonly attribute boolean clonable;
readonly attribute boolean serializable;
readonly attribute Element host;
attribute EventHandler onslotchange;
};
Expand Down Expand Up @@ -5921,6 +5923,9 @@ It is initially set to false.</p>
<p><a for=/>Shadow roots</a> have an associated <dfn for=ShadowRoot>clonable</dfn> (a boolean).
It is initially set to false.</p>

<p><a for=/>Shadow roots</a> have an associated <dfn for=ShadowRoot>serializable</dfn> (a boolean).
It is initially set to false.</p>

<p>A <a for=/>shadow root</a>'s <a>get the parent</a> algorithm, given an <var>event</var>, returns
null if <var>event</var>'s <a>composed flag</a> is unset and <a for=/>shadow root</a> is the
<a for=tree>root</a> of <var>event</var>'s <a for=Event>path</a>'s first struct's
Expand All @@ -5939,6 +5944,9 @@ null if <var>event</var>'s <a>composed flag</a> is unset and <a for=/>shadow roo
<p>The <dfn attribute for=ShadowRoot><code>clonable</code></dfn> getter steps are to return
<a>this</a>'s <a for=ShadowRoot>clonable</a>.

<p>The <dfn attribute for=ShadowRoot><code>serializable</code></dfn> getter steps are to return
<a>this</a>'s <a for=ShadowRoot>serializable</a>.

<p>The <dfn attribute for=ShadowRoot><code>host</code></dfn> getter steps are to return
<a>this</a>'s <a for=DocumentFragment>host</a>.

Expand Down Expand Up @@ -6071,6 +6079,7 @@ dictionary ShadowRootInit {
boolean delegatesFocus = false;
SlotAssignmentMode slotAssignment = "named";
boolean clonable = false;
boolean serializable = false;
};
</pre>

Expand Down Expand Up @@ -6924,6 +6933,7 @@ are:
<ol>
<li><p>Run <a>attach a shadow root</a> with <a>this</a>,
<var>init</var>["{{ShadowRootInit/mode}}"], <var>init</var>["{{ShadowRootInit/clonable}}"],
<var>init</var>["{{ShadowRootInit/serializable}}"],
<var>init</var>["{{ShadowRootInit/delegatesFocus}}"], and
<var>init</var>["{{ShadowRootInit/slotAssignment}}"].

Expand All @@ -6934,7 +6944,8 @@ are:
<div algorithm>
<p>To <dfn id=concept-attach-a-shadow-root>attach a shadow root</dfn>, given an
<a for=/>element</a> <var>element</var>, a string <var>mode</var>, a boolean <var>clonable</var>,
a boolean <var>delegatesFocus</var>, and a string <var>slotAssignment</var>:
a boolean <var>serializable</var>, a boolean <var>delegatesFocus</var>, and a string
<var>slotAssignment</var>:

<ol>
<li><p>If <var>element</var>'s <a for=Element>namespace</a> is not the <a>HTML namespace</a>,
Expand Down Expand Up @@ -7006,6 +7017,8 @@ a boolean <var>delegatesFocus</var>, and a string <var>slotAssignment</var>:

<li><p>Set <var>shadow</var>'s <a for=ShadowRoot>clonable</a> to <var>clonable</var>.

<li><p>Set <var>shadow</var>'s <a for=ShadowRoot>serializable</a> to <var>serializable</var>.

<li><p>Set <var>element</var>'s <a for=Element>shadow root</a> to <var>shadow</var>.
</ol>
</div>
Expand Down

0 comments on commit 2d890bd

Please sign in to comment.