Skip to content

Commit f60c3a0

Browse files
committed
Ignore DOM state when hiding popovers if needed
Fixes whatwg#9161 Fixes whatwg#9367 Makes obsolete whatwg/dom#1185 This PR prevents the hide popover algorithm from returning early when the popover attribute is removed or when the element with the popover attribute is removed from the document. The fireEvents parameter is used as an indicator that either the element is being removed or that the attribute is being removed, and when it is false, the calls to check popover validity are replaced with a check to simply see if the popover is already hidden. This patch also makes removal of the popover attribute stop firing events in order to signal to the hide popover algorithm that checks for the popover attribute should be ignored.
1 parent 8430871 commit f60c3a0

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

source

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82409,9 +82409,11 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> {
8240982409
<li><p>If <var>localName</var> is not <code data-x="attr-popover">popover</code>, then
8241082410
return.</p></li>
8241182411

82412+
<li><p>Let <var>fireEvents</var> be false if <var>value</var> is null, otherwise true.</p></li>
82413+
8241282414
<li><p>If <var>oldValue</var> and <var>value</var> are in different <span
8241382415
data-x="attr-popover">states</span>, then run the <span>hide popover algorithm</span> given
82414-
<var>element</var>, true, true, and false.</p></li>
82416+
<var>element</var>, true, <var>fireEvents</var>, and false.</p></li>
8241582417
</ol>
8241682418

8241782419
<dl class="domintro">
@@ -82613,8 +82615,12 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> {
8261382615
boolean <var>fireEvents</var>, and a boolean <var>throwExceptions</var>:</p>
8261482616

8261582617
<ol>
82616-
<li><p>If the result of running <span>check popover validity</span> given <var>element</var>,
82617-
true, <var>throwExceptions</var>, and null is false, then return.</p></li>
82618+
<li><p>If <var>fireEvents</var> is true and the result of running <span>check popover
82619+
validity</span> given <var>element</var>, true, <var>throwExceptions</var>, and null is false,
82620+
then return.</p></li>
82621+
82622+
<li><p>If <var>fireEvents</var> is false and <var>element</var>'s <span>popover visibility
82623+
state</span> is <span data-x="popover-hidden-state">hidden</span>, then return.</p></li>
8261882624

8261982625
<li><p>Let <var>document</var> be <var>element</var>'s <span>node document</span>.</p></li>
8262082626

@@ -82643,15 +82649,19 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> {
8264382649
<var>element</var>, <var>focusPreviousElement</var>, and <var>fireEvents</var>.</p></li>
8264482650

8264582651
<li>
82646-
<p>If the result of running <span>check popover validity</span> given <var>element</var>,
82647-
true, and <var>throwExceptions</var> is false, then run <var>cleanupHidingFlag</var> and
82648-
return.</p>
82652+
<p>If <var>fireEvents</var> is true and the result of running <span>check popover
82653+
validity</span> given <var>element</var>, true, and <var>throwExceptions</var> is false, then
82654+
run <var>cleanupHidingFlag</var> and return.</p>
8264982655

8265082656
<p class="note"><span>Check popover validity</span> is called again because running <span
8265182657
data-x="hide-all-popovers-until">hide all popovers until</span> could have disconnected
8265282658
<var>element</var> or changed its <code data-x="attr-popover">popover</code> attribute.</p>
8265382659
</li>
8265482660

82661+
<li><p>If <var>fireEvents</var> is false and <var>element</var>'s <span>popover visibility
82662+
state</span> is <span data-x="popover-hidden-state">hidden</span>, then run
82663+
<var>cleanupHidingFlag</var> and return.</p></li>
82664+
8265582665
<li><p>If the last item in <var>document</var>'s <span>auto popover list</span> is
8265682666
<var>element</var>, then <span>break</span>.</p></li>
8265782667
</ol>

0 commit comments

Comments
 (0)