From b58f2c744c75ac2096750a5e1b19a9166086e9fe Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Tue, 3 Jan 2023 18:43:57 +0100 Subject: [PATCH] Resolves: #2126524 (Update patch to handle frame flattening change in WebKitGTK) --- evolution-3.40.4-frame-flattenning.patch | 163 ++++++++++++++++------- evolution.spec | 5 +- 2 files changed, 120 insertions(+), 48 deletions(-) diff --git a/evolution-3.40.4-frame-flattenning.patch b/evolution-3.40.4-frame-flattenning.patch index 1d899ac..8ae3210 100644 --- a/evolution-3.40.4-frame-flattenning.patch +++ b/evolution-3.40.4-frame-flattenning.patch @@ -1,8 +1,7 @@ -diff --git a/data/webkit/e-web-view.js b/data/webkit/e-web-view.js -index a8f99c4668..058b4e578c 100644 ---- a/data/webkit/e-web-view.js -+++ b/data/webkit/e-web-view.js -@@ -772,6 +772,38 @@ Evo.EnsureMainDocumentInitialized = function() +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); } @@ -20,12 +19,12 @@ index a8f99c4668..058b4e578c 100644 + Evo.mailDisplayUpdateIFramesHeightRecursive(iframes[ii].contentDocument); + } + -+ if (!doc.body || !doc.defaultView || !doc.defaultView.frameElement) ++ if (!doc.scrollingElement || !doc.defaultView || !doc.defaultView.frameElement) + return; + -+ if (doc.defaultView.frameElement.height == doc.body.scrollHeight) ++ if (doc.defaultView.frameElement.height == doc.scrollingElement.scrollHeight) + doc.defaultView.frameElement.height = 10; -+ doc.defaultView.frameElement.height = doc.body.scrollHeight + 2 + (doc.body.scrollWidth > doc.body.clientWidth ? 20 : 0); ++ doc.defaultView.frameElement.height = doc.scrollingElement.scrollHeight + 2 + (doc.scrollingElement.scrollWidth > doc.scrollingElement.clientWidth ? 20 : 0); +} + +Evo.MailDisplayUpdateIFramesHeight = function() @@ -41,7 +40,7 @@ index a8f99c4668..058b4e578c 100644 if (this instanceof Window && this.document) { this.document.onload = function() { Evo.initializeAndPostContentLoaded(this); }; -@@ -857,9 +889,8 @@ Evo.mailDisplayResizeContentToPreviewWidth = function() +@@ -815,9 +847,8 @@ Evo.mailDisplayResizeContentToPreviewWid local_width -= 2; /* 1 + 1 frame borders */ } else if (!iframes.length) { /* Message main body */ @@ -53,7 +52,7 @@ index a8f99c4668..058b4e578c 100644 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;"); -@@ -869,7 +900,7 @@ Evo.mailDisplayResizeContentToPreviewWidth = function() +@@ -827,7 +858,7 @@ Evo.mailDisplayResizeContentToPreviewWid Evo.addRuleIntoStyleSheetDocument(doc, "-e-mail-formatter-style-sheet", "body", "width: " + local_width + "px;"); @@ -62,7 +61,7 @@ index a8f99c4668..058b4e578c 100644 Evo.addRuleIntoStyleSheetDocument(doc, "-e-mail-formatter-style-sheet", ".part-container-nostyle iframe", "width: " + local_width + "px;"); -@@ -881,19 +912,15 @@ Evo.mailDisplayResizeContentToPreviewWidth = function() +@@ -839,19 +870,15 @@ Evo.mailDisplayResizeContentToPreviewWid Evo.addRuleIntoStyleSheetDocument(doc, "-e-mail-formatter-style-sheet", ".part-container iframe", "width: " + (local_width - 10) + "px;"); } else { @@ -87,7 +86,7 @@ index a8f99c4668..058b4e578c 100644 } /* Add rules to every sub document */ -@@ -904,7 +931,7 @@ Evo.mailDisplayResizeContentToPreviewWidth = function() +@@ -862,7 +889,7 @@ Evo.mailDisplayResizeContentToPreviewWid var tmp_local_width = local_width; if (level == 0) { @@ -96,7 +95,7 @@ index a8f99c4668..058b4e578c 100644 Evo.addRuleIntoStyleSheetDocument(doc, "-e-mail-formatter-style-sheet", ".attachment-wrapper iframe:not([src*=\"__formatas=\"])", "width: " + tmp_local_width + "px;"); -@@ -913,7 +940,7 @@ Evo.mailDisplayResizeContentToPreviewWidth = function() +@@ -871,7 +898,7 @@ Evo.mailDisplayResizeContentToPreviewWid "width: " + tmp_local_width + "px;"); Evo.addRuleIntoStyleSheetDocument(doc, "-e-mail-formatter-style-sheet", "body > .part-container-nostyle iframe", @@ -105,7 +104,7 @@ index a8f99c4668..058b4e578c 100644 } this.set_iframe_and_body_width (iframes[ii].contentDocument, tmp_local_width, original_width, level + 1); -@@ -926,6 +953,7 @@ Evo.mailDisplayResizeContentToPreviewWidth = function() +@@ -884,6 +911,7 @@ Evo.mailDisplayResizeContentToPreviewWid width -= 20; /* 10 + 10 margins of body */ traversar.set_iframe_and_body_width(document, width, width, 0); @@ -113,7 +112,7 @@ index a8f99c4668..058b4e578c 100644 } Evo.mailDisplayUpdateMagicSpacebarState = function() -@@ -1294,6 +1322,8 @@ Evo.MailDisplayShowAttachment = function(element_id, show) +@@ -1249,6 +1277,8 @@ Evo.MailDisplayShowAttachment = function window.webkit.messageHandlers.contentLoaded.postMessage(iframe_id); Evo.mailDisplayUpdateMagicSpacebarState(); } @@ -122,10 +121,83 @@ index a8f99c4668..058b4e578c 100644 } } -diff --git a/data/webkit/webview.css b/data/webkit/webview.css -index 905e148aa3..257c25b42d 100644 ---- a/data/webkit/webview.css -+++ b/data/webkit/webview.css +@@ -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 { } @@ -137,7 +209,7 @@ index 905e148aa3..257c25b42d 100644 } body, div, p, td { -@@ -39,21 +39,21 @@ img#__evo-contact-photo { +@@ -38,21 +38,21 @@ img#__evo-contact-photo { img.navigable { cursor: pointer; @@ -163,7 +235,7 @@ index 905e148aa3..257c25b42d 100644 } .attachment td { -@@ -67,21 +67,21 @@ iframe:not([id$=".itip"]) { +@@ -66,21 +66,21 @@ iframe:not([id$=".itip"]) { .part-container { height: 100%; @@ -191,7 +263,7 @@ index 905e148aa3..257c25b42d 100644 } .__evo-highlight { -@@ -176,7 +176,7 @@ th.rtl { +@@ -166,7 +166,7 @@ th.rtl { /***** PRINTING *******/ .printing-header { @@ -200,7 +272,7 @@ index 905e148aa3..257c25b42d 100644 } .printing-header h1, -@@ -196,7 +196,7 @@ th.rtl { +@@ -186,7 +186,7 @@ th.rtl { /******* ITIP *********/ .itip.icon { float: left; @@ -209,7 +281,7 @@ index 905e148aa3..257c25b42d 100644 } .itip.content { -@@ -205,7 +205,7 @@ th.rtl { +@@ -195,7 +195,7 @@ th.rtl { } .itip.description { @@ -218,7 +290,7 @@ index 905e148aa3..257c25b42d 100644 } .itip tr { -@@ -229,7 +229,7 @@ th.rtl { +@@ -219,7 +219,7 @@ th.rtl { } #table_row_buttons img { @@ -227,11 +299,10 @@ index 905e148aa3..257c25b42d 100644 vertical-align: middle; } -diff --git a/src/em-format/e-mail-formatter-text-plain.c b/src/em-format/e-mail-formatter-text-plain.c -index 7c6befda6b..3858bcdb3d 100644 ---- a/src/em-format/e-mail-formatter-text-plain.c -+++ b/src/em-format/e-mail-formatter-text-plain.c -@@ -111,7 +111,7 @@ emfe_text_plain_format (EMailFormatterExtension *extension, +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 = "
settings != NULL) { g_signal_handlers_disconnect_matched ( priv->settings, G_SIGNAL_MATCH_DATA, -@@ -1599,6 +1644,18 @@ mail_display_magic_spacebar_state_changed_cb (WebKitUserContentManager *manager, - mail_display->priv->magic_spacebar_state = jsc_value_to_int32 (jsc_value); +@@ -1600,6 +1645,18 @@ mail_display_magic_spacebar_state_change } -+static void + static void +mail_display_schedule_iframes_height_update_cb (WebKitUserContentManager *manager, + WebKitJavascriptResult *js_result, + gpointer user_data) @@ -333,10 +402,11 @@ index cc4d2404e2..8ef29512dd 100644 + mail_display_schedule_iframes_height_update (mail_display); +} + - static void ++static void mail_display_constructed (GObject *object) { -@@ -1611,9 +1668,11 @@ mail_display_constructed (GObject *object) + EContentRequest *content_request; +@@ -1611,9 +1668,11 @@ mail_display_constructed (GObject *objec /* Chain up to parent's constructed() method. */ G_OBJECT_CLASS (e_mail_display_parent_class)->constructed (object); @@ -351,7 +421,7 @@ index cc4d2404e2..8ef29512dd 100644 display = E_MAIL_DISPLAY (object); web_view = E_WEB_VIEW (object); -@@ -1661,8 +1720,12 @@ mail_display_constructed (GObject *object) +@@ -1661,8 +1720,12 @@ mail_display_constructed (GObject *objec g_signal_connect_object (manager, "script-message-received::mailDisplayMagicSpacebarStateChanged", G_CALLBACK (mail_display_magic_spacebar_state_changed_cb), display, 0); @@ -364,11 +434,10 @@ index cc4d2404e2..8ef29512dd 100644 e_extensible_load_extensions (E_EXTENSIBLE (object)); } -diff --git a/src/modules/text-highlight/e-mail-formatter-text-highlight.c b/src/modules/text-highlight/e-mail-formatter-text-highlight.c -index d43d2fcbb6..052260d4a0 100644 ---- a/src/modules/text-highlight/e-mail-formatter-text-highlight.c -+++ b/src/modules/text-highlight/e-mail-formatter-text-highlight.c -@@ -135,16 +135,26 @@ text_hightlight_read_data_thread (gpointer user_data) +diff -up evolution-3.40.4/src/modules/text-highlight/e-mail-formatter-text-highlight.c.6 evolution-3.40.4/src/modules/text-highlight/e-mail-formatter-text-highlight.c +--- evolution-3.40.4/src/modules/text-highlight/e-mail-formatter-text-highlight.c.6 2021-08-13 11:50:35.000000000 +0200 ++++ evolution-3.40.4/src/modules/text-highlight/e-mail-formatter-text-highlight.c 2023-01-03 18:41:01.215700736 +0100 +@@ -135,16 +135,26 @@ text_hightlight_read_data_thread (gpoint { TextHighlightClosure *closure = user_data; gint nbuffer = 10240; diff --git a/evolution.spec b/evolution.spec index d033e4d..d7576bb 100644 --- a/evolution.spec +++ b/evolution.spec @@ -43,7 +43,7 @@ Name: evolution Version: 3.40.4 -Release: 8%{?dist} +Release: 9%{?dist} Summary: Mail and calendar client for GNOME License: GPLv2+ and GFDL URL: https://wiki.gnome.org/Apps/Evolution @@ -574,6 +574,9 @@ grep -v "%{_datadir}/locale" evolution.lang > help.lang %endif %changelog +* Tue Jan 03 2023 Milan Crha - 3.40.4-9 +- Resolves: #2126524 (Update patch to handle frame flattening change in WebKitGTK) + * Mon Sep 26 2022 Milan Crha - 3.40.4-8 - Resolves: #2129703 (EShellWindow: The 'New' menu is not filled after start) - Correct Requires for the 'devel' subpackage to enchant-2