From 40f97de745741fe54a8ece2ddd106cb356c8811d Mon Sep 17 00:00:00 2001
From: Michael Gratton <mike@vee.net>
Date: Sat, 17 Oct 2020 13:36:30 +1100
Subject: [PATCH 105/124] ui/conversation-web-view.css: Clean up HTML/BODY
 element lockdowns

Use some more obvious CSS to ensure we can get an accurate idea of the
content height for sizing the web view and that the body fits the
web view's width.
---
 ui/conversation-web-view.css | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/ui/conversation-web-view.css b/ui/conversation-web-view.css
index d4786b4a..3c1929f2 100644
--- a/ui/conversation-web-view.css
+++ b/ui/conversation-web-view.css
@@ -1,5 +1,8 @@
 /**
  * Style that is inserted into the message after it is loaded.
+ *
+ * Copyright © 2016 Software Freedom Conservancy Inc.
+ * Copyright © 2020 Michael Gratton <mike@vee.net>
  */
 
 /*
@@ -14,17 +17,15 @@ html {
   color: black;
   background-color: white;
 
-  /* Trigger CSS 2.1 § 10.6.7 to get a shrink-wrapped height. */
-  position: absolute !important;
-  top: 0 !important;
-  bottom: auto !important;
-  height: auto !important;
-
-  /* Fix up the width after going to absolute positioning above. */
-  width: 100%;
+  /* Width must always be defined by the viewport so content doesn't
+  overflow inside the WebView, height must always be defined by the
+  content so the WebView can be sized to fit exactly. */
+  width: 100vw !important;
+  height: max-content !important;
 
-  /* Lock down the box just enough so we don't get an incrementally
-     expanding web view */
+  /* Lock down the box sizing just enough so that the width and height
+  constraints above work as expected, and so the element's
+  scrollHeight is accurate. */
   box-sizing: border-box !important;
   margin: 0 !important;
   border-width: 0 !important;
-- 
2.29.2

