MDN URL
https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/showPopover
What specific section or headline is this issue about?
Exceptions
What information was incorrect, unhelpful, or incomplete?
It claims that showPopover will throw an InvalidStateError if the popover is already showing.
This appears to no longer be accurate, calling showPopover on a popover that is already showing is now a no-op.
hidePopover's documentation has the same problem. It claims hidePopover will throw InvalidStateError if the popover is already hidden, which is no longer true.
The description for togglePopover's force parameter also currently mentions the outdated exception-throwing behavior as if it were still valid.
What did you expect to see?
Either no mention of an exception being thrown if the popover is already in the requested state, or a notice that it used to throw, but no longer does.
Do you have any supporting links, references, or citations?
Do you have anything more you want to share?
Example:
<div id="mypopover" popover>
Popover content
</div>
<button onclick="mypopover.showPopover()">
Show popover
</button>
<button onclick="mypopover.hidePopover()">
Hide popover
</button>
No exception is thrown when clicking on "Show popover" while the popover is shown, or clicking on "Hide popover" while the popover is hidden.
I tested this with:
- Chrome 149.0.7827.116
- Firefox 152.0.3
MDN metadata
Page report details
MDN URL
https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/showPopover
What specific section or headline is this issue about?
Exceptions
What information was incorrect, unhelpful, or incomplete?
It claims that
showPopoverwill throw anInvalidStateErrorif the popover is already showing.This appears to no longer be accurate, calling
showPopoveron a popover that is already showing is now a no-op.hidePopover's documentation has the same problem. It claimshidePopoverwill throwInvalidStateErrorif the popover is already hidden, which is no longer true.The description for
togglePopover'sforceparameter also currently mentions the outdated exception-throwing behavior as if it were still valid.What did you expect to see?
Either no mention of an exception being thrown if the popover is already in the requested state, or a notice that it used to throw, but no longer does.
Do you have any supporting links, references, or citations?
Do you have anything more you want to share?
Example:
No exception is thrown when clicking on "Show popover" while the popover is shown, or clicking on "Hide popover" while the popover is hidden.
I tested this with:
MDN metadata
Page report details
en-us/web/api/htmlelement/showpopover