[Webkit-unassigned] [Bug 95440] New: testing img.complete without waiting for decoding is wrong
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Aug 30 02:44:21 PDT 2012
https://bugs.webkit.org/show_bug.cgi?id=95440
Summary: testing img.complete without waiting for decoding is
wrong
Product: WebKit
Version: 528+ (Nightly build)
Platform: Unspecified
OS/Version: Unspecified
Status: NEW
Severity: Normal
Priority: P2
Component: Tools / Tests
AssignedTo: webkit-unassigned at lists.webkit.org
ReportedBy: jussi.kukkonen at intel.com
I was trying to fix HTMLImageElement.complete (so it would return false when the image was not decodable), and realised the tests that use it are also wrong.
img.complete may (and should) change while the script is running. If we want to check the "final" value we can't do it when script execution starts: the image may not be loaded/decoded yet at that time. We should check img.complete only after decoding should be complete.
Fixing this reliably wasn't as easy as I hoped:
* it seems even for inlined uri-data images, the decoding is still done in parallel with script execution
* same goes for img.onload: checking for img.complete from the onload handler gives flaky results
...at least these were my results with the WIP patch in bug 28832
A timeout is an inherently flaky solution but still the best I could think of... with small images (like the testrunner ones) the decoding seems to take only milliseconds. I'll upload a patch with a timeout but I'd be happy with a better solution if anyone has one.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list