Open Bug 1276363 Opened 8 years ago Updated 2 years ago

Allow custom registerElement names

Categories

(Core :: DOM: Core & HTML, defect, P2)

defect

Tracking

()

People

(Reporter: bdahl, Unassigned)

Details

(Whiteboard: btpp-fixlater)

Attachments

(1 file)

In positron we need a way to register some custom elements that do no follow the spec requirements such as 'webview' and 'browserplugin'. Blink/Webkit have a way to do so by allowing embedders to registers these names (applicable code https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/core/dom/custom/V0CustomElement.cpp&sq=package:chromium&type=cs&l=60&rcl=1464366759)

Temporary solution in positron https://github.com/brendandahl/positron/commit/78db7db098571898bc4d5fbc06420e3e577b72d7

For the real solution we'd need to maintain a list of these like blink does.
Summary: Allow registered custom element names → Allow custom registerElement names
Boris: can you suggest an approach here?
Seems like comment 0 describes a perfectly fine approach: add static array with an API to add things to it and check it in nsContentUtils::IsCustomElementName.
Whiteboard: btpp-fixlater
Comment on attachment 8766519 [details] [diff] [review]
0001-Bug-1276363-Allow-custom-embedder-element-names.patch

Review of attachment 8766519 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/webidl/CustomElementRegistry.webidl
@@ +13,5 @@
> +/**
> + * This interface once implemented will not be chrome only, but for now it is
> + * only being used for embedder custom element names.
> + */
> +[ChromeOnly]

The CustomElmentRegistry interface seems like a sensible place for this API, but the interface shouldn't be ChromeOnly and should be behind the web components flag. There is already work for the actual implementation in Bug 1275833. If you want the API to live on this interface, you should either wait for the other patches to land or coordinate with the work in the other bug.
Attachment #8766519 - Flags: review?(wchen)
Priority: -- → P2
Component: DOM → DOM: Core & HTML
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: