Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforce same parameters for attachShadow on declarative shadow root #1246

Merged
merged 8 commits into from
Feb 16, 2024
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 30 additions & 3 deletions dom.bs
Original file line number Diff line number Diff line change
Expand Up @@ -4502,6 +4502,8 @@ dom-Range-extractContents, dom-Range-cloneContents -->
<a for=ShadowRoot>clonable</a> is true:

<ol>
<li><p>Assert: <var>copy</var> is not a <a for=Element>shadow host</a>.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(It's weird that this has for=Element, but that's a pre-existing issue.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Want me to change something?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to take it on, it should be a separate PR making it a standalone term that doesn't belong to Element.


<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>delegates focus</a>, and <var>node</var>'s
Expand Down Expand Up @@ -6929,7 +6931,11 @@ 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 boolean <var>slotAssignment</var>:
a boolean <var>delegatesFocus</var>, and a string <var>slotAssignment</var>:
mfreed7 marked this conversation as resolved.
Show resolved Hide resolved

<!-- Any new parameters added to <a>attach a shadow root</a> should be
added to the list of parameter-match tests under "If one of the
following is true" below. -->

<ol>
<li><p>If <var>element</var>'s <a for=Element>namespace</a> is not the <a>HTML namespace</a>,
Expand Down Expand Up @@ -6958,8 +6964,29 @@ a boolean <var>delegatesFocus</var>, and a boolean <var>slotAssignment</var>:
<p>If <var>element</var> is a <a for=Element>shadow host</a>, then:

<ol>
<li><p>If <var>element</var>'s <a for=Element>shadow root</a>'s <a for=ShadowRoot>declarative</a>
is false, then <a>throw</a> an "{{NotSupportedError!!exception}}" {{DOMException}}.
<li><p>Let <var>currentShadowRoot</var> be <var>element</var>'s
mfreed7 marked this conversation as resolved.
Show resolved Hide resolved
<a for=Element>shadow root</a>.

<li>
<p>If one of the following is true:

<ul>
<li><p><var>currentShadowRoot</var>'s <a for=ShadowRoot>declarative</a> is false,

<li><p><var>currentShadowRoot</var>'s <a for=ShadowRoot>mode</a> does not match
<var>mode</var>,

<li><p><var>currentShadowRoot</var>'s <a for=ShadowRoot>delegates focus</a> does
not match <var>delegatesFocus</var>,

<li><p><var>currentShadowRoot</var>'s <a for=ShadowRoot>slot assignment</a> does
not match <var>slotAssignment</var>, or

<li><p><var>currentShadowRoot</var>'s <a for=ShadowRoot>clonable</a> does
not match <var>clonable</var>,
</ul>

<p>then <a>throw</a> a "{{NotSupportedError!!exception}}" {{DOMException}}.

<li>
<p>Otherwise:
Expand Down
Loading