[geary/wip/765516-gtk-widget-conversation-viewer: 134/187] Fix 0px elements being rendered as 1px boxes.



commit 06f53818c619714bb244eacc3d2daf466427b8ea
Author: Michael James Gratton <mike vee net>
Date:   Sun Aug 14 13:30:24 2016 +1000

    Fix 0px elements being rendered as 1px boxes.

 .../conversation-viewer/conversation-message.vala  |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/client/conversation-viewer/conversation-message.vala 
b/src/client/conversation-viewer/conversation-message.vala
index d832a69..47cb6ef 100644
--- a/src/client/conversation-viewer/conversation-message.vala
+++ b/src/client/conversation-viewer/conversation-message.vala
@@ -1009,9 +1009,13 @@ public class ConversationMessage : Gtk.Grid {
                     WebKit.DOM.Element? element = nodes.item(i) as WebKit.DOM.Element;
                     if (element == null || !element.has_attribute("src"))
                         continue;
-                    
+
                     string src = element.get_attribute("src");
-                    if (!web_view.is_always_loaded(src)) {
+                    // Don't prefix empty src strings since it will
+                    // cause e.g. 0px images (commonly found in
+                    // commercial mailouts) to be rendered as broken
+                    // images instead of empty elements.
+                    if (src.length > 0 && !web_view.is_always_loaded(src)) {
                         // Workaround a WebKitGTK+ 2.4.10 crash. See Bug 763933
                         element.remove_attribute("src");
                         element.set_attribute("src", web_view.allow_prefix + src);


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