Changeset 63927 in webkit
- Timestamp:
- Jul 22, 2010 5:37:03 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 14 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r63926 r63927 1 2010-07-22 Sam Weinig <sam@webkit.org> 2 3 Reviewed by Maciej Stachowiak. 4 5 Fix for <rdar://problem/8222626> 6 Send textDidChangeInTextField delegate callback only in response to typing or other forms of user text input. 7 8 * GNUmakefile.am: 9 * WebCore.gypi: 10 * WebCore.pro: 11 * WebCore.vcproj/WebCore.vcproj: 12 * WebCore.xcodeproj/project.pbxproj: 13 Update project files. 14 15 * dom/UserTypingGestureIndicator.cpp: Copied from dom/UserGestureIndicator.cpp. 16 (WebCore::UserTypingGestureIndicator::processingUserTypingGesture): 17 (WebCore::focusedNode): 18 (WebCore::UserTypingGestureIndicator::focusedElementAtGestureStart): 19 (WebCore::UserTypingGestureIndicator::UserTypingGestureIndicator): 20 (WebCore::UserTypingGestureIndicator::~UserTypingGestureIndicator): 21 * dom/UserTypingGestureIndicator.h: Copied from dom/UserGestureIndicator.h. 22 Version of UserGestureIndicator that just tracks keyboard gestures and the focused 23 node they were targeting. 24 25 * editing/Editor.cpp: 26 (WebCore::Editor::confirmComposition): 27 (WebCore::Editor::setComposition): 28 * page/EventHandler.cpp: 29 (WebCore::EventHandler::keyEvent): 30 Put UserTypingGestureIndicator on the stack for user generated keyboard events. 31 1 32 2010-07-22 Kent Tamura <tkent@chromium.org> 2 33 -
trunk/WebCore/GNUmakefile.am
r63863 r63927 1165 1165 WebCore/dom/UserGestureIndicator.cpp \ 1166 1166 WebCore/dom/UserGestureIndicator.h \ 1167 WebCore/dom/UserTypingGestureIndicator.cpp \ 1168 WebCore/dom/UserTypingGestureIndicator.h \ 1167 1169 WebCore/dom/ViewportArguments.cpp \ 1168 1170 WebCore/dom/ViewportArguments.h \ -
trunk/WebCore/WebCore.exp.in
r63904 r63927 311 311 __ZN7WebCore14ResourceLoader19setShouldBufferDataEb 312 312 __ZN7WebCore14SVGSMILElement13isSMILElementEPNS_4NodeE 313 __ZN7WebCore14SchemeRegistry24registerURLSchemeAsLocalERKNS_6StringE 313 314 __ZN7WebCore14SchemeRegistry25registerURLSchemeAsSecureERKNS_6StringE 314 __ZN7WebCore14SchemeRegistry24registerURLSchemeAsLocalERKNS_6StringE315 315 __ZN7WebCore14SecurityOrigin16createFromStringERKNS_6StringE 316 316 __ZN7WebCore14SecurityOrigin18setLocalLoadPolicyENS0_15LocalLoadPolicyE … … 481 481 __ZN7WebCore26CSSMutableStyleDeclarationC1Ev 482 482 __ZN7WebCore26NetscapePlugInStreamLoader6createEPNS_5FrameEPNS_32NetscapePlugInStreamLoaderClientE 483 __ZN7WebCore26UserTypingGestureIndicator27processingUserTypingGestureEv 484 __ZN7WebCore26UserTypingGestureIndicator28focusedElementAtGestureStartEv 483 485 __ZN7WebCore26contextMenuItemTagFontMenuEv 484 486 __ZN7WebCore26contextMenuItemTagOpenLinkEv … … 762 764 __ZN7WebCore9FrameView20enterCompositingModeEv 763 765 __ZN7WebCore9FrameView21flushDeferredRepaintsEv 764 __ZN7WebCore9FrameView38scrollPositionChangedViaPlatformWidgetEv765 766 __ZN7WebCore9FrameView22setBaseBackgroundColorENS_5ColorE 766 767 __ZN7WebCore9FrameView23layoutIfNeededRecursiveEv … … 769 770 __ZN7WebCore9FrameView29setShouldUpdateWhileOffscreenEb 770 771 __ZN7WebCore9FrameView29syncCompositingStateRecursiveEv 772 __ZN7WebCore9FrameView38scrollPositionChangedViaPlatformWidgetEv 771 773 __ZN7WebCore9FrameView6createEPNS_5FrameE 772 774 __ZN7WebCore9FrameView6createEPNS_5FrameERKNS_7IntSizeE -
trunk/WebCore/WebCore.gypi
r63919 r63927 1274 1274 'dom/UserGestureIndicator.cpp', 1275 1275 'dom/UserGestureIndicator.h', 1276 'dom/UserTypingGestureIndicator.cpp', 1277 'dom/UserTypingGestureIndicator.h', 1276 1278 'dom/ViewportArguments.cpp', 1277 1279 'dom/ViewportArguments.h', -
trunk/WebCore/WebCore.pro
r63902 r63927 550 550 dom/UIEventWithKeyState.cpp \ 551 551 dom/UserGestureIndicator.cpp \ 552 dom/UserTypingGestureIndicator.cpp \ 552 553 dom/ViewportArguments.cpp \ 553 554 dom/WebKitAnimationEvent.cpp \ -
trunk/WebCore/WebCore.vcproj/WebCore.vcproj
r63863 r63927 33014 33014 </File> 33015 33015 <File 33016 RelativePath="..\dom\UserTypingGestureIndicator.cpp" 33017 > 33018 </File> 33019 <File 33020 RelativePath="..\dom\UserTypingGestureIndicator.h" 33021 > 33022 </File> 33023 <File 33016 33024 RelativePath="..\dom\ViewportArguments.cpp" 33017 33025 > -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r63904 r63927 4786 4786 BCDBB8CD0E08958400C60FF6 /* File.h in Headers */ = {isa = PBXBuildFile; fileRef = BCDBB8CB0E08958400C60FF6 /* File.h */; }; 4787 4787 BCDBB8CE0E08958400C60FF6 /* File.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCDBB8CC0E08958400C60FF6 /* File.cpp */; }; 4788 BCDF317B11F8D683003C5BF8 /* UserTypingGestureIndicator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCDF317911F8D683003C5BF8 /* UserTypingGestureIndicator.cpp */; }; 4789 BCDF317C11F8D683003C5BF8 /* UserTypingGestureIndicator.h in Headers */ = {isa = PBXBuildFile; fileRef = BCDF317A11F8D683003C5BF8 /* UserTypingGestureIndicator.h */; settings = {ATTRIBUTES = (Private, ); }; }; 4788 4790 BCDFD48E0E305290009D10AD /* XMLHttpRequestUpload.h in Headers */ = {isa = PBXBuildFile; fileRef = BCDFD48C0E305290009D10AD /* XMLHttpRequestUpload.h */; }; 4789 4791 BCDFD48F0E305290009D10AD /* XMLHttpRequestUpload.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCDFD48D0E305290009D10AD /* XMLHttpRequestUpload.cpp */; }; … … 10429 10431 BCDBB8CB0E08958400C60FF6 /* File.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = File.h; sourceTree = "<group>"; }; 10430 10432 BCDBB8CC0E08958400C60FF6 /* File.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = File.cpp; sourceTree = "<group>"; }; 10433 BCDF317911F8D683003C5BF8 /* UserTypingGestureIndicator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserTypingGestureIndicator.cpp; sourceTree = "<group>"; }; 10434 BCDF317A11F8D683003C5BF8 /* UserTypingGestureIndicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserTypingGestureIndicator.h; sourceTree = "<group>"; }; 10431 10435 BCDFD48C0E305290009D10AD /* XMLHttpRequestUpload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLHttpRequestUpload.h; sourceTree = "<group>"; }; 10432 10436 BCDFD48D0E305290009D10AD /* XMLHttpRequestUpload.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XMLHttpRequestUpload.cpp; sourceTree = "<group>"; }; … … 17128 17132 2542F4D81166C25A00E89A86 /* UserGestureIndicator.cpp */, 17129 17133 2542F4D91166C25A00E89A86 /* UserGestureIndicator.h */, 17134 BCDF317911F8D683003C5BF8 /* UserTypingGestureIndicator.cpp */, 17135 BCDF317A11F8D683003C5BF8 /* UserTypingGestureIndicator.h */, 17130 17136 CEF418CC1179678C009D112C /* ViewportArguments.cpp */, 17131 17137 CEF418CD1179678C009D112C /* ViewportArguments.h */, … … 19844 19850 BC5CFCA911F793320099ED09 /* LocalizationStrategy.h in Headers */, 19845 19851 5162C7F511F77EFB00612EFE /* SchemeRegistry.h in Headers */, 19852 BCDF317C11F8D683003C5BF8 /* UserTypingGestureIndicator.h in Headers */, 19846 19853 ); 19847 19854 runOnlyForDeploymentPostprocessing = 0; … … 19903 19910 buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */; 19904 19911 compatibilityVersion = "Xcode 2.4"; 19905 developmentRegion = English;19906 19912 hasScannedForEncodings = 1; 19907 19913 knownRegions = ( … … 22239 22245 8C6EA61911EF7E0400FD8EE3 /* RuntimeEnabledFeatures.cpp in Sources */, 22240 22246 5162C7F411F77EFB00612EFE /* SchemeRegistry.cpp in Sources */, 22247 BCDF317B11F8D683003C5BF8 /* UserTypingGestureIndicator.cpp in Sources */, 22241 22248 ); 22242 22249 runOnlyForDeploymentPostprocessing = 0; -
trunk/WebCore/dom/UserTypingGestureIndicator.cpp
r63905 r63927 25 25 26 26 #include "config.h" 27 #include "UserGestureIndicator.h" 27 #include "UserTypingGestureIndicator.h" 28 29 #include "Frame.h" 30 #include "Node.h" 31 #include <wtf/StdLibExtras.h> 28 32 29 33 namespace WebCore { 30 34 31 ProcessingUserGestureState UserGestureIndicator::s_processingUserGesture = PossiblyProcessingUserGesture; 32 33 UserGestureIndicator::UserGestureIndicator(ProcessingUserGestureState state) 34 : m_previousValue(s_processingUserGesture) 35 static bool s_processingUserTypingGesture; 36 bool UserTypingGestureIndicator::processingUserTypingGesture() 35 37 { 36 s_processingUserGesture = state;38 return s_processingUserTypingGesture; 37 39 } 38 40 39 UserGestureIndicator::~UserGestureIndicator()41 static RefPtr<Node>& focusedNode() 40 42 { 41 s_processingUserGesture = m_previousValue; 43 DEFINE_STATIC_LOCAL(RefPtr<Node>, node, ()); 44 return node; 45 } 46 47 Node* UserTypingGestureIndicator::focusedElementAtGestureStart() 48 { 49 return focusedNode().get(); 50 } 51 52 UserTypingGestureIndicator::UserTypingGestureIndicator(Frame* frame) 53 : m_previousProcessingUserTypingGesture(s_processingUserTypingGesture) 54 , m_previousFocusedNode(focusedNode()) 55 { 56 s_processingUserTypingGesture = true; 57 focusedNode() = frame->document() ? frame->document()->focusedNode() : 0; 58 } 59 60 UserTypingGestureIndicator::~UserTypingGestureIndicator() 61 { 62 s_processingUserTypingGesture = m_previousProcessingUserTypingGesture; 63 focusedNode() = m_previousFocusedNode; 42 64 } 43 65 -
trunk/WebCore/dom/UserTypingGestureIndicator.h
r63905 r63927 24 24 */ 25 25 26 #ifndef User GestureIndicator_h27 #define User GestureIndicator_h26 #ifndef UserTypingGestureIndicator_h 27 #define UserTypingGestureIndicator_h 28 28 29 29 #include <wtf/Noncopyable.h> 30 #include <wtf/RefPtr.h> 30 31 31 32 namespace WebCore { 32 33 33 enum ProcessingUserGestureState { 34 DefinitelyProcessingUserGesture, 35 PossiblyProcessingUserGesture, 36 DefinitelyNotProcessingUserGesture 37 }; 34 class Frame; 35 class Node; 38 36 39 class User GestureIndicator : public Noncopyable {37 class UserTypingGestureIndicator : public Noncopyable { 40 38 public: 41 static bool processingUser Gesture() { return s_processingUserGesture == DefinitelyProcessingUserGesture; }42 static ProcessingUserGestureState getUserGestureState() { return s_processingUserGesture; }39 static bool processingUserTypingGesture(); 40 static Node* focusedElementAtGestureStart(); 43 41 44 explicit User GestureIndicator(ProcessingUserGestureState);45 ~User GestureIndicator();42 explicit UserTypingGestureIndicator(Frame*); 43 ~UserTypingGestureIndicator(); 46 44 47 45 private: 48 static ProcessingUserGestureState s_processingUserGesture;49 ProcessingUserGestureState m_previousValue;46 bool m_previousProcessingUserTypingGesture; 47 RefPtr<Node> m_previousFocusedNode; 50 48 }; 51 49 52 50 } // namespace WebCore 53 51 54 #endif // User GestureIndicator_h52 #endif // UserTypingGestureIndicator_h -
trunk/WebCore/editing/Editor.cpp
r61418 r63927 69 69 #include "TextIterator.h" 70 70 #include "TypingCommand.h" 71 #include "UserTypingGestureIndicator.h" 71 72 #include "htmlediting.h" 72 73 #include "markup.h" … … 1371 1372 void Editor::confirmComposition(const String& text, bool preserveSelection) 1372 1373 { 1374 UserTypingGestureIndicator typingGestureIndicator(m_frame); 1375 1373 1376 setIgnoreCompositionSelectionChange(true); 1374 1377 … … 1413 1416 void Editor::setComposition(const String& text, const Vector<CompositionUnderline>& underlines, unsigned selectionStart, unsigned selectionEnd) 1414 1417 { 1418 UserTypingGestureIndicator typingGestureIndicator(m_frame); 1419 1415 1420 setIgnoreCompositionSelectionChange(true); 1416 1421 -
trunk/WebCore/page/EventHandler.cpp
r63888 r63927 70 70 #include "TextIterator.h" 71 71 #include "UserGestureIndicator.h" 72 #include "UserTypingGestureIndicator.h" 72 73 #include "WheelEvent.h" 73 74 #include "htmlediting.h" // for comparePositions() … … 2267 2268 2268 2269 UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture); 2270 UserTypingGestureIndicator typingGestureIndicator(m_frame); 2269 2271 2270 2272 if (FrameView* view = m_frame->view()) -
trunk/WebCore/page/Frame.cpp
r63847 r63927 78 78 #include "TextResourceDecoder.h" 79 79 #include "UserContentURLPattern.h" 80 #include "UserTypingGestureIndicator.h" 80 81 #include "XMLNSNames.h" 81 82 #include "XMLNames.h" -
trunk/WebKit/mac/ChangeLog
r63904 r63927 1 2010-07-22 Sam Weinig <sam@webkit.org> 2 3 Reviewed by Maciej Stachowiak. 4 5 Fix for <rdar://problem/8222626> 6 Send textDidChangeInTextField delegate callback only in response to typing or other forms of user text input. 7 8 The function name no longer perfectly matches the behavior, but I didn't want to break any existing clients. Maybe we 9 should migrate to a new function name eventually 10 11 * WebCoreSupport/WebEditorClient.mm: 12 (WebEditorClient::textDidChangeInTextField): 13 1 14 2010-07-22 Sam Weinig <sam@webkit.org> 2 15 -
trunk/WebKit/mac/WebCoreSupport/WebEditorClient.mm
r63602 r63927 60 60 #import <WebCore/PlatformKeyboardEvent.h> 61 61 #import <WebCore/PlatformString.h> 62 #import <WebCore/UserTypingGestureIndicator.h> 62 63 #import <WebCore/WebCoreObjCExtras.h> 63 64 #import <runtime/InitializeThreading.h> … … 558 559 CallFormDelegate(m_webView, @selector(textFieldDidEndEditing:inFrame:), inputElement, kit(element->document()->frame())); 559 560 } 560 561 561 562 void WebEditorClient::textDidChangeInTextField(Element* element) 562 563 { 563 564 if (!element->hasTagName(inputTag)) 565 return; 566 567 if (!UserTypingGestureIndicator::processingUserTypingGesture() || UserTypingGestureIndicator::focusedElementAtGestureStart() != element) 564 568 return; 565 569 -
trunk/WebKit/win/ChangeLog
r63863 r63927 1 2010-07-22 Sam Weinig <sam@webkit.org> 2 3 Reviewed by Maciej Stachowiak. 4 5 Fix for <rdar://problem/8222626> 6 Send textDidChangeInTextField delegate callback only in response to typing or other forms of user text input. 7 8 The function name no longer perfectly matches the behavior, but I didn't want to break any existing clients. Maybe we 9 should migrate to a new function name eventually 10 11 * WebCoreSupport/WebEditorClient.cpp: 12 (WebEditorClient::textDidChangeInTextField): 13 1 14 2010-07-21 Brady Eidson <beidson@apple.com> 2 15 -
trunk/WebKit/win/WebCoreSupport/WebEditorClient.cpp
r63602 r63927 42 42 #include <WebCore/HTMLNames.h> 43 43 #include <WebCore/KeyboardEvent.h> 44 #include <WebCore/NotImplemented.h> 44 45 #include <WebCore/PlatformKeyboardEvent.h> 45 #include <WebCore/NotImplemented.h>46 46 #include <WebCore/Range.h> 47 #include <WebCore/UserTypingGestureIndicator.h> 47 48 #pragma warning(pop) 48 49 … … 348 349 void WebEditorClient::textDidChangeInTextField(Element* e) 349 350 { 351 if (!UserTypingGestureIndicator::processingUserTypingGesture() || UserTypingGestureIndicator::focusedElementAtGestureStart() != e) 352 return; 353 350 354 IWebFormDelegate* formDelegate; 351 355 if (SUCCEEDED(m_webView->formDelegate(&formDelegate)) && formDelegate) {
Note: See TracChangeset
for help on using the changeset viewer.