<?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>80028</bug_id>
          
          <creation_ts>2012-03-01 07:49:21 -0800</creation_ts>
          <short_desc>Setting crossOrigin attribute for images won&apos;t trigger onerror on CORS denial</short_desc>
          <delta_ts>2012-06-19 00:32:51 -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>Images</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows Vista</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>81998</dup_id>
          
          <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="Niklas von Hertzen">niklasvh</reporter>
          <assigned_to name="Adam Barth">abarth</assigned_to>
          <cc>abarth</cc>
    
    <cc>ap</cc>
    
    <cc>mkwst</cc>
    
    <cc>pf</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>568658</commentid>
    <comment_count>0</comment_count>
      <attachid>129704</attachid>
    <who name="Niklas von Hertzen">niklasvh</who>
    <bug_when>2012-03-01 07:49:21 -0800</bug_when>
    <thetext>Created attachment 129704
example where onerror / onload isn&apos;t triggered

When defining the crossOrigin attribute for an Image element, it won&apos;t return an onload/onerror event if the image exists, but denied by CORS policy. In other words, there is no event to determine when the image has finished loading and whether it managed to load it, unless you check with timers for the complete attribute to change. 

The expected result would be for the onerror event of the image to be triggered (as it does in Firefox), and as defined in http://www.whatwg.org/specs/web-apps/current-work/multipage/embedded-content-1.html#attr-img-crossorigin &quot;Set the img element to the broken state, and fire a simple event named error at the img element.&quot;

Tested on both 19.0.1057.0 canary and 17.0.963.56 m, and neither is triggering the real onerror in the example.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>569946</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2012-03-02 14:26:56 -0800</bug_when>
    <thetext>There should be no way to differentiate between non-existent resources and</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>569947</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2012-03-02 14:27:32 -0800</bug_when>
    <thetext>Taking that unfinished comment back, this doesn&apos;t seem like security.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>569986</commentid>
    <comment_count>3</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2012-03-02 15:23:10 -0800</bug_when>
    <thetext>I&apos;m going to try to fix this bug next week.  If someone else is excited about fixing it sooner, go for it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>652153</commentid>
    <comment_count>4</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2012-06-19 00:32:20 -0700</bug_when>
    <thetext>@mkwst: Here&apos;s the related bug for CORS.  I thought I fixed this though...  Maybe I did it in a different bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>652154</commentid>
    <comment_count>5</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2012-06-19 00:32:51 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 81998 ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>129704</attachid>
            <date>2012-03-01 07:49:21 -0800</date>
            <delta_ts>2012-03-01 07:49:21 -0800</delta_ts>
            <desc>example where onerror / onload isn&apos;t triggered</desc>
            <filename>crossorigin.html</filename>
            <type>text/html</type>
            <size>551</size>
            <attacher name="Niklas von Hertzen">niklasvh</attacher>
            
              <data encoding="base64">PHNjcmlwdD4NCmZ1bmN0aW9uIGlzQ29tcGxldGUoKSB7DQogICAgKCF0aGlzLmNvbXBsZXRlKSA/
IHdpbmRvdy5zZXRUaW1lb3V0KHRoaXMuY3VzdG9tQ29tcGxldGUsIDEwMCkgOiB0aGlzLm9uZXJy
b3IoKTsNCn0NCg0KdmFyIGltZyA9IG5ldyBJbWFnZSgpOw0KaW1nLmNyb3NzT3JpZ2luID0gIiI7
DQoNCmltZy5vbmxvYWQgPSBmdW5jdGlvbihlKSB7DQogY29uc29sZS5sb2coJ2xvYWQ/PycpOyAg
ICANCn0NCiAgICANCmltZy5vbmVycm9yID0gZnVuY3Rpb24oZSkgew0KICAgIChlID09PSB1bmRl
ZmluZWQpID8gY29uc29sZS5sb2coImN1c3RvbSBlcnJvciIpIDogY29uc29sZS5sb2coInJlYWwg
ZXJyb3IiLCBlKTsNCn0NCiAgICANCiAgICANCmltZy5zcmMgPSAiaHR0cHM6Ly93d3cuZ29vZ2xl
LmNvbS9pbnRsL2VuX2NvbS9pbWFnZXMvc3Jwci9sb2dvM3cucG5nIjsgLy8gZG9lc24ndCBoYXZl
IGNvcnMgZW5hYmxlZA0KDQppbWcuY3VzdG9tQ29tcGxldGUgPSBpc0NvbXBsZXRlLmJpbmQoaW1n
KTsNCg0KaW1nLmN1c3RvbUNvbXBsZXRlKCk7DQo8L3NjcmlwdD4=
</data>

          </attachment>
      

    </bug>

</bugzilla>