Changeset 241481 in webkit


Ignore:
Timestamp:
Feb 13, 2019 3:08:26 PM (5 years ago)
Author:
timothy_horton@apple.com
Message:

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>.

Location:
trunk
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r241480 r241481  
     12019-02-13  Tim Horton  <timothy_horton@apple.com>
     2
     3        Encrypted PDFs inside <embed> or <object> crash the Web Content process
     4        https://bugs.webkit.org/show_bug.cgi?id=194605
     5        <rdar://problem/19894818>
     6
     7        Reviewed by Andy Estes.
     8
     9        * fast/replaced/encrypted-pdf-as-object-and-embed-expected.txt: Added.
     10        * fast/replaced/encrypted-pdf-as-object-and-embed.html: Added.
     11        * fast/replaced/resources/encrypted-image.pdf: Added.
     12        Add a test ensuring that we don't crash with encrypted PDF in <object> or <embed>.
     13
    1142019-02-12  Jiewen Tan  <jiewen_tan@apple.com>
    215
  • trunk/Source/WebKit/ChangeLog

    r241480 r241481  
     12019-02-13  Tim Horton  <timothy_horton@apple.com>
     2
     3        Encrypted PDFs inside <embed> or <object> crash the Web Content process
     4        https://bugs.webkit.org/show_bug.cgi?id=194605
     5        <rdar://problem/19894818>
     6
     7        Reviewed by Andy Estes.
     8
     9        * WebProcess/Plugins/PDF/PDFPlugin.mm:
     10        (WebKit::PDFPlugin::createPasswordEntryForm):
     11        Don't try to create a password form field if we can't make form fields.
     12
     13        This means you will be left with a useless embedded PDF, but at least
     14        the Web Content process won't crash.
     15
     16        We'll need to find an alternative implementation of PDF embedded form
     17        fields that is compatible with <embed> and <object> if we want to support
     18        this. Currently we piggy-back off the fact that we can just insert
     19        <input>s into the PluginDocument's DOM, but we can't do that if there
     20        is no PluginDocument, just a main document, like in the <embed> case.
     21
    1222019-02-12  Jiewen Tan  <jiewen_tan@apple.com>
    223
  • trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm

    r241000 r241481  
    11251125void PDFPlugin::createPasswordEntryForm()
    11261126{
     1127    if (!supportsForms())
     1128        return;
     1129
    11271130    m_passwordField = PDFPluginPasswordField::create(m_pdfLayerController.get(), this);
    11281131    m_passwordField->attach(m_annotationContainer.get());
Note: See TracChangeset for help on using the changeset viewer.