<?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>14531</bug_id>
          
          <creation_ts>2011-10-21 17:41:01 +0000</creation_ts>
          <short_desc>Require that &lt;img&gt;s are updated when @crossorigin is changed</short_desc>
          <delta_ts>2011-10-28 22:59:56 +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>HTML5 spec</component>
          <version>unspecified</version>
          <rep_platform>PC</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="Jonas Sicking (Not reading bugmail)">jonas</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>bzbarsky</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</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>58654</commentid>
    <comment_count>0</comment_count>
    <who name="Jonas Sicking (Not reading bugmail)">jonas</who>
    <bug_when>2011-10-21 17:41:01 +0000</bug_when>
    <thetext>Currently the spec only permits changing the loaded image data when @src is modified. It should both permit and require that the data is updated when @crossorigin is modified too.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58869</commentid>
    <comment_count>1</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-10-25 05:06:01 +0000</bug_when>
    <thetext>I&apos;m concerned that this would lead to people setting src=&quot;&quot; then setting crossorigin=&quot;&quot; and doubling the amount of network traffic. If we don&apos;t do this, then they&apos;ll quickly realise they have to set it the other way around (since if they need crossorigin, and don&apos;t set it, something will break).

What reasoning did you have for the opposite conclusion? (I&apos;m certainly open to changing this, just curious what your reasoning was and whether the above changes your mind.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58888</commentid>
    <comment_count>2</comment_count>
    <who name="Jonas Sicking (Not reading bugmail)">jonas</who>
    <bug_when>2011-10-25 06:48:17 +0000</bug_when>
    <thetext>As a general rule the way a DOM behaves should depend on the current configuration of the DOM. I.e. on the configuration of elements, children and attributes. It should not matter how it got there. This is much more understandable for people. This is especially the case for attribute setters which people tend to think if as state setters, not function calls. Hence, it&apos;s very surprising that the order of setting attributes matter.

We have very few diversions from this rule. Most of them involve &lt;script&gt; elements where we simply can&apos;t undo actions when attributes or child lists are changed. The *only* other case I can think of is changes to base URIs where complexity was vey high and value very low to try to do otherwise (and I&apos;d expect that over time we&apos;ll end up adding a lot of that complexity).

Additionally, if the crossorigin attribute doesn&apos;t affect what image is actually going to be attempted to be loaded that means we&apos;ll be carrying around hidden state not exposed to script. In almost every situation where we do that people end up wanting to get at that state. Which leads to more API for us, or more complexity for them when they have to work around not having that state.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58889</commentid>
    <comment_count>3</comment_count>
    <who name="Jonas Sicking (Not reading bugmail)">jonas</who>
    <bug_when>2011-10-25 06:53:19 +0000</bug_when>
    <thetext>I don&apos;t think we&apos;ll end up with double network traffic ever. Ain most cases I would expect to not have been able to hit the network by the time that the second attribute is set.

But I&apos;m curious what bz thinks of the matter.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58908</commentid>
    <comment_count>4</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2011-10-25 10:39:44 +0000</bug_when>
    <thetext>For &lt;video&gt;, loading waits for a stable state, so it wouldn&apos;t matter if crossorigin was set first or last. However, setting crossorigin after a video has already loaded (or changing the src=&quot;&quot; of &lt;source&gt;, even) does not change anything (the script needs to call load()).

I&apos;m not sure what to do with &lt;img&gt;. It would be nice if it was equivalent to set src first and crossorigin second in the same script. I&apos;m not convinced that setting crossorigin after the image has loaded should reload the image.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58921</commentid>
    <comment_count>5</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2011-10-25 15:57:18 +0000</bug_when>
    <thetext>Not starting extraneous loads seems like a basic matter of implementation quality...  I&apos;m fairly certain that in Gecko there would be no extra loads.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59156</commentid>
    <comment_count>6</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-10-28 22:49:03 +0000</bug_when>
    <thetext>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: Accepted
Change Description: see diff given below
Rationale: Yeah, fair enough.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59157</commentid>
    <comment_count>7</comment_count>
    <who name="">contributor</who>
    <bug_when>2011-10-28 22:49:21 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r6779.
Check-in comment: Make setting &lt;img crossorigin&gt; refetch the image.
http://html5.org/tools/web-apps-tracker?from=6778&amp;to=6779</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59158</commentid>
    <comment_count>8</comment_count>
    <who name="">contributor</who>
    <bug_when>2011-10-28 22:59:56 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r6780.
Check-in comment: Tweak the algorithm for &lt;img&gt; loading to avoid multiple network requests when src=&apos;&apos; is set multiple times in a row.
http://html5.org/tools/web-apps-tracker?from=6779&amp;to=6780</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>