Title: [237159] trunk/Source/WebKit
Revision
237159
Author
[email protected]
Date
2018-10-15 17:32:56 -0700 (Mon, 15 Oct 2018)

Log Message

REGRESSION (r236512): [ Mac WK2 ] Layout Test editing/undo/undo-smart-delete-word.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=190375
<rdar://problem/45177807>

Reviewed by Ryosuke Niwa.

The test is doing the following:
> document.execCommand("Delete"); document.execCommand("Undo");

Both operation are synchronous and rely on synchronous IPC from the WebProcess to the UIProcess.
However, for the undo operation to succeed, the first command need to have been registered with
with the UIProcess via the WebPageProxy::RegisterEditCommandForUndo IPC to the UIProcess, which
is asynchronous.

After r236512, the UIProcess no longer processes incoming sync / async IPC in order and thus,
it is possible for the WebPageProxy::ExecuteUndoRedo synchronous IPC to get processed by the
UIProcess *before* the WebPageProxy::RegisterEditCommandForUndo asynchronous IPC for the
previous "Delete" command. As a result, canUndo would return false and we would fail to undo.

To address the issue, use SendOption::DispatchMessageEvenWhenWaitingForSyncReply flag when sending
the WebPageProxy::RegisterEditCommandForUndo IPC, so that it gets processed in order with regards
to surrounding synchronous IPC.

* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::registerUndoStep):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (237158 => 237159)


--- trunk/Source/WebKit/ChangeLog	2018-10-16 00:30:49 UTC (rev 237158)
+++ trunk/Source/WebKit/ChangeLog	2018-10-16 00:32:56 UTC (rev 237159)
@@ -1,3 +1,31 @@
+2018-10-15  Chris Dumez  <[email protected]>
+
+        REGRESSION (r236512): [ Mac WK2 ] Layout Test editing/undo/undo-smart-delete-word.html is flaky
+        https://bugs.webkit.org/show_bug.cgi?id=190375
+        <rdar://problem/45177807>
+
+        Reviewed by Ryosuke Niwa.
+
+        The test is doing the following:
+        > document.execCommand("Delete"); document.execCommand("Undo");
+
+        Both operation are synchronous and rely on synchronous IPC from the WebProcess to the UIProcess.
+        However, for the undo operation to succeed, the first command need to have been registered with
+        with the UIProcess via the WebPageProxy::RegisterEditCommandForUndo IPC to the UIProcess, which
+        is asynchronous.
+
+        After r236512, the UIProcess no longer processes incoming sync / async IPC in order and thus,
+        it is possible for the WebPageProxy::ExecuteUndoRedo synchronous IPC to get processed by the
+        UIProcess *before* the WebPageProxy::RegisterEditCommandForUndo asynchronous IPC for the
+        previous "Delete" command. As a result, canUndo would return false and we would fail to undo.
+
+        To address the issue, use SendOption::DispatchMessageEvenWhenWaitingForSyncReply flag when sending
+        the WebPageProxy::RegisterEditCommandForUndo IPC, so that it gets processed in order with regards
+        to surrounding synchronous IPC.
+
+        * WebProcess/WebCoreSupport/WebEditorClient.cpp:
+        (WebKit::WebEditorClient::registerUndoStep):
+
 2018-10-15  Alex Christensen  <[email protected]>
 
         Modernize BackForwardClient.h

Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.cpp (237158 => 237159)


--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.cpp	2018-10-16 00:30:49 UTC (rev 237158)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.cpp	2018-10-16 00:32:56 UTC (rev 237159)
@@ -300,7 +300,7 @@
     auto editAction = static_cast<uint32_t>(webStep->step().editingAction());
 
     m_page->addWebUndoStep(webStep->stepID(), webStep.ptr());
-    m_page->send(Messages::WebPageProxy::RegisterEditCommandForUndo(webStep->stepID(), editAction));
+    m_page->send(Messages::WebPageProxy::RegisterEditCommandForUndo(webStep->stepID(), editAction), m_page->pageID(), IPC::SendOption::DispatchMessageEvenWhenWaitingForSyncReply);
 }
 
 void WebEditorClient::registerRedoStep(UndoStep&)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to