Re: [whatwg/dom] Add before removing steps (PR #1185)

> I see, yeah I guess that in the case where we want to hide a popover regardless of the dom state, the only relevant check in the check popover algorithm is whether or not the popover is in the showing or hidden state, so we could conditionally replace calls to the check popover algorithm with checks for the popover visibility state. Sounds good to me, and it could also be used to fix https://github.com/whatwg/html/issues/9367

Keep in mind:
```
<div>X</div>
<script>
let d = document.querySelector("div");
d.hidePopover(); // Should throw according to spec and does in Chrome dev edition.
</script>
```
However, https://jsfiddle.net/hyzLu4nk/1/ doesn't throw in Chrome dev edition. Adapting the spec to let https://html.spec.whatwg.org/#dom-hidepopover throw only when https://html.spec.whatwg.org/#popover-showing-or-hiding is `false` would cover that.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/pull/1185#issuecomment-1588820883
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/dom/pull/1185/c1588820883@github.com>

Received on Tuesday, 13 June 2023 08:36:08 UTC