Add initial implementation for HTML Template & Document Fragment

https://html.spec.whatwg.org/multipage/scripting.html#the-template-element
This commit is contained in:
iska committed 2015-04-16 00:13:15 +02:00
1 parent 01adbf4437
commit 654dffcc92
9 files changed
+213 -22

No files matched your search

+34
View File
@@ -0,0 +1,34 @@
//
// HTMLTemplate.m
// HTMLKit
//
// Created by Iska on 12/04/15.
// Copyright (c) 2015 BrainCookie. All rights reserved.
//
#import "HTMLTemplate.h"
#import "HTMLDocument.h"
@implementation HTMLTemplate
- (instancetype)init
{
self = [super initWithTagName:@"template"];
return self;
}
- (HTMLDocumentFragment *)content
{
if (_content == nil) {
_content = [[HTMLDocumentFragment alloc] initWithDocument:self.ownerDocument.associatedInertTemplateDocument];
}
return _content;
}
- (NSOrderedSet *)childNodes
{
return self.content.childNodes;
}
@end