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

editorial: move dialog content attributes above properties #10969

Closed
Changes from all 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
71 changes: 37 additions & 34 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -61735,6 +61735,42 @@ interface <dfn interface>HTMLDialogElement</dfn> : <span>HTMLElement</span> {
caused focus to jump to the Agree <code>button</code>, which is a bad user experience.</p>
</div>

<div w-nodev>

<p>A <code>dialog</code> element without an <code data-x="attr-dialog-open">open</code> attribute
specified should not be shown to the user. This requirement may be implemented indirectly through
the style layer. For example, user agents that <a href="#renderingUA">support the suggested
default rendering</a> implement this requirement using the CSS rules described in the <a
href="#rendering">Rendering section</a>.</p>

</div>

<div class="note" id="note-dialog-remove-open-attribute">
<p>Removing the <code data-x="attr-dialog-open">open</code> attribute will usually hide the
dialog. However, doing so has a number of strange additional consequences:

<ul>
<li><p>The <code data-x="event-close">close</code> event will not be fired.</p></li>

<li><p>The <code data-x="dom-dialog-close">close()</code> method, and any <span data-x="close
request">close requests</span>, will no longer be able to close the dialog.</p></li>

<li><p>If the dialog was shown using its <code data-x="dom-dialog-showModal">showModal()</code>
method, the <code>Document</code> will still be <span data-x="blocked by a modal
dialog">blocked</span>.</p></li>
</ul>

<p>For these reasons, it is generally better to never remove the <code
data-x="attr-dialog-open">open</code> attribute manually. Instead, use the <code
data-x="dom-dialog-close">close()</code> method to close the dialog, or the <code
data-x="attr-hidden">hidden</code> attribute to hide it.</p>
</div>

<hr>

<p>The <code data-x="attr-tabindex">tabindex</code> attribute must not be specified on
<code>dialog</code> elements.</p>

<p>The <dfn element-attr for="dialog"><code data-x="attr-dialog-open">open</code></dfn> attribute
is a <span>boolean attribute</span>. When specified, it indicates that the <code>dialog</code>
element is active and that the user can interact with it.</p>
Expand Down Expand Up @@ -61773,40 +61809,7 @@ interface <dfn interface>HTMLDialogElement</dfn> : <span>HTMLElement</span> {
<code>dialog</code> was shown using its <code data-x="dom-dialog-showModal">showModal()</code>
method; otherwise the <span data-x="attr-dialog-closedby-none-state">None</span> state.</p>

<div w-nodev>

<p>A <code>dialog</code> element without an <code data-x="attr-dialog-open">open</code> attribute
specified should not be shown to the user. This requirement may be implemented indirectly through
the style layer. For example, user agents that <a href="#renderingUA">support the suggested
default rendering</a> implement this requirement using the CSS rules described in the <a
href="#rendering">Rendering section</a>.</p>

</div>

<div class="note" id="note-dialog-remove-open-attribute">
<p>Removing the <code data-x="attr-dialog-open">open</code> attribute will usually hide the
dialog. However, doing so has a number of strange additional consequences:

<ul>
<li><p>The <code data-x="event-close">close</code> event will not be fired.</p></li>

<li><p>The <code data-x="dom-dialog-close">close()</code> method, and any <span data-x="close
request">close requests</span>, will no longer be able to close the dialog.</p></li>

<li><p>If the dialog was shown using its <code data-x="dom-dialog-showModal">showModal()</code>
method, the <code>Document</code> will still be <span data-x="blocked by a modal
dialog">blocked</span>.</p></li>
</ul>

<p>For these reasons, it is generally better to never remove the <code
data-x="attr-dialog-open">open</code> attribute manually. Instead, use the <code
data-x="dom-dialog-close">close()</code> method to close the dialog, or the <code
data-x="attr-hidden">hidden</code> attribute to hide it.</p>
</div>

<p>The <code data-x="attr-tabindex">tabindex</code> attribute must not be specified on
<code>dialog</code> elements.</p>

<hr>

<dl class="domintro">
<dt><code data-x=""><var>dialog</var>.<span subdfn data-x="dom-dialog-show">show</span>()</code></dt>
Expand Down