Ensure ClientWebView's preferred height is updated after doc load.
Should help/fix Bug 778025. * ui/client-web-view.js (PageView::init): Also add a load handler to the window, to (strangely) catch the final load event on the document. Expand and correct comments a bit.
This commit is contained in:
parent
7608d160fe
commit
d6ed3e3877
1 changed files with 11 additions and 5 deletions
|
|
@ -40,17 +40,23 @@ PageState.prototype = {
|
|||
state.loaded();
|
||||
queuePreferredHeightUpdate();
|
||||
});
|
||||
// Queues updates for not only the complete document, but also
|
||||
// for any IMG elements loaded, hence handles resizing when
|
||||
// the user later requests remote images loading.
|
||||
|
||||
// Queues an update when the complete document is loaded.
|
||||
//
|
||||
// Note also that the delay introduced here by the last call
|
||||
// Note also that the delay introduced here by this last call
|
||||
// to queuePreferredHeightUpdate when the complete document is
|
||||
// loaded seems to be important to get an acurate idea of the
|
||||
// final document size.
|
||||
window.addEventListener("load", function(e) {
|
||||
queuePreferredHeightUpdate();
|
||||
}, true); // load does not bubble
|
||||
|
||||
// Queues updates for any STYLE, IMG and other loaded
|
||||
// elements, hence handles resizing when the user later
|
||||
// requests remote images loading.
|
||||
document.addEventListener("load", function(e) {
|
||||
queuePreferredHeightUpdate();
|
||||
}, true);
|
||||
}, true); // load does not bubble
|
||||
},
|
||||
getPreferredHeight: function() {
|
||||
let html = window.document.documentElement;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue