mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 787378 - Part 1: Fire a "firstpaint" event in iframe mozbrowser.
This commit is contained in:
parent
7c9a912940
commit
fc6bed0372
@ -107,6 +107,12 @@ BrowserElementChild.prototype = {
|
|||||||
/* useCapture = */ true,
|
/* useCapture = */ true,
|
||||||
/* wantsUntrusted = */ false);
|
/* wantsUntrusted = */ false);
|
||||||
|
|
||||||
|
this._afterPaintHandlerClosure = this._afterPaintHandler.bind(this);
|
||||||
|
addEventListener('MozAfterPaint',
|
||||||
|
this._afterPaintHandlerClosure,
|
||||||
|
/* useCapture = */ true,
|
||||||
|
/* wantsUntrusted = */ false);
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
function addMsgListener(msg, handler) {
|
function addMsgListener(msg, handler) {
|
||||||
addMessageListener('browser-element-api:' + msg, handler.bind(self));
|
addMessageListener('browser-element-api:' + msg, handler.bind(self));
|
||||||
@ -351,6 +357,19 @@ BrowserElementChild.prototype = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_afterPaintHandler: function(e) {
|
||||||
|
let uri = docShell.QueryInterface(Ci.nsIWebNavigation).currentURI;
|
||||||
|
debug("Got afterpaint event: " + uri.spec);
|
||||||
|
if (uri.spec != "about:blank") {
|
||||||
|
/* this._afterPaintHandlerClosure == arguments.callee, except we're in
|
||||||
|
* strict mode so we don't have arguments.callee. */
|
||||||
|
removeEventListener('MozAfterPaint', this._afterPaintHandlerClosure,
|
||||||
|
/* useCapture */ true);
|
||||||
|
|
||||||
|
sendAsyncMsg('firstpaint');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
_closeHandler: function(e) {
|
_closeHandler: function(e) {
|
||||||
let win = e.target;
|
let win = e.target;
|
||||||
if (win != content || e.defaultPrevented) {
|
if (win != content || e.defaultPrevented) {
|
||||||
|
@ -195,6 +195,7 @@ function BrowserElementParent(frameLoader, hasRemoteFrame) {
|
|||||||
addMessageListener("securitychange", this._fireEventFromMsg);
|
addMessageListener("securitychange", this._fireEventFromMsg);
|
||||||
addMessageListener("error", this._fireEventFromMsg);
|
addMessageListener("error", this._fireEventFromMsg);
|
||||||
addMessageListener("scroll", this._fireEventFromMsg);
|
addMessageListener("scroll", this._fireEventFromMsg);
|
||||||
|
addMessageListener("firstpaint", this._fireEventFromMsg);
|
||||||
addMessageListener("keyevent", this._fireKeyEvent);
|
addMessageListener("keyevent", this._fireKeyEvent);
|
||||||
addMessageListener("showmodalprompt", this._handleShowModalPrompt);
|
addMessageListener("showmodalprompt", this._handleShowModalPrompt);
|
||||||
addMessageListener('got-screenshot', this._gotDOMRequestResult);
|
addMessageListener('got-screenshot', this._gotDOMRequestResult);
|
||||||
|
Loading…
Reference in New Issue
Block a user