[geary/wip/message-quoting: 3/3] ClientWebView: Use HTML element's height to determine preferred
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/wip/message-quoting: 3/3] ClientWebView: Use HTML element's height to determine preferred
- Date: Sat, 6 Jul 2019 03:43:22 +0000 (UTC)
commit d2054f26a7270853a6ed2f587379371c3affdf69
Author: Michael Gratton <mike vee net>
Date: Mon May 6 21:43:06 2019 +1000
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.
ui/client-web-view.js | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/ui/client-web-view.js b/ui/client-web-view.js
index 8f71594f..75bdecf1 100644
--- a/ui/client-web-view.js
+++ b/ui/client-web-view.js
@@ -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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]