This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 18742 - tests relying on HTMLImageElement.complete are incorrect
Summary: tests relying on HTMLImageElement.complete are incorrect
Status: NEW
Alias: None
Product: HTML WG
Classification: Unclassified
Component: testsuite (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: This bug has no owner yet - up for the taking
QA Contact: HTML WG Bugzilla archive list
URL: http://dev.w3.org/html5/spec/single-p...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-30 10:06 UTC by Jussi Kukkonen
Modified: 2012-08-30 10:08 UTC (History)
2 users (show)

See Also:


Attachments

Description Jussi Kukkonen 2012-08-30 10:06:08 UTC
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'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 "final" value instantly when the script execution starts. E.g. 2d.pattern.image.broken:

  var img = document.getElementById('broken.png');
  _assertSame(img.complete, false, "img.complete", "false");

In reality the image decoder may, or may not, still be working on the image at that point... I don't have great ideas on how to fix this: A timeout does the job but in the end it's just as flaky as the current code.
Comment 1 Jussi Kukkonen 2012-08-30 10:08:46 UTC
https://bugs.webkit.org/show_bug.cgi?id=95440