Webcomponents: [template] What if the `type` attribute is specified in the <template> but its processor is not registered?

Created on 13 Nov 2017  ·  4Comments  ·  Source: WICG/webcomponents

I could not find any reference about this part of the logic in the proposal.

Each template element has an associated TemplateProcessCallback either the one specified by type content attribute or of the default template process callback if the content attribute is not specified.

Falling back to the default processor might not be possible. Should createInstance throw when attempting to instantiate a template with an unknown type?

templates v2

Most helpful comment

@snuggs : Not yet. I'm trying to find a time to write up the updated proposal but unfortunately I've been busy with other stuff for the last 6-8 months :(

All 4 comments

Nothing would happen if there is no matching type. We can make createInstance throw in those cases.

At TPAC we decided to go for a more minimal proposal without a global processor registry in v1, so marking this as a templates-v2 concern.

@domenic is there a reference to said proposal?

Thanks in advance!

@snuggs : Not yet. I'm trying to find a time to write up the updated proposal but unfortunately I've been busy with other stuff for the last 6-8 months :(

Was this page helpful?
0 / 5 - 0 ratings