Bug 167135 - JS implementation of TemplatePart
Summary: JS implementation of TemplatePart
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-17 13:10 PST by Ryosuke Niwa
Modified: 2017-12-04 14:27 PST (History)
1 user (show)

See Also:


Attachments
template-part.js (12.72 KB, application/x-javascript)
2017-01-17 13:10 PST, Ryosuke Niwa
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2017-01-17 13:10:02 PST
Created attachment 299053 [details]
template-part.js

Posting here since there is no other place to do this with a proper licensing.
Comment 1 Ryosuke Niwa 2017-01-17 13:11:31 PST
WebIDL:

callback TemplateProcessor = void (TemplateInstance instance, sequence<TemplatePart> parts, any parameters);

interface TemplatePart {
    stringier attribute DOMString value;
    readonly attribute DOMString expression;
}

interface AttributeTemplatePart : TemplatePart {
}

interface NodeTemplatePart : TemplatePart {
    void replace(sequence<Node>);
    void replaceHTML(DOMString html);
}

partial interface HTMLTemplateElement {
    TemplateInstance createInstance(any parameters, optional TemplateProcessor processor);
}

interface TemplateInstance : DocumentFragment  {
    void update(any parameters);
}