From d716c3a67815327c191549d2cf45a9b63bcb063e Mon Sep 17 00:00:00 2001 From: iska Date: Wed, 1 Apr 2015 01:08:23 +0200 Subject: [PATCH] Add Document Type to the children-nodes list in the HTML Document --- HTMLKit/HTMLDocument.m | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/HTMLKit/HTMLDocument.m b/HTMLKit/HTMLDocument.m index 5ffaf3b..e8a41e3 100644 --- a/HTMLKit/HTMLDocument.m +++ b/HTMLKit/HTMLDocument.m @@ -28,6 +28,15 @@ return self; } +- (void)setDocumentType:(HTMLDocumentType *)documentType +{ + if (self.documentType != nil) { + [self replaceChildNode:self.documentType withNode:documentType]; + } else { + [self appendNode:documentType]; + } +} + - (HTMLNode *)adoptNode:(HTMLNode *)node { if (node.type == HTMLNodeDocument) {