Bug 239610

Summary: [model] How can we query availability of <model> reliably?
Product: WebKit Reporter: Thomas Kumlehn <pixelpartner>
Component: New BugsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED WORKSFORME    
Severity: Enhancement CC: dino, graouts, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari Technology Preview   
Hardware: Mac (Apple Silicon)   
OS: macOS 12   

Thomas Kumlehn
Reported 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.
Attachments
Antoine Quint
Comment 1 2022-04-22 02:54:18 PDT
I believe this does the trick: function supportsModel () { return "HTMLModelElement" in window; }
Thomas Kumlehn
Comment 2 2022-04-22 03:18:20 PDT
Thank you very much
Radar WebKit Bug Importer
Comment 3 2022-04-28 10:00:18 PDT
Note You need to log in before you can comment on or make changes to this bug.