| 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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 return XMLDocument::createXHTML(init); | 227 return XMLDocument::createXHTML(init); |
| 228 | 228 |
| 229 PluginData* pluginData = 0; | 229 PluginData* pluginData = 0; |
| 230 if (init.frame() && init.frame()->page() && init.frame()->loader().allowPlug
ins(NotAboutToInstantiatePlugin)) | 230 if (init.frame() && init.frame()->page() && init.frame()->loader().allowPlug
ins(NotAboutToInstantiatePlugin)) |
| 231 pluginData = init.frame()->page()->pluginData(); | 231 pluginData = init.frame()->page()->pluginData(); |
| 232 | 232 |
| 233 // PDF is one image type for which a plugin can override built-in support. | 233 // PDF is one image type for which a plugin can override built-in support. |
| 234 // We do not want QuickTime to take over all image types, obviously. | 234 // We do not want QuickTime to take over all image types, obviously. |
| 235 if ((type == "application/pdf" || type == "text/pdf") && pluginData && plugi
nData->supportsMimeType(type)) | 235 if ((type == "application/pdf" || type == "text/pdf") && pluginData && plugi
nData->supportsMimeType(type)) |
| 236 return PluginDocument::create(init); | 236 return PluginDocument::create(init); |
| 237 if (Image::supportsType(type)) | 237 // multipart/x-mixed-replace is only supported for images. |
| 238 if (Image::supportsType(type) || type == "multipart/x-mixed-replace") |
| 238 return ImageDocument::create(init); | 239 return ImageDocument::create(init); |
| 239 | 240 |
| 240 // Check to see if the type can be played by our media player, if so create
a MediaDocument | 241 // Check to see if the type can be played by our media player, if so create
a MediaDocument |
| 241 if (HTMLMediaElement::supportsType(ContentType(type))) | 242 if (HTMLMediaElement::supportsType(ContentType(type))) |
| 242 return MediaDocument::create(init); | 243 return MediaDocument::create(init); |
| 243 | 244 |
| 244 // Everything else except text/plain can be overridden by plugins. In partic
ular, Adobe SVG Viewer should be used for SVG, if installed. | 245 // Everything else except text/plain can be overridden by plugins. In partic
ular, Adobe SVG Viewer should be used for SVG, if installed. |
| 245 // Disallowing plugins to use text/plain prevents plugins from hijacking a f
undamental type that the browser is expected to handle, | 246 // Disallowing plugins to use text/plain prevents plugins from hijacking a f
undamental type that the browser is expected to handle, |
| 246 // and also serves as an optimization to prevent loading the plugin database
in the common case. | 247 // and also serves as an optimization to prevent loading the plugin database
in the common case. |
| 247 if (type != "text/plain" && pluginData && pluginData->supportsMimeType(type)
) | 248 if (type != "text/plain" && pluginData && pluginData->supportsMimeType(type)
) |
| 248 return PluginDocument::create(init); | 249 return PluginDocument::create(init); |
| 249 if (isTextMIMEType(type)) | 250 if (isTextMIMEType(type)) |
| 250 return TextDocument::create(init); | 251 return TextDocument::create(init); |
| 251 if (type == "image/svg+xml") | 252 if (type == "image/svg+xml") |
| 252 return XMLDocument::createSVG(init); | 253 return XMLDocument::createSVG(init); |
| 253 if (isXMLMIMEType(type)) | 254 if (isXMLMIMEType(type)) |
| 254 return XMLDocument::create(init); | 255 return XMLDocument::create(init); |
| 255 | 256 |
| 256 return HTMLDocument::create(init); | 257 return HTMLDocument::create(init); |
| 257 } | 258 } |
| 258 | 259 |
| 259 DEFINE_TRACE(DOMImplementation) | 260 DEFINE_TRACE(DOMImplementation) |
| 260 { | 261 { |
| 261 visitor->trace(m_document); | 262 visitor->trace(m_document); |
| 262 } | 263 } |
| 263 | 264 |
| 264 } // namespace blink | 265 } // namespace blink |
| OLD | NEW |