[geary/mjog/283-plain-text-whitespace-fixes: 2/4] ui/conversation-web-view.css: Clean up HTML/BODY element lockdowns




commit 96f9537b6984bd7c8b6d84b5c78ceab3f2b824e6
Author: Michael Gratton <mike vee net>
Date:   Sat Oct 17 13:36:30 2020 +1100

    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 d4786b4a7..3c1929f29 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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]