ClientWebView: Use HTML element's height to determine preferred
Return the scroll height of the HTML element since the BODY may have margin/border/padding and we want to know precisely how high the widget needs to be to avoid scrolling.
This commit is contained in:
parent
66fb96181c
commit
c27d250032
1 changed files with 5 additions and 1 deletions
|
|
@ -90,7 +90,11 @@ PageState.prototype = {
|
|||
}, false); // load does not bubble
|
||||
},
|
||||
getPreferredHeight: function() {
|
||||
return window.document.body.scrollHeight;
|
||||
// Return the scroll height of the HTML element since the BODY
|
||||
// may have margin/border/padding and we want to know
|
||||
// precisely how high the widget needs to be to avoid
|
||||
// scrolling.
|
||||
return window.document.documentElement.scrollHeight;
|
||||
},
|
||||
getHtml: function() {
|
||||
return document.body.innerHTML;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue