<?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>18742</bug_id>
          
          <creation_ts>2012-08-30 10:06:08 +0000</creation_ts>
          <short_desc>tests relying on HTMLImageElement.complete are incorrect</short_desc>
          <delta_ts>2012-08-30 10:08:46 +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>testsuite</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc>http://dev.w3.org/html5/spec/single-page.html#dom-img-complete</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="Jussi Kukkonen">jussi.kukkonen</reporter>
          <assigned_to name="This bug has no owner yet - up for the taking">dave.null</assigned_to>
          <cc>mike</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>73059</commentid>
    <comment_count>0</comment_count>
    <who name="Jussi Kukkonen">jussi.kukkonen</who>
    <bug_when>2012-08-30 10:06:08 +0000</bug_when>
    <thetext>Spec says:
---
The IDL attribute complete must return true if any of the following conditions is true:

    The src attribute is omitted.
    The src attribute&apos;s value is the empty string.
    The final task that is queued by the networking task source once the resource has been fetched has been queued, but has not yet been run, and the img element is not in the broken state.
    The img element is completely available. 

Otherwise, the attribute must return false.

The value of complete can thus change while a script is executing.
---

Still, the tests that use img.complete seem to rely on it having the &quot;final&quot; value instantly when the script execution starts. E.g. 2d.pattern.image.broken:

  var img = document.getElementById(&apos;broken.png&apos;);
  _assertSame(img.complete, false, &quot;img.complete&quot;, &quot;false&quot;);

In reality the image decoder may, or may not, still be working on the image at that point... I don&apos;t have great ideas on how to fix this: A timeout does the job but in the end it&apos;s just as flaky as the current code.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73060</commentid>
    <comment_count>1</comment_count>
    <who name="Jussi Kukkonen">jussi.kukkonen</who>
    <bug_when>2012-08-30 10:08:46 +0000</bug_when>
    <thetext>https://bugs.webkit.org/show_bug.cgi?id=95440</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>