diff --git a/ui/client-web-view.js b/ui/client-web-view.js index 4c11d399..57f0b538 100644 --- a/ui/client-web-view.js +++ b/ui/client-web-view.js @@ -53,7 +53,17 @@ PageState.prototype = { }, true); }, getPreferredHeight: function() { - return window.document.documentElement.offsetHeight; + let html = window.document.documentElement; + let height = html.offsetHeight; + let computed = window.getComputedStyle(html); + let top = computed.getPropertyValue('margin-top'); + let bot = computed.getPropertyValue('margin-bottom'); + + return ( + height + + parseInt(top.substring(0, top.length - 2)) + + parseInt(bot.substring(0, bot.length - 2)) + ); }, loaded: function() { this.isLoaded = true; diff --git a/ui/conversation-web-view.css b/ui/conversation-web-view.css index e3385e3b..d1cf1fd1 100644 --- a/ui/conversation-web-view.css +++ b/ui/conversation-web-view.css @@ -7,33 +7,15 @@ */ * { - transition: height 0.25s; -} - -html { - /* Trigger CSS 2.1 ยง 10.6.7 to get a shrink-wrapped height. */ - position: absolute !important; - top: 0 !important; - left: 0 !important; - bottom: auto !important; - width: 100% !important; - height: auto !important; - - /* Lock down the box enough so we don't get an incrementally - expanding web view */ - box-sizing: border-box !important; - margin: 0 !important; - border: 0 !important; - padding: 0; - - /* Never show scroll bars */ - overflow: hidden; + transition: height 0.25s !important; } body { - margin: 0; + margin: 12px; border: 0; - padding: 12px; + padding: 0; + + /* XXX for plain text only? */ overflow-wrap: break-word !important; } @@ -61,7 +43,6 @@ blockquote { padding: 0 8px; } - pre { white-space: pre-wrap; }