Skip to content

[Web API type definition issue] showPopover and togglePopover options are supported more widely now #2256

@birtles

Description

@birtles

Summary

The argument to showPopover is removed, and the argument to togglePopover is overridden because they were only supported in Blink in Nov 2024 but now they are supported by at least Gecko

Expected vs. Actual Behavior

Expected: showPopover accepts an options argument, togglePopover accepts a dictionary argument
Actual: showPopover does not accept any arguments, and togglePopover only accepts a boolean

Playground Link

No response

Browser Support

  • This API is supported in at least two major browser engines (not two Chromium-based browsers).

Have Tried The Latest Releases

  • This issue applies to the latest release of TypeScript.
  • This issue applies to the latest release of @types/web.

Additional Context

showPopover drops the options argument:

"HTMLElement": {
"methods": {
"method": {
"showPopover": {
"signature": {
"0": {
"param": ["options"] // Blink only as of 2024-11
}
}
}
}
}
},

But this argument is supported by at least Gecko: https://searchfox.org/firefox-main/rev/f6e3ccb5853c46f917578697a488d48c3bc09ac8/dom/webidl/HTMLElement.webidl#79

BCD says Safari supports it too: https://github.com/mdn/browser-compat-data/blob/a3ab1a95367f1dcee3b59e4a6e0081595c5e3b4f/api/HTMLElement.json#L2426-L2483

Similarly for togglePopover, only a bool is supported:

"togglePopover": {
"signature": {
"0": {
"param": [
{
// dictionary support is Blink only as of 2024-11
"name": "options",
"type": "boolean"
}
]
}
}
}

However, Gecko appears to support the dictionary form: https://searchfox.org/firefox-main/rev/f6e3ccb5853c46f917578697a488d48c3bc09ac8/dom/webidl/HTMLElement.webidl#81

BCD says Safari supports it too: https://github.com/mdn/browser-compat-data/blob/a3ab1a95367f1dcee3b59e4a6e0081595c5e3b4f/api/HTMLElement.json#L2960-L3052

Appears to come from 3bd3006

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions