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

Another corner case about nested popovers #9319

Closed
cathiechen opened this issue May 22, 2023 · 3 comments · Fixed by #9198
Closed

Another corner case about nested popovers #9319

cathiechen opened this issue May 22, 2023 · 3 comments · Fixed by #9198
Labels
topic: popover The popover attribute and friends

Comments

@cathiechen
Copy link

What should be the status of p19?
Currently, in Gecko both p18 and p19 are popover-open, and p18 is on the top.

<!doctype html>
<div id=p16 popover="auto">
    <div id=p17 popover="auto">17</div>
    <div id=p18 popover="auto">18</div>
    <div id=p19 popover="auto">19</div>
</div>
<script>
    p16.showPopover();
    p17.showPopover();
    p17.addEventListener('beforetoggle', () => p19.showPopover());
    p18.showPopover();
</script>

@emilio @josepharhar @mfreed7 @nt1m

@nt1m nt1m added the topic: popover The popover attribute and friends label May 23, 2023
@josepharhar
Copy link
Contributor

https://jsfiddle.net/jarhar/s5v6tr1q/
In chrome canary it looks like p19 is closed. It is closed by p18's call to "hide all popovers until".

Some raw debugging output from chrome:

ShowPopover id: "p16"
ShowPopover calling HideAllPopoversUntil id: "p16"
ShowPopover calling HideAllPopoversUntil id: "p16" DONE
ShowPopover id: "p17"
ShowPopover calling HideAllPopoversUntil id: "p17"
ShowPopover calling HideAllPopoversUntil id: "p17" DONE
ShowPopover id: "p18"
ShowPopover calling HideAllPopoversUntil id: "p18"
HidePopover id: "p17"
ShowPopover id: "p19"
ShowPopover calling HideAllPopoversUntil id: "p19"
HidePopover id: "p17"
ShowPopover calling HideAllPopoversUntil id: "p19" DONE
HidePopover id: "p19"

@cathiechen
Copy link
Author

Looks like #9198 could address this one, the update in "hide all popovers until".
I'll work on a patch in Gecko.

@cathiechen
Copy link
Author

Added the test case web-platform-tests/wpt#40366

annevk pushed a commit that referenced this issue Jun 8, 2023
- Fix a case where a beforetoggle event handler opens a new popover.
- Stop firing beforetoggle events when there are nested calls to showPopover or hidePopover due to script.

Fixes #9196, fixes #9197, and fixes #9319.
rubberyuzu pushed a commit to rubberyuzu/html that referenced this issue Jul 20, 2023
- Fix a case where a beforetoggle event handler opens a new popover.
- Stop firing beforetoggle events when there are nested calls to showPopover or hidePopover due to script.

Fixes whatwg#9196, fixes whatwg#9197, and fixes whatwg#9319.
rubberyuzu pushed a commit to rubberyuzu/html that referenced this issue Jul 21, 2023
- Fix a case where a beforetoggle event handler opens a new popover.
- Stop firing beforetoggle events when there are nested calls to showPopover or hidePopover due to script.

Fixes whatwg#9196, fixes whatwg#9197, and fixes whatwg#9319.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: popover The popover attribute and friends
Development

Successfully merging a pull request may close this issue.

3 participants