Bug 239610 - [model] How can we query availability of <model> reliably?
Summary: [model] How can we query availability of <model> reliably?
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: Safari Technology Preview
Hardware: Mac (Apple Silicon) macOS 12
: P2 Enhancement
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-04-21 09:59 PDT by Thomas Kumlehn
Modified: 2022-06-07 01:04 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Kumlehn 2022-04-21 09:59:36 PDT
If the HTML model feature is deactivated, document.createElement("model") neither triggers an exception, nor does it return HTMLUnknownElement like other browsers do.
On all Safari platforms.
What would be a valid way to use Javascript to query this feature reliably? I assume, the standards conform way should be to return HTMLUnknownElement.
Comment 1 Antoine Quint 2022-04-22 02:54:18 PDT
I believe this does the trick:

function supportsModel () {
    return "HTMLModelElement" in window;
}
Comment 2 Thomas Kumlehn 2022-04-22 03:18:20 PDT
Thank you very much
Comment 3 Radar WebKit Bug Importer 2022-04-28 10:00:18 PDT
<rdar://problem/92470985>