Bug 156612 - [WK2] <object>/<embed> without HTML type attribute cannot load PHP-generated image
Summary: [WK2] <object>/<embed> without HTML type attribute cannot load PHP-generated ...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Local Build
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-14 16:51 PDT by Daniel Bates
Modified: 2017-03-24 09:45 PDT (History)
9 users (show)

See Also:


Attachments
Layout Test (4.41 KB, patch)
2016-04-14 16:52 PDT, Daniel Bates
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews107 for mac-yosemite-wk2 (876.76 KB, application/zip)
2016-04-15 09:37 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews123 for ios-simulator-wk2 (857.22 KB, application/zip)
2016-04-15 09:43 PDT, Build Bot
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Bates 2016-04-14 16:51:06 PDT
Consider a web page with the following markup:

<!DOCTYPE html>
<html>
<body>
<object data="resources/image.php"></object>
</body>
</html>

where image.php is a script that returns image data with an appropriate Content-Type HTTP header. In WebKit2, no image is display when this page is viewed. In WebKit1, Firefox for Mac 45.0.1 and Google Chrome for Mac 50.0.2661.75 beta (64-bit), an image is displayed when the page is viewed.

Suppose the image.php returns Content-Type image/jpeg and consider a web page with the following markup:

<!DOCTYPE html>
<html>
<body>
<object data="resources/image.php" type="image/jpeg"></object>
</body>
</html>

In WebKit2, an image is displayed when this page is viewed.
Comment 1 Daniel Bates 2016-04-14 16:52:43 PDT
Created attachment 276450 [details]
Layout Test

DumpRenderTree/WebKitTestRunner-compatible layout test
Comment 2 Build Bot 2016-04-15 09:37:24 PDT
Comment on attachment 276450 [details]
Layout Test

Attachment 276450 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/1163983

New failing tests:
http/tests/misc/object-without-type-load-php-image.html
Comment 3 Build Bot 2016-04-15 09:37:27 PDT
Created attachment 276478 [details]
Archive of layout-test-results from ews107 for mac-yosemite-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews107  Port: mac-yosemite-wk2  Platform: Mac OS X 10.10.5
Comment 4 Build Bot 2016-04-15 09:43:22 PDT
Comment on attachment 276450 [details]
Layout Test

Attachment 276450 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/1163984

New failing tests:
http/tests/misc/object-without-type-load-php-image.html
Comment 5 Build Bot 2016-04-15 09:43:25 PDT
Created attachment 276479 [details]
Archive of layout-test-results from ews123 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews123  Port: ios-simulator-wk2  Platform: Mac OS X 10.10.5
Comment 6 Michael Catanzaro 2016-05-15 15:02:07 PDT
Note that http/tests/security/contentSecurityPolicy/embed-redirect-blocked3.htm and http/tests/security/contentSecurityPolicy/object-redirect-blocked3.htm are both already passing on GTK (WK2).
Comment 7 Carlos Garcia Campos 2017-03-23 05:16:48 PDT
This is because in WebKit1 WebFrameLoaderClient::objectContentType returns ObjectContentType::Frame for php mime type:

if ([m_webFrame->_private->webFrameView _viewClassForMIMEType:type])
        return ObjectContentType::Frame;

I guess _viewClassForMIMEType has a different behavior than MIMETypeRegistry::isSupportedNonImageMIMEType().
Comment 8 Carlos Garcia Campos 2017-03-24 09:45:50 PDT
Maybe we should just claim to support php, assuming the server will deal with it?