12013-08-29 Christophe Dumez <ch.dumez@sisa.samsung.com>
2
3 According to DOM4, all DocType nodes should have a document
4 https://bugs.webkit.org/show_bug.cgi?id=99244
5
6 Reviewed by NOBODY (OOPS!).
7
8 Doctypes now always have a node document and can be moved across document boundaries as per
9 the latest DOM4 specification:
10 http://dom.spec.whatwg.org/#dom-domimplementation-createdocumenttype
11 http://dom.spec.whatwg.org/#dom-node-ownerdocument
12
13 This means that DOMImplementation.createDocumentType() now sets the ownerDocument of the
14 new DocumentType Node to the associated document of the current "context" object. In
15 DOM4, all nodes have a document at all times. DocumentType nodes can now be moved across
16 document boundaries so that the node can be added to a Document after being created.
17
18 This means we will no longer need to special case DocumentType nodes in the code and
19 Node::document() can no longer return NULL, which means that we'll be able to remove
20 NULL checks in call sites.
21
22 Firefox stable and since recently Blink already follow DOM4 here while IE10 does not (yet).
23
24 Test: fast/dom/createDocumentType-ownerDocument.html
25
26 * dom/ContainerNode.cpp:
27 (WebCore::checkAcceptChild):
28 * dom/DOMImplementation.cpp:
29 (WebCore::DOMImplementation::createDocumentType):
30 (WebCore::DOMImplementation::createDocument):
31 * dom/Node.h:
32 (WebCore::Node::document):
33