[geary/wip/765516-gtk-widget-conversation-viewer] Fix 0px elements being rendered as 1px boxes.
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/wip/765516-gtk-widget-conversation-viewer] Fix 0px elements being rendered as 1px boxes.
- Date: Sun, 14 Aug 2016 03:33:50 +0000 (UTC)
commit 83e12ca945d34bb74631c846c6cd3d3be26aaecf
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]