Closed Bug 787378 Opened 11 years ago Closed 11 years ago

Dispatch a "firstpaint" event for mozbrowsers


(Core :: DOM: Core & HTML, defect)

Not set





(Reporter: cjones, Assigned: justin.lebar+bug)



(Keywords: dev-doc-needed)


(2 files)

This lets the embedder know when the iframe has valid pixels available.  This is useful for things like .

To implement this, I think we'd want to
 - register a MozAfterPaint listener from BrowserElementChild when it's initialized
 - when the first MozAfterPaint event is dispatched, fire the "firstpaint" notification to the embedder
 - unhook the MozAfterPaint listener (they can cause some perf issues)
Assignee: nobody → justin.lebar+bug
Hm ... need to be careful about about:blank here.
(In reply to Chris Jones [:cjones] [:warhammer] from comment #1)
> Hm ... need to be careful about about:blank here.

Yeah, I was just about to comment on that.  :)  But I think we can just check the location of the docshell/document.
> But I think we can just check the location of the docshell/document.

...unless can be painted before the docshell's location changes away from about:blank.  I hope not, but I'm not sure.
If that were true, I think that many things other than this would be broken.
One way to find out, I guess.

Anyone want to take bets on which platform will go randomorange?  My money is on OSX.
No random oranges; just permaorange on opt builds on all platforms.  :)
Attachment #657434 - Flags: review? → review?(dale)
Attachment #657435 - Flags: review? → review?(dale)
Comment on attachment 657434 [details] [diff] [review]
Part 1: Fire a "firstpaint" event in iframe mozbrowser.


>diff --git a/dom/browser-element/BrowserElementChild.js b/dom/browser-element/BrowserElementChild.js

> function debug(msg) {
>-  //dump("BrowserElementChild - " + msg + "\n");
>+  // dump("BrowserElementChild - " + msg + "\n");

This is distracting, please remove.

Looks good!  r=me with nitfix
Attachment #657434 - Flags: review?(dale) → review+
Attachment #657435 - Flags: review?(dale) → review+
10 demerits.  10 more and we bust you down to L2 ;).
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla18
Blocks: 796254
No longer blocks: 796254
Keywords: dev-doc-needed
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.