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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 { | 218 { |
219 if (inViewSourceMode) | 219 if (inViewSourceMode) |
220 return HTMLViewSourceDocument::create(init, type); | 220 return HTMLViewSourceDocument::create(init, type); |
221 | 221 |
222 // Plugins cannot take HTML and XHTML from us, and we don't even need to ini
tialize the plugin database for those. | 222 // Plugins cannot take HTML and XHTML from us, and we don't even need to ini
tialize the plugin database for those. |
223 if (type == "text/html") | 223 if (type == "text/html") |
224 return HTMLDocument::create(init); | 224 return HTMLDocument::create(init); |
225 if (type == "application/xhtml+xml") | 225 if (type == "application/xhtml+xml") |
226 return XMLDocument::createXHTML(init); | 226 return XMLDocument::createXHTML(init); |
227 | 227 |
228 PluginData* pluginData = 0; | 228 PluginData* pluginData = nullptr; |
229 if (init.frame() && init.frame()->page() && init.frame()->loader().allowPlug
ins(NotAboutToInstantiatePlugin)) | 229 if (init.frame() && init.frame()->page() && init.frame()->loader().allowPlug
ins(NotAboutToInstantiatePlugin)) |
230 pluginData = init.frame()->pluginData(); | 230 pluginData = init.frame()->page()->pluginData(init.frame()->isMainFrame(
) ? SecurityOrigin::create(init.url()).get() : init.frame()->tree().top()->secur
ityContext()->getSecurityOrigin()); |
231 | 231 |
232 // PDF is one image type for which a plugin can override built-in support. | 232 // PDF is one image type for which a plugin can override built-in support. |
233 // We do not want QuickTime to take over all image types, obviously. | 233 // We do not want QuickTime to take over all image types, obviously. |
234 if ((type == "application/pdf" || type == "text/pdf") && pluginData && plugi
nData->supportsMimeType(type)) | 234 if ((type == "application/pdf" || type == "text/pdf") && pluginData && plugi
nData->supportsMimeType(type)) |
235 return PluginDocument::create(init); | 235 return PluginDocument::create(init); |
236 // multipart/x-mixed-replace is only supported for images. | 236 // multipart/x-mixed-replace is only supported for images. |
237 if (Image::supportsType(type) || type == "multipart/x-mixed-replace") | 237 if (Image::supportsType(type) || type == "multipart/x-mixed-replace") |
238 return ImageDocument::create(init); | 238 return ImageDocument::create(init); |
239 | 239 |
240 // Check to see if the type can be played by our media player, if so create
a MediaDocument | 240 // Check to see if the type can be played by our media player, if so create
a MediaDocument |
(...skipping 14 matching lines...) Expand all Loading... |
255 | 255 |
256 return HTMLDocument::create(init); | 256 return HTMLDocument::create(init); |
257 } | 257 } |
258 | 258 |
259 DEFINE_TRACE(DOMImplementation) | 259 DEFINE_TRACE(DOMImplementation) |
260 { | 260 { |
261 visitor->trace(m_document); | 261 visitor->trace(m_document); |
262 } | 262 } |
263 | 263 |
264 } // namespace blink | 264 } // namespace blink |
OLD | NEW |