Changeset 107256 in webkit
- Timestamp:
- Feb 9, 2012 9:31:07 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r107251 r107256 1 2012-02-09 Mark Rowe <mrowe@apple.com> 2 3 REGRESSION (r104746): iframes load PDFs as media documents 4 <http://webkit.org/b/77079> / <rdar://problem/10757933> 5 6 Roll out r104746 since it completely broke support for loading PDF documents in subframes. 7 8 Reviewed by Adam Treat. 9 10 * dom/DOMImplementation.cpp: 11 (WebCore::DOMImplementation::createDocument): 12 1 13 2012-02-09 Andrey Kosyakov <caseq@chromium.org> 2 14 -
trunk/Source/WebCore/dom/DOMImplementation.cpp
r104872 r107256 365 365 if (type == "text/html") 366 366 return HTMLDocument::create(frame, url); 367 368 // Plugins cannot take text/plain from us either.369 if (type == "text/plain")370 return TextDocument::create(frame, url);371 372 367 if (type == "application/xhtml+xml") 373 368 return Document::createXHTML(frame, url); 374 369 375 370 #if ENABLE(FTPDIR) 376 // Plugins cannot take FTP from us either .371 // Plugins cannot take FTP from us either 377 372 if (type == "application/x-ftp-directory") 378 373 return FTPDirectoryDocument::create(frame, url); 379 374 #endif 380 375 381 // PDF is the only image type for which a plugin can override built-in support.382 if (Image::supportsType(type) && type != "application/pdf" && type != "text/pdf")383 return ImageDocument::create(frame, url);384 385 #if ENABLE(VIDEO)386 // Check to see if the type can be played by our MediaPlayer, if so create a MediaDocument as387 // this can not be taken by plugins either.388 if (MediaPlayer::supportsType(ContentType(type)))389 return MediaDocument::create(frame, url);390 #endif391 392 // The plugin database is initialized at this point if plugins are enabled393 // which is non-zero overhead.394 376 PluginData* pluginData = 0; 395 377 if (frame && frame->page() && frame->loader()->subframeLoader()->allowPlugins(NotAboutToInstantiatePlugin)) 396 378 pluginData = frame->page()->pluginData(); 397 379 398 // At this point anything that can be supported can be overridden by plugins. 399 if (pluginData && pluginData->supportsMimeType(type)) 380 // PDF is one image type for which a plugin can override built-in support. 381 // We do not want QuickTime to take over all image types, obviously. 382 if ((type == "application/pdf" || type == "text/pdf") && pluginData && pluginData->supportsMimeType(type)) 400 383 return PluginDocument::create(frame, url); 401 402 // Handle PDF for instance if it was not handled by a plugin.403 384 if (Image::supportsType(type)) 404 385 return ImageDocument::create(frame, url); 405 386 406 // Handle a text document was not handled by a plugin. 387 #if ENABLE(VIDEO) 388 // Check to see if the type can be played by our MediaPlayer, if so create a MediaDocument 389 if (MediaPlayer::supportsType(ContentType(type))) 390 return MediaDocument::create(frame, url); 391 #endif 392 393 // Everything else except text/plain can be overridden by plugins. In particular, Adobe SVG Viewer should be used for SVG, if installed. 394 // Disallowing plug-ins to use text/plain prevents plug-ins from hijacking a fundamental type that the browser is expected to handle, 395 // and also serves as an optimization to prevent loading the plug-in database in the common case. 396 if (type != "text/plain" && pluginData && pluginData->supportsMimeType(type)) 397 return PluginDocument::create(frame, url); 407 398 if (isTextMIMEType(type)) 408 399 return TextDocument::create(frame, url);
Note: See TracChangeset
for help on using the changeset viewer.