| 561 webkit_web_view_load_string(WEBKIT_WEB_VIEW(webview), html, NULL, NULL, |
561 webkit_web_view_load_string(WEBKIT_WEB_VIEW(webview), html, NULL, NULL, |
| 562 "file:///"); |
562 "file:///"); |
| 563 } |
563 } |
| 564 |
564 |
| 565 void |
565 void |
| |
566 gtk_webview_load_html_string_with_selection(GtkWebView *webview, const char *html) |
| |
567 { |
| |
568 gtk_webview_load_html_string(webview, html); |
| |
569 gtk_webview_safe_execute_script(webview, |
| |
570 "var s = window.getSelection();" |
| |
571 "var r = document.createRange();" |
| |
572 "var n = document.getElementById('caret');" |
| |
573 "r.setStartBefore(n);" |
| |
574 "r.setEndBefore(n);" |
| |
575 "s.removeAllRanges();" |
| |
576 "s.addRange(r);"); |
| |
577 } |
| |
578 |
| |
579 void |
| 566 gtk_webview_append_html(GtkWebView *webview, const char *html) |
580 gtk_webview_append_html(GtkWebView *webview, const char *html) |
| 567 { |
581 { |
| 568 GtkWebViewPriv *priv = GTK_WEBVIEW_GET_PRIVATE(webview); |
582 GtkWebViewPriv *priv = GTK_WEBVIEW_GET_PRIVATE(webview); |
| 569 WebKitDOMDocument *doc; |
583 WebKitDOMDocument *doc; |
| 570 WebKitDOMHTMLElement *body; |
584 WebKitDOMHTMLElement *body; |