Skip to content

Outdated exception documentation for showPopover and hidePopover #44587

Description

@PatTheHyruler

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Content:WebAPIWeb API docsneeds triageTriage needed by staff and/or partners. Automatically applied when an issue is opened.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions