Add initial implementation for HTML Template & Document Fragment
https://html.spec.whatwg.org/multipage/scripting.html#the-template-element
This commit is contained in:
1 parent
01adbf4437
commit
654dffcc92
9 files changed
+213
-22
No files matched your search
@@ -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
|
||||
Reference in new issue
Block a user