Changeset 150291 in webkit
- Timestamp:
- May 17, 2013, 1:04:43 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r150290 r150291 1 2013-05-16 Alexey Proskuryakov <ap@apple.com> 2 3 Text input is largely broken when there are subframes loading 4 http://bugs.webkit.org/show_bug.cgi?id=59121 5 <rdar://problem/9320468> 6 7 Reviewed by Darin Adler. 8 9 The new test's result are affected by DRT and WTR deficiencies, but it still 10 verifies that a tricky crash I had during development doesn't start to happen again. 11 12 * platform/mac-wk2/TestExpectations: 13 * platform/mac/editing/input/resources: Added. 14 * platform/mac/editing/input/resources/first-page.html: Added. 15 * platform/mac/editing/input/resources/other-page.html: Added. 16 * platform/mac/editing/input/unconfirmed-text-navigation-with-page-cache-expected.txt: Added. 17 * platform/mac/editing/input/unconfirmed-text-navigation-with-page-cache.html: Added. 18 1 19 2013-05-17 Ryosuke Niwa <rniwa@webkit.org> 2 20 -
trunk/LayoutTests/platform/mac-wk2/TestExpectations
r150235 r150291 320 320 editing/secure-input/password-input-focusing-to-different-frame.html [ Failure ] 321 321 322 # textInputController.hasMarkedText is implemented, but gives a wrong result for some reason. 323 platform/mac/editing/input/unconfirmed-text-navigation-with-page-cache.html 324 322 325 ### END OF (3) Unclassified failures 323 326 ######################################## -
trunk/Source/WebCore/ChangeLog
r150283 r150291 1 2013-05-17 Alexey Proskuryakov <ap@apple.com> 2 3 Text input is largely broken when there are subframes loading 4 http://bugs.webkit.org/show_bug.cgi?id=59121 5 <rdar://problem/9320468> 6 7 Reviewed by Darin Adler. 8 9 This addresses text input being abandoned when another frame in a page is navigated. 10 11 There are still many opportunities for improvement: 12 - Track other cases where WebCore interferes may want to cancel input without 13 direct user action (e.g. deleting the whole editable element on a timer). 14 - Fix how dictionary panel and autocorrection are dismissed (they still have the 15 same issue, and get dismissed with any frame navigation). 16 17 Test: platform/mac/editing/input/unconfirmed-text-navigation-with-page-cache.html 18 19 * loader/FrameLoader.h: 20 * loader/FrameLoader.cpp: 21 (WebCore::FrameLoader::willTransitionToCommitted): Make sure that we 22 do not keep an inline session in a frame that's no longer active, as WebKit2 no 23 longer takes care of this case (and more of the logic should be in WebCore anyway). 24 (WebCore::FrameLoader::commitProvisionalLoad): Added a hook that gets invoked right 25 before transitioning to committed state starts. We may want to move more code here 26 eventually, e.g. from Frame::setView. 27 1 28 2013-05-17 Christophe Dumez <ch.dumez@sisa.samsung.com> 2 29 -
trunk/Source/WebCore/loader/FrameLoader.cpp
r150214 r150291 475 475 } 476 476 477 void FrameLoader::willTransitionToCommitted() 478 { 479 // This function is called when a frame is still fully in place (not cached, not detached), but will be replaced. 480 481 if (m_frame->editor()->hasComposition()) { 482 // The text was already present in DOM, so it's better to confirm than to cancel the composition. 483 m_frame->editor()->confirmComposition(); 484 if (EditorClient* editorClient = m_frame->editor()->client()) 485 editorClient->respondToChangedSelection(m_frame); 486 } 487 } 488 477 489 bool FrameLoader::closeURL() 478 490 { … … 1681 1693 m_frame->document() ? m_frame->document()->url().elidedString().utf8().data() : "", 1682 1694 pdl ? pdl->url().elidedString().utf8().data() : "<no provisional DocumentLoader>"); 1695 1696 willTransitionToCommitted(); 1683 1697 1684 1698 // Check to see if we need to cache the page we are navigating away from into the back/forward cache. -
trunk/Source/WebCore/loader/FrameLoader.h
r150214 r150291 368 368 void provisionalLoadStarted(); 369 369 370 void willTransitionToCommitted(); 370 371 bool didOpenURL(); 371 372 -
trunk/Source/WebKit2/ChangeLog
r150289 r150291 1 2013-05-16 Alexey Proskuryakov <ap@apple.com> 2 3 Text input is largely broken when there are subframes loading 4 http://bugs.webkit.org/show_bug.cgi?id=59121 5 <rdar://problem/9320468> 6 7 Reviewed by Darin Adler. 8 9 * UIProcess/PageClient.h: 10 * UIProcess/API/mac/PageClientImpl.h: 11 * UIProcess/API/mac/PageClientImpl.mm: 12 (WebKit::PageClientImpl::updateSecureInputState): Separated secure input state 13 updating into a separate function. Removed updateTextInputState, we don't need 14 to go through PageClient to implement its behavior at all. 15 (WebKit::PageClientImpl::dismissDictionaryLookupPanel): Added a FIXME. 16 17 * UIProcess/API/mac/WKView.mm: 18 * UIProcess/API/mac/WKViewInternal.h: 19 Removed _updateTextInputStateIncludingSecureInputState. 20 21 * UIProcess/WebPageProxy.h: Added m_temporarilyClosedComposition, which helps 22 to figure out that WebCore decided to close a composition. The issue is that WebCore 23 would first send an EditorState with hasComposition set to false, and with 24 shouldIgnoreCompositionSelectionChange set to true, at which time we forget the 25 previous m_editorState, but can't make any decisions based on this transient state. 26 We should find a way to simplify this (maybe not send these updates with 27 shouldIgnoreCompositionSelectionChange at all?) 28 29 * UIProcess/WebPageProxy.cpp: 30 (WebKit::WebPageProxy::WebPageProxy): Initialize m_temporarilyClosedComposition. 31 (WebKit::WebPageProxy::didCommitLoadForFrame): Removed the code to kill a composition 32 when any frame commits a load, which made no sense (along with surrounding code, 33 which will unfortunately survive longer). 34 (WebKit::WebPageProxy::editorStateChanged): Implemented state updating here, 35 we don't need to go to WKView.mm to implement this logic. Figure out when WebCore 36 discards a composition, and notify input methods about this. 37 (WebKit::WebPageProxy::resetStateAfterProcessExited): Reset m_temporarilyClosedComposition. 38 Added some FIXMEs. 39 1 40 2013-05-17 Manuel Rego Casasnovas <rego@igalia.com> 2 41 -
trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.h
r150132 r150291 83 83 virtual void setPromisedData(const String& pasteboardName, PassRefPtr<WebCore::SharedBuffer> imageBuffer, const String& filename, const String& extension, const String& title, 84 84 const String& url, const String& visibleUrl, PassRefPtr<WebCore::SharedBuffer> archiveBuffer); 85 virtual void update TextInputState(bool updateSecureInputState);85 virtual void updateSecureInputState() OVERRIDE; 86 86 virtual void resetSecureInputState() OVERRIDE; 87 87 virtual void notifyInputContextAboutDiscardedComposition() OVERRIDE; -
trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm
r150230 r150291 327 327 } 328 328 329 void PageClientImpl::update TextInputState(bool updateSecureInputState)330 { 331 [m_wkView _update TextInputStateIncludingSecureInputState:updateSecureInputState];329 void PageClientImpl::updateSecureInputState() 330 { 331 [m_wkView _updateSecureInputState]; 332 332 } 333 333 … … 503 503 void PageClientImpl::dismissDictionaryLookupPanel() 504 504 { 505 // FIXME: We don't know which panel we are dismissing, it may not even be in the current page (see <rdar://problem/13875766>). 505 506 WKHideWordDefinitionWindow(); 506 507 } -
trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm
r150132 r150291 2901 2901 } 2902 2902 2903 - (void)_updateTextInputStateIncludingSecureInputState:(BOOL)updateSecureInputState2904 {2905 const EditorState& editorState = _data->_page->editorState();2906 if (updateSecureInputState) {2907 // This is a temporary state when editing. Flipping secure input state too quickly can expose race conditions.2908 if (!editorState.selectionIsNone)2909 [self _updateSecureInputState];2910 }2911 2912 if (!editorState.hasComposition || editorState.shouldIgnoreCompositionSelectionChange)2913 return;2914 2915 _data->_page->cancelComposition();2916 2917 [self _notifyInputContextAboutDiscardedComposition];2918 }2919 2920 2903 - (void)_resetSecureInputState 2921 2904 { -
trunk/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h
r150132 r150291 85 85 - (void)_resetSecureInputState; 86 86 - (void)_notifyInputContextAboutDiscardedComposition; 87 - (void)_updateTextInputStateIncludingSecureInputState:(BOOL)updateSecureInputState;88 87 89 88 - (WebKit::ColorSpaceData)_colorSpace; -
trunk/Source/WebKit2/UIProcess/PageClient.h
r150132 r150291 157 157 virtual bool executeSavedCommandBySelector(const String& selector) = 0; 158 158 virtual void setDragImage(const WebCore::IntPoint& clientPosition, PassRefPtr<ShareableBitmap> dragImage, bool isLinkDrag) = 0; 159 virtual void update TextInputState(bool updateSecureInputState) = 0;159 virtual void updateSecureInputState() = 0; 160 160 virtual void resetSecureInputState() = 0; 161 161 virtual void notifyInputContextAboutDiscardedComposition() = 0; -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r150271 r150291 246 246 , m_backForwardList(WebBackForwardList::create(this)) 247 247 , m_loadStateAtProcessExit(WebFrameProxy::LoadStateFinished) 248 , m_temporarilyClosedComposition(false) 248 249 , m_textZoomFactor(1) 249 250 , m_pageZoomFactor(1) … … 2261 2262 #if PLATFORM(MAC) 2262 2263 // FIXME (bug 59111): didCommitLoadForFrame comes too late when restoring a page from b/f cache, making us disable secure event mode in password fields. 2263 // FIXME (bug 59121): A load going on in one frame shouldn't affect typing in sibling frames. 2264 m_pageClient->notifyInputContextAboutDiscardedComposition(); 2264 // FIXME: A load going on in one frame shouldn't affect text editing in other frames on the page. 2265 2265 m_pageClient->resetSecureInputState(); 2266 2266 dismissCorrectionPanel(ReasonForDismissingAlternativeTextIgnored); … … 3070 3070 #if PLATFORM(MAC) 3071 3071 bool couldChangeSecureInputState = m_editorState.isInPasswordField != editorState.isInPasswordField || m_editorState.selectionIsNone; 3072 bool closedComposition = !editorState.shouldIgnoreCompositionSelectionChange && !editorState.hasComposition && (m_editorState.hasComposition || m_temporarilyClosedComposition); 3073 m_temporarilyClosedComposition = editorState.shouldIgnoreCompositionSelectionChange && (m_temporarilyClosedComposition || m_editorState.hasComposition) && !editorState.hasComposition; 3072 3074 #endif 3073 3075 … … 3075 3077 3076 3078 #if PLATFORM(MAC) 3077 m_pageClient->updateTextInputState(couldChangeSecureInputState); 3079 // Selection being none is a temporary state when editing. Flipping secure input state too quickly was causing trouble (not fully understood). 3080 if (couldChangeSecureInputState && !editorState.selectionIsNone) 3081 m_pageClient->updateSecureInputState(); 3082 3083 if (editorState.shouldIgnoreCompositionSelectionChange) 3084 return; 3085 3086 if (closedComposition) 3087 m_pageClient->notifyInputContextAboutDiscardedComposition(); 3088 if (editorState.hasComposition) { 3089 // Abandon the current inline input session if selection changed for any other reason but an input method changing the composition. 3090 // FIXME: This logic should be in WebCore, no need to round-trip to UI process to cancel the composition. 3091 cancelComposition(); 3092 m_pageClient->notifyInputContextAboutDiscardedComposition(); 3093 } 3078 3094 #elif PLATFORM(QT) || PLATFORM(EFL) || PLATFORM(GTK) 3079 3095 m_pageClient->updateTextInputState(); … … 3916 3932 m_touchEventQueue.clear(); 3917 3933 #endif 3934 3935 // FIXME: Reset m_editorState. 3936 // FIXME: Notify input methods about abandoned composition. 3937 m_temporarilyClosedComposition = false; 3918 3938 3919 3939 #if PLATFORM(MAC) -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r150271 r150291 1132 1132 1133 1133 EditorState m_editorState; 1134 bool m_temporarilyClosedComposition; // Editor state changed from hasComposition to !hasComposition, but that was only with shouldIgnoreCompositionSelectionChange yet. 1134 1135 1135 1136 double m_textZoomFactor;
Note:
See TracChangeset
for help on using the changeset viewer.