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

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>12427</bug_id>
          
          <creation_ts>2011-04-05 22:17:33 +0000</creation_ts>
          <short_desc>User interface of spatial media fragment URI in &lt;img&gt; or &lt;video&gt; resource, or in browser navigation</short_desc>
          <delta_ts>2011-08-04 05:35:19 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>LC1 HTML5 spec</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</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="Silvia Pfeiffer">silviapfeiffer1</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>ayg</cc>
    
    <cc>cdouble</cc>
    
    <cc>ian</cc>
    
    <cc>jackalmage</cc>
    
    <cc>mike</cc>
    
    <cc>philipj</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
    
    <cc>raphael.troncy</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>47171</commentid>
    <comment_count>0</comment_count>
    <who name="Silvia Pfeiffer">silviapfeiffer1</who>
    <bug_when>2011-04-05 22:17:33 +0000</bug_when>
    <thetext>Problem: what is a browser to display when the browser navigates to a image or video resource with a spatial media fragment URI, or when the @src attribute of a &lt;img&gt; or &lt;video&gt; element contains a spatial media fragment URI

Proposal: a cropped (spliced) image or video is displayed to the user by hiding the other pixels from the user.

Section affected for image: http://www.whatwg.org/specs/web-apps/current-work/#update-the-image-data

In particular, this section explains what the image element&apos;s image data is: &quot;The resouce obtained in this fashion is the img element&apos;s image data.&quot; This should state that when the resource is obtained with a spatial media fragment, the img element&apos;s image data is restricted to the rectangular region defined by the spatial media fragment.

Section affected for video: http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#concept-video-intrinsic-width

The intrinsic width and height of a video element are influenced by provision of a spatial media fragment URI. The width and height are restricted to the width and height of the rectangle provided in the spatial media fragment URI. The browser further needs to remember the x and y offset from which that region is extracted.

Further, for video, a definition of the video&apos;s image data is required similar to how there is a definition of the img element&apos;s image data. This is particularly important, since video data can be imported into canvas elements through the drawImage function, so it needs to be clear what the image data is.
http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-drawimage</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>47172</commentid>
    <comment_count>1</comment_count>
    <who name="Tab Atkins Jr.">jackalmage</who>
    <bug_when>2011-04-05 23:47:19 +0000</bug_when>
    <thetext>Isn&apos;t this up to the Media Fragments spec to define?

The answer should be, imo, that a spatial fragment represents precisely that - a fragment of a larger resource.  Only the fragment would be displayed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>47178</commentid>
    <comment_count>2</comment_count>
    <who name="Silvia Pfeiffer">silviapfeiffer1</who>
    <bug_when>2011-04-06 01:13:39 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; Isn&apos;t this up to the Media Fragments spec to define?
&gt; 
&gt; The answer should be, imo, that a spatial fragment represents precisely that -
&gt; a fragment of a larger resource.  Only the fragment would be displayed.

The issue is that you cannot deliver just the fragment pixels, so it&apos;s up to the User Agent to restrict the image pixels to just the requested ones. Otherwise it would be simple. So, since the UA receives all the pixels, it needs to be specified what pixels the UA actually has to deal with.

The Media Fragment spec already makes a recommendation, but is that sufficient for browsers to actually be assured of what pixels to work with from within a HTML5 page? In particular in a cross-browser consistent manner?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>47183</commentid>
    <comment_count>3</comment_count>
    <who name="Silvia Pfeiffer">silviapfeiffer1</who>
    <bug_when>2011-04-06 06:27:43 +0000</bug_when>
    <thetext>Note: related earlier discussion http://lists.w3.org/Archives/Public/public-media-fragment/2010May/0061.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>47184</commentid>
    <comment_count>4</comment_count>
    <who name="Silvia Pfeiffer">silviapfeiffer1</who>
    <bug_when>2011-04-06 06:33:52 +0000</bug_when>
    <thetext>It is actually necessary to specify where a media fragment URI is executed and where not in a browser. For example in a download link such as in right-clicks, the UA can&apos;t execute the fragment, since that would require creation of a consistent new resource and not just several byte range requests (unless browsers actually repackage the content, which is certainly an option).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>47185</commentid>
    <comment_count>5</comment_count>
    <who name="Chris Double">cdouble</who>
    <bug_when>2011-04-06 06:51:32 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; ...since that would require creation of a
&gt; consistent new resource and not just several byte range requests (unless
&gt; browsers actually repackage the content, which is certainly an option).

Byte range requests wouldn&apos;t work for spatial media fragments would they? For the formats that immediately come to mind you&apos;d have to download the actual resource and then crop. You can&apos;t byte range request into a spatial area.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>47186</commentid>
    <comment_count>6</comment_count>
    <who name="Silvia Pfeiffer">silviapfeiffer1</who>
    <bug_when>2011-04-06 07:17:33 +0000</bug_when>
    <thetext>(In reply to comment #5)
&gt; (In reply to comment #4)
&gt; &gt; ...since that would require creation of a
&gt; &gt; consistent new resource and not just several byte range requests (unless
&gt; &gt; browsers actually repackage the content, which is certainly an option).
&gt; 
&gt; Byte range requests wouldn&apos;t work for spatial media fragments would they? For
&gt; the formats that immediately come to mind you&apos;d have to download the actual
&gt; resource and then crop. You can&apos;t byte range request into a spatial area.


No, you cannot do byte ranges on spatial media fragments in general. Indeed, cropping is necessary, which would be browser-internal only.

My above comment was also for temporal media fragments, where it is possible though probably not trivial to re-package the content as a shorter piece of audio/video.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>47191</commentid>
    <comment_count>7</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2011-04-06 08:44:41 +0000</bug_when>
    <thetext>What about the percent syntax #xywh=percent:25,25,50,50 ? If that does not map to a integer number of pixels, should rounding be applied and in which direction?

I presume that videoWidth and videoHeight should also reflect the cropped dimensions, so the question applies there as well.

I note also in passing that if Opera implements support for Media Fragment, there&apos;s no plan for supporting the xywh syntax, as you can already achieve cropping with CSS. If there are compelling use cases where CSS doesn&apos;t do a good job, then I might reconsider, of course.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>47200</commentid>
    <comment_count>8</comment_count>
    <who name="Silvia Pfeiffer">silviapfeiffer1</who>
    <bug_when>2011-04-06 12:52:28 +0000</bug_when>
    <thetext>(In reply to comment #7)
&gt; What about the percent syntax #xywh=percent:25,25,50,50 ? If that does not map
&gt; to a integer number of pixels, should rounding be applied and in which
&gt; direction?

That should probably go into the media fragment spec. Good point to make - I would say always round up.

&gt; I presume that videoWidth and videoHeight should also reflect the cropped
&gt; dimensions, so the question applies there as well.

Yes, indeed, so that has to go into the HTML spec (or at least refer to the media frag spec).

&gt; I note also in passing that if Opera implements support for Media Fragment,
&gt; there&apos;s no plan for supporting the xywh syntax, as you can already achieve
&gt; cropping with CSS. If there are compelling use cases where CSS doesn&apos;t do a
&gt; good job, then I might reconsider, of course.

Link below has a use case..


(In reply to comment #3)
&gt; Note: related earlier discussion
&gt; http://lists.w3.org/Archives/Public/public-media-fragment/2010May/0061.html

Sorry, I meant this one:
http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2010-August/027581.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>47202</commentid>
    <comment_count>9</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2011-04-06 13:01:48 +0000</bug_when>
    <thetext>(In reply to comment #8)
&gt; (In reply to comment #7)
&gt; &gt; What about the percent syntax #xywh=percent:25,25,50,50 ? If that does not map
&gt; &gt; to a integer number of pixels, should rounding be applied and in which
&gt; &gt; direction?
&gt; 
&gt; That should probably go into the media fragment spec. Good point to make - I
&gt; would say always round up.

OK, raised in http://lists.w3.org/Archives/Public/public-media-fragment/2011Apr/0011.html

&gt; Link below has a use case..

&gt; http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2010-August/027581.html

I&apos;m not sure I understand this. What is &quot;image sprite support&quot; and why is cutting an image using the canvas 2d api not good enough?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>47208</commentid>
    <comment_count>10</comment_count>
    <who name="Tab Atkins Jr.">jackalmage</who>
    <bug_when>2011-04-06 15:56:15 +0000</bug_when>
    <thetext>(In reply to comment #9)
&gt; &gt; http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2010-August/027581.html
&gt; 
&gt; I&apos;m not sure I understand this. What is &quot;image sprite support&quot; and why is
&gt; cutting an image using the canvas 2d api not good enough?

Consider the general case of CSS spriting, which is currently done in a hacky way with background-position.  Spriting into an &lt;img&gt; is just one instance of this type of spriting that can&apos;t be done even hackily at present (without doing something like running script to use &lt;canvas&gt;).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>47211</commentid>
    <comment_count>11</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2011-04-06 17:43:38 +0000</bug_when>
    <thetext>(In reply to comment #10)
&gt; (In reply to comment #9)
&gt; &gt; &gt; http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2010-August/027581.html
&gt; &gt; 
&gt; &gt; I&apos;m not sure I understand this. What is &quot;image sprite support&quot; and why is
&gt; &gt; cutting an image using the canvas 2d api not good enough?
&gt; 
&gt; Consider the general case of CSS spriting, which is currently done in a hacky
&gt; way with background-position.  Spriting into an &lt;img&gt; is just one instance of
&gt; this type of spriting that can&apos;t be done even hackily at present (without doing
&gt; something like running script to use &lt;canvas&gt;).

Is the goal of this to save bandwidth by putting several images into a single physical image?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>47212</commentid>
    <comment_count>12</comment_count>
    <who name="Tab Atkins Jr.">jackalmage</who>
    <bug_when>2011-04-06 17:51:08 +0000</bug_when>
    <thetext>(In reply to comment #11)
&gt; (In reply to comment #10)
&gt; &gt; (In reply to comment #9)
&gt; &gt; &gt; &gt; http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2010-August/027581.html
&gt; &gt; &gt; 
&gt; &gt; &gt; I&apos;m not sure I understand this. What is &quot;image sprite support&quot; and why is
&gt; &gt; &gt; cutting an image using the canvas 2d api not good enough?
&gt; &gt; 
&gt; &gt; Consider the general case of CSS spriting, which is currently done in a hacky
&gt; &gt; way with background-position.  Spriting into an &lt;img&gt; is just one instance of
&gt; &gt; this type of spriting that can&apos;t be done even hackily at present (without doing
&gt; &gt; something like running script to use &lt;canvas&gt;).
&gt; 
&gt; Is the goal of this to save bandwidth by putting several images into a single
&gt; physical image?

Not bandwidth, but connections, yes.  Spriting isn&apos;t the best approach for saving connections (better is resource packages, or a reworking of the internet architecture like SPDY), but it&apos;s a decent stop-gap solution.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>47227</commentid>
    <comment_count>13</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2011-04-07 07:57:31 +0000</bug_when>
    <thetext>My concern with supporting #xywh for still images is that it would require rewriting code all over the place (&lt;img&gt;, CSS backgrounds/borders) that previously used the physical size of the image to also consider the fragment size. This is of course possible, but it&apos;s really a question if it&apos;s worth the implementation cost (and future bugs) to support these use cases, which IMO are rather marginal.

If HTTP pipelining were completely inadequate, I&apos;d have expected to see JavaScript libraries to work around this using CSS or canvas in common use.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>47237</commentid>
    <comment_count>14</comment_count>
    <who name="Tab Atkins Jr.">jackalmage</who>
    <bug_when>2011-04-07 15:46:40 +0000</bug_when>
    <thetext>(In reply to comment #13)
&gt; If HTTP pipelining were completely inadequate, I&apos;d have expected to see
&gt; JavaScript libraries to work around this using CSS or canvas in common use.

You do, in the form of CSS Spriting, which is very widespread and recommended by all major performance optimization guides.  It&apos;s an ugly hack, though - background-position was never meant to be used in this way.  I&apos;m helping with a bug on an internal page right now where background-position rounds in different directions at certain zoom levels, causing the sprited image to appear to vibrate when you animate between the sprites - my best suggestion so far was to use &lt;canvas&gt; to sprite the images instead. ^_^</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49733</commentid>
    <comment_count>15</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-06-16 21:37:30 +0000</bug_when>
    <thetext>(In reply to comment #0)
&gt; Problem: what is a browser to display when the browser navigates to a image or
&gt; video resource with a spatial media fragment URI

That&apos;s more or less out of scope of the HTML spec, no?


&gt; or when the @src attribute of
&gt; a &lt;img&gt; [...] element contains a spatial media fragment URI

Are there any image MIME types that support the media fragment syntax? If not, then the answer is &quot;nothing different&quot;.


&gt; or &lt;video&gt;

For video, the spec just defers to the video format; if the video format supports the media fragment syntax then that&apos;ll be defined by the video format spec.

In conclusion, this seems out of scope for HTML.

EDITOR&apos;S RESPONSE: This is an Editor&apos;s Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Rejected
Change Description: no spec change
Rationale: see above</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54010</commentid>
    <comment_count>16</comment_count>
    <who name="Michael[tm] Smith">mike</who>
    <bug_when>2011-08-04 05:35:19 +0000</bug_when>
    <thetext>mass-move component to LC1</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>