| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 #include "core/frame/UseCounter.h" | 42 #include "core/frame/UseCounter.h" |
| 43 #include "core/html/HTMLDocument.h" | 43 #include "core/html/HTMLDocument.h" |
| 44 #include "core/html/HTMLMediaElement.h" | 44 #include "core/html/HTMLMediaElement.h" |
| 45 #include "core/html/HTMLViewSourceDocument.h" | 45 #include "core/html/HTMLViewSourceDocument.h" |
| 46 #include "core/html/ImageDocument.h" | 46 #include "core/html/ImageDocument.h" |
| 47 #include "core/html/MediaDocument.h" | 47 #include "core/html/MediaDocument.h" |
| 48 #include "core/html/PluginDocument.h" | 48 #include "core/html/PluginDocument.h" |
| 49 #include "core/html/TextDocument.h" | 49 #include "core/html/TextDocument.h" |
| 50 #include "core/loader/FrameLoader.h" | 50 #include "core/loader/FrameLoader.h" |
| 51 #include "core/page/Page.h" | 51 #include "core/page/Page.h" |
| 52 #include "core/svg/SVGDocument.h" | |
| 53 #include "platform/ContentType.h" | 52 #include "platform/ContentType.h" |
| 54 #include "platform/MIMETypeRegistry.h" | 53 #include "platform/MIMETypeRegistry.h" |
| 55 #include "platform/graphics/Image.h" | 54 #include "platform/graphics/Image.h" |
| 56 #include "platform/graphics/media/MediaPlayer.h" | 55 #include "platform/graphics/media/MediaPlayer.h" |
| 57 #include "platform/plugins/PluginData.h" | 56 #include "platform/plugins/PluginData.h" |
| 58 #include "platform/weborigin/SecurityOrigin.h" | 57 #include "platform/weborigin/SecurityOrigin.h" |
| 59 #include "wtf/StdLibExtras.h" | 58 #include "wtf/StdLibExtras.h" |
| 60 | 59 |
| 61 namespace WebCore { | 60 namespace WebCore { |
| 62 | 61 |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 | 196 |
| 198 return DocumentType::create(&m_document, qualifiedName, publicId, systemId); | 197 return DocumentType::create(&m_document, qualifiedName, publicId, systemId); |
| 199 } | 198 } |
| 200 | 199 |
| 201 PassRefPtr<XMLDocument> DOMImplementation::createDocument(const AtomicString& na
mespaceURI, | 200 PassRefPtr<XMLDocument> DOMImplementation::createDocument(const AtomicString& na
mespaceURI, |
| 202 const AtomicString& qualifiedName, DocumentType* doctype, ExceptionState& ex
ceptionState) | 201 const AtomicString& qualifiedName, DocumentType* doctype, ExceptionState& ex
ceptionState) |
| 203 { | 202 { |
| 204 RefPtr<XMLDocument> doc; | 203 RefPtr<XMLDocument> doc; |
| 205 DocumentInit init = DocumentInit::fromContext(m_document.contextDocument()); | 204 DocumentInit init = DocumentInit::fromContext(m_document.contextDocument()); |
| 206 if (namespaceURI == SVGNames::svgNamespaceURI) { | 205 if (namespaceURI == SVGNames::svgNamespaceURI) { |
| 207 // FIXME: This should be an XMLDocument as per DOM4 but we need to get r
id of SVGDocument first. | 206 doc = XMLDocument::createSVG(init); |
| 208 // SVGDocument no longer exists in SVG2. | |
| 209 doc = SVGDocument::create(init); | |
| 210 } else if (namespaceURI == HTMLNames::xhtmlNamespaceURI) { | 207 } else if (namespaceURI == HTMLNames::xhtmlNamespaceURI) { |
| 211 doc = XMLDocument::createXHTML(init.withRegistrationContext(m_document.r
egistrationContext())); | 208 doc = XMLDocument::createXHTML(init.withRegistrationContext(m_document.r
egistrationContext())); |
| 212 } else { | 209 } else { |
| 213 doc = XMLDocument::create(init); | 210 doc = XMLDocument::create(init); |
| 214 } | 211 } |
| 215 | 212 |
| 216 doc->setSecurityOrigin(m_document.securityOrigin()->isolatedCopy()); | 213 doc->setSecurityOrigin(m_document.securityOrigin()->isolatedCopy()); |
| 217 doc->setContextFeatures(m_document.contextFeatures()); | 214 doc->setContextFeatures(m_document.contextFeatures()); |
| 218 | 215 |
| 219 RefPtr<Node> documentElement; | 216 RefPtr<Node> documentElement; |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 return MediaDocument::create(init); | 364 return MediaDocument::create(init); |
| 368 | 365 |
| 369 // Everything else except text/plain can be overridden by plugins. In partic
ular, Adobe SVG Viewer should be used for SVG, if installed. | 366 // Everything else except text/plain can be overridden by plugins. In partic
ular, Adobe SVG Viewer should be used for SVG, if installed. |
| 370 // Disallowing plug-ins to use text/plain prevents plug-ins from hijacking a
fundamental type that the browser is expected to handle, | 367 // Disallowing plug-ins to use text/plain prevents plug-ins from hijacking a
fundamental type that the browser is expected to handle, |
| 371 // and also serves as an optimization to prevent loading the plug-in databas
e in the common case. | 368 // and also serves as an optimization to prevent loading the plug-in databas
e in the common case. |
| 372 if (type != "text/plain" && pluginData && pluginData->supportsMimeType(type)
) | 369 if (type != "text/plain" && pluginData && pluginData->supportsMimeType(type)
) |
| 373 return PluginDocument::create(init); | 370 return PluginDocument::create(init); |
| 374 if (isTextMIMEType(type)) | 371 if (isTextMIMEType(type)) |
| 375 return TextDocument::create(init); | 372 return TextDocument::create(init); |
| 376 if (type == "image/svg+xml") | 373 if (type == "image/svg+xml") |
| 377 return SVGDocument::create(init); | 374 return XMLDocument::createSVG(init); |
| 378 if (isXMLMIMEType(type)) | 375 if (isXMLMIMEType(type)) |
| 379 return XMLDocument::create(init); | 376 return XMLDocument::create(init); |
| 380 | 377 |
| 381 return HTMLDocument::create(init); | 378 return HTMLDocument::create(init); |
| 382 } | 379 } |
| 383 | 380 |
| 384 } | 381 } |
| OLD | NEW |