OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
6 * Copyright (C) 2006 Samuel Weinig (sam@webkit.org) | 6 * Copyright (C) 2006 Samuel Weinig (sam@webkit.org) |
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
(...skipping 13 matching lines...) Expand all Loading... |
24 | 24 |
25 #include "config.h" | 25 #include "config.h" |
26 #include "core/dom/DOMImplementation.h" | 26 #include "core/dom/DOMImplementation.h" |
27 | 27 |
28 #include "HTMLNames.h" | 28 #include "HTMLNames.h" |
29 #include "SVGNames.h" | 29 #include "SVGNames.h" |
30 #include "core/css/CSSStyleSheet.h" | 30 #include "core/css/CSSStyleSheet.h" |
31 #include "core/css/MediaList.h" | 31 #include "core/css/MediaList.h" |
32 #include "core/css/StyleSheetContents.h" | 32 #include "core/css/StyleSheetContents.h" |
33 #include "core/dom/ContextFeatures.h" | 33 #include "core/dom/ContextFeatures.h" |
| 34 #include "core/dom/CustomElementRegistrationContextualizer.h" |
34 #include "core/dom/DocumentType.h" | 35 #include "core/dom/DocumentType.h" |
35 #include "core/dom/Element.h" | 36 #include "core/dom/Element.h" |
36 #include "core/dom/ExceptionCode.h" | 37 #include "core/dom/ExceptionCode.h" |
37 #include "core/html/HTMLDocument.h" | 38 #include "core/html/HTMLDocument.h" |
38 #include "core/html/HTMLMediaElement.h" | 39 #include "core/html/HTMLMediaElement.h" |
39 #include "core/html/HTMLViewSourceDocument.h" | 40 #include "core/html/HTMLViewSourceDocument.h" |
40 #include "core/html/ImageDocument.h" | 41 #include "core/html/ImageDocument.h" |
41 #include "core/html/MediaDocument.h" | 42 #include "core/html/MediaDocument.h" |
42 #include "core/html/PluginDocument.h" | 43 #include "core/html/PluginDocument.h" |
43 #include "core/html/TextDocument.h" | 44 #include "core/html/TextDocument.h" |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 RefPtr<Document> doc; | 257 RefPtr<Document> doc; |
257 if (namespaceURI == SVGNames::svgNamespaceURI) | 258 if (namespaceURI == SVGNames::svgNamespaceURI) |
258 doc = SVGDocument::create(0, KURL()); | 259 doc = SVGDocument::create(0, KURL()); |
259 else if (namespaceURI == HTMLNames::xhtmlNamespaceURI) | 260 else if (namespaceURI == HTMLNames::xhtmlNamespaceURI) |
260 doc = Document::createXHTML(0, KURL()); | 261 doc = Document::createXHTML(0, KURL()); |
261 else | 262 else |
262 doc = Document::create(0, KURL()); | 263 doc = Document::create(0, KURL()); |
263 | 264 |
264 doc->setSecurityOrigin(m_document->securityOrigin()); | 265 doc->setSecurityOrigin(m_document->securityOrigin()); |
265 doc->setContextFeatures(m_document->contextFeatures()); | 266 doc->setContextFeatures(m_document->contextFeatures()); |
| 267 CustomElementRegistrationContextualizer::didCreateRelatedDocument(m_document
->registrationContext(), CustomElementRegistrationContextualizer::DOMImplementat
ion_createDocument, doc.get()); |
266 | 268 |
267 RefPtr<Node> documentElement; | 269 RefPtr<Node> documentElement; |
268 if (!qualifiedName.isEmpty()) { | 270 if (!qualifiedName.isEmpty()) { |
269 documentElement = doc->createElementNS(namespaceURI, qualifiedName, ec); | 271 documentElement = doc->createElementNS(namespaceURI, qualifiedName, ec); |
270 if (ec) | 272 if (ec) |
271 return 0; | 273 return 0; |
272 } | 274 } |
273 | 275 |
274 // WrongDocumentError: Raised if doctype has already been used with a differ
ent document or was | 276 // WrongDocumentError: Raised if doctype has already been used with a differ
ent document or was |
275 // created from a different implementation. | 277 // created from a different implementation. |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 | 374 |
373 PassRefPtr<HTMLDocument> DOMImplementation::createHTMLDocument(const String& tit
le) | 375 PassRefPtr<HTMLDocument> DOMImplementation::createHTMLDocument(const String& tit
le) |
374 { | 376 { |
375 RefPtr<HTMLDocument> d = HTMLDocument::create(0, KURL()); | 377 RefPtr<HTMLDocument> d = HTMLDocument::create(0, KURL()); |
376 d->open(); | 378 d->open(); |
377 d->write("<!doctype html><html><body></body></html>"); | 379 d->write("<!doctype html><html><body></body></html>"); |
378 if (!title.isNull()) | 380 if (!title.isNull()) |
379 d->setTitle(title); | 381 d->setTitle(title); |
380 d->setSecurityOrigin(m_document->securityOrigin()); | 382 d->setSecurityOrigin(m_document->securityOrigin()); |
381 d->setContextFeatures(m_document->contextFeatures()); | 383 d->setContextFeatures(m_document->contextFeatures()); |
| 384 CustomElementRegistrationContextualizer::didCreateRelatedDocument(m_document
->registrationContext(), CustomElementRegistrationContextualizer::DOMImplementat
ion_createDocument, d.get()); |
382 return d.release(); | 385 return d.release(); |
383 } | 386 } |
384 | 387 |
385 PassRefPtr<Document> DOMImplementation::createDocument(const String& type, Frame
* frame, const KURL& url, bool inViewSourceMode) | 388 PassRefPtr<Document> DOMImplementation::createDocument(const String& type, Frame
* frame, const KURL& url, bool inViewSourceMode) |
386 { | 389 { |
387 if (inViewSourceMode) | 390 if (inViewSourceMode) |
388 return HTMLViewSourceDocument::create(frame, url, type); | 391 return HTMLViewSourceDocument::create(frame, url, type); |
389 | 392 |
390 // Plugins cannot take HTML and XHTML from us, and we don't even need to ini
tialize the plugin database for those. | 393 // Plugins cannot take HTML and XHTML from us, and we don't even need to ini
tialize the plugin database for those. |
391 if (type == "text/html") | 394 if (type == "text/html") |
(...skipping 25 matching lines...) Expand all Loading... |
417 return TextDocument::create(frame, url); | 420 return TextDocument::create(frame, url); |
418 if (type == "image/svg+xml") | 421 if (type == "image/svg+xml") |
419 return SVGDocument::create(frame, url); | 422 return SVGDocument::create(frame, url); |
420 if (isXMLMIMEType(type)) | 423 if (isXMLMIMEType(type)) |
421 return Document::create(frame, url); | 424 return Document::create(frame, url); |
422 | 425 |
423 return HTMLDocument::create(frame, url); | 426 return HTMLDocument::create(frame, url); |
424 } | 427 } |
425 | 428 |
426 } | 429 } |
OLD | NEW |