-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Consider throwing for showModal() and showPopover() in non-fully-active documents #10659
Comments
Sounds reasonable to me (non-implementer, userland consumer). They already throw for a handful of exceptional cases (calling |
Given how new popover is, how most uses of popover are probably based on user input, and how niche this type of document is, my instinct is also that this would be web compatible. Likewise for dialogs, they're relatively new too. Should this apply to dialog.show() too? |
I'm unsure about |
Throwing sounds good to me. |
Is the idea here that nothing should be in the top layer when a document is no longer fully active? Will we also empty it when a document becomes inactive? |
No, I think the idea is that nothing should be in the top layer for synthetic documents. "Normal" documents that get bfcached can have a top layer without an issue, IMO. |
Wouldn't a browsing context check be more appropriate then? I guess either way could work, but the former is a more exact match of what you're after. |
Indeed, they're equivalent in this case. Fully active is just more conventional. |
Well, doesn't a bfcache'd document still hold onto its browsing context? |
Yes, but you cannot call |
What is the issue with the HTML Standard?
As a followup to #10634, it doesn't really make sense that you can call
showModal()
orshowPopover()
on elements which are inside of synthetic documents, of the type created bydocument.implementation.createHTMLDocument()
. Example: https://jsbin.com/cubafoputo/1/edit?html,js,outputI think we should have these throw exceptions, similar to the exceptions we already throw for disconnected elements.
I suspect this change is web-compatible, especially for popover but even for dialog. These synthetic documents are super rare.
@smaug---- @keithamus @josepharhar @nt1m do you agree? Are you willing to take the potential compat risk or the trouble of adding use counters?
The text was updated successfully, but these errors were encountered: