<?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>51195</bug_id>
          
          <creation_ts>2010-12-16 10:16:09 -0800</creation_ts>
          <short_desc>MediaPlayer should look for MIME type in data: URL</short_desc>
          <delta_ts>2010-12-23 01:26:05 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Media</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</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></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Eric Carlson">eric.carlson</reporter>
          <assigned_to name="Eric Carlson">eric.carlson</assigned_to>
          <cc>abarth</cc>
    
    <cc>darin</cc>
    
    <cc>eric</cc>
    
    <cc>jberlin</cc>
    
    <cc>pnormand</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>323247</commentid>
    <comment_count>0</comment_count>
    <who name="Eric Carlson">eric.carlson</who>
    <bug_when>2010-12-16 10:16:09 -0800</bug_when>
    <thetext>MediaPlayer::load should try to get the MIME type from the url when passed a data: url.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>323278</commentid>
    <comment_count>1</comment_count>
      <attachid>76786</attachid>
    <who name="Eric Carlson">eric.carlson</who>
    <bug_when>2010-12-16 10:52:20 -0800</bug_when>
    <thetext>Created attachment 76786
Proposed patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>323287</commentid>
    <comment_count>2</comment_count>
      <attachid>76786</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2010-12-16 10:59:06 -0800</bug_when>
    <thetext>Comment on attachment 76786
Proposed patch

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

Can we make tests for this?

&gt; WebCore/platform/graphics/MediaPlayer.cpp:306
&gt; +    // If the MIME type is missing or is not meaningful, try to figure it out from the url.
&gt; +    if (type.isEmpty() &amp;&amp; protocolIs(url, &quot;data&quot;))

The comment says “is not meaningful”, but the code only checks for empty strings. Aren’t there other non-meaningful MIME types?

I suggest capitalizing URL in the comment.

I suggest we add protocolIsData to KURL.h. We already have it for actual KURL objects and I’d like to have it for strings. It’s not good to have the actual &quot;data&quot; string in the code. We should also adopt protocolIsData in KURL.cpp, KURLGoogle.cpp, DataURL.cpp, ResourceHandleSoup.cpp. None of that needs to be done right away or by you.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>323296</commentid>
    <comment_count>3</comment_count>
    <who name="Eric Carlson">eric.carlson</who>
    <bug_when>2010-12-16 11:09:30 -0800</bug_when>
    <thetext>(In reply to comment #2)
&gt; 
&gt; Can we make tests for this?
&gt; 
  The MIME type is only used internally within MediaPlayer so I couldn&apos;t think of a way to create a test.

&gt; &gt; WebCore/platform/graphics/MediaPlayer.cpp:306
&gt; &gt; +    // If the MIME type is missing or is not meaningful, try to figure it out from the url.
&gt; &gt; +    if (type.isEmpty() &amp;&amp; protocolIs(url, &quot;data&quot;))
&gt; 
&gt; The comment says “is not meaningful”, but the code only checks for empty strings. Aren’t there other non-meaningful MIME types?
&gt; 
  Good point, we try to infer the MIME type from the file extension when passed application/octetstream or text/plain, so we should look for type in a data url when passed those types as well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>325689</commentid>
    <comment_count>4</comment_count>
    <who name="Eric Carlson">eric.carlson</who>
    <bug_when>2010-12-22 14:13:38 -0800</bug_when>
    <thetext>http://trac.webkit.org/changeset/74504</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>325730</commentid>
    <comment_count>5</comment_count>
    <who name="Jessie Berlin">jberlin</who>
    <bug_when>2010-12-22 15:28:39 -0800</bug_when>
    <thetext>(In reply to comment #4)
&gt; http://trac.webkit.org/changeset/74504

I think this change broke media/audio-data-url.html in the Windows 7 Release Tests:

http://build.webkit.org/results/Windows%207%20Release%20(Tests)/r74504%20(7657)/media/audio-data-url-pretty-diff.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>325736</commentid>
    <comment_count>6</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2010-12-22 15:32:42 -0800</bug_when>
    <thetext>http://trac.webkit.org/changeset/74504 might have broken GTK Linux 64-bit Debug
The following tests are not passing:
media/audio-data-url.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>325869</commentid>
    <comment_count>7</comment_count>
    <who name="Jessie Berlin">jberlin</who>
    <bug_when>2010-12-22 20:02:49 -0800</bug_when>
    <thetext>Bug for the failing Windows 7 Release Tests

https://bugs.webkit.org/show_bug.cgi?id=51518</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>325984</commentid>
    <comment_count>8</comment_count>
    <who name="Philippe Normand">pnormand</who>
    <bug_when>2010-12-23 01:26:05 -0800</bug_when>
    <thetext>(In reply to comment #6)
&gt; http://trac.webkit.org/changeset/74504 might have broken GTK Linux 64-bit Debug
&gt; The following tests are not passing:
&gt; media/audio-data-url.html

https://bugs.webkit.org/show_bug.cgi?id=51525 ...</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>76786</attachid>
            <date>2010-12-16 10:52:20 -0800</date>
            <delta_ts>2010-12-16 10:59:05 -0800</delta_ts>
            <desc>Proposed patch</desc>
            <filename>patch_1.txt</filename>
            <type>text/plain</type>
            <size>1797</size>
            <attacher name="Eric Carlson">eric.carlson</attacher>
            
              <data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gYXBwbGljYXRpb25PY3RldFN0cmVhbSgpIHx8IHR5cGUgPT0gdGV4
dFBsYWluKCkpIHsKICAgICAgICAgc2l6ZV90IHBvcyA9IHVybC5yZXZlcnNlRmluZCgnLicpOwog
ICAgICAgICBpZiAocG9zICE9IG5vdEZvdW5kKSB7CiAgICAgICAgICAgICBTdHJpbmcgZXh0ZW5z
aW9uID0gdXJsLnN1YnN0cmluZyhwb3MgKyAxKTsK
</data>
<flag name="review"
          id="67793"
          type_id="1"
          status="+"
          setter="darin"
    />
          </attachment>
      

    </bug>

</bugzilla>