-
Notifications
You must be signed in to change notification settings - Fork 3k
Add "check and possibly close popover stack" algorithm #9048
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
Closed
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
44ca874
Add "check and possibly close popover stack" algorithm
josepharhar c683d72
add popovertarget change check
josepharhar df13f28
fix attr-popovertarget
josepharhar e1edb5d
use hide all popovers
josepharhar 7e2eb2a
add note
josepharhar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1828,6 +1828,10 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute | |
<li><p>If <var>removedNode</var>'s <code data-x="attr-popover">popover</code> attribute is not in | ||
the <span data-x="attr-popover-none-state">no popover state</span>, then run the <span>hide | ||
popover algorithm</span> given <var>removedNode</var>, false, false, and false.</p></li> | ||
|
||
<li><p>If <var>removedNode</var> is a <span data-x="concept-button">button</span>, then run | ||
<span>check and possibly close popover stack</span> given <var>removedNode</var>'s <span>node | ||
document</span>.</p></li> | ||
</ol> | ||
|
||
<p>A <dfn id="insert-an-element-into-a-document" data-x="node is inserted into a document" | ||
|
@@ -47024,6 +47028,9 @@ interface <dfn interface>HTMLInputElement</dfn> : <span>HTMLElement</span> { | |
element's <span data-x="concept-textarea/input-cursor">text entry cursor position</span> to the | ||
beginning of the text control, and <span data-x="set the selection direction">set its selection | ||
direction</span> to "<code data-x="">none</code>".</p></li> | ||
|
||
<li><p>Run <span>check and possibly close popover stack</span> given the element's <span>node | ||
document</span>.</p></li> | ||
</ol> | ||
|
||
</div> | ||
|
@@ -81861,6 +81868,11 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> { | |
<ol> | ||
<li><p>If <var>namespace</var> is not null, then return.</p></li> | ||
|
||
<li><p>If <var>localName</var> is <code data-x="attr-fe-disabled">disabled</code>, <code | ||
data-x="attr-fae-form">form</code>, or <code data-x="attr-popovertarget">popovertarget</code>, | ||
then run <span>check and possibly close popover stack</span> given <var>element</var>'s | ||
<span>node document</span>.</p></li> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this is correct for |
||
|
||
<li><p>If <var>localName</var> is not <code data-x="attr-popover">popover</code>, then | ||
return.</p></li> | ||
|
||
|
@@ -82411,6 +82423,42 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> { | |
<li><p>Return true.</p></li> | ||
</ol> | ||
|
||
<p>To <dfn>check and possibly close popover stack</dfn> for a <code>Document</code> | ||
<var>document</var>:</p> | ||
|
||
<ol> | ||
<li><p>Let <var>stack</var> be <var>document</var>'s <span>auto popover list</span>.</p></li> | ||
|
||
<li><p>Let <var>index</var> <var>stack</var>'s <span data-x="list size">size</span> - 1.</p></li> | ||
|
||
<li> | ||
<p><span>While</span> <var>index</var> is greater than 0:</p> | ||
|
||
<ol> | ||
<li> | ||
<p>If the result of running <span>topmost popover ancestor</span> given | ||
<var>stack</var>[<var>index</var>] is not <var>stack</var>[<var>index</var> - 1], then:</p> | ||
|
||
<ol> | ||
<li><p>Run <span>hide all popovers</span> given <var>document</var>.</p></li> | ||
|
||
<li><p>Return.</p></li> | ||
</ol> | ||
</li> | ||
|
||
<li><p>Set <var>index</var> to <var>index</var> - 1.</p></li> | ||
</ol> | ||
</li> | ||
</ol> | ||
|
||
<div class="note"> | ||
<p><span>Check and possibly close popover stack</span> is used to close multiple popovers which | ||
are only open due to their ancestral relationship to each other in the case where that ancestral | ||
relationship has been broken. <span>Show popover</span> also closes popovers which don't meet | ||
this ancestral relationship by calling <span data-x="hide-all-popovers-until">hide all popovers | ||
until</span>.</p> | ||
</div> | ||
|
||
<h4>The popover target attributes</h4> | ||
|
||
<p><span data-x="concept-button">Buttons</span> may have the following content attributes:</p> | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.