[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:25:30 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 67b730e074889e4ea283ee6d4134b4edbc618733
Author: weinig at apple.com <weinig at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Jul 23 00:37:03 2010 +0000

    Fix for <rdar://problem/8222626>
    Send textDidChangeInTextField delegate callback only in response to typing or other forms of user text input.
    
    Reviewed by Maciej Stachowiak.
    
    WebCore:
    
    * GNUmakefile.am:
    * WebCore.gypi:
    * WebCore.pro:
    * WebCore.vcproj/WebCore.vcproj:
    * WebCore.xcodeproj/project.pbxproj:
    Update project files.
    
    * dom/UserTypingGestureIndicator.cpp: Copied from dom/UserGestureIndicator.cpp.
    (WebCore::UserTypingGestureIndicator::processingUserTypingGesture):
    (WebCore::focusedNode):
    (WebCore::UserTypingGestureIndicator::focusedElementAtGestureStart):
    (WebCore::UserTypingGestureIndicator::UserTypingGestureIndicator):
    (WebCore::UserTypingGestureIndicator::~UserTypingGestureIndicator):
    * dom/UserTypingGestureIndicator.h: Copied from dom/UserGestureIndicator.h.
    Version of UserGestureIndicator that just tracks keyboard gestures and the focused
    node they were targeting.
    
    * editing/Editor.cpp:
    (WebCore::Editor::confirmComposition):
    (WebCore::Editor::setComposition):
    * page/EventHandler.cpp:
    (WebCore::EventHandler::keyEvent):
    Put UserTypingGestureIndicator on the stack for user generated keyboard events.
    
    WebKit/mac:
    
    The function name no longer perfectly matches the behavior, but I didn't want to break any existing clients. Maybe we
    should migrate to a new function name eventually
    
    * WebCoreSupport/WebEditorClient.mm:
    (WebEditorClient::textDidChangeInTextField):
    
    WebKit/win:
    
    The function name no longer perfectly matches the behavior, but I didn't want to break any existing clients. Maybe we
    should migrate to a new function name eventually
    
    * WebCoreSupport/WebEditorClient.cpp:
    (WebEditorClient::textDidChangeInTextField):
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63927 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 2961814..ec6815a 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,34 @@
+2010-07-22  Sam Weinig  <sam at webkit.org>
+
+        Reviewed by Maciej Stachowiak.
+
+        Fix for <rdar://problem/8222626>
+        Send textDidChangeInTextField delegate callback only in response to typing or other forms of user text input.
+
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        Update project files.
+        
+        * dom/UserTypingGestureIndicator.cpp: Copied from dom/UserGestureIndicator.cpp.
+        (WebCore::UserTypingGestureIndicator::processingUserTypingGesture):
+        (WebCore::focusedNode):
+        (WebCore::UserTypingGestureIndicator::focusedElementAtGestureStart):
+        (WebCore::UserTypingGestureIndicator::UserTypingGestureIndicator):
+        (WebCore::UserTypingGestureIndicator::~UserTypingGestureIndicator):
+        * dom/UserTypingGestureIndicator.h: Copied from dom/UserGestureIndicator.h.
+        Version of UserGestureIndicator that just tracks keyboard gestures and the focused
+        node they were targeting.
+        
+        * editing/Editor.cpp:
+        (WebCore::Editor::confirmComposition):
+        (WebCore::Editor::setComposition):
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::keyEvent):
+        Put UserTypingGestureIndicator on the stack for user generated keyboard events.
+
 2010-07-22  Kent Tamura  <tkent at chromium.org>
 
         Reviewed by Ojan Vafai.
diff --git a/WebCore/GNUmakefile.am b/WebCore/GNUmakefile.am
index f47c3e6..8fbbb95 100644
--- a/WebCore/GNUmakefile.am
+++ b/WebCore/GNUmakefile.am
@@ -1164,6 +1164,8 @@ webcore_sources += \
 	WebCore/dom/UIEventWithKeyState.h \
 	WebCore/dom/UserGestureIndicator.cpp \
 	WebCore/dom/UserGestureIndicator.h \
+	WebCore/dom/UserTypingGestureIndicator.cpp \
+	WebCore/dom/UserTypingGestureIndicator.h \
 	WebCore/dom/ViewportArguments.cpp \
 	WebCore/dom/ViewportArguments.h \
 	WebCore/dom/WebKitAnimationEvent.cpp \
diff --git a/WebCore/WebCore.exp.in b/WebCore/WebCore.exp.in
index c2c29fe..3899bf5 100644
--- a/WebCore/WebCore.exp.in
+++ b/WebCore/WebCore.exp.in
@@ -310,8 +310,8 @@ __ZN7WebCore14ResourceHandle20forceContentSniffingEv
 __ZN7WebCore14ResourceLoader14cancelledErrorEv
 __ZN7WebCore14ResourceLoader19setShouldBufferDataEb
 __ZN7WebCore14SVGSMILElement13isSMILElementEPNS_4NodeE
-__ZN7WebCore14SchemeRegistry25registerURLSchemeAsSecureERKNS_6StringE
 __ZN7WebCore14SchemeRegistry24registerURLSchemeAsLocalERKNS_6StringE
+__ZN7WebCore14SchemeRegistry25registerURLSchemeAsSecureERKNS_6StringE
 __ZN7WebCore14SecurityOrigin16createFromStringERKNS_6StringE
 __ZN7WebCore14SecurityOrigin18setLocalLoadPolicyENS0_15LocalLoadPolicyE
 __ZN7WebCore14SecurityOrigin18shouldHideReferrerERKNS_4KURLERKNS_6StringE
@@ -480,6 +480,8 @@ __ZN7WebCore25PluginMainThreadScheduler9schedulerEv
 __ZN7WebCore25contextMenuItemTagOutlineEv
 __ZN7WebCore26CSSMutableStyleDeclarationC1Ev
 __ZN7WebCore26NetscapePlugInStreamLoader6createEPNS_5FrameEPNS_32NetscapePlugInStreamLoaderClientE
+__ZN7WebCore26UserTypingGestureIndicator27processingUserTypingGestureEv
+__ZN7WebCore26UserTypingGestureIndicator28focusedElementAtGestureStartEv
 __ZN7WebCore26contextMenuItemTagFontMenuEv
 __ZN7WebCore26contextMenuItemTagOpenLinkEv
 __ZN7WebCore26usesTestModeFocusRingColorEv
@@ -761,13 +763,13 @@ __ZN7WebCore9FrameView16setPaintBehaviorEj
 __ZN7WebCore9FrameView18updateControlTintsEv
 __ZN7WebCore9FrameView20enterCompositingModeEv
 __ZN7WebCore9FrameView21flushDeferredRepaintsEv
-__ZN7WebCore9FrameView38scrollPositionChangedViaPlatformWidgetEv
 __ZN7WebCore9FrameView22setBaseBackgroundColorENS_5ColorE
 __ZN7WebCore9FrameView23layoutIfNeededRecursiveEv
 __ZN7WebCore9FrameView23updateCanHaveScrollbarsEv
 __ZN7WebCore9FrameView29forceLayoutWithPageWidthRangeEffb
 __ZN7WebCore9FrameView29setShouldUpdateWhileOffscreenEb
 __ZN7WebCore9FrameView29syncCompositingStateRecursiveEv
+__ZN7WebCore9FrameView38scrollPositionChangedViaPlatformWidgetEv
 __ZN7WebCore9FrameView6createEPNS_5FrameE
 __ZN7WebCore9FrameView6createEPNS_5FrameERKNS_7IntSizeE
 __ZN7WebCore9HTMLNames10listingTagE
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index 0c58914..f222ead 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -1273,6 +1273,8 @@
             'dom/UIEventWithKeyState.h',
             'dom/UserGestureIndicator.cpp',
             'dom/UserGestureIndicator.h',
+            'dom/UserTypingGestureIndicator.cpp',
+            'dom/UserTypingGestureIndicator.h',
             'dom/ViewportArguments.cpp',
             'dom/ViewportArguments.h',
             'dom/WebKitAnimationEvent.cpp',
diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro
index 2085dbf..66fa5ca 100644
--- a/WebCore/WebCore.pro
+++ b/WebCore/WebCore.pro
@@ -549,6 +549,7 @@ SOURCES += \
     dom/UIEvent.cpp \
     dom/UIEventWithKeyState.cpp \
     dom/UserGestureIndicator.cpp \
+    dom/UserTypingGestureIndicator.cpp \
     dom/ViewportArguments.cpp \
     dom/WebKitAnimationEvent.cpp \
     dom/WebKitTransitionEvent.cpp \
diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
index e96b7be..78440fa 100644
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -33013,6 +33013,14 @@
 				>
 			</File>
 			<File
+				RelativePath="..\dom\UserTypingGestureIndicator.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\dom\UserTypingGestureIndicator.h"
+				>
+			</File>
+			<File
 				RelativePath="..\dom\ViewportArguments.cpp"
 				>
 			</File>
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index f465146..0d4fc35 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -4785,6 +4785,8 @@
 		BCDBB8AD0E088CA500C60FF6 /* FileList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCDBB8AB0E088CA500C60FF6 /* FileList.cpp */; };
 		BCDBB8CD0E08958400C60FF6 /* File.h in Headers */ = {isa = PBXBuildFile; fileRef = BCDBB8CB0E08958400C60FF6 /* File.h */; };
 		BCDBB8CE0E08958400C60FF6 /* File.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCDBB8CC0E08958400C60FF6 /* File.cpp */; };
+		BCDF317B11F8D683003C5BF8 /* UserTypingGestureIndicator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCDF317911F8D683003C5BF8 /* UserTypingGestureIndicator.cpp */; };
+		BCDF317C11F8D683003C5BF8 /* UserTypingGestureIndicator.h in Headers */ = {isa = PBXBuildFile; fileRef = BCDF317A11F8D683003C5BF8 /* UserTypingGestureIndicator.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		BCDFD48E0E305290009D10AD /* XMLHttpRequestUpload.h in Headers */ = {isa = PBXBuildFile; fileRef = BCDFD48C0E305290009D10AD /* XMLHttpRequestUpload.h */; };
 		BCDFD48F0E305290009D10AD /* XMLHttpRequestUpload.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCDFD48D0E305290009D10AD /* XMLHttpRequestUpload.cpp */; };
 		BCDFD4920E3056BD009D10AD /* JSXMLHttpRequestUploadCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCDFD4910E3056BD009D10AD /* JSXMLHttpRequestUploadCustom.cpp */; };
@@ -10428,6 +10430,8 @@
 		BCDBB8AB0E088CA500C60FF6 /* FileList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileList.cpp; sourceTree = "<group>"; };
 		BCDBB8CB0E08958400C60FF6 /* File.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = File.h; sourceTree = "<group>"; };
 		BCDBB8CC0E08958400C60FF6 /* File.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = File.cpp; sourceTree = "<group>"; };
+		BCDF317911F8D683003C5BF8 /* UserTypingGestureIndicator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserTypingGestureIndicator.cpp; sourceTree = "<group>"; };
+		BCDF317A11F8D683003C5BF8 /* UserTypingGestureIndicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserTypingGestureIndicator.h; sourceTree = "<group>"; };
 		BCDFD48C0E305290009D10AD /* XMLHttpRequestUpload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLHttpRequestUpload.h; sourceTree = "<group>"; };
 		BCDFD48D0E305290009D10AD /* XMLHttpRequestUpload.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XMLHttpRequestUpload.cpp; sourceTree = "<group>"; };
 		BCDFD4900E305644009D10AD /* XMLHttpRequestUpload.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = XMLHttpRequestUpload.idl; sourceTree = "<group>"; };
@@ -17127,6 +17131,8 @@
 				85031B390A44EFC700F992E0 /* UIEventWithKeyState.h */,
 				2542F4D81166C25A00E89A86 /* UserGestureIndicator.cpp */,
 				2542F4D91166C25A00E89A86 /* UserGestureIndicator.h */,
+				BCDF317911F8D683003C5BF8 /* UserTypingGestureIndicator.cpp */,
+				BCDF317A11F8D683003C5BF8 /* UserTypingGestureIndicator.h */,
 				CEF418CC1179678C009D112C /* ViewportArguments.cpp */,
 				CEF418CD1179678C009D112C /* ViewportArguments.h */,
 				31C0FF1B0E4CEB6E007D6FE5 /* WebKitAnimationEvent.cpp */,
@@ -19843,6 +19849,7 @@
 				8C6EA61A11EF7E0400FD8EE3 /* RuntimeEnabledFeatures.h in Headers */,
 				BC5CFCA911F793320099ED09 /* LocalizationStrategy.h in Headers */,
 				5162C7F511F77EFB00612EFE /* SchemeRegistry.h in Headers */,
+				BCDF317C11F8D683003C5BF8 /* UserTypingGestureIndicator.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -19902,7 +19909,6 @@
 			isa = PBXProject;
 			buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
 			compatibilityVersion = "Xcode 2.4";
-			developmentRegion = English;
 			hasScannedForEncodings = 1;
 			knownRegions = (
 				English,
@@ -22238,6 +22244,7 @@
 				97DD4D860FDF4D6E00ECF9A4 /* XSSAuditor.cpp in Sources */,
 				8C6EA61911EF7E0400FD8EE3 /* RuntimeEnabledFeatures.cpp in Sources */,
 				5162C7F411F77EFB00612EFE /* SchemeRegistry.cpp in Sources */,
+				BCDF317B11F8D683003C5BF8 /* UserTypingGestureIndicator.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
diff --git a/WebCore/dom/UserTypingGestureIndicator.cpp b/WebCore/dom/UserTypingGestureIndicator.cpp
new file mode 100644
index 0000000..5120843
--- /dev/null
+++ b/WebCore/dom/UserTypingGestureIndicator.cpp
@@ -0,0 +1,66 @@
+/*
+ * 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 "config.h"
+#include "UserTypingGestureIndicator.h"
+
+#include "Frame.h"
+#include "Node.h"
+#include <wtf/StdLibExtras.h>
+
+namespace WebCore {
+
+static bool s_processingUserTypingGesture;
+bool UserTypingGestureIndicator::processingUserTypingGesture()
+{
+    return s_processingUserTypingGesture;
+}
+
+static RefPtr<Node>& focusedNode()
+{
+    DEFINE_STATIC_LOCAL(RefPtr<Node>, node, ());
+    return node;
+}
+
+Node* UserTypingGestureIndicator::focusedElementAtGestureStart()
+{
+    return focusedNode().get();
+}
+
+UserTypingGestureIndicator::UserTypingGestureIndicator(Frame* frame)
+    : m_previousProcessingUserTypingGesture(s_processingUserTypingGesture)
+    , m_previousFocusedNode(focusedNode())
+{
+    s_processingUserTypingGesture = true;
+    focusedNode() = frame->document() ? frame->document()->focusedNode() : 0;
+}
+
+UserTypingGestureIndicator::~UserTypingGestureIndicator()
+{
+    s_processingUserTypingGesture = m_previousProcessingUserTypingGesture;
+    focusedNode() = m_previousFocusedNode;
+}
+
+} // namespace WebCore
diff --git a/WebCore/dom/UserTypingGestureIndicator.h b/WebCore/dom/UserTypingGestureIndicator.h
new file mode 100644
index 0000000..6c71079
--- /dev/null
+++ b/WebCore/dom/UserTypingGestureIndicator.h
@@ -0,0 +1,52 @@
+/*
+ * 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 UserTypingGestureIndicator_h
+#define UserTypingGestureIndicator_h
+
+#include <wtf/Noncopyable.h>
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+
+class Frame;
+class Node;
+
+class UserTypingGestureIndicator : public Noncopyable {
+public:
+    static bool processingUserTypingGesture();
+    static Node* focusedElementAtGestureStart();
+
+    explicit UserTypingGestureIndicator(Frame*);
+    ~UserTypingGestureIndicator();
+
+private:
+    bool m_previousProcessingUserTypingGesture;
+    RefPtr<Node> m_previousFocusedNode;
+};    
+
+} // namespace WebCore
+
+#endif // UserTypingGestureIndicator_h
diff --git a/WebCore/editing/Editor.cpp b/WebCore/editing/Editor.cpp
index 773ed90..76b5a90 100644
--- a/WebCore/editing/Editor.cpp
+++ b/WebCore/editing/Editor.cpp
@@ -68,6 +68,7 @@
 #include "Text.h"
 #include "TextIterator.h"
 #include "TypingCommand.h"
+#include "UserTypingGestureIndicator.h"
 #include "htmlediting.h"
 #include "markup.h"
 #include "visible_units.h"
@@ -1370,6 +1371,8 @@ void Editor::confirmComposition(const String& text)
 
 void Editor::confirmComposition(const String& text, bool preserveSelection)
 {
+    UserTypingGestureIndicator typingGestureIndicator(m_frame);
+
     setIgnoreCompositionSelectionChange(true);
 
     VisibleSelection oldSelection = m_frame->selection()->selection();
@@ -1412,6 +1415,8 @@ void Editor::confirmComposition(const String& text, bool preserveSelection)
 
 void Editor::setComposition(const String& text, const Vector<CompositionUnderline>& underlines, unsigned selectionStart, unsigned selectionEnd)
 {
+    UserTypingGestureIndicator typingGestureIndicator(m_frame);
+
     setIgnoreCompositionSelectionChange(true);
 
     selectComposition();
diff --git a/WebCore/page/EventHandler.cpp b/WebCore/page/EventHandler.cpp
index cfc9f56..2b10c6d 100644
--- a/WebCore/page/EventHandler.cpp
+++ b/WebCore/page/EventHandler.cpp
@@ -69,6 +69,7 @@
 #include "TextEvent.h"
 #include "TextIterator.h"
 #include "UserGestureIndicator.h"
+#include "UserTypingGestureIndicator.h"
 #include "WheelEvent.h"
 #include "htmlediting.h" // for comparePositions()
 #include <wtf/CurrentTime.h>
@@ -2266,6 +2267,7 @@ bool EventHandler::keyEvent(const PlatformKeyboardEvent& initialKeyEvent)
         return false;
 
     UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture);
+    UserTypingGestureIndicator typingGestureIndicator(m_frame);
 
     if (FrameView* view = m_frame->view())
         view->resetDeferredRepaintDelay();
diff --git a/WebCore/page/Frame.cpp b/WebCore/page/Frame.cpp
index cbf472d..b419e14 100644
--- a/WebCore/page/Frame.cpp
+++ b/WebCore/page/Frame.cpp
@@ -77,6 +77,7 @@
 #include "TextIterator.h"
 #include "TextResourceDecoder.h"
 #include "UserContentURLPattern.h"
+#include "UserTypingGestureIndicator.h"
 #include "XMLNSNames.h"
 #include "XMLNames.h"
 #include "htmlediting.h"
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index 57951da..7bd6b47 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,5 +1,18 @@
 2010-07-22  Sam Weinig  <sam at webkit.org>
 
+        Reviewed by Maciej Stachowiak.
+
+        Fix for <rdar://problem/8222626>
+        Send textDidChangeInTextField delegate callback only in response to typing or other forms of user text input.
+
+        The function name no longer perfectly matches the behavior, but I didn't want to break any existing clients. Maybe we
+        should migrate to a new function name eventually
+
+        * WebCoreSupport/WebEditorClient.mm:
+        (WebEditorClient::textDidChangeInTextField):
+
+2010-07-22  Sam Weinig  <sam at webkit.org>
+
         Reviewed by Anders Carlsson.
 
         Patch for https://bugs.webkit.org/show_bug.cgi?id=42836
diff --git a/WebKit/mac/WebCoreSupport/WebEditorClient.mm b/WebKit/mac/WebCoreSupport/WebEditorClient.mm
index d2f2706..2c89919 100644
--- a/WebKit/mac/WebCoreSupport/WebEditorClient.mm
+++ b/WebKit/mac/WebCoreSupport/WebEditorClient.mm
@@ -59,6 +59,7 @@
 #import <WebCore/LegacyWebArchive.h>
 #import <WebCore/PlatformKeyboardEvent.h>
 #import <WebCore/PlatformString.h>
+#import <WebCore/UserTypingGestureIndicator.h>
 #import <WebCore/WebCoreObjCExtras.h>
 #import <runtime/InitializeThreading.h>
 #import <wtf/PassRefPtr.h>
@@ -557,12 +558,15 @@ void WebEditorClient::textFieldDidEndEditing(Element* element)
     FormDelegateLog(inputElement);
     CallFormDelegate(m_webView, @selector(textFieldDidEndEditing:inFrame:), inputElement, kit(element->document()->frame()));
 }
-    
+
 void WebEditorClient::textDidChangeInTextField(Element* element)
 {
     if (!element->hasTagName(inputTag))
         return;
 
+    if (!UserTypingGestureIndicator::processingUserTypingGesture() || UserTypingGestureIndicator::focusedElementAtGestureStart() != element)
+        return;
+
     DOMHTMLInputElement* inputElement = kit(static_cast<HTMLInputElement*>(element));
     FormDelegateLog(inputElement);
     CallFormDelegate(m_webView, @selector(textDidChangeInTextField:inFrame:), inputElement, kit(element->document()->frame()));
diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog
index 1e7f405..cec41c7 100644
--- a/WebKit/win/ChangeLog
+++ b/WebKit/win/ChangeLog
@@ -1,3 +1,16 @@
+2010-07-22  Sam Weinig  <sam at webkit.org>
+
+        Reviewed by Maciej Stachowiak.
+
+        Fix for <rdar://problem/8222626>
+        Send textDidChangeInTextField delegate callback only in response to typing or other forms of user text input.
+
+        The function name no longer perfectly matches the behavior, but I didn't want to break any existing clients. Maybe we
+        should migrate to a new function name eventually
+
+        * WebCoreSupport/WebEditorClient.cpp:
+        (WebEditorClient::textDidChangeInTextField):
+
 2010-07-21  Brady Eidson  <beidson at apple.com>
 
         Reviewed by Geoffrey Garen.
diff --git a/WebKit/win/WebCoreSupport/WebEditorClient.cpp b/WebKit/win/WebCoreSupport/WebEditorClient.cpp
index e05951c..f03ffd6 100644
--- a/WebKit/win/WebCoreSupport/WebEditorClient.cpp
+++ b/WebKit/win/WebCoreSupport/WebEditorClient.cpp
@@ -41,9 +41,10 @@
 #include <WebCore/HTMLInputElement.h>
 #include <WebCore/HTMLNames.h>
 #include <WebCore/KeyboardEvent.h>
-#include <WebCore/PlatformKeyboardEvent.h>
 #include <WebCore/NotImplemented.h>
+#include <WebCore/PlatformKeyboardEvent.h>
 #include <WebCore/Range.h>
+#include <WebCore/UserTypingGestureIndicator.h>
 #pragma warning(pop)
 
 using namespace WebCore;
@@ -347,6 +348,9 @@ void WebEditorClient::textFieldDidEndEditing(Element* e)
 
 void WebEditorClient::textDidChangeInTextField(Element* e)
 {
+    if (!UserTypingGestureIndicator::processingUserTypingGesture() || UserTypingGestureIndicator::focusedElementAtGestureStart() != e)
+        return;
+
     IWebFormDelegate* formDelegate;
     if (SUCCEEDED(m_webView->formDelegate(&formDelegate)) && formDelegate) {
         IDOMElement* domElement = DOMElement::createInstance(e);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list