[Webkit-unassigned] [Bug 17897] Not Rendering Images Imported from XHTML Document

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Aug 26 09:55:25 PDT 2008


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





------- Comment #7 from jchaffraix at webkit.org  2008-08-26 09:55 PDT -------
(In reply to comment #6)
> (From update of attachment 22964 [edit])
> So are new HTMLImageLoader objects created every time a load is issued?

It is created once and reused between loads.

> Otherwise I fear your patch will break things like:
> 
> image.src = "willfail.png"
> // first load returns an error, possibly from the error callback we do:
> image.src = "willwork.png"

Actually your test case will work as we return an small image when we try to
load a non-existent image.
But you are right, there is an issue if the loader had an error. I will fix
that, provide a test case and correct the misleading comment.


> Also, I'm not a big fan of functions being declared in the middle of function
> calls:
> 
>  26                 icon.addEventListener("load", function () {
>  27                     var console = document.getElementById('console');
>  28                     // If the image was loaded correctly, then height and
> width are not
>  29                     // zero.
>  30                     if (icon.height && icon.width)
>  31                         console.innerHTML = "PASSED";
>  32                     else
>  33                         console.innerHTML = "FAILED";
>  34 
>  35                     if (window.layoutTestController)
>  36                         layoutTestController.notifyDone();
>  37 
>  38                 }, true);
> 
> I'd rather see that declared in a local variable and used instead of as part of
> that function call.

Having anonymous function is fine by me, but I will  make the change you are
requesting as it is a standalone method that could easily be extracted.


-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list