<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>64934</bug_id>
          
          <creation_ts>2011-07-21 05:23:01 -0700</creation_ts>
          <short_desc>[Mac] Embedding PDF with &lt;object&gt; or &lt;embed&gt; fails when there is no MIME type specified</short_desc>
          <delta_ts>2011-10-11 22:43:53 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>PDF</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="lvschie">lvschie</reporter>
          <assigned_to name="Alexey Proskuryakov">ap</assigned_to>
          <cc>aestes</cc>
    
    <cc>andersca</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>440356</commentid>
    <comment_count>0</comment_count>
    <who name="lvschie">lvschie</who>
    <bug_when>2011-07-21 05:23:01 -0700</bug_when>
    <thetext>In Safari 5.1 and the most recent versions of WebKit the embedding of PDF&apos;s in the HTML tags OBJECT or EMBED fail (at least under Lion) and display the message &quot;Missing plugin&quot;. In earlier versions of Safari (5.0x and lower) this worked like a charm. This is a major issue for us, because our software relies heavily on this and there are not alternatives available for Lion yet (Acrobat PDF plugin not supported onder OS X 10.7 Lion). It seems that the embedded PDF viewer only displays PDF&apos;s that are loaded directly into a page correctly, but not those embedded in the OBJECT and/or EMBED tags.

Example of code: 

&lt; object data=&quot;file.pdf&quot; width=&quot;80%&quot; height=&quot;80%&quot; type=&quot;application/pdf&quot; &gt;Object embed not supported by this browser &lt; /object &gt;

or:

&lt; embed src=&quot;file.pdf&quot; width=&quot;80%&quot; height=&quot;80%&quot; &gt;&lt; /embed &gt;

Example of website that shows the issue:

http://blogs.adobe.com/pdfdevjunkie/2007/08/using_the_html_embed_tag_to_di.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>440496</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2011-07-21 11:05:29 -0700</bug_when>
    <thetext>&lt;rdar://problem/9816330&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>443489</commentid>
    <comment_count>2</comment_count>
    <who name="lvschie">lvschie</who>
    <bug_when>2011-07-28 07:41:01 -0700</bug_when>
    <thetext>I sure hope that either you guys at Webkit, or Apple, fix this issue. It&apos;s driving me nuts, to say the least.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>481779</commentid>
    <comment_count>3</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2011-10-11 11:46:43 -0700</bug_when>
    <thetext>This largely works in nightlies already. One exception is the latter example, where &lt;embed&gt; doesn&apos;t have a type. Patch forthcoming.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>481785</commentid>
    <comment_count>4</comment_count>
      <attachid>110552</attachid>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2011-10-11 11:51:43 -0700</bug_when>
    <thetext>Created attachment 110552
proposed fix</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>481788</commentid>
    <comment_count>5</comment_count>
      <attachid>110552</attachid>
    <who name="">mitz</who>
    <bug_when>2011-10-11 11:56:01 -0700</bug_when>
    <thetext>Comment on attachment 110552
proposed fix

View in context: https://bugs.webkit.org/attachment.cgi?id=110552&amp;action=review

&gt; Source/WebKit2/WebProcess/WebPage/WebPage.cpp:336
&gt; +            || (parameters.mimeType.isEmpty() &amp;&amp; parameters.url.string().lower().endsWith(&quot;.pdf&quot;)))

This should check the path component of the url rather than the whole string.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>481792</commentid>
    <comment_count>6</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2011-10-11 12:00:54 -0700</bug_when>
    <thetext>Committed &lt;http://trac.webkit.org/changeset/97167&gt;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>482229</commentid>
    <comment_count>7</comment_count>
    <who name="lvschie">lvschie</who>
    <bug_when>2011-10-11 22:43:53 -0700</bug_when>
    <thetext>Great, it works partially. Only thing missing now are the zoom, download and page forward/back buttons when a PDF is loaded. I assume that these will be visible when Mac OS X 10.7.2 is launched?</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>110552</attachid>
            <date>2011-10-11 11:51:43 -0700</date>
            <delta_ts>2011-10-11 11:56:01 -0700</delta_ts>
            <desc>proposed fix</desc>
            <filename>PDFNoMIMEType.txt</filename>
            <type>text/plain</type>
            <size>1586</size>
            <attacher name="Alexey Proskuryakov">ap</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJLaXQyL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
S2l0Mi9DaGFuZ2VMb2cJKHJldmlzaW9uIDk3MTY2KQorKysgU291cmNlL1dlYktpdDIvQ2hhbmdl
TG9nCSh3b3JraW5nIGNvcHkpCkBAIC0xLDMgKzEsMTUgQEAKKzIwMTEtMTAtMTEgIEFsZXhleSBQ
cm9za3VyeWFrb3YgIDxhcEBhcHBsZS5jb20+CisKKyAgICAgICAgRW1iZWRkaW5nIG9mIFBERidz
IHdpdGggPG9iamVjdD4gb3IgPGVtYmVkPiBmYWl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KQorKysgU291cmNlL1dlYktpdDIvV2ViUHJvY2Vz
cy9XZWJQYWdlL1dlYlBhZ2UuY3BwCSh3b3JraW5nIGNvcHkpCkBAIC0zMzIsNyArMzMyLDggQEAg
UGFzc1JlZlB0cjxQbHVnaW4+IFdlYlBhZ2U6OmNyZWF0ZVBsdWdpbgogCiAgICAgaWYgKHBsdWdp
blBhdGguaXNOdWxsKCkpIHsKICNpZiBQTEFURk9STShNQUMpCi0gICAgICAgIGlmIChwYXJhbWV0
ZXJzLm1pbWVUeXBlID09ICJhcHBsaWNhdGlvbi9wZGYiKQorICAgICAgICBpZiAocGFyYW1ldGVy
cy5taW1lVHlwZSA9PSAiYXBwbGljYXRpb24vcGRmIgorICAgICAgICAgICAgfHwgKHBhcmFtZXRl
cnMubWltZVR5cGUuaXNFbXB0eSgpICYmIHBhcmFtZXRlcnMudXJsLnN0cmluZygpLmxvd2VyKCku
ZW5kc1dpdGgoIi5wZGYiKSkpCiAgICAgICAgICAgICByZXR1cm4gQnVpbHRJblBERlZpZXc6OmNy
ZWF0ZShtX3BhZ2UuZ2V0KCkpOwogI2VuZGlmCiAgICAgICAgIHJldHVybiAwOwo=
</data>
<flag name="review"
          id="108089"
          type_id="1"
          status="+"
          setter="mitz"
    />
          </attachment>
      

    </bug>

</bugzilla>