aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2014-03-13 22:31:36 +0800
committerMilan Crha <mcrha@redhat.com>2014-03-13 22:31:36 +0800
commit7749f1a1c6035e87c2f5b8620d08954e70af2e6d (patch)
tree756f8448310f89b247fa8bdf97ba3f465f238dfe
parent708a35fdf61e23d22910cb000bb1b2ddbab31f3d (diff)
downloadgsoc2013-evolution-7749f1a1c6035e87c2f5b8620d08954e70af2e6d.tar
gsoc2013-evolution-7749f1a1c6035e87c2f5b8620d08954e70af2e6d.tar.gz
gsoc2013-evolution-7749f1a1c6035e87c2f5b8620d08954e70af2e6d.tar.bz2
gsoc2013-evolution-7749f1a1c6035e87c2f5b8620d08954e70af2e6d.tar.lz
gsoc2013-evolution-7749f1a1c6035e87c2f5b8620d08954e70af2e6d.tar.xz
gsoc2013-evolution-7749f1a1c6035e87c2f5b8620d08954e70af2e6d.tar.zst
gsoc2013-evolution-7749f1a1c6035e87c2f5b8620d08954e70af2e6d.zip
EWebView/EMailDisplay: Setup custom CSS styles to DOM right after document loads
The custom styles, those which are added on-the-fly directly to DOM, were added only after whole document was completely loaded, which included also sub-frames content, thus when these were slow to download for any reason, the main frame content, like the top header bar, was shown with a default style, which is white background and black text color. The WebKitWebView's document-load-finished signal is emitted whenever the actual HTML content is loaded, and the DOM is available as well, for each frame, including the main frame of the WebView, thus updating/setting custom CSS styles in this signal handler makes the loaded frames look as expected, without waiting for other frames in the document to finish their load.
-rw-r--r--e-util/e-web-view.c4
-rw-r--r--mail/e-mail-display.c3
2 files changed, 7 insertions, 0 deletions
diff --git a/e-util/e-web-view.c b/e-util/e-web-view.c
index 2578590b3f..511f17e743 100644
--- a/e-util/e-web-view.c
+++ b/e-util/e-web-view.c
@@ -1634,6 +1634,10 @@ e_web_view_init (EWebView *web_view)
NULL);
g_signal_connect (
+ web_view, "document-load-finished",
+ G_CALLBACK (style_updated_cb), NULL);
+
+ g_signal_connect (
web_view, "notify::load-status",
G_CALLBACK (web_view_load_status_changed_cb), NULL);
diff --git a/mail/e-mail-display.c b/mail/e-mail-display.c
index f063fd237b..82dd8e999e 100644
--- a/mail/e-mail-display.c
+++ b/mail/e-mail-display.c
@@ -1547,6 +1547,9 @@ e_mail_display_init (EMailDisplay *display)
g_signal_connect (
main_frame, "notify::load-status",
G_CALLBACK (mail_parts_bind_dom), NULL);
+ g_signal_connect (
+ display, "document-load-finished",
+ G_CALLBACK (initialize_web_view_colors), NULL);
actions = e_web_view_get_action_group (E_WEB_VIEW (display), "mailto");
gtk_action_group_add_actions (