Changeset 166421 in webkit
- Timestamp:
- Mar 28, 2014 12:11:18 PM (10 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r166410 r166421 1 2014-03-28 Alexey Proskuryakov <ap@apple.com> 2 3 Eliminate a sync cancelComposition call in WebPageProxy::editorStateChanged 4 https://bugs.webkit.org/show_bug.cgi?id=130727 5 6 Reviewed by Enrica Casucci. 7 8 Added a separate CompositionWasCanceled IPC call, with which WebProcess can tell 9 UIProcess that it should notify an input method of canceled composition. There are 10 a lot of incorrect edge cases where we don't call it correctly, but this was true 11 in the old implementation too (for different edge cases). 12 13 This change only affects iOS and async NSTextInputClient code path on Mac. I don't 14 want to change sync NSTextInputClient code path unless absolutely necessary. 15 16 * UIProcess/WebPageProxy.cpp: 17 (WebKit::WebPageProxy::WebPageProxy): 18 (WebKit::WebPageProxy::editorStateChanged): 19 (WebKit::WebPageProxy::compositionWasCanceled): 20 (WebKit::WebPageProxy::resetStateAfterProcessExited): 21 * UIProcess/WebPageProxy.h: 22 * UIProcess/WebPageProxy.messages.in: 23 * UIProcess/mac/WebPageProxyMac.mm: 24 (WebKit::WebPageProxy::insertText): 25 (WebKit::WebPageProxy::executeKeypressCommands): 26 * WebProcess/WebPage/WebPage.cpp: 27 (WebKit::WebPage::didChangeSelection): 28 1 29 2014-03-28 Mario Sanchez Prada <mario.prada@samsung.com> 2 30 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r166374 r166421 269 269 , m_backForwardList(WebBackForwardList::create(*this)) 270 270 , m_loadStateAtProcessExit(FrameLoadState::State::Finished) 271 #if PLATFORM(MAC) && !USE(ASYNC_NSTEXTINPUTCLIENT) 271 272 , m_temporarilyClosedComposition(false) 273 #endif 272 274 , m_textZoomFactor(1) 273 275 , m_pageZoomFactor(1) … … 3121 3123 #if PLATFORM(COCOA) 3122 3124 bool couldChangeSecureInputState = m_editorState.isInPasswordField != editorState.isInPasswordField || m_editorState.selectionIsNone; 3125 #endif 3126 #if PLATFORM(MAC) && !USE(ASYNC_NSTEXTINPUTCLIENT) 3123 3127 bool closedComposition = !editorState.shouldIgnoreCompositionSelectionChange && !editorState.hasComposition && (m_editorState.hasComposition || m_temporarilyClosedComposition); 3124 3128 m_temporarilyClosedComposition = editorState.shouldIgnoreCompositionSelectionChange && (m_temporarilyClosedComposition || m_editorState.hasComposition) && !editorState.hasComposition; … … 3131 3135 if (couldChangeSecureInputState && !editorState.selectionIsNone) 3132 3136 m_pageClient.updateSecureInputState(); 3137 #endif 3133 3138 3134 3139 if (editorState.shouldIgnoreCompositionSelectionChange) 3135 3140 return; 3136 3141 3142 #if PLATFORM(MAC) && !USE(ASYNC_NSTEXTINPUTCLIENT) 3137 3143 if (closedComposition) 3138 3144 m_pageClient.notifyInputContextAboutDiscardedComposition(); … … 3143 3149 m_pageClient.notifyInputContextAboutDiscardedComposition(); 3144 3150 } 3145 # if PLATFORM(IOS)3146 else{3151 #elif PLATFORM(IOS) 3152 if (!editorState.hasComposition) { 3147 3153 // We need to notify the client on iOS to make sure the selection is redrawn. 3148 3154 notifyRevealedSelection(); 3149 3155 } 3150 #endif3151 3156 #elif PLATFORM(EFL) || PLATFORM(GTK) 3152 3157 m_pageClient.updateTextInputState(); 3153 3158 #endif 3159 } 3160 3161 void WebPageProxy::compositionWasCanceled(const EditorState& editorState) 3162 { 3163 #if PLATFORM(COCOA) 3164 m_pageClient.notifyInputContextAboutDiscardedComposition(); 3165 #endif 3166 editorStateChanged(editorState); 3154 3167 } 3155 3168 … … 4074 4087 // FIXME: Reset m_editorState. 4075 4088 // FIXME: Notify input methods about abandoned composition. 4089 #if PLATFORM(MAC) && !USE(ASYNC_NSTEXTINPUTCLIENT) 4076 4090 m_temporarilyClosedComposition = false; 4091 #endif 4077 4092 4078 4093 #if PLATFORM(MAC) -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r166384 r166421 1187 1187 1188 1188 void editorStateChanged(const EditorState&); 1189 void compositionWasCanceled(const EditorState&); 1189 1190 1190 1191 // Back/Forward list management … … 1471 1472 1472 1473 EditorState m_editorState; 1474 #if PLATFORM(MAC) && !USE(ASYNC_NSTEXTINPUTCLIENT) 1473 1475 bool m_temporarilyClosedComposition; // Editor state changed from hasComposition to !hasComposition, but that was only with shouldIgnoreCompositionSelectionChange yet. 1476 #endif 1474 1477 1475 1478 double m_textZoomFactor; -
trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in
r166384 r166421 204 204 # Editor notifications 205 205 EditorStateChanged(WebKit::EditorState editorState) 206 CompositionWasCanceled(WebKit::EditorState editorState) 206 207 207 208 # Find messages -
trunk/Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm
r166105 r166421 181 181 bool handled = true; 182 182 process().sendSync(Messages::WebPage::InsertText(text, replacementRange), Messages::WebPage::InsertText::Reply(handled, m_editorState), m_pageID); 183 #if PLATFORM(MAC) && !USE(ASYNC_NSTEXTINPUTCLIENT) 183 184 m_temporarilyClosedComposition = false; 185 #endif 184 186 185 187 return handled; … … 271 273 bool result = false; 272 274 process().sendSync(Messages::WebPage::ExecuteKeypressCommands(commands), Messages::WebPage::ExecuteKeypressCommands::Reply(result, m_editorState), m_pageID); 275 #if PLATFORM(MAC) && !USE(ASYNC_NSTEXTINPUTCLIENT) 273 276 m_temporarilyClosedComposition = false; 277 #endif 274 278 return result; 275 279 } -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r166384 r166421 4110 4110 void WebPage::didChangeSelection() 4111 4111 { 4112 send(Messages::WebPageProxy::EditorStateChanged(editorState())); 4112 #if (PLATFORM(MAC) && USE(ASYNC_NSTEXTINPUTCLIENT)) || PLATFORM(IOS) 4113 Frame& frame = m_page->focusController().focusedOrMainFrame(); 4114 // Abandon the current inline input session if selection changed for any other reason but an input method direct action. 4115 // FIXME: Many changes that affect composition node do not go through didChangeSelection(). We need to do something when DOM manipulation affects the composition, because otherwise input method's idea about it will be different from Editor's. 4116 // FIXME: We can't cancel composition when selection changes to NoSelection, but we probably should. 4117 if (frame.editor().hasComposition() && !frame.editor().ignoreCompositionSelectionChange() && !frame.selection().isNone()) { 4118 frame.editor().cancelComposition(); 4119 send(Messages::WebPageProxy::CompositionWasCanceled(editorState())); 4120 } else 4121 #endif 4122 send(Messages::WebPageProxy::EditorStateChanged(editorState())); 4123 4113 4124 #if PLATFORM(IOS) 4114 4125 m_drawingArea->scheduleCompositingLayerFlush();
Note: See TracChangeset
for help on using the changeset viewer.