Add HTML Document Type node

https://dom.spec.whatwg.org/#interface-documenttype
This commit is contained in:
iska
2015-02-25 23:48:24 +01:00
parent da00182ff2
commit 5e9846b8ea
3 changed files with 66 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
//
// HTMLDocumentType.h
// HTMLKit
//
// Created by Iska on 25/02/15.
// Copyright (c) 2015 BrainCookie. All rights reserved.
//
#import "HTMLNode.h"
@interface HTMLDocumentType : HTMLNode
@property (nonatomic, copy, readonly) NSString *publicIdentifier;
@property (nonatomic, copy, readonly) NSString *systemIdentifier;
- (instancetype)initWithName:(NSString *)name
publicIdentifier:(NSString *)publicIdentifier
systemIdentifier:(NSString *)systemIdentifier;
@end
+35
View File
@@ -0,0 +1,35 @@
//
// HTMLDocumentType.m
// HTMLKit
//
// Created by Iska on 25/02/15.
// Copyright (c) 2015 BrainCookie. All rights reserved.
//
#import "HTMLDocumentType.h"
@implementation HTMLDocumentType
- (instancetype)initWithName:(NSString *)name
publicIdentifier:(NSString *)publicIdentifier
systemIdentifier:(NSString *)systemIdentifier
{
self = [super initWithName:name type:HTMLDocumentTypeNode];
if (self) {
_publicIdentifier = [publicIdentifier copy] ?: @"";
_systemIdentifier = [systemIdentifier copy] ?: @"";
}
return self;
}
#pragma mark - NSCopying
- (id)copyWithZone:(NSZone *)zone
{
HTMLDocumentType *copy = [super copyWithZone:zone];
copy->_publicIdentifier = self.publicIdentifier;
copy->_systemIdentifier = self.systemIdentifier;
return copy;
}
@end