<?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>89764</bug_id>
          
          <creation_ts>2012-06-22 09:39:00 -0700</creation_ts>
          <short_desc>Prefer PluginDocument over MediaDocument</short_desc>
          <delta_ts>2022-07-12 11:37:36 -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>DOM</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</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>0</everconfirmed>
          <reporter name="Daniel Drake">dsd</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>ap</cc>
    
    <cc>bfulgham</cc>
    
    <cc>darin</cc>
    
    <cc>eric.carlson</cc>
    
    <cc>jer.noble</cc>
    
    <cc>philn</cc>
    
    <cc>pnormand</cc>
    
    <cc>rniwa</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>655511</commentid>
    <comment_count>0</comment_count>
    <who name="Daniel Drake">dsd</who>
    <bug_when>2012-06-22 09:39:00 -0700</bug_when>
    <thetext>Currently, WebCore/dom/DOMImplementation.cpp createDocument() prefers MediaDocument over PluginDocument for a file loaded by clicking on a link such as &lt;a href=&quot;foo.ogg&quot;&gt;link&lt;/a&gt;

For OLPC, this is not ideal: we have already-deployed content shipped in this way, but the inbuilt WebKit media support does not use Xv hardware acceleration (and seems to be moving even further away from that, towards OpenGL). This means that the video playback is so choppy that videos are un-watchable.

It also seems that in the general case, there would be some value in letting the user/deployer have power here to define which technologies are used for media playback.

Preferring PluginDocument over MediaDocument, a simple reordering of the code, would solve such issues in the same way that plugins can be used for SVG. Would this be acceptable? Patch coming up.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>655515</commentid>
    <comment_count>1</comment_count>
      <attachid>149043</attachid>
    <who name="Daniel Drake">dsd</who>
    <bug_when>2012-06-22 09:44:16 -0700</bug_when>
    <thetext>Created attachment 149043
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>655533</commentid>
    <comment_count>2</comment_count>
    <who name="Eric Carlson">eric.carlson</who>
    <bug_when>2012-06-22 10:00:58 -0700</bug_when>
    <thetext>The general trend on the Web to use &lt;video&gt; *instead of* &lt;embed&gt; for embedded video, so I think this is absolutely the wrong approach. This change may improve the performance of &lt;a href=myvideo&gt;, but it does nothing for the far the more common case of &lt;video src=myvideo&gt;, so how can it possibly make sense?

If &lt;video&gt; is slower than a plug-in on OLPC, move the logic from the plug-in down into the media element.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>655547</commentid>
    <comment_count>3</comment_count>
    <who name="Daniel Drake">dsd</who>
    <bug_when>2012-06-22 10:14:52 -0700</bug_when>
    <thetext>OLPC has never had support for &lt;video&gt; and &lt;audio&gt;, so our projects have built up content around &lt;a&gt;. Thats why it makes sense for us - we&apos;re breaking a lot of our existing content with our move to webkit :( &lt;a&gt; *is* the common case in our corner of the world.

But I can see your point about &lt;video&gt; being the way forward, at least in the wider view of things.

I did not get a very encouraging response about adding Xv acceleration into the inbuilt video code - I was told it will move to OpenGL, which would mean we would be left with absolutely no webkit-internal video support on our platform, we don&apos;t have OpenGL. Anyway, I will poke a bit more with your response in mind.

If I don&apos;t make progress on that track, would you consider a similar patch to the one posted here, but controlled by a runtime configuration option, off by default?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>655574</commentid>
    <comment_count>4</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2012-06-22 10:42:24 -0700</bug_when>
    <thetext>Have OLPC engineers been making other contributions to WebKit? Generally we don’t welcome a new contribution that is simply adding a specific option or tweak for their use of WebKit without other contributions.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>655594</commentid>
    <comment_count>5</comment_count>
    <who name="Daniel Drake">dsd</who>
    <bug_when>2012-06-22 10:55:32 -0700</bug_when>
    <thetext>Yes, we have, but not a huge amount - we&apos;re new here :)
So far we have contributed:

bug #87283 [GTK] run-file-chooser signal for WebKit1
bug #87687 Check for GTK2/GTK3 symbol mismatch earlier
bug #84149 [GTK] Enable back double buffering on WebKitWebView to fix flickering</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>655608</commentid>
    <comment_count>6</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2012-06-22 11:03:46 -0700</bug_when>
    <thetext>Before we add this feature for OLPC, we should think this through a bit more:

Which clients will want this? I suppose the answer is “platforms where plug-ins have superior support for types that are also handled by built-in media machinery”. I’m not sure this is happening on a lot of platforms.

If we really do need it, we can do this with a compile time switch. The name should somehow express the “built-in media is assumed to be not as good as plug-in handling of same types” I suppose.

Maybe it’s the other platforms that are strange, where the plug-ins are old so they handle types that are better handled by the built-in media machinery.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>655688</commentid>
    <comment_count>7</comment_count>
    <who name="Daniel Drake">dsd</who>
    <bug_when>2012-06-22 12:27:08 -0700</bug_when>
    <thetext>Regarding improving the &lt;video&gt; handling to use Xv hardware acceleration:

After some discussion, this seems unlikely to happen. 

The existing maintainer would not be willing to maintain such code, and is not really keen on the idea of a co-maintainer looking after it either.

It also seems like it would be impossible: &lt;video&gt; elements need to blend with the page, can have CSS transformations applied, etc. However, Xv does not support this, and applying transformations and so on is not realistic because Xv must render to its own X window.

If we are going to land something to fix this that is of use to OLPC, it needs to either be the default, or configurable at runtime. We use distribution packages from Fedora so changing compile time options is unfortunately not an option.

Sorry if this is a pain - but it seems like &lt;video&gt; is powerful enough that it mandates the use of OpenGL or similar for good performance, and we&apos;re in the process of moving around 2 million users to webkit on a low-power platform that can&apos;t run OpenGL. For this reason it seems most sensible for us to focus on the plugin experience as before.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>655701</commentid>
    <comment_count>8</comment_count>
    <who name="Eric Carlson">eric.carlson</who>
    <bug_when>2012-06-22 12:54:00 -0700</bug_when>
    <thetext>(In reply to comment #7)
&gt; Regarding improving the &lt;video&gt; handling to use Xv hardware acceleration:
&gt; 
&gt; After some discussion, this seems unlikely to happen. 
&gt; 
&gt; The existing maintainer would not be willing to maintain such code, and is not really keen on the idea of a co-maintainer looking after it either.
&gt; 
&gt; It also seems like it would be impossible: &lt;video&gt; elements need to blend with the page, can have CSS transformations applied, etc. However, Xv does not support this, and applying transformations and so on is not realistic because Xv must render to its own X window.
&gt; 
&gt; If we are going to land something to fix this that is of use to OLPC, it needs to either be the default, or configurable at runtime. We use distribution packages from Fedora so changing compile time options is unfortunately not an option.
&gt; 
&gt; Sorry if this is a pain - but it seems like &lt;video&gt; is powerful enough that it mandates the use of OpenGL or similar for good performance, and we&apos;re in the process of moving around 2 million users to webkit on a low-power platform that can&apos;t run OpenGL. For this reason it seems most sensible for us to focus on the plugin experience as before.

If your port has such poor support for the &lt;video&gt; element, why not turn it off?

A MediaDocument will not be created unless your implementation of MediaPlayerPrivate::supportsType says it supports the MIME type, so another options is to have your &lt;video&gt; element only support MIME types not supported by the plug-in.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1882439</commentid>
    <comment_count>9</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-07-12 11:30:51 -0700</bug_when>
    <thetext>Can this be closed considering &lt;video&gt; tag is not defect standard to make videos available on the web and this patch was focused on old &lt;a&gt; tag? Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1882442</commentid>
    <comment_count>10</comment_count>
    <who name="Philippe Normand">philn</who>
    <bug_when>2022-07-12 11:37:36 -0700</bug_when>
    <thetext>NPAPI support was removed.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>149043</attachid>
            <date>2012-06-22 09:44:16 -0700</date>
            <delta_ts>2012-06-22 10:01:16 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-89764-20120622124415.patch</filename>
            <type>text/plain</type>
            <size>3034</size>
            <attacher name="Daniel Drake">dsd</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDEyMTAyOSkKKysrIFNvdXJjZS9XZWJDb3JlL0NoYW5n
ZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDIzIEBACisyMDEyLTA2LTIyICBEYW5pZWwg
RHJha2UgIDxkc2RAbGFwdG9wLm9yZz4KKworICAgICAgICBQcmVmZXIgUGx1Z2luRG9jdW1lbnQg
b3ZlciBNZWRpYURvY3VtZW50CisgICAgICAgIGh0dHBzOi8vYnVncy53ZWJraXQub3JnL3Nob3df
YnVnLmNnaT9pZD04OTc2NAorCisgICAgICAgIFJldmlld2VkIGJ5IE5PQk9EWSAoT09QUyEpLgor
CisgICAgICAgIFByb3ZpZGUgdGhlIHVzZXIvYWRtaW4gd2l0aCB0aGUgYWJpbGl0eSB0byBzdXBw
bHkgdGhlaXIgb3duCisgICAgICAgIG1lZGlhIHBsYXliYWNrIHBsdWdpbiBlLmcuIGZvciBtZWRp
YSBvcGVuZWQgdmlhIGFuIDxhPiBsaW5rLAorICAgICAgICBjb250aW51aW5nIHRvIGZhbGxiYWNr
IG9uIHdlYmtpdCdzIG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R0RvY3VtZW50OjpjcmVhdGUo
ZnJhbWUsIHVybCk7Cg==
</data>
<flag name="review"
          id="156961"
          type_id="1"
          status="-"
          setter="eric.carlson"
    />
          </attachment>
      

    </bug>

</bugzilla>