If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Need a way to programmatically enable imagelib logging for a specific image

NEW
Unassigned

Status

()

Core
ImageLib
8 years ago
4 years ago

People

(Reporter: bholley, Unassigned)

Tracking

Trunk
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

For bug 510001 it would be really nice if I could, using javascript, get the imgIRequest, QI it it to something like imgIRequestDebug or something of that sort, and then call enableLogging.

This bug really has two parts. The first is cleaning up the logging in imagelib and making it possible to log only for a specific image. The second part is exposing this to JS somehow. I'm guessing we should do this by having imgRequestProxy conditionally implement a separate debug interface. However, there might be other use cases for this. For example, I can imagine doing something with it for firebug. In this case, we'd probably want to do something fancier than just spitting it to the system console, but I'm not sure what.
CCing john to see if he's interested in this for firebug.

Comment 2

8 years ago
Sorry I don't have enough context to know that "this" is.

From bug 510001 there is
1) foo.src = url
2) function call
3) (within the function call) foo.onload = bar
4) bar never gets called, test times out

I gather that this is not 100% of the time? Is there a web page test case that shows the behavior? I guess one only needs to set a breakpoint on the function called in step 2 and watch the network events to see what is going on.
John - er, sorry for the unambiguous "this".

What I meant was that I'm going to instrument the image downloading/rendering library with logging that can be enabled programmatically per-image (in order to debug this issue that only shows up on winnt tinderboxen). If I was just doing it for myself, I'd just have it dump to the console. However, if firebug were interested in this information, we could make the data available in some nicer way.

Thinking more about it, I'm pretty sure that firebug doesn't care. Firebug already knows when images are downloaded via the net tab, and the question of when images are decoded is a firefox internal issue, and probably isn't of interest to web developers.

Comment 4

8 years ago
I agreed with your assessment with regard to Firebug. However, if the code in comment #2 is involved in your issue, then I don't understand why you are interested in that info either. All you really need to know is whether the foo.onload is set before the image load event. You can print foo.onload after you set it and print in a network event handler. If the foo.src = url is async with the function call, you lose, your JS is incorrect. Else the onload event is not correct.  Anyway good luck...
yeah I've also patched it to set foo.onload before foo.src, to no avail. This is just some weird issue that only happens on WinNT tinderboxes (so I can't reproduce it locally). So logging on the tinderbox seems like the only decent option.
You need to log in before you can comment on or make changes to this bug.