mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-30 21:55:31 +00:00
bug 458489. Avoid doing unnecessary work when iframes finish loading
when we only care about the main document. r=gavin
This commit is contained in:
parent
616cf7ce25
commit
fde38e1d43
@ -390,15 +390,16 @@ ProgressController.prototype = {
|
||||
},
|
||||
|
||||
onStateChange : function(aWebProgress, aRequest, aStateFlags, aStatus) {
|
||||
// we currently only care if we're getting things for the main document, not sub-frames
|
||||
if (aWebProgress.DOMWindow != this._browser.contentWindow) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (aStateFlags & Ci.nsIWebProgressListener.STATE_IS_NETWORK) {
|
||||
if (aRequest && aWebProgress.DOMWindow == this._browser.contentWindow) {
|
||||
if (aStateFlags & Ci.nsIWebProgressListener.STATE_START) {
|
||||
BrowserUI.update(TOOLBARSTATE_LOADING, this._browser);
|
||||
}
|
||||
else if (aStateFlags & Ci.nsIWebProgressListener.STATE_STOP) {
|
||||
BrowserUI.update(TOOLBARSTATE_LOADED, this._browser);
|
||||
}
|
||||
}
|
||||
if (aStateFlags & Ci.nsIWebProgressListener.STATE_START)
|
||||
BrowserUI.update(TOOLBARSTATE_LOADING, this._browser);
|
||||
else if (aStateFlags & Ci.nsIWebProgressListener.STATE_STOP)
|
||||
BrowserUI.update(TOOLBARSTATE_LOADED, this._browser);
|
||||
}
|
||||
|
||||
if (aStateFlags & Ci.nsIWebProgressListener.STATE_IS_DOCUMENT) {
|
||||
|
@ -136,7 +136,9 @@
|
||||
<method name="updateCanvasState">
|
||||
<body><![CDATA[
|
||||
// Clear the whole canvas
|
||||
// XXX is this really necessary given zoomToPage's redraw?
|
||||
// we clear the whole canvas becaues the browser's width or height
|
||||
// could be less than the area we end up actually drawing.
|
||||
// XXX we could be smarter about this and only clear when necessary
|
||||
var ctx = this._canvas.getContext("2d");
|
||||
ctx.clearRect(0, 0, this._canvas.width, this._canvas.height);
|
||||
|
||||
@ -517,7 +519,6 @@
|
||||
|
||||
<method name="_browserToCanvas">
|
||||
<body><![CDATA[
|
||||
|
||||
// FIXME: canvas needs to know it's actual width/height
|
||||
// we should be able to use _canvas.width/_canvas.height here
|
||||
// and can, most of the time
|
||||
|
Loading…
Reference in New Issue
Block a user