[Xfce4-commits] <midori:master> Always create a new style element for link find

Christian Dywan noreply at xfce.org
Wed Oct 27 00:16:01 CEST 2010


Updating branch refs/heads/master
         to 80bd531d58ba6f36b5da2f9b31daec3657f78593 (commit)
       from 95f22785425f709a414040deb2f6dc8ab8489fdf (commit)

commit 80bd531d58ba6f36b5da2f9b31daec3657f78593
Author: Christian Dywan <christian at twotoasts.de>
Date:   Tue Oct 26 23:50:59 2010 +0200

    Always create a new style element for link find
    
    Otherwise adding rules for link find on pages with
    no stylesheets doesn't work.

 midori/midori-view.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/midori/midori-view.c b/midori/midori-view.c
index 2e6f462..14353c4 100644
--- a/midori/midori-view.c
+++ b/midori/midori-view.c
@@ -1812,8 +1812,12 @@ gtk_widget_key_press_event_cb (WebKitWebView* web_view,
         if (view->find_links == -1)
         {
             result = sokoke_js_script_eval (js_context,
-                "(function (aSelector, aRule) { "
-                " document.styleSheets[0].insertRule (aSelector + ' ' + aRule);"
+                "(function (selector, rule) { "
+                " var style = document.createElement ('style');"
+                " style.setAttribute ('type', 'text/css');"
+                " var heads = document.getElementsByTagName ('head');"
+                " heads[0].appendChild (style);"
+                " document.styleSheets[0].insertRule (selector + ' ' + rule);"
                 " } )"
                 " ('.midoriHKD87346', '{ "
                 " font-size:small !important; font-weight:bold !important;"



More information about the Xfce4-commits mailing list