[anjal] Update the webkit patch and try to make as little as possible.
- From: Fridrich Strba <strba src gnome org>
- To: svn-commits-list gnome org
- Subject: [anjal] Update the webkit patch and try to make as little as possible.
- Date: Mon, 8 Jun 2009 08:48:49 -0400 (EDT)
commit fa4ceaff17e92461a362658c2dc16f19cf6580a6
Author: Fridrich Strba <fridrich strba bluewin ch>
Date: Mon Jun 8 14:48:08 2009 +0200
Update the webkit patch and try to make as little as possible.
---
src/mail-editor.c | 4 +-
webkit.patch | 143 +++++++++++++++++++++--------------------------------
2 files changed, 59 insertions(+), 88 deletions(-)
diff --git a/src/mail-editor.c b/src/mail-editor.c
index 71a809f..7ba06bc 100644
--- a/src/mail-editor.c
+++ b/src/mail-editor.c
@@ -342,7 +342,7 @@ mail_editor_get_text_plain (MailEditor *editor,
priv = MAIL_EDITOR_GET_PRIVATE (editor);
frame = webkit_web_view_get_main_frame (priv->editor);
- contents = webkit_web_frame_get_string (frame);
+ contents = webkit_web_frame_get_inner_text (frame);
*length = g_utf8_strlen (contents, -1); /*FIXME*/
@@ -404,7 +404,7 @@ mail_editor_get_html (MailEditor *editor, gsize *length)
*length = 0;
frame = webkit_web_view_get_main_frame (priv->editor);
- contents = webkit_web_frame_get_string (frame);
+ contents = webkit_web_frame_get_inner_text (frame);
contents = g_strdup_printf ("<html>%s</html>", contents);
*length = g_utf8_strlen (contents, -1); /*FIXME ?*/
diff --git a/webkit.patch b/webkit.patch
index 50d2d11..bb60a77 100644
--- a/webkit.patch
+++ b/webkit.patch
@@ -1,54 +1,11 @@
-diff --git a/WebCore/editing/Editor.cpp b/WebCore/editing/Editor.cpp
-index 1edcdc6..8a7676b 100644
---- a/WebCore/editing/Editor.cpp
-+++ b/WebCore/editing/Editor.cpp
-@@ -220,6 +220,14 @@ bool Editor::isSelectTrailingWhitespaceEnabled()
- return client() && client()->isSelectTrailingWhitespaceEnabled();
- }
-
-+int Editor::numEnclosedBlockquotes()
-+{
-+ SelectionController* sel = m_frame->selection();
-+ Position start = sel->selection().start();
-+
-+ return WebCore::numEnclosingMailBlockquotes(start);
-+}
-+
- bool Editor::deleteWithDirection(SelectionController::EDirection direction, TextGranularity granularity, bool killRing, bool isTypingAction)
- {
- if (!canEdit())
-diff --git a/WebCore/editing/Editor.h b/WebCore/editing/Editor.h
-index 2f67723..dc6a7b9 100644
---- a/WebCore/editing/Editor.h
-+++ b/WebCore/editing/Editor.h
-@@ -269,6 +269,7 @@ public:
- PassRefPtr<Range> nextVisibleRange(Range*, const String&, bool forward, bool caseFlag, bool wrapFlag);
-
- void addToKillRing(Range*, bool prepend);
-+ int numEnclosedBlockquotes ();
- private:
- Frame* m_frame;
- OwnPtr<DeleteButtonController> m_deleteButtonController;
-diff --git a/WebKit/gtk/webkit/webkitwebframe.cpp b/WebKit/gtk/webkit/webkitwebframe.cpp
-index e2b10b6..1ded1fb 100644
---- a/WebKit/gtk/webkit/webkitwebframe.cpp
-+++ b/WebKit/gtk/webkit/webkitwebframe.cpp
-@@ -429,6 +429,52 @@ void webkit_web_frame_load_string(WebKitWebFrame* frame, const gchar* content, c
- coreFrame->loader()->load(ResourceRequest(url), substituteData, false);
+--- WebKit/gtk/webkit/webkitwebframe.cpp (revision 44495)
++++ WebKit/gtk/webkit/webkitwebframe.cpp (working copy)
+@@ -490,6 +490,31 @@
+ webkit_web_frame_load_data(frame, content, NULL, NULL, baseURL, unreachableURL);
}
+/*
-+ * Get HTML Document String
-+ */
-+char *webkit_web_frame_get_string(WebKitWebFrame* frame)
-+{
-+ Frame* coreFrame = core(frame);
-+ String foo = coreFrame->document()->body()->outerHTML();
-+ return g_strdup(foo.utf8().data());
-+}
-+
-+/*
-+ * Insert new line into the webkit editor quoted data
++ * Detect whether a cursor is in a blockquote
+ */
+gboolean
+webkit_web_frame_is_cursor_at_blockquote (WebKitWebFrame *frame)
@@ -59,17 +16,6 @@ index e2b10b6..1ded1fb 100644
+}
+
+/*
-+ * Insert new line into the webkit editor quoted data
-+ */
-+void
-+webkit_web_frame_break_quote (WebKitWebFrame *frame)
-+{
-+ Frame* coreFrame = core(frame);
-+
-+ coreFrame->editor()->command("InsertNewlineInQuotedContent").execute();
-+}
-+
-+/*
+ * Execute arbitary commands in frame.
+ */
+void
@@ -86,51 +32,76 @@ index e2b10b6..1ded1fb 100644
/**
* webkit_web_frame_load_request:
* @frame: a #WebKitWebFrame
-@@ -610,6 +656,15 @@ gchar* webkit_web_frame_dump_render_tree(WebKitWebFrame* frame)
- return g_strdup(string.utf8().data());
+@@ -828,3 +853,12 @@
+ WebKitWebFramePrivate* priv = frame->priv;
+ return priv->loadStatus;
}
-
++
+int
+webkit_web_frame_get_height (WebKitWebFrame *frame)
+{
-+ Frame* coreFrame = core(frame);
-+ FrameView* view = coreFrame->view();
++ Frame* coreFrame = core(frame);
++ FrameView* view = coreFrame->view();
+
-+ return view->contentsHeight();
++ return view->contentsHeight();
+}
-+
- #if GTK_CHECK_VERSION(2,10,0)
-
- static void begin_print(GtkPrintOperation* op, GtkPrintContext* context, gpointer user_data)
-diff --git a/WebKit/gtk/webkit/webkitwebframe.h b/WebKit/gtk/webkit/webkitwebframe.h
-index 7e24565..2bb9e67 100644
---- a/WebKit/gtk/webkit/webkitwebframe.h
-+++ b/WebKit/gtk/webkit/webkitwebframe.h
-@@ -84,6 +84,17 @@ WEBKIT_API void
+--- WebKit/gtk/webkit/webkitwebframe.h (revision 44495)
++++ WebKit/gtk/webkit/webkitwebframe.h (working copy)
+@@ -92,7 +92,20 @@
webkit_web_frame_load_uri (WebKitWebFrame *frame,
const gchar *uri);
-+WEBKIT_API gchar *
-+webkit_web_frame_get_string (WebKitWebFrame *frame);
++WEBKIT_API gchar*
++webkit_web_frame_get_inner_text (WebKitWebFrame *frame);
++
+WEBKIT_API gboolean
+webkit_web_frame_is_cursor_at_blockquote (WebKitWebFrame *frame);
-+WEBKIT_API void
-+webkit_web_frame_break_quote (WebKitWebFrame *frame);
+
-+WEBKIT_API void
+ WEBKIT_API void
+webkit_web_frame_execute_command (WebKitWebFrame *frame,
-+ const gchar *command);
++ const gchar *command);
+
- WEBKIT_API void
++#define webkit_web_frame_break_quote (frame) \
++webkit_web_frame_execute_command (frame, "InsertNewlineInQuotedContent")
++
++WEBKIT_API void
webkit_web_frame_load_string (WebKitWebFrame *frame,
const gchar *content,
-@@ -107,7 +118,8 @@ webkit_web_frame_find_frame (WebKitWebFrame *frame,
+ const gchar *mime_type,
+@@ -134,6 +147,9 @@
+ WEBKIT_API WebKitLoadStatus
+ webkit_web_frame_get_load_status (WebKitWebFrame *frame);
- WEBKIT_API JSGlobalContextRef
- webkit_web_frame_get_global_context (WebKitWebFrame *frame);
--
+WEBKIT_API int
-+webkit_web_frame_get_height (WebKitWebFrame *frame);
++webkit_web_frame_get_height (WebKitWebFrame *frame);
++
G_END_DECLS
#endif
+--- WebCore/editing/Editor.cpp (revision 44495)
++++ WebCore/editing/Editor.cpp (working copy)
+@@ -223,6 +223,14 @@
+ return client() && client()->isSelectTrailingWhitespaceEnabled();
+ }
+
++int Editor::numEnclosedBlockquotes()
++{
++ SelectionController* sel = m_frame->selection();
++ Position start = sel->selection().start();
++
++ return WebCore::numEnclosingMailBlockquotes(start);
++}
++
+ bool Editor::deleteWithDirection(SelectionController::EDirection direction, TextGranularity granularity, bool killRing, bool isTypingAction)
+ {
+ if (!canEdit())
+--- WebCore/editing/Editor.h (revision 44495)
++++ WebCore/editing/Editor.h (working copy)
+@@ -291,6 +291,7 @@
+ PassRefPtr<Range> nextVisibleRange(Range*, const String&, bool forward, bool caseFlag, bool wrapFlag);
+
+ void addToKillRing(Range*, bool prepend);
++ int numEnclosedBlockquotes ();
+ private:
+ Frame* m_frame;
+ OwnPtr<DeleteButtonController> m_deleteButtonController;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]