Files
HTMLKit/HTMLKit/HTMLDocument.m
T

43 lines
879 B
Objective-C

//
// HTMLDocument.m
// HTMLKit
//
// Created by Iska on 25/02/15.
// Copyright (c) 2015 BrainCookie. All rights reserved.
//
#import "HTMLDocument.h"
#import "HTMLKitExceptions.h"
@interface HTMLNode (Private)
@property (nonatomic, strong) HTMLNode *parentNode;
@end
@interface HTMLDocument ()
@property (nonatomic, assign) HTMLDocumentReadyState readyState;
@end
@implementation HTMLDocument
- (instancetype)init
{
self = [super initWithName:@"#document" type:HTMLNodeDocument];
if (self) {
_readyState = HTMLDocumentLoading;
}
return self;
}
- (HTMLNode *)adoptNode:(HTMLNode *)node
{
if (node.type == HTMLNodeDocument) {
[NSException raise:HTMLKitNotSupportedError
format:@"%@: Not Fount Error, adopting a document node. The operation is not supported.", NSStringFromSelector(_cmd)];
}
[node.parentNode removeChildNode:node];
return node;
}
@end