diff -up evolution-3.40.4/data/webkit/e-web-view.js.6 evolution-3.40.4/data/webkit/e-web-view.js --- evolution-3.40.4/data/webkit/e-web-view.js.6 2023-01-03 18:41:01.198700722 +0100 +++ evolution-3.40.4/data/webkit/e-web-view.js 2023-01-03 18:41:01.215700736 +0100 @@ -730,6 +730,38 @@ Evo.EnsureMainDocumentInitialized = func Evo.initializeAndPostContentLoaded(null); } +Evo.mailDisplayUpdateIFramesHeightRecursive = function(doc) +{ + if (!doc) + return; + + var ii, iframes; + + iframes = doc.getElementsByTagName("iframe"); + + /* Update from bottom to top */ + for (ii = 0; ii < iframes.length; ii++) { + Evo.mailDisplayUpdateIFramesHeightRecursive(iframes[ii].contentDocument); + } + + if (!doc.scrollingElement || !doc.defaultView || !doc.defaultView.frameElement) + return; + + if (doc.defaultView.frameElement.height == doc.scrollingElement.scrollHeight) + doc.defaultView.frameElement.height = 10; + doc.defaultView.frameElement.height = doc.scrollingElement.scrollHeight + 2 + (doc.scrollingElement.scrollWidth > doc.scrollingElement.clientWidth ? 20 : 0); +} + +Evo.MailDisplayUpdateIFramesHeight = function() +{ + var scrolly = document.defaultView ? document.defaultView.scrollY : -1; + + Evo.mailDisplayUpdateIFramesHeightRecursive(document); + + if (scrolly != -1 && document.defaultView.scrollY != scrolly) + document.defaultView.scrollTo(0, scrolly); +} + if (this instanceof Window && this.document) { this.document.onload = function() { Evo.initializeAndPostContentLoaded(this); }; @@ -815,9 +847,8 @@ Evo.mailDisplayResizeContentToPreviewWid local_width -= 2; /* 1 + 1 frame borders */ } else if (!iframes.length) { /* Message main body */ - local_width -= 8; /* 8 + 8 margins of body without iframes */ - if (level > 1) - local_width -= 8; + local_width -= level * 20; /* 10 + 10 margins of body without iframes */ + local_width -= 4; Evo.addRuleIntoStyleSheetDocument(doc, "-e-mail-formatter-style-sheet", "body", "width: " + local_width + "px;"); Evo.addRuleIntoStyleSheetDocument(doc, "-e-mail-formatter-style-sheet", ".part-container", "width: " + local_width + "px;"); @@ -827,7 +858,7 @@ Evo.mailDisplayResizeContentToPreviewWid Evo.addRuleIntoStyleSheetDocument(doc, "-e-mail-formatter-style-sheet", "body", "width: " + local_width + "px;"); - local_width -= 2; /* 1 + 1 frame borders */ + local_width -= 4; /* 2 + 2 frame borders */ Evo.addRuleIntoStyleSheetDocument(doc, "-e-mail-formatter-style-sheet", ".part-container-nostyle iframe", "width: " + local_width + "px;"); @@ -839,19 +870,15 @@ Evo.mailDisplayResizeContentToPreviewWid Evo.addRuleIntoStyleSheetDocument(doc, "-e-mail-formatter-style-sheet", ".part-container iframe", "width: " + (local_width - 10) + "px;"); } else { - local_width -= 20; /* 10 + 10 margins of body with iframes */ - local_width -= 8; /* attachment margin */ - local_width -= 2; /* 1 + 1 frame borders */ + local_width -= (level - 1) * 20; /* 10 + 10 margins of body with iframes */ + local_width -= 4; /* 2 + 2 frame borders */ + local_width -= 10; /* attachment margin */ - /* We need to subtract another 10 pixels from the iframe width to - * have the iframe's borders on the correct place. We can't subtract - * it from local_width as we don't want to propagate this change - * further. */ Evo.addRuleIntoStyleSheetDocument(doc, "-e-mail-formatter-style-sheet", ".part-container-nostyle iframe", - "width: " + (local_width - 10) + "px;"); + "width: " + local_width + "px;"); Evo.addRuleIntoStyleSheetDocument(doc, "-e-mail-formatter-style-sheet", "body > .part-container-nostyle iframe", - "width: " + (local_width - 10) + "px;"); + "width: " + local_width + "px;"); } /* Add rules to every sub document */ @@ -862,7 +889,7 @@ Evo.mailDisplayResizeContentToPreviewWid var tmp_local_width = local_width; if (level == 0) { - tmp_local_width -= 8; /* attachment's margin */ + tmp_local_width -= 10; /* attachment's margin */ Evo.addRuleIntoStyleSheetDocument(doc, "-e-mail-formatter-style-sheet", ".attachment-wrapper iframe:not([src*=\"__formatas=\"])", "width: " + tmp_local_width + "px;"); @@ -871,7 +898,7 @@ Evo.mailDisplayResizeContentToPreviewWid "width: " + tmp_local_width + "px;"); Evo.addRuleIntoStyleSheetDocument(doc, "-e-mail-formatter-style-sheet", "body > .part-container-nostyle iframe", - "width: " + local_width + "px;"); + "width: " + tmp_local_width + "px;"); } this.set_iframe_and_body_width (iframes[ii].contentDocument, tmp_local_width, original_width, level + 1); @@ -884,6 +911,7 @@ Evo.mailDisplayResizeContentToPreviewWid width -= 20; /* 10 + 10 margins of body */ traversar.set_iframe_and_body_width(document, width, width, 0); + window.webkit.messageHandlers.scheduleIFramesHeightUpdate.postMessage(0); } Evo.mailDisplayUpdateMagicSpacebarState = function() @@ -1249,6 +1277,8 @@ Evo.MailDisplayShowAttachment = function window.webkit.messageHandlers.contentLoaded.postMessage(iframe_id); Evo.mailDisplayUpdateMagicSpacebarState(); } + } else if (elem.ownerDocument.defaultView.frameElement) { + window.webkit.messageHandlers.scheduleIFramesHeightUpdate.postMessage(0); } } @@ -1343,8 +1373,10 @@ EvoItip.SetElementInnerHTML = function(i { var elem = Evo.FindElement(iframe_id, element_id); - if (elem) + if (elem) { elem.innerHTML = html_content; + window.webkit.messageHandlers.scheduleIFramesHeightUpdate.postMessage(0); + } } EvoItip.SetShowCheckbox = function(iframe_id, element_id, show, update_second) @@ -1370,6 +1402,8 @@ EvoItip.SetShowCheckbox = function(ifram if (elem) { elem.hidden = !show; } + + window.webkit.messageHandlers.scheduleIFramesHeightUpdate.postMessage(0); } } @@ -1383,6 +1417,8 @@ EvoItip.SetAreaText = function(iframe_id if (row.lastElementChild) { row.lastElementChild.innerHTML = text; } + + window.webkit.messageHandlers.scheduleIFramesHeightUpdate.postMessage(0); } } @@ -1400,6 +1436,8 @@ EvoItip.UpdateTimes = function(iframe_id if (elem.lastElementChild) { elem.lastElementChild.innerHTML = label; } + + window.webkit.messageHandlers.scheduleIFramesHeightUpdate.postMessage(0); } } @@ -1427,6 +1465,8 @@ EvoItip.AppendInfoRow = function(iframe_ cell = row.insertCell(-1); cell.innerHTML = message; + + window.webkit.messageHandlers.scheduleIFramesHeightUpdate.postMessage(0); } EvoItip.RemoveInfoRow = function(iframe_id, row_id) @@ -1435,6 +1475,7 @@ EvoItip.RemoveInfoRow = function(iframe_ if (row && row.parentNode) { row.parentNode.removeChild(row); + window.webkit.messageHandlers.scheduleIFramesHeightUpdate.postMessage(0); } } @@ -1446,6 +1487,8 @@ EvoItip.RemoveChildNodes = function(ifra while (elem.lastChild) { elem.removeChild(elem.lastChild); } + + window.webkit.messageHandlers.scheduleIFramesHeightUpdate.postMessage(0); } } @@ -1498,6 +1541,8 @@ EvoItip.HideButtons = function(iframe_id if (button) button.hidden = true; } + + window.webkit.messageHandlers.scheduleIFramesHeightUpdate.postMessage(0); } } diff -up evolution-3.40.4/data/webkit/webview.css.6 evolution-3.40.4/data/webkit/webview.css --- evolution-3.40.4/data/webkit/webview.css.6 2021-08-13 11:50:35.000000000 +0200 +++ evolution-3.40.4/data/webkit/webview.css 2023-01-03 18:41:01.214700735 +0100 @@ -12,8 +12,8 @@ img { } body { - /* Use margin so that children can safely use width=100% */ - margin: 5px 10px 5px 10px; + /* Use padding so that children can safely use width=100% */ + padding: 8px; } body, div, p, td { @@ -38,21 +38,21 @@ img#__evo-contact-photo { img.navigable { cursor: pointer; - margin-right: 4px; + padding-right: 4px; } .attachments { background: #FFF; border: 1px solid silver; - margin: 10px 10px 10px 10px; + padding: 10px 10px 10px 10px; border-left: 0; border-right: 0; border-bottom: 0; } .attachment { - margin-left: 8px; - margin-right: 0px; + padding-left: 8px; + padding-right: 0px; } .attachment td { @@ -66,21 +66,21 @@ iframe:not([id$=".itip"]) { .part-container { height: 100%; - margin-top: 2px; - margin-bottom: 2px; + padding: 0px; } .part-container-nostyle iframe { - margin-right: 10px; + margin: 0px; + padding-right: 0px; } .part-container-inner-margin { - margin: 8px; + padding: 0px; } object { /* GtkWidgets */ - margin-top: 2px; - margin-bottom: 2px; + padding-top: 2px; + padding-bottom: 2px; } .__evo-highlight { @@ -166,7 +166,7 @@ th.rtl { /***** PRINTING *******/ .printing-header { - margin-bottom: 20px; + padding-bottom: 20px; } .printing-header h1, @@ -186,7 +186,7 @@ th.rtl { /******* ITIP *********/ .itip.icon { float: left; - margin-right: 5px; + padding-right: 5px; } .itip.content { @@ -195,7 +195,7 @@ th.rtl { } .itip.description { - margin: 5px; + padding: 5px; } .itip tr { @@ -219,7 +219,7 @@ th.rtl { } #table_row_buttons img { - margin-right: 5px; + padding-right: 5px; vertical-align: middle; } diff -up evolution-3.40.4/src/em-format/e-mail-formatter-text-plain.c.6 evolution-3.40.4/src/em-format/e-mail-formatter-text-plain.c --- evolution-3.40.4/src/em-format/e-mail-formatter-text-plain.c.6 2021-08-13 11:50:35.000000000 +0200 +++ evolution-3.40.4/src/em-format/e-mail-formatter-text-plain.c 2023-01-03 18:41:01.214700735 +0100 @@ -111,7 +111,7 @@ emfe_text_plain_format (EMailFormatterEx string = "