REGRESSION (iOS 8): PDFs embedded in <object>/<embed> tag don't load at all
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 11 Feb 2015 21:36:22 +0000 (21:36 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 11 Feb 2015 21:36:22 +0000 (21:36 +0000)
https://bugs.webkit.org/show_bug.cgi?id=141457
<rdar://problem/18221851>

Reviewed by Alexey Proskuryakov.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::objectContentType):
On iOS, if we don't know what to do with a PDF-in-object, treat it as an image.

* TestExpectations:
* fast/replaced/pdf-as-object-and-embed-expected.html: Added.
* fast/replaced/pdf-as-object-and-embed.html: Added.
* platform/ios-simulator-wk2/TestExpectations:
Add a test that ensures that WebKit2 on iOS treats <object>, <embed>,
and <img> the same when rendering a PDF.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@179955 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/fast/replaced/pdf-as-object-and-embed-expected.html [new file with mode: 0644]
LayoutTests/fast/replaced/pdf-as-object-and-embed.html [new file with mode: 0644]
LayoutTests/platform/ios-simulator-wk2/TestExpectations
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp

index a8914b1a70f653b80132e620a384b1322982b7f5..6c39b3453648b53441652bedfba52c2a6066a74c 100644 (file)
@@ -1,3 +1,18 @@
+2015-02-11  Tim Horton  <timothy_horton@apple.com>
+
+        REGRESSION (iOS 8): PDFs embedded in <object>/<embed> tag don't load at all
+        https://bugs.webkit.org/show_bug.cgi?id=141457
+        <rdar://problem/18221851>
+
+        Reviewed by Alexey Proskuryakov.
+
+        * TestExpectations:
+        * fast/replaced/pdf-as-object-and-embed-expected.html: Added.
+        * fast/replaced/pdf-as-object-and-embed.html: Added.
+        * platform/ios-simulator-wk2/TestExpectations:
+        Add a test that ensures that WebKit2 on iOS treats <object>, <embed>,
+        and <img> the same when rendering a PDF.
+
 2015-02-11  ChangSeok Oh  <changseok.oh@collabora.com>
 
         Div having contentEditable and display:flex cannot be edited if it is empty.
index 3d305ffb550cae809e51db3d51f738fa98b3c773..c5c80c1460e4565a203fbae8d7944819b24e9eef 100644 (file)
@@ -477,3 +477,6 @@ webkit.org/b/87633 http/tests/appcache/abort-cache-onchecking-manifest-404.html
 webkit.org/b/87633 http/tests/appcache/abort-cache-ondownloading-resource-404.html [ Pass Failure ]
 
 webkit.org/b/141370 http/tests/security/appcache-in-private-browsing.html [ Pass Failure ]
+
+# The current expectations for this test only make sense for WebKit on iOS; other platforms can have very different behaviors.
+webkit.org/b/141488 fast/replaced/pdf-as-object-and-embed.html [ Skip ]
diff --git a/LayoutTests/fast/replaced/pdf-as-object-and-embed-expected.html b/LayoutTests/fast/replaced/pdf-as-object-and-embed-expected.html
new file mode 100644 (file)
index 0000000..8f321aa
--- /dev/null
@@ -0,0 +1,8 @@
+<html>
+<body style='margin: 0px'>
+<div>
+    <div><img src='resources/image.pdf'></div>
+    <div><img src='resources/image.pdf'></div>
+</div>
+</body>
+</html>
\ No newline at end of file
diff --git a/LayoutTests/fast/replaced/pdf-as-object-and-embed.html b/LayoutTests/fast/replaced/pdf-as-object-and-embed.html
new file mode 100644 (file)
index 0000000..fc9666d
--- /dev/null
@@ -0,0 +1,8 @@
+<html>
+<body style='margin: 0px'>
+<div>
+    <div><object data="resources/image.pdf"></object></div>
+    <div><embed src="resources/image.pdf" type="application/pdf"></embed></div>
+</div>
+</body>
+</html>
\ No newline at end of file
index f39ad531884429c2d83041bbc810bb2a1d324d76..a334edceb1d3b02f930054bd139fea47da566b14 100644 (file)
@@ -2262,3 +2262,6 @@ transitions/interrupt-transform-transition.html
 
 # Crashes when running all tests, but not by itself.
 webkit.org/b/141436 fast/loader/subframe-navigate-during-main-frame-load.html [ Crash Pass ]
+
+# Unskip otherwise globally-skipped test
+fast/replaced/pdf-as-object-and-embed.html [ Pass ]
index b99bfaf683e4d0b55bce0cc004fe698a21a1ce4a..225961eca55583827dab46a0ca7c7162d71f6be1 100644 (file)
@@ -1,3 +1,15 @@
+2015-02-11  Tim Horton  <timothy_horton@apple.com>
+
+        REGRESSION (iOS 8): PDFs embedded in <object>/<embed> tag don't load at all
+        https://bugs.webkit.org/show_bug.cgi?id=141457
+        <rdar://problem/18221851>
+
+        Reviewed by Alexey Proskuryakov.
+
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebKit::WebFrameLoaderClient::objectContentType):
+        On iOS, if we don't know what to do with a PDF-in-object, treat it as an image.
+
 2015-02-11  ChangSeok Oh  <changseok.oh@collabora.com>
 
         Activate ReliefLogger of a memory pressure handler for linux system.
index 3970ce906a9d5691e589305775c06b1b1c9bae6d..7529f92c714e0b9eba13a55be040cf86a8b78b77 100644 (file)
@@ -1501,6 +1501,12 @@ ObjectContentType WebFrameLoaderClient::objectContentType(const URL& url, const
     if (MIMETypeRegistry::isSupportedNonImageMIMEType(mimeType))
         return ObjectContentFrame;
 
+#if PLATFORM(IOS)
+    // iOS can render PDF in <object>/<embed> via PDFDocumentImage.
+    if (MIMETypeRegistry::isPDFOrPostScriptMIMEType(mimeType))
+        return ObjectContentImage;
+#endif
+
     return ObjectContentNone;
 }