Bug 167135

Summary: JS implementation of TemplatePart
Product: WebKit Reporter: Ryosuke Niwa <rniwa>
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: don.olmstead
Priority: P2    
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
template-part.js
none
DOM parts none

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);
}
Comment 2 Ryosuke Niwa 2023-03-09 22:53:39 PST
Created attachment 465386 [details]
DOM parts