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 6 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
20 changes: 17 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,7 @@ 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

<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 +6960,20 @@ 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>, or

Choose a reason for hiding this comment

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

Is there something missing here, or should the trailing or be removed?

Copy link
Member

Choose a reason for hiding this comment

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

It should move up one bullet point I think.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed. I removed the , or because I couldn't find other examples. For example, https://dom.spec.whatwg.org/#retarget just has the bullet list of options. LMK if that's the wrong conclusion to reach.

Copy link
Member

@annevk annevk Feb 15, 2024

Choose a reason for hiding this comment

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

I pushed a fix for this (Domenic established a pattern to follow for new constructs) and also for the note we identified in the original issue as well as some wrapping nits.

</ul>

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

<li>
<p>Otherwise:
Expand Down
Loading