[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

weinig at apple.com weinig at apple.com
Wed Dec 22 11:47:03 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 04c6b6627a465611dfa44bae1733b2185c62cb0e
Author: weinig at apple.com <weinig at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Aug 6 18:54:12 2010 +0000

    Roll out http://trac.webkit.org/changeset/64801, which broke the Safari Windows Build.
    Unreviewed.
    
    Patch by Jessie Berlin <jberlin at apple.com> on 2010-08-06
    * UIProcess/PageClient.h:
    * UIProcess/VisitedLinkProvider.h:
    * UIProcess/WebContextInjectedBundleClient.h:
    * UIProcess/WebFrameProxy.h:
    * UIProcess/WebHistoryClient.h:
    * UIProcess/WebLoaderClient.h:
    * UIProcess/WebPolicyClient.h:
    * UIProcess/WebProcessProxy.h:
    * UIProcess/WebUIClient.h:
    * UIProcess/win/WebView.h:
    * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h:
    * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
    * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
    * WebProcess/Plugins/NPRuntimeObjectMap.h:
    * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
    * WebProcess/Plugins/PluginController.h:
    * WebProcess/WebPage/WebFrame.h:
    * WebProcess/WebPage/WebPage.h:
    * WebProcess/WebProcess.h:
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@64862 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 113d969..3f4435a 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -27,6 +27,36 @@
 
         Reviewed by Anders Carlsson.
 
+        Add form client for injected bundle code
+        https://bugs.webkit.org/show_bug.cgi?id=43603
+
+        * WebKit2.xcodeproj/project.pbxproj:
+        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
+        (WKBundlePageSetFormClient):
+        * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
+        * WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp: Added.
+        (WebKit::InjectedBundlePageFormClient::InjectedBundlePageFormClient):
+        (WebKit::InjectedBundlePageFormClient::initialize):
+        (WebKit::InjectedBundlePageFormClient::textFieldDidBeginEditing):
+        (WebKit::InjectedBundlePageFormClient::textFieldDidEndEditing):
+        (WebKit::InjectedBundlePageFormClient::textDidChangeInTextField):
+        (WebKit::InjectedBundlePageFormClient::textDidChangeInTextArea):
+        * WebProcess/InjectedBundle/InjectedBundlePageFormClient.h: Added.
+        * WebProcess/WebCoreSupport/WebEditorClient.cpp:
+        (WebKit::WebEditorClient::textFieldDidBeginEditing):
+        (WebKit::WebEditorClient::textFieldDidEndEditing):
+        (WebKit::WebEditorClient::textDidChangeInTextField):
+        (WebKit::WebEditorClient::textDidChangeInTextArea):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::initializeInjectedBundleFormClient):
+        * WebProcess/WebPage/WebPage.h:
+        (WebKit::WebPage::injectedBundleFormClient):
+        * win/WebKit2.vcproj:
+
+2010-08-05  Sam Weinig  <sam at webkit.org>
+
+        Reviewed by Anders Carlsson.
+
         Add ability to get a JSValueRef for a node handle and a world
         https://bugs.webkit.org/show_bug.cgi?id=43591
 
diff --git a/WebKit2/WebKit2.xcodeproj/project.pbxproj b/WebKit2/WebKit2.xcodeproj/project.pbxproj
index ac62817..b1d3a48 100644
--- a/WebKit2/WebKit2.xcodeproj/project.pbxproj
+++ b/WebKit2/WebKit2.xcodeproj/project.pbxproj
@@ -155,6 +155,8 @@
 		BC14DF78120B5B7900826C0C /* InjectedBundleScriptWorld.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC14DF76120B5B7900826C0C /* InjectedBundleScriptWorld.cpp */; };
 		BC14DF9E120B635F00826C0C /* WKBundleScriptWorld.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC14DF9C120B635F00826C0C /* WKBundleScriptWorld.cpp */; };
 		BC14DF9F120B635F00826C0C /* WKBundleScriptWorld.h in Headers */ = {isa = PBXBuildFile; fileRef = BC14DF9D120B635F00826C0C /* WKBundleScriptWorld.h */; };
+		BC14E109120B905E00826C0C /* InjectedBundlePageFormClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC14E107120B905E00826C0C /* InjectedBundlePageFormClient.cpp */; };
+		BC14E10A120B905E00826C0C /* InjectedBundlePageFormClient.h in Headers */ = {isa = PBXBuildFile; fileRef = BC14E108120B905E00826C0C /* InjectedBundlePageFormClient.h */; };
 		BC177465118B9FF4007D9E9A /* WKPagePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = BC177464118B9FF4007D9E9A /* WKPagePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		BC17753F118BABF0007D9E9A /* GenericCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = BC17753E118BABF0007D9E9A /* GenericCallback.h */; };
 		BC1A7C581136E19C00FB7167 /* ProcessLauncher.h in Headers */ = {isa = PBXBuildFile; fileRef = BC1A7C571136E19C00FB7167 /* ProcessLauncher.h */; };
@@ -480,6 +482,8 @@
 		BC14DF76120B5B7900826C0C /* InjectedBundleScriptWorld.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundleScriptWorld.cpp; sourceTree = "<group>"; };
 		BC14DF9C120B635F00826C0C /* WKBundleScriptWorld.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKBundleScriptWorld.cpp; sourceTree = "<group>"; };
 		BC14DF9D120B635F00826C0C /* WKBundleScriptWorld.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKBundleScriptWorld.h; sourceTree = "<group>"; };
+		BC14E107120B905E00826C0C /* InjectedBundlePageFormClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundlePageFormClient.cpp; sourceTree = "<group>"; };
+		BC14E108120B905E00826C0C /* InjectedBundlePageFormClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundlePageFormClient.h; sourceTree = "<group>"; };
 		BC177464118B9FF4007D9E9A /* WKPagePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKPagePrivate.h; sourceTree = "<group>"; };
 		BC17753E118BABF0007D9E9A /* GenericCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GenericCallback.h; sourceTree = "<group>"; };
 		BC1A7C571136E19C00FB7167 /* ProcessLauncher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProcessLauncher.h; sourceTree = "<group>"; };
@@ -1137,6 +1141,8 @@
 				BC204EE111C83E98008F3375 /* InjectedBundle.h */,
 				E1EE53E611F8CFFB00CCBEE4 /* InjectedBundlePageEditorClient.cpp */,
 				E1EE53DC11F8CF9F00CCBEE4 /* InjectedBundlePageEditorClient.h */,
+				BC14E107120B905E00826C0C /* InjectedBundlePageFormClient.cpp */,
+				BC14E108120B905E00826C0C /* InjectedBundlePageFormClient.h */,
 				BCA8C6A611E3BA5F00812FB7 /* InjectedBundlePageLoaderClient.cpp */,
 				BCA8C6A711E3BA5F00812FB7 /* InjectedBundlePageLoaderClient.h */,
 				BCA8C6AD11E3C08700812FB7 /* InjectedBundlePageUIClient.cpp */,
@@ -1432,6 +1438,7 @@
 				BC4BEFE1120A1A4C00FBA0C7 /* WKBundleNodeHandle.h in Headers */,
 				BC14DF77120B5B7900826C0C /* InjectedBundleScriptWorld.h in Headers */,
 				BC14DF9F120B635F00826C0C /* WKBundleScriptWorld.h in Headers */,
+				BC14E10A120B905E00826C0C /* InjectedBundlePageFormClient.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -1646,6 +1653,7 @@
 				BC4BEFE2120A1A4C00FBA0C7 /* WKBundleNodeHandle.cpp in Sources */,
 				BC14DF78120B5B7900826C0C /* InjectedBundleScriptWorld.cpp in Sources */,
 				BC14DF9E120B635F00826C0C /* WKBundleScriptWorld.cpp in Sources */,
+				BC14E109120B905E00826C0C /* InjectedBundlePageFormClient.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
index fd2582f..79cd84a 100644
--- a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
@@ -44,6 +44,12 @@ void WKBundlePageSetEditorClient(WKBundlePageRef pageRef, WKBundlePageEditorClie
         toWK(pageRef)->initializeInjectedBundleEditorClient(wkClient);
 }
 
+void WKBundlePageSetFormClient(WKBundlePageRef pageRef, WKBundlePageFormClient* wkClient)
+{
+    if (wkClient && !wkClient->version)
+        toWK(pageRef)->initializeInjectedBundleFormClient(wkClient);
+}
+
 void WKBundlePageSetLoaderClient(WKBundlePageRef pageRef, WKBundlePageLoaderClient* wkClient)
 {
     if (wkClient && !wkClient->version)
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h
index 4da5033..3c14b95 100644
--- a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h
@@ -91,7 +91,6 @@ struct WKBundlePageUIClient {
 typedef struct WKBundlePageUIClient WKBundlePageUIClient;
 
 // Editor client
-// FIXME: Objective-C API provides a WebView pointer in callbacks, what should the injected bundle API do?
 typedef bool (*WKBundlePageShouldBeginEditingCallback)(WKBundlePageRef page, WKBundleRangeRef range, const void* clientInfo);
 typedef bool (*WKBundlePageShouldEndEditingCallback)(WKBundlePageRef page, WKBundleRangeRef range, const void* clientInfo);
 typedef bool (*WKBundlePageShouldInsertNodeCallback)(WKBundlePageRef page, WKBundleNodeRef node, WKBundleRangeRef rangeToReplace, WKInsertActionType action, const void* clientInfo);
@@ -118,9 +117,26 @@ struct WKBundlePageEditorClient {
 };
 typedef struct WKBundlePageEditorClient WKBundlePageEditorClient;
 
+// Form client
+typedef void (*WKBundlePageTextFieldDidBeginEditingCallback)(WKBundlePageRef page, WKBundleNodeHandleRef htmlInputElementHandle, WKBundleFrameRef frame, const void* clientInfo);
+typedef void (*WKBundlePageTextFieldDidEndEditingCallback)(WKBundlePageRef page, WKBundleNodeHandleRef htmlInputElementHandle, WKBundleFrameRef frame, const void* clientInfo);
+typedef void (*WKBundlePageTextDidChangeInTextFieldCallback)(WKBundlePageRef page, WKBundleNodeHandleRef htmlInputElementHandle, WKBundleFrameRef frame, const void* clientInfo);
+typedef void (*WKBundlePageTextDidChangeInTextAreaCallback)(WKBundlePageRef page, WKBundleNodeHandleRef htmlTextAreaElementHandle, WKBundleFrameRef frame, const void* clientInfo);
+
+struct WKBundlePageFormClient {
+    int                                                                 version;
+    const void *                                                        clientInfo;
+    WKBundlePageTextFieldDidBeginEditingCallback                        textFieldDidBeginEditing;
+    WKBundlePageTextFieldDidEndEditingCallback                          textFieldDidEndEditing;
+    WKBundlePageTextDidChangeInTextFieldCallback                        textDidChangeInTextField;
+    WKBundlePageTextDidChangeInTextAreaCallback                         textDidChangeInTextArea;
+};
+typedef struct WKBundlePageFormClient WKBundlePageFormClient;
+
 WK_EXPORT WKTypeID WKBundlePageGetTypeID();
 
 WK_EXPORT void WKBundlePageSetEditorClient(WKBundlePageRef page, WKBundlePageEditorClient* client);
+WK_EXPORT void WKBundlePageSetFormClient(WKBundlePageRef page, WKBundlePageFormClient* client);
 WK_EXPORT void WKBundlePageSetLoaderClient(WKBundlePageRef page, WKBundlePageLoaderClient* client);
 WK_EXPORT void WKBundlePageSetUIClient(WKBundlePageRef page, WKBundlePageUIClient* client);
 
diff --git a/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp b/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp
new file mode 100644
index 0000000..cfbcc4c
--- /dev/null
+++ b/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "InjectedBundlePageFormClient.h"
+
+#include "InjectedBundleNodeHandle.h"
+#include "WKAPICast.h"
+#include "WKBundleAPICast.h"
+#include <WebCore/HTMLInputElement.h>
+#include <WebCore/HTMLTextAreaElement.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+InjectedBundlePageFormClient::InjectedBundlePageFormClient()
+{
+    initialize(0);
+}
+
+void InjectedBundlePageFormClient::initialize(WKBundlePageFormClient* client)
+{
+    if (client && !client->version)
+        m_client = *client;
+    else 
+        memset(&m_client, 0, sizeof(m_client));
+}
+
+void InjectedBundlePageFormClient::textFieldDidBeginEditing(WebPage* page, WebCore::HTMLInputElement* inputElement, WebFrame* frame)
+{
+    if (!m_client.textFieldDidBeginEditing)
+        return;
+
+    RefPtr<InjectedBundleNodeHandle> nodeHandle = InjectedBundleNodeHandle::getOrCreate(inputElement);
+    m_client.textFieldDidBeginEditing(toRef(page), toRef(nodeHandle.get()), toRef(frame), m_client.clientInfo);
+}
+
+void InjectedBundlePageFormClient::textFieldDidEndEditing(WebPage* page, WebCore::HTMLInputElement* inputElement, WebFrame* frame)
+{
+    if (!m_client.textFieldDidBeginEditing)
+        return;
+
+    RefPtr<InjectedBundleNodeHandle> nodeHandle = InjectedBundleNodeHandle::getOrCreate(inputElement);
+    m_client.textFieldDidEndEditing(toRef(page), toRef(nodeHandle.get()), toRef(frame), m_client.clientInfo);
+}
+
+void InjectedBundlePageFormClient::textDidChangeInTextField(WebPage* page, WebCore::HTMLInputElement* inputElement, WebFrame* frame)
+{
+    if (!m_client.textFieldDidBeginEditing)
+        return;
+
+    RefPtr<InjectedBundleNodeHandle> nodeHandle = InjectedBundleNodeHandle::getOrCreate(inputElement);
+    m_client.textDidChangeInTextField(toRef(page), toRef(nodeHandle.get()), toRef(frame), m_client.clientInfo);
+}
+
+void InjectedBundlePageFormClient::textDidChangeInTextArea(WebPage* page, WebCore::HTMLTextAreaElement* textAreaElement, WebFrame* frame)
+{
+    if (!m_client.textFieldDidBeginEditing)
+        return;
+
+    RefPtr<InjectedBundleNodeHandle> nodeHandle = InjectedBundleNodeHandle::getOrCreate(textAreaElement);
+    m_client.textDidChangeInTextArea(toRef(page), toRef(nodeHandle.get()), toRef(frame), m_client.clientInfo);
+}
+
+} // namespace WebKit
diff --git a/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageFormClient.h b/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageFormClient.h
new file mode 100644
index 0000000..9c40698
--- /dev/null
+++ b/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageFormClient.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef InjectedBundlePageFormClient_h
+#define InjectedBundlePageFormClient_h
+
+#include "WKBundlePage.h"
+
+namespace WebCore {
+    class HTMLInputElement;
+    class HTMLTextAreaElement;
+}
+
+namespace WebKit {
+
+class WebFrame;
+class WebPage;
+
+class InjectedBundlePageFormClient {
+public:
+    InjectedBundlePageFormClient();
+    void initialize(WKBundlePageFormClient*);
+
+    void textFieldDidBeginEditing(WebPage*, WebCore::HTMLInputElement*, WebFrame*);
+    void textFieldDidEndEditing(WebPage*, WebCore::HTMLInputElement*, WebFrame*);
+    void textDidChangeInTextField(WebPage*, WebCore::HTMLInputElement*, WebFrame*);
+    void textDidChangeInTextArea(WebPage*, WebCore::HTMLTextAreaElement*, WebFrame*);
+
+private:
+    WKBundlePageFormClient m_client;
+};
+
+} // namespace WebKit
+
+#endif // InjectedBundlePageFormClient_h
diff --git a/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp b/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp
index b8d9a05..5d16e3f 100644
--- a/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp
+++ b/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp
@@ -28,12 +28,18 @@
 #define DISABLE_NOT_IMPLEMENTED_WARNINGS 1
 #include "NotImplemented.h"
 
+#include "WebFrameLoaderClient.h"
 #include "WebPage.h"
-
 #include <WebCore/EditCommand.h>
+#include <WebCore/Frame.h>
+#include <WebCore/HTMLInputElement.h>
+#include <WebCore/HTMLNames.h>
+#include <WebCore/HTMLTextAreaElement.h>
 #include <WebCore/KeyboardEvent.h>
+#include <WebCore/UserTypingGestureIndicator.h>
 
 using namespace WebCore;
+using namespace HTMLNames;
 
 namespace WebKit {
 
@@ -238,19 +244,43 @@ void WebEditorClient::handleInputMethodKeydown(KeyboardEvent*)
     notImplemented();
 }
 
-void WebEditorClient::textFieldDidBeginEditing(Element*)
+void WebEditorClient::textFieldDidBeginEditing(Element* element)
 {
-    notImplemented();
+    if (!element->hasTagName(inputTag))
+        return;
+
+    WebFrame* webFrame =  static_cast<WebFrameLoaderClient*>(element->document()->frame()->loader()->client())->webFrame();
+    m_page->injectedBundleFormClient().textFieldDidBeginEditing(m_page, static_cast<HTMLInputElement*>(element), webFrame);
 }
 
-void WebEditorClient::textFieldDidEndEditing(Element*)
+void WebEditorClient::textFieldDidEndEditing(Element* element)
 {
-    notImplemented();
+    if (!element->hasTagName(inputTag))
+        return;
+
+    WebFrame* webFrame =  static_cast<WebFrameLoaderClient*>(element->document()->frame()->loader()->client())->webFrame();
+    m_page->injectedBundleFormClient().textFieldDidEndEditing(m_page, static_cast<HTMLInputElement*>(element), webFrame);
 }
 
-void WebEditorClient::textDidChangeInTextField(Element*)
+void WebEditorClient::textDidChangeInTextField(Element* element)
 {
-    notImplemented();
+    if (!element->hasTagName(inputTag))
+        return;
+
+    if (!UserTypingGestureIndicator::processingUserTypingGesture() || UserTypingGestureIndicator::focusedElementAtGestureStart() != element)
+        return;
+
+    WebFrame* webFrame =  static_cast<WebFrameLoaderClient*>(element->document()->frame()->loader()->client())->webFrame();
+    m_page->injectedBundleFormClient().textDidChangeInTextField(m_page, static_cast<HTMLInputElement*>(element), webFrame);
+}
+
+void WebEditorClient::textDidChangeInTextArea(Element* element)
+{
+    if (!element->hasTagName(textareaTag))
+        return;
+
+    WebFrame* webFrame =  static_cast<WebFrameLoaderClient*>(element->document()->frame()->loader()->client())->webFrame();
+    m_page->injectedBundleFormClient().textDidChangeInTextArea(m_page, static_cast<HTMLTextAreaElement*>(element), webFrame);
 }
 
 bool WebEditorClient::doTextFieldCommandFromEvent(Element*, KeyboardEvent*)
@@ -264,10 +294,6 @@ void WebEditorClient::textWillBeDeletedInTextField(Element*)
     notImplemented();
 }
 
-void WebEditorClient::textDidChangeInTextArea(Element*)
-{
-    notImplemented();
-}
 
 #if PLATFORM(MAC)
 NSString* WebEditorClient::userVisibleString(NSURL*)
diff --git a/WebKit2/WebProcess/WebPage/WebPage.cpp b/WebKit2/WebProcess/WebPage/WebPage.cpp
index 6a63d05..8fc516c 100644
--- a/WebKit2/WebProcess/WebPage/WebPage.cpp
+++ b/WebKit2/WebProcess/WebPage/WebPage.cpp
@@ -141,6 +141,11 @@ void WebPage::initializeInjectedBundleEditorClient(WKBundlePageEditorClient* cli
     m_editorClient.initialize(client);
 }
 
+void WebPage::initializeInjectedBundleFormClient(WKBundlePageFormClient* client)
+{
+    m_formClient.initialize(client);
+}
+
 void WebPage::initializeInjectedBundleLoaderClient(WKBundlePageLoaderClient* client)
 {
     m_loaderClient.initialize(client);
@@ -375,7 +380,6 @@ void WebPage::wheelEvent(const WebWheelEvent& wheelEvent)
     m_mainFrame->coreFrame()->eventHandler()->handleWheelEvent(platformWheelEvent);
 }
 
-
 void WebPage::keyEvent(const WebKeyboardEvent& keyboardEvent)
 {
     CurrentEvent currentEvent(keyboardEvent);
diff --git a/WebKit2/WebProcess/WebPage/WebPage.h b/WebKit2/WebProcess/WebPage/WebPage.h
index 2964a4c..a31b086 100644
--- a/WebKit2/WebProcess/WebPage/WebPage.h
+++ b/WebKit2/WebProcess/WebPage/WebPage.h
@@ -29,6 +29,7 @@
 #include "APIObject.h"
 #include "DrawingArea.h"
 #include "InjectedBundlePageEditorClient.h"
+#include "InjectedBundlePageFormClient.h"
 #include "InjectedBundlePageLoaderClient.h"
 #include "InjectedBundlePageUIClient.h"
 #include <WebCore/FrameLoaderTypes.h>
@@ -96,10 +97,12 @@ public:
 
     // -- InjectedBundle methods
     void initializeInjectedBundleEditorClient(WKBundlePageEditorClient*);
+    void initializeInjectedBundleFormClient(WKBundlePageFormClient*);
     void initializeInjectedBundleLoaderClient(WKBundlePageLoaderClient*);
     void initializeInjectedBundleUIClient(WKBundlePageUIClient*);
 
     InjectedBundlePageEditorClient& injectedBundleEditorClient() { return m_editorClient; }
+    InjectedBundlePageFormClient& injectedBundleFormClient() { return m_formClient; }
     InjectedBundlePageLoaderClient& injectedBundleLoaderClient() { return m_loaderClient; }
     InjectedBundlePageUIClient& injectedBundleUIClient() { return m_uiClient; }
 
@@ -155,6 +158,7 @@ private:
     RefPtr<DrawingArea> m_drawingArea;
 
     InjectedBundlePageEditorClient m_editorClient;
+    InjectedBundlePageFormClient m_formClient;
     InjectedBundlePageLoaderClient m_loaderClient;
     InjectedBundlePageUIClient m_uiClient;
 
diff --git a/WebKit2/win/WebKit2.vcproj b/WebKit2/win/WebKit2.vcproj
index 36a3182..5aaf06a 100755
--- a/WebKit2/win/WebKit2.vcproj
+++ b/WebKit2/win/WebKit2.vcproj
@@ -716,6 +716,14 @@
 					>
 				</File>
 				<File
+					RelativePath="..\WebProcess\InjectedBundle\InjectedBundlePageFormClient.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\WebProcess\InjectedBundle\InjectedBundlePageFormClient.h"
+					>
+				</File>
+				<File
 					RelativePath="..\WebProcess\InjectedBundle\InjectedBundlePageLoaderClient.cpp"
 					>
 				</File>

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list