- Revision
- 241509
- Author
- [email protected]
- Date
- 2019-02-14 00:34:48 -0800 (Thu, 14 Feb 2019)
Log Message
Cherry-pick r241481. rdar://problem/48065616
Encrypted PDFs inside <embed> or <object> crash the Web Content process
https://bugs.webkit.org/show_bug.cgi?id=194605
<rdar://problem/19894818>
Reviewed by Andy Estes.
Source/WebKit:
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::createPasswordEntryForm):
Don't try to create a password form field if we can't make form fields.
This means you will be left with a useless embedded PDF, but at least
the Web Content process won't crash.
We'll need to find an alternative implementation of PDF embedded form
fields that is compatible with <embed> and <object> if we want to support
this. Currently we piggy-back off the fact that we can just insert
<input>s into the PluginDocument's DOM, but we can't do that if there
is no PluginDocument, just a main document, like in the <embed> case.
LayoutTests:
* fast/replaced/encrypted-pdf-as-object-and-embed-expected.txt: Added.
* fast/replaced/encrypted-pdf-as-object-and-embed.html: Added.
* fast/replaced/resources/encrypted-image.pdf: Added.
Add a test ensuring that we don't crash with encrypted PDF in <object> or <embed>.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241481 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Modified Paths
Added Paths
Diff
Modified: branches/safari-607-branch/LayoutTests/ChangeLog (241508 => 241509)
--- branches/safari-607-branch/LayoutTests/ChangeLog 2019-02-14 08:34:43 UTC (rev 241508)
+++ branches/safari-607-branch/LayoutTests/ChangeLog 2019-02-14 08:34:48 UTC (rev 241509)
@@ -1,5 +1,53 @@
2019-02-13 Babak Shafiei <[email protected]>
+ Cherry-pick r241481. rdar://problem/48065616
+
+ Encrypted PDFs inside <embed> or <object> crash the Web Content process
+ https://bugs.webkit.org/show_bug.cgi?id=194605
+ <rdar://problem/19894818>
+
+ Reviewed by Andy Estes.
+
+ Source/WebKit:
+
+ * WebProcess/Plugins/PDF/PDFPlugin.mm:
+ (WebKit::PDFPlugin::createPasswordEntryForm):
+ Don't try to create a password form field if we can't make form fields.
+
+ This means you will be left with a useless embedded PDF, but at least
+ the Web Content process won't crash.
+
+ We'll need to find an alternative implementation of PDF embedded form
+ fields that is compatible with <embed> and <object> if we want to support
+ this. Currently we piggy-back off the fact that we can just insert
+ <input>s into the PluginDocument's DOM, but we can't do that if there
+ is no PluginDocument, just a main document, like in the <embed> case.
+
+ LayoutTests:
+
+ * fast/replaced/encrypted-pdf-as-object-and-embed-expected.txt: Added.
+ * fast/replaced/encrypted-pdf-as-object-and-embed.html: Added.
+ * fast/replaced/resources/encrypted-image.pdf: Added.
+ Add a test ensuring that we don't crash with encrypted PDF in <object> or <embed>.
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241481 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2019-02-13 Tim Horton <[email protected]>
+
+ Encrypted PDFs inside <embed> or <object> crash the Web Content process
+ https://bugs.webkit.org/show_bug.cgi?id=194605
+ <rdar://problem/19894818>
+
+ Reviewed by Andy Estes.
+
+ * fast/replaced/encrypted-pdf-as-object-and-embed-expected.txt: Added.
+ * fast/replaced/encrypted-pdf-as-object-and-embed.html: Added.
+ * fast/replaced/resources/encrypted-image.pdf: Added.
+ Add a test ensuring that we don't crash with encrypted PDF in <object> or <embed>.
+
+2019-02-13 Babak Shafiei <[email protected]>
+
Cherry-pick r241480. rdar://problem/48065618
Further restricting webarchive loads
Added: branches/safari-607-branch/LayoutTests/fast/replaced/encrypted-pdf-as-object-and-embed-expected.txt (0 => 241509)
--- branches/safari-607-branch/LayoutTests/fast/replaced/encrypted-pdf-as-object-and-embed-expected.txt (rev 0)
+++ branches/safari-607-branch/LayoutTests/fast/replaced/encrypted-pdf-as-object-and-embed-expected.txt 2019-02-14 08:34:48 UTC (rev 241509)
@@ -0,0 +1,3 @@
+This test passes as long as it does not crash.
+
+
Added: branches/safari-607-branch/LayoutTests/fast/replaced/encrypted-pdf-as-object-and-embed.html (0 => 241509)
--- branches/safari-607-branch/LayoutTests/fast/replaced/encrypted-pdf-as-object-and-embed.html (rev 0)
+++ branches/safari-607-branch/LayoutTests/fast/replaced/encrypted-pdf-as-object-and-embed.html 2019-02-14 08:34:48 UTC (rev 241509)
@@ -0,0 +1,15 @@
+<html>
+<head>
+<script>
+ if (window.testRunner)
+ testRunner.dumpAsText();
+</script>
+</head>
+<body style='margin: 0px'>
+This test passes as long as it does not crash.
+<div>
+ <div><object data=""
+ <div><embed src="" type="application/pdf"></embed></div>
+</div>
+</body>
+</html>
\ No newline at end of file
Added: branches/safari-607-branch/LayoutTests/fast/replaced/resources/encrypted-image.pdf (0 => 241509)
--- branches/safari-607-branch/LayoutTests/fast/replaced/resources/encrypted-image.pdf (rev 0)
+++ branches/safari-607-branch/LayoutTests/fast/replaced/resources/encrypted-image.pdf 2019-02-14 08:34:48 UTC (rev 241509)
@@ -0,0 +1,161 @@
+%PDF-1.6
+%\xC4\xE5\xF2\xE5\xEB\xA7\xF3\xA0\xD0\xC4\xC6
+4 0 obj
+<< /Length 5 0 R /Filter /FlateDecode >>
+stream
+\xF3\xCD\xF45\x943\xB5\x9F\xCCu\xBB\xDC\xFC&\xC8\xE89N\x9B\xF2x\x88\x8B\xD3^$B\xF2\xA9\xFD\xB8\xB0\xB4\xC5<'F\x9CI\xA2,\xA2\xC0ui]NLN\xC6\xEFx\xD96\xB4\xA1\xDF&!\x93\xFF\xABf\x87\xB58\x81\xCEk\x82\x88\xA7^[\xAA\xF6<k\xFC\xC6\xCE\xD2��\xFC2=\xB3l\xD5\xD2'9O;\xD5m\xFE0\\xC8Y}\xEE\xC1\xC8懾\x81\xF4\xE7\xF1\xAA\xBA\xBFa\xB7\x94\xAEH\xE7:]K.k\x9C@\x8Dl*u \xB6i\xF0��\xD6\xE6\xC2d2M\xF3\xC9\xEEX\x8B)Mc\xA6\xF7\xC8#U\x8EϽD\xD2=\x930&\xA9\xE3ch&\xB6] \xFBJU@\x83\xAF;(\xF34\xC3*\xC0\xED\x91\xE3\x9Bl\xAEH\xE4\x91\xD1Z0\x8Eby\xCA\xC7*vx<>\xAC\x82D\x87\xF0=U\xFC*\xA8\x92\x81@赉\\x83\xA23U)\x99\xF0\xCC|/\xFC\xB6\xA2G\x92iN1K\x8F\xCAbĠ\xDC\x9C\xCB4o~\xACВ\xF1x\x84\xA4[\xFF`\xB4\xE5\x9Fh\xDC}\x84`\xC9 \x99\x96/(\xE9\x8F\xF1p\xA3o{\xCERl\xC2#v\xF4Ag\xBC\x84\xD0tRP\xD7\xE1\x96\xF2E4\x9F\xB2\xE1\xAD\xFE\x89\x92MdG\xAB.\xBEI\xA1$\x97\x97q};z\xF2i\xBD\xE8B\x86\x92\xB1jz\xB2*
+\x8E\x82B\x86\xEFŻ\xC1\xF9++��\x87+\xF9\x8EɖS/Zb\xD3L\xE5T:ެ\xD1\xFD\xA1\xAA\x9E!\xD6Oy\xCB\xC5b|\xBA*\xA7y\xEDG6\xCC+\xFB\x8B\xBC\x9B\xF7\xE8\x863\x8B$\xDD\xEEV\xB0}\x84]Ğ\xBA*8f\x8C\xBBB(r\,+\xA1C
+endstream
+endobj
+5 0 obj
+480
+endobj
+2 0 obj
+<< /Type /Page /Parent 3 0 R /Resources 6 0 R /Contents 4 0 R /MediaBox [0 0 612 792]
+>>
+endobj
+6 0 obj
+<< /ProcSet [ /PDF /ImageB /ImageC /ImageI ] /ColorSpace << /Cs1 11 0 R >>
+/XObject << /Im1 7 0 R /Im2 9 0 R >> >>
+endobj
+7 0 obj
+<< /Length 8 0 R /Type /XObject /Subtype /Image /Width 92 /Height 92 /Interpolate
+true /ColorSpace 11 0 R /SMask 12 0 R /BitsPerComponent 8 /Filter /FlateDecode
+>>
+stream
+\xF3\xCD\xF45\x943\xB5\x9F\xCCu\xBB\xDC\xFC&\xC8\xE8\x95\x8A32\xA7\x96G\x91\xB2\xA3Ս\xEB\xE9+\x81997Qr\x91K\x90\xFF`Fg\xC8\xC0\x9AJ\x92\x931\xCE \xA9\x983\xBA\xBBg\xDD\xE9K\xD5\xD2f\xA8d}ifV\x94b\xEA\xAA\xDF\xFA\xC8\xEA\x8F\\x90\xC1o\xF8\xDDPu\x81\x94\x8A\xB2\xD2`#\x96\xF9<\x9B^GB\xCA$\xF0\xFDA\x96\xAC\xB3~\x93\xD7s\x90\xC0\xF9\xE5uJ\x93\xBA\x89ؽ\xFC\xF6Q4m\xA5\xBCh\xAA\xB8\xA1\xA0Sr\x8B\xC8n2ٮ\x8Dؕ
+endstream
+endobj
+8 0 obj
+160
+endobj
+9 0 obj
+<< /Length 10 0 R /Type /XObject /Subtype /Image /Width 36 /Height 36 /Interpolate
+true /ColorSpace 11 0 R /SMask 14 0 R /BitsPerComponent 8 /Filter /FlateDecode
+>>
+stream
+\xF3\xCD\xF45\x943\xB5\x9F\xCCu\xBB\xDC\xFC&\xC8\xE8\xD1`\xF7 \xB7\x89\xE9\xD20\xBB\xDDlu+|}\xB6)\xBB\xCAPdn\x97\xA4\xAE\x9EaXk\xAEހw\xE7\xA6
+endstream
+endobj
+10 0 obj
+64
+endobj
+14 0 obj
+<< /Length 15 0 R /Type /XObject /Subtype /Image /Width 36 /Height 36 /ColorSpace
+/DeviceGray /Interpolate true /BitsPerComponent 8 /Filter /FlateDecode >>
+stream
+\xF3\xCD\xF45\x943\xB5\x9F\xCCu\xBB\xDC\xFC&\xC8\xE89\x90U\x80\xB0o+\xF2+\x92]\xC8\x99a-\xFE\xEA\xDD\xDCjO\x97\xDA\xD6 \x82\x81M\xA7\xAD2\x96K$\xFE\x80:\xBB\x8E=j\\xCAB\xACm{h\x83a\xF2\x88a\xE5`ĀQ\x84\xB0E~tҸ\xB2vE\xE9\xB3\xC6ذM\x82\xB39\xB74\xE4Lo[\xB7\x9C\xC4\xE1*z)[V\xC8\xEF%F\xDCC(\xB2V\xA1\xC4$<\x9B\xB3\xD5\x8D1\xF1\x80e\xE3\xB1݂+\x9E\xAE`\xCB\xE7b\xE3\xC9w\xF0\x80\xBE\xDFJ ҁ\xED\x90BБᳱ4zK/>\xD4|\xD9E*_\xBC\xEE\x87W_\x95\xDElx\xA6\x8C\xE9\x87o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\xB2\xD5N\xB9\x804O\xCEl5rX5m\xC9
+��\xF9\xBCU\x97Je
+endstream
+endobj
+15 0 obj
+736
+endobj
+12 0 obj
+<< /Length 13 0 R /Type /XObject /Subtype /Image /Width 92 /Height 92 /ColorSpace
+/DeviceGray /Interpolate true /BitsPerComponent 8 /Filter /FlateDecode >>
+stream
+\xF3\xCD\xF45\x943\xB5\x9F\xCCu\xBB\xDC\xFC&\xC8\xE8L\xFCp?\xC9j\xBE\x99@\xFF\xA5\x8B"\x8A\x88j\x85\xD9Ġ\x8F\xE1\xC5\x89\xC358\xB0\x86S\xEB\xACY\xA8k2=k:L\xE5C\xC5b[\xEF\xACn78\x85,\xEF\x9D\xA1\xB5_w\xCD\xEA\xF3u\xA8\x97\x92\xC4g\xDC\xEB<\xFA/\xA1x\xF1&\xED\xE2\x810\x87\xB1\xB8\xA0\xD5\xE7C\xBCJ\x9D,\xB0H\xDD@_\xF2}\xEE\x96\xFFNUA\xE8\xF2\xEE0Zy\x8F
+\xBEb1\xED8V+^K\xDD3\x99\x9F\xEDS\x86\x97K\xAFw[:\xA4h\x95\xF0\x94\x83nj\xD0{&ǔS\xAA\xCC \xDDU\xF2\xCE\xF1oI\xAB1Gs1D\xF9L~\x9A`U>QW8\x9B\x96>\xE7)F3\xA5\x95JA\xE8\x916\xDD2\xFBTq5\xF7\xE6Ha|\xF5o+b5\xF4
+\xE2hJ\x9D\x92]\xF2E+\xD6\xAEѷ\xFF\xA6*\xEB\xFCͣXˢ\xF6X \x9Bm\x99\xE6\xD2\xE9}<\xD2\xF4\x9070\xE1\xA9k{|\xBA X\xF7\x98<\xFA\xAEt$\xB1KXs\x93R\x9E9\xC3\xE2U\x8B\xCAY\xD4\xF1\xB96\x99\xF6\xE2}\xFBc\xEF戅\xB9S|*p\xC5:\xD6\xDCXI\x8A
+"\x80;b��\x81u\xA7\xF1`\xC0\xDC>\xCC\x8A\xB7\xD1O\xB3'\xD0\xD6\xF4p\xED\xE8\xF3\x83$$\xB2\xB0\xBB\xCC-2ߓu8H\xECX8OC \x86\x88\xD9Ψ\xA2\xEF\xB1p\xCE\xECI\x85\xEB\xB3\xEF\xBA\xDF\xE5d\xA2\xA8\x8A\xEA\x99'\xCBn\xA1\x9A:'\x9A\xF1㤳\xBB\xF1\xE2\xC7;b]\xC4봘\xD0\xB7\x88\xABKL\xA4z��g\x9C\xA2\xE7\xF2o\x92\x9F\xE7\xEF\x86S\xF4֮\xF6,\xA6\xF8\x98\xAC\xAAU\xF5k\xF0\x81\x911\xD1\x9EI,/i5B':\x94QuU\xAA\xB5\xC5@\x96:\x86u\xBC\x9B\x9F\xEFV\xA2\xF0ݳ\xA2u\xC2;_)$\x95J\xC1Q\x85Ym\xB5]\xB8��\xB3\xCB��\xF3\x84\xDA\xC6\xE5\xDF%D@R\x85P\xA9I3\xF3#Z;S\xAB\xF2\x80]J^\xC2\xFB\xD9&y\xAB��w\xF2_&\x90\xEFW\x90\x9D\xD4±\xFE\x9D\xCE%m\xBC\\xF3\xE5uN\xA3U\xEA[h\xDDX\x95\xA5b8\xE8\xF7\xF9p:|\xBE\xA3>{_\xA1\xED\x9D0\xBA.\xFF֙\x90VJ1\xB0\xBF\xE9\xC8sH\xDFz^Hl\xFC}\xC6$P\xFF\xFC\xC7
+endstream
+endobj
+13 0 obj
+704
+endobj
+16 0 obj
+<< /Length 17 0 R /N 3 /Alternate /DeviceRGB /Filter /FlateDecode >>
+stream
+\xF3\xCD\xF45\x943\xB5\x9F\xCCu\xBB\xDC\xFC&\xC8诺\xF8#K``\\xC8\xFC{\xCD\xEFY\x81\xFF\xF3\xAD\xCA\xE5\xBCY\xFE\xE3\xBBLo-\xE1\xD7M;\xAA\xAF\xD0\xF7\xECz\xB5+zDFE\xAC\xB8\xB0\xE9\xB2;J\x84\xBF;N\x9EDO\x94TC%^\x86.[N\x95\x9D]
+\x8D\xD0\xEAx\x8F\xD0\xD2\xF5\xD2@swOI9B\xB8DBC\x95\x8B\xA4\xA4=_\x89\xB1\x9E\x97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88!u\xA2\xDBđ=.\xA1\xB6ަdܟ\xE7&\xA0XY^\xEB`\xA9\xF2?O\x9DOY\xE1\xAFP\xC6)\xBB\xFCг\xCB)dW\x82\xBC\xA5\xFA\xBB\xEA\xE4 \xAC\x86\xA8\xD5+\xB1lsL\xA3\xD9Z^\xEAyf\xF7\xF1\xFCnt\xAB\xA1\x93\x81\xC72\xB6\x80<C\xA5\x92\xD5I\xC2\x82\xC6XD5\xB3\x88-\ph84\xAD\x9B\x9D\xB4\\xDFi
+endstream
+endobj
+17 0 obj
+768
+endobj
+11 0 obj
+[ /ICCBased 16 0 R ]
+endobj
+3 0 obj
+<< /Type /Pages /MediaBox [0 0 612 792] /Count 1 /Kids [ 2 0 R ] >>
+endobj
+18 0 obj
+<< /Type /Catalog /Pages 3 0 R /Version /1.6 >>
+endobj
+19 0 obj
+(\xF3\xCD\xF45\x943\xB5\x9F\xCCu\xBB\xDC\xFC&\xC8\xE8\033\xDB#\034,\005\xFA\xAB\031\025w\037\x90a8\x9E)
+endobj
+20 0 obj
+(\xF3\xCD\xF45\x943\xB5\x9F\xCCu\xBB\xDC\xFC&\xC8\xE8!\022\xBCS\031\xBDm\006?\xF6\036s|\xEB8\xBDɎ\xA3\xFC\xF6M\034$W\xBE\xC2\000#C7\022m\\\xDB\xC1\022f\013\xE3\xE6mc+5\xE5Z\)\xE9\xC7FW\xD0\xF4H\xACܧ\xC3\034\xC2\xFB\xB3\x8B)
+endobj
+21 0 obj
+(\xF3\xCD\xF45\x943\xB5\x9F\xCCu\xBB\xDC\xFC&\xC8\xE8\xC4\xE1ﳐ\xFB\x8F\xE8\xAD=L^-\015\xD3l)
+endobj
+22 0 obj
+(\xF3\xCD\xF45\x943\xB5\x9F\xCCu\xBB\xDC\xFC&\xC8蓍\xFD\xFA\xF9n\xAF\x88\x85Z~jv\037\xAF=!\xE5$x\x94ߐ\xAF\006\001#!\xD1L\016K)
+endobj
+23 0 obj
+(\xF3\xCD\xF45\x943\xB5\x9F\xCCu\xBB\xDC\xFC&\xC8\xE8\x88\001\xD7\xCCW=\xBE\xE6\035\xE3R\x864\xF4\xEF\xB0)
+endobj
+24 0 obj
+[ ]
+endobj
+1 0 obj
+<< /Title 19 0 R /Producer 20 0 R /Creator 21 0 R /CreationDate 22 0 R /ModDate
+22 0 R /Keywords 23 0 R /AAPL:Keywords 24 0 R >>
+endobj
+25 0 obj
+<< /Filter /Standard /V 4 /R 4 /Length 128 /CF << /StdCF << /AuthEvent /DocOpen
+/CFM /AESV2 /Length 16 >> >> /StmF /StdCF /StrF /StdCF /O <13c66a43c490aaab3dec89368cee72e8bfa665160d9d7c3be12a1b93229fa84c>
+/U <2681f20cc4807592b39b35f1f457c3d300000000000000000000000000000000> /P -4
+>>
+endobj
+xref
+0 26
+0000000000 65535 f
+0000004831 00000 n
+0000000595 00000 n
+0000004274 00000 n
+0000000022 00000 n
+0000000576 00000 n
+0000000699 00000 n
+0000000829 00000 n
+0000001186 00000 n
+0000001205 00000 n
+0000001467 00000 n
+0000004237 00000 n
+0000002432 00000 n
+0000003326 00000 n
+0000001486 00000 n
+0000002412 00000 n
+0000003346 00000 n
+0000004217 00000 n
+0000004357 00000 n
+0000004421 00000 n
+0000004490 00000 n
+0000004621 00000 n
+0000004675 00000 n
+0000004754 00000 n
+0000004811 00000 n
+0000004975 00000 n
+trailer
+<< /Size 26 /Root 18 0 R /Encrypt 25 0 R /Info 1 0 R /ID [ <b5f907f4345af7c507b1960eeb3eb858>
+<b5f907f4345af7c507b1960eeb3eb858> ] >>
+startxref
+5275
+%%EOF
Added: branches/safari-607-branch/LayoutTests/platform/ios/fast/replaced/encrypted-pdf-as-object-and-embed-expected.txt (0 => 241509)
--- branches/safari-607-branch/LayoutTests/platform/ios/fast/replaced/encrypted-pdf-as-object-and-embed-expected.txt (rev 0)
+++ branches/safari-607-branch/LayoutTests/platform/ios/fast/replaced/encrypted-pdf-as-object-and-embed-expected.txt 2019-02-14 08:34:48 UTC (rev 241509)
@@ -0,0 +1,2 @@
+This test passes as long as it does not crash.
+
Modified: branches/safari-607-branch/Source/WebKit/ChangeLog (241508 => 241509)
--- branches/safari-607-branch/Source/WebKit/ChangeLog 2019-02-14 08:34:43 UTC (rev 241508)
+++ branches/safari-607-branch/Source/WebKit/ChangeLog 2019-02-14 08:34:48 UTC (rev 241509)
@@ -1,5 +1,61 @@
2019-02-13 Babak Shafiei <[email protected]>
+ Cherry-pick r241481. rdar://problem/48065616
+
+ Encrypted PDFs inside <embed> or <object> crash the Web Content process
+ https://bugs.webkit.org/show_bug.cgi?id=194605
+ <rdar://problem/19894818>
+
+ Reviewed by Andy Estes.
+
+ Source/WebKit:
+
+ * WebProcess/Plugins/PDF/PDFPlugin.mm:
+ (WebKit::PDFPlugin::createPasswordEntryForm):
+ Don't try to create a password form field if we can't make form fields.
+
+ This means you will be left with a useless embedded PDF, but at least
+ the Web Content process won't crash.
+
+ We'll need to find an alternative implementation of PDF embedded form
+ fields that is compatible with <embed> and <object> if we want to support
+ this. Currently we piggy-back off the fact that we can just insert
+ <input>s into the PluginDocument's DOM, but we can't do that if there
+ is no PluginDocument, just a main document, like in the <embed> case.
+
+ LayoutTests:
+
+ * fast/replaced/encrypted-pdf-as-object-and-embed-expected.txt: Added.
+ * fast/replaced/encrypted-pdf-as-object-and-embed.html: Added.
+ * fast/replaced/resources/encrypted-image.pdf: Added.
+ Add a test ensuring that we don't crash with encrypted PDF in <object> or <embed>.
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241481 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2019-02-13 Tim Horton <[email protected]>
+
+ Encrypted PDFs inside <embed> or <object> crash the Web Content process
+ https://bugs.webkit.org/show_bug.cgi?id=194605
+ <rdar://problem/19894818>
+
+ Reviewed by Andy Estes.
+
+ * WebProcess/Plugins/PDF/PDFPlugin.mm:
+ (WebKit::PDFPlugin::createPasswordEntryForm):
+ Don't try to create a password form field if we can't make form fields.
+
+ This means you will be left with a useless embedded PDF, but at least
+ the Web Content process won't crash.
+
+ We'll need to find an alternative implementation of PDF embedded form
+ fields that is compatible with <embed> and <object> if we want to support
+ this. Currently we piggy-back off the fact that we can just insert
+ <input>s into the PluginDocument's DOM, but we can't do that if there
+ is no PluginDocument, just a main document, like in the <embed> case.
+
+2019-02-13 Babak Shafiei <[email protected]>
+
Cherry-pick r241480. rdar://problem/48065618
Further restricting webarchive loads
Modified: branches/safari-607-branch/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm (241508 => 241509)
--- branches/safari-607-branch/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm 2019-02-14 08:34:43 UTC (rev 241508)
+++ branches/safari-607-branch/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm 2019-02-14 08:34:48 UTC (rev 241509)
@@ -1124,6 +1124,9 @@
void PDFPlugin::createPasswordEntryForm()
{
+ if (!supportsForms())
+ return;
+
m_passwordField = PDFPluginPasswordField::create(m_pdfLayerController.get(), this);
m_passwordField->attach(m_annotationContainer.get());
}