[Webkit-unassigned] [Bug 28832] <img>.complete should return false for invalid images

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Aug 29 04:28:48 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=28832


Jussi Kukkonen <jussi.kukkonen at intel.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|webkit-unassigned at lists.web |jussi.kukkonen at intel.com
                   |kit.org                     |




--- Comment #23 from Jussi Kukkonen <jussi.kukkonen at intel.com>  2012-08-29 04:28:51 PST ---
Thanks for the comments, much appreciated.

(In reply to comment #21)
> > Source/WebCore/ChangeLog:9
> > +        - Return true if no src or it is empty string
> 
> no src is present? or if it is equal to an empty string
> 
> Could be written better


Agreed, will improve.

> > Source/WebCore/platform/graphics/BitmapImage.h:137
> > +    virtual bool decodeFailed() const { return m_source.decodeFailed(); }
> 
> why not decodingFailed? or decodeDidFail(). I am not sure what is most correct.

Agree that decodeFailed does not sound entirely correct, I copied it from the underlying classes that actually implement the functionality...

> > Source/WebCore/platform/graphics/cg/ImageSourceCG.cpp:239
> > +bool ImageSource::decodeFailed() const
> > +{
> > +    // TODO: implement this (with kCGImageStatus?)
> > +    return false;
> > +}
> 
> file bug report then, add link

Ok

> > LayoutTests/ChangeLog:6
> > +        Tests that deal with img.complete with broken images are
> 
> I dont understand this line


I don't blame you... Actually "Tests that rely on img.complete are ..." would be correct -- it's just that we notice the problem using broken images.


> > LayoutTests/canvas/philip/tests/2d.drawImage.broken.html:25
> > +deferTest();
> > +
> > +// wait a moment so imageloader has time to load the image
> > +setTimeout(wrapFunction(function () {
> > +  var img = document.getElementById('broken.png');
> > +  _assertSame(img.complete, false, "img.complete", "false");
> > +  ctx.drawImage(img, 0, 0);
> > +}), 100);
> 
> This often leads to flaky tests. How do you know 100 is enough? anyway to avoid depending on time?

Hmm, I'll think about this.


(In reply to comment #22)
> Maybe encode the image as a data-URI and place it inline, then put a script tag below that triggers starting the test? (Since image progress events as proposed in bug 76102 haven't been accepted yet.) I'd suggest to file a W3C Test Cases bug if you plan to change the philip test case here.

The test case bug sounds like a good idea, I'll do this.

-- 
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