Changeset 244897 in webkit
- Timestamp:
- May 2, 2019 6:05:32 PM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r244893 r244897 1 2019-05-02 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 REGRESSION: Layout test editing/selection/ios/selection-after-changing-text-with-callout-menu.html is failing 4 https://bugs.webkit.org/show_bug.cgi?id=197532 5 <rdar://problem/50177144> 6 7 Reviewed by Ryosuke Niwa. 8 9 Fixes layout tests that began failing after r244546. See below for details. 10 11 * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm: 12 (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): 13 14 Partially reverts a change in r244546, after which we commit the layer tree and scroll before updating the 15 page's editor state. The purpose of this change was to ensure that UI process-side element focus scrolling logic 16 would not conflict with web-process-driven scrolling logic. 17 18 Instead, we split the existing logic in WebPageProxy::editorStateChanged into two pieces: one that updates the 19 editor state (by setting m_editorState), and a second that dispatches updates to PageClient when the first 20 editor state is received after focusing an element. During a layer tree commit in the UI process, we first 21 update the editor state, then commit the layer tree and apply scroll position changes, and finally scroll to 22 reveal the focused element if necessary. 23 24 When an editor state is delivered to the UI process in an out-of-band update (i.e. not in a layer tree commit), 25 simply dispatch the initial editor state for a focused element immediately. 26 27 * UIProcess/WebPageProxy.cpp: 28 (WebKit::WebPageProxy::scheduleFullEditorStateUpdate): 29 30 Add an IPC message to schedule an editor state update in the next remote layer tree commit. See below for more 31 details. 32 33 (WebKit::WebPageProxy::editorStateChanged): 34 (WebKit::WebPageProxy::dispatchDidReceiveEditorStateAfterFocus): 35 * UIProcess/WebPageProxy.h: 36 * UIProcess/gtk/WebPageProxyGtk.cpp: 37 (WebKit::WebPageProxy::updateEditorState): 38 (WebKit::WebPageProxy::editorStateChanged): Deleted. 39 * UIProcess/ios/WKContentViewInteraction.mm: 40 (-[WKContentView willFinishIgnoringCalloutBarFadeAfterPerformingAction]): 41 42 Additionally ensure that an editor state update is scheduled. This addresses a potential source of flakiness in 43 the layout test editing/selection/ios/selection-after-changing-text-with-callout-menu.html, where an editor 44 state update may only be scheduled after the next layout timer fires (this is the case in custom callout menu 45 actions that change the DOM but do not otherwise trigger any editing commands). 46 47 In the problematic scenario, the client could make a change that triggers layout soon; but before the layout 48 timer fires, the timer for the next remote layer tree commit could fire, such that the next layer tree commit 49 would not contain the relevant editor state. 50 51 This extra step ensures that we always *schedule* an editor state update when performing a callout menu action 52 that does not automatically dismiss, so that we can prevent the callout bar from dismissing during the correct 53 scope. 54 55 * UIProcess/ios/WebPageProxyIOS.mm: 56 (WebKit::WebPageProxy::layerTreeCommitComplete): 57 (WebKit::WebPageProxy::updateEditorState): 58 59 Rename editorStateChanged to updateEditorState, and make the editorStateChanged codepath only executed when an 60 out-of-band editor state update is delivered to the UI process. 61 62 (WebKit::WebPageProxy::dispatchDidReceiveEditorStateAfterFocus): 63 64 Notify the UI process that the initial editor state has been received; this prompts us to scroll to reveal the 65 focused element, if needed. 66 67 (WebKit::WebPageProxy::editorStateChanged): Deleted. 68 * UIProcess/mac/WebPageProxyMac.mm: 69 (WebKit::WebPageProxy::updateEditorState): 70 (WebKit::WebPageProxy::editorStateChanged): Deleted. 71 * UIProcess/win/WebPageProxyWin.cpp: 72 (WebKit::WebPageProxy::updateEditorState): 73 (WebKit::WebPageProxy::editorStateChanged): Deleted. 74 * UIProcess/wpe/WebPageProxyWPE.cpp: 75 (WebKit::WebPageProxy::updateEditorState): 76 (WebKit::WebPageProxy::editorStateChanged): Deleted. 77 * WebProcess/WebPage/WebPage.h: 78 * WebProcess/WebPage/WebPage.messages.in: 79 1 80 2019-05-02 Timothy Hatcher <timothy@apple.com> 2 81 -
trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm
r244546 r244897 200 200 m_activityStateChangeID = layerTreeTransaction.activityStateChangeID(); 201 201 202 if (layerTreeTransaction.hasEditorState()) 203 m_webPageProxy.updateEditorState(layerTreeTransaction.editorState()); 204 202 205 if (m_remoteLayerTreeHost->updateLayerTree(layerTreeTransaction)) { 203 206 if (layerTreeTransaction.transactionID() >= m_transactionIDForUnhidingContent) … … 254 257 255 258 if (layerTreeTransaction.hasEditorState()) 256 m_webPageProxy. editorStateChanged(layerTreeTransaction.editorState());259 m_webPageProxy.dispatchDidReceiveEditorStateAfterFocus(); 257 260 258 261 if (auto milestones = layerTreeTransaction.newlyReachedPaintingMilestones()) -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r244819 r244897 2007 2007 } 2008 2008 2009 void WebPageProxy::scheduleFullEditorStateUpdate() 2010 { 2011 if (!hasRunningProcess()) 2012 return; 2013 2014 m_process->send(Messages::WebPage::ScheduleFullEditorStateUpdate(), m_pageID); 2015 } 2016 2009 2017 void WebPageProxy::executeEditCommand(const String& commandName, const String& argument, WTF::Function<void(CallbackBase::Error)>&& callbackFunction) 2010 2018 { … … 6503 6511 callback->performCallbackWithReturnValue(range); 6504 6512 } 6513 6514 void WebPageProxy::editorStateChanged(const EditorState& editorState) 6515 { 6516 updateEditorState(editorState); 6517 dispatchDidReceiveEditorStateAfterFocus(); 6518 } 6519 6520 #if !PLATFORM(IOS_FAMILY) 6521 6522 void WebPageProxy::dispatchDidReceiveEditorStateAfterFocus() 6523 { 6524 } 6525 6526 #endif 6505 6527 6506 6528 #if ENABLE(APPLICATION_MANIFEST) -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r244819 r244897 1424 1424 #endif 1425 1425 void editorStateChanged(const EditorState&); 1426 void updateEditorState(const EditorState&); 1427 void scheduleFullEditorStateUpdate(); 1428 void dispatchDidReceiveEditorStateAfterFocus(); 1426 1429 1427 1430 #if PLATFORM(COCOA) -
trunk/Source/WebKit/UIProcess/gtk/WebPageProxyGtk.cpp
r243862 r244897 80 80 } 81 81 82 void WebPageProxy:: editorStateChanged(const EditorState& editorState)82 void WebPageProxy::updateEditorState(const EditorState& editorState) 83 83 { 84 84 m_editorState = editorState; -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
r244775 r244897 3921 3921 { 3922 3922 _ignoreSelectionCommandFadeCount++; 3923 _page->scheduleFullEditorStateUpdate(); 3923 3924 _page->callAfterNextPresentationUpdate([weakSelf = WeakObjCPtr<WKContentView>(self)] (auto) { 3924 3925 if (auto strongSelf = weakSelf.get()) -
trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm
r244775 r244897 431 431 { 432 432 pageClient().layerTreeCommitComplete(); 433 434 if (m_waitingForPostLayoutEditorStateUpdateAfterFocusingElement && !m_editorState.isMissingPostLayoutData) { 435 pageClient().didReceiveEditorStateUpdateAfterFocus(); 436 m_waitingForPostLayoutEditorStateUpdateAfterFocusingElement = false; 437 } 433 438 } 434 439 … … 1103 1108 } 1104 1109 1105 void WebPageProxy:: editorStateChanged(const EditorState& editorState)1110 void WebPageProxy::updateEditorState(const EditorState& editorState) 1106 1111 { 1107 1112 bool couldChangeSecureInputState = m_editorState.isInPasswordField != editorState.isInPasswordField || m_editorState.selectionIsNone; … … 1120 1125 pageClient().selectionDidChange(); 1121 1126 updateFontAttributesAfterEditorStateChange(); 1122 1123 if (m_waitingForPostLayoutEditorStateUpdateAfterFocusingElement && !m_editorState.isMissingPostLayoutData) { 1124 pageClient().didReceiveEditorStateUpdateAfterFocus(); 1125 m_waitingForPostLayoutEditorStateUpdateAfterFocusingElement = false; 1126 } 1127 } 1128 1129 void WebPageProxy::dispatchDidReceiveEditorStateAfterFocus() 1130 { 1131 if (!m_waitingForPostLayoutEditorStateUpdateAfterFocusingElement || m_editorState.isMissingPostLayoutData) 1132 return; 1133 1134 pageClient().didReceiveEditorStateUpdateAfterFocus(); 1135 m_waitingForPostLayoutEditorStateUpdateAfterFocusingElement = false; 1127 1136 } 1128 1137 -
trunk/Source/WebKit/UIProcess/mac/WebPageProxyMac.mm
r244633 r244897 608 608 } 609 609 610 void WebPageProxy:: editorStateChanged(const EditorState& editorState)610 void WebPageProxy::updateEditorState(const EditorState& editorState) 611 611 { 612 612 bool couldChangeSecureInputState = m_editorState.isInPasswordField != editorState.isInPasswordField || m_editorState.selectionIsNone; -
trunk/Source/WebKit/UIProcess/win/WebPageProxyWin.cpp
r243327 r244897 61 61 } 62 62 63 void WebPageProxy:: editorStateChanged(const EditorState& editorState)63 void WebPageProxy::updateEditorState(const EditorState& editorState) 64 64 { 65 65 m_editorState = editorState; -
trunk/Source/WebKit/UIProcess/wpe/WebPageProxyWPE.cpp
r243327 r244897 65 65 } 66 66 67 void WebPageProxy:: editorStateChanged(const EditorState&)67 void WebPageProxy::updateEditorState(const EditorState&) 68 68 { 69 69 notImplemented(); -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.h
r244849 r244897 1184 1184 1185 1185 void updateIntrinsicContentSizeIfNeeded(const WebCore::IntSize&); 1186 void scheduleFullEditorStateUpdate(); 1186 1187 1187 1188 private: … … 1200 1201 void platformEditorState(WebCore::Frame&, EditorState& result, IncludePostLayoutDataHint) const; 1201 1202 void sendEditorStateUpdate(); 1202 void scheduleFullEditorStateUpdate();1203 1203 1204 1204 #if PLATFORM(COCOA) -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in
r244775 r244897 203 203 ForceRepaint(WebKit::CallbackID callbackID) 204 204 205 ScheduleFullEditorStateUpdate() 206 205 207 #if PLATFORM(COCOA) 206 208 # Dictionary support.
Note: See TracChangeset
for help on using the changeset viewer.