Title: [247261] branches/safari-608.1.34.0-branch
Revision
247261
Author
[email protected]
Date
2019-07-09 10:46:03 -0700 (Tue, 09 Jul 2019)

Log Message

Cherry-pick r247180. rdar://problem/51597945

    [iOS] Crash in WebKit::WebPage::positionInformation via Range::startPosition
    https://bugs.webkit.org/show_bug.cgi?id=199503

    Reviewed by Wenson Hsieh.

    Source/WebCore:

    * editing/Editor.cpp:
    (WebCore::Editor::compositionRange const): Added a FIXME.

    Source/WebKit:

    The crash was caused because focusedElementPositionInformation asssumes Editor::compositionRange is not null
    whenever Editor::hasComposition returns true, which is not necessary the case when Editor::m_compositionNode
    contains no text (data is of length 0).

    Fixed the crash by adding an early return for when Editor::compositionRange returns nullptr.

    * WebProcess/WebPage/ios/WebPageIOS.mm:
    (WebKit::focusedElementPositionInformation):

    Tools:

    Added UIScriptController.ensurePositionInformationIsUpToDateAt using the existing WKWebView SPI:
    _requestActivatedElementAtPosition

    * DumpRenderTree/ios/UIScriptControllerIOS.mm:
    (WTR::UIScriptController::ensurePositionInformationIsUpToDateAt):
    * DumpRenderTree/mac/UIScriptControllerMac.mm:
    (WTR::UIScriptController::ensurePositionInformationIsUpToDateAt):
    * TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
    * TestRunnerShared/UIScriptContext/UIScriptController.cpp:
    (WTR::UIScriptController::ensurePositionInformationIsUpToDateAt):
    * TestRunnerShared/UIScriptContext/UIScriptController.h:
    * WebKitTestRunner/ios/UIScriptControllerIOS.mm:
    (WTR::UIScriptController::ensurePositionInformationIsUpToDateAt):
    * WebKitTestRunner/ios/UIScriptControllerMac.mm:
    (WTR::UIScriptController::ensurePositionInformationIsUpToDateAt):

    LayoutTests:

    Added a regression test for the crash.

    * editing/input/delete-text-in-composition-expected.txt: Added.
    * editing/input/delete-text-in-composition.html: Added.
    * resources/ui-helper.js:
    (window.UIHelper.ensurePositionInformationUpdateForElement): Added.

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247180 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Added Paths

Diff

Modified: branches/safari-608.1.34.0-branch/LayoutTests/ChangeLog (247260 => 247261)


--- branches/safari-608.1.34.0-branch/LayoutTests/ChangeLog	2019-07-09 17:44:11 UTC (rev 247260)
+++ branches/safari-608.1.34.0-branch/LayoutTests/ChangeLog	2019-07-09 17:46:03 UTC (rev 247261)
@@ -1,3 +1,72 @@
+2019-07-09  Alan Coon  <[email protected]>
+
+        Cherry-pick r247180. rdar://problem/51597945
+
+    [iOS] Crash in WebKit::WebPage::positionInformation via Range::startPosition
+    https://bugs.webkit.org/show_bug.cgi?id=199503
+    
+    Reviewed by Wenson Hsieh.
+    
+    Source/WebCore:
+    
+    * editing/Editor.cpp:
+    (WebCore::Editor::compositionRange const): Added a FIXME.
+    
+    Source/WebKit:
+    
+    The crash was caused because focusedElementPositionInformation asssumes Editor::compositionRange is not null
+    whenever Editor::hasComposition returns true, which is not necessary the case when Editor::m_compositionNode
+    contains no text (data is of length 0).
+    
+    Fixed the crash by adding an early return for when Editor::compositionRange returns nullptr.
+    
+    * WebProcess/WebPage/ios/WebPageIOS.mm:
+    (WebKit::focusedElementPositionInformation):
+    
+    Tools:
+    
+    Added UIScriptController.ensurePositionInformationIsUpToDateAt using the existing WKWebView SPI:
+    _requestActivatedElementAtPosition
+    
+    * DumpRenderTree/ios/UIScriptControllerIOS.mm:
+    (WTR::UIScriptController::ensurePositionInformationIsUpToDateAt):
+    * DumpRenderTree/mac/UIScriptControllerMac.mm:
+    (WTR::UIScriptController::ensurePositionInformationIsUpToDateAt):
+    * TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
+    * TestRunnerShared/UIScriptContext/UIScriptController.cpp:
+    (WTR::UIScriptController::ensurePositionInformationIsUpToDateAt):
+    * TestRunnerShared/UIScriptContext/UIScriptController.h:
+    * WebKitTestRunner/ios/UIScriptControllerIOS.mm:
+    (WTR::UIScriptController::ensurePositionInformationIsUpToDateAt):
+    * WebKitTestRunner/ios/UIScriptControllerMac.mm:
+    (WTR::UIScriptController::ensurePositionInformationIsUpToDateAt):
+    
+    LayoutTests:
+    
+    Added a regression test for the crash.
+    
+    * editing/input/delete-text-in-composition-expected.txt: Added.
+    * editing/input/delete-text-in-composition.html: Added.
+    * resources/ui-helper.js:
+    (window.UIHelper.ensurePositionInformationUpdateForElement): Added.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247180 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-07-05  Ryosuke Niwa  <[email protected]>
+
+            [iOS] Crash in WebKit::WebPage::positionInformation via Range::startPosition
+            https://bugs.webkit.org/show_bug.cgi?id=199503
+
+            Reviewed by Wenson Hsieh.
+
+            Added a regression test for the crash.
+
+            * editing/input/delete-text-in-composition-expected.txt: Added.
+            * editing/input/delete-text-in-composition.html: Added.
+            * resources/ui-helper.js:
+            (window.UIHelper.ensurePositionInformationUpdateForElement): Added.
+
 2019-07-05  Babak Shafiei  <[email protected]>
 
         Cherry-pick r247167. rdar://problem/52547473

Added: branches/safari-608.1.34.0-branch/LayoutTests/editing/input/delete-text-in-composition-expected.txt (0 => 247261)


--- branches/safari-608.1.34.0-branch/LayoutTests/editing/input/delete-text-in-composition-expected.txt	                        (rev 0)
+++ branches/safari-608.1.34.0-branch/LayoutTests/editing/input/delete-text-in-composition-expected.txt	2019-07-09 17:46:03 UTC (rev 247261)
@@ -0,0 +1,7 @@
+PASS successfullyParsed is true
+
+TEST COMPLETE
+This tests deleting the composition text does not result in a crash.
+To manually test, type in the box below using input method (e.g. Japanese or Chinese). WebKit on iOS should not crash.
+
+PASS - WebKit did not crash

Added: branches/safari-608.1.34.0-branch/LayoutTests/editing/input/delete-text-in-composition.html (0 => 247261)


--- branches/safari-608.1.34.0-branch/LayoutTests/editing/input/delete-text-in-composition.html	                        (rev 0)
+++ branches/safari-608.1.34.0-branch/LayoutTests/editing/input/delete-text-in-composition.html	2019-07-09 17:46:03 UTC (rev 247261)
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html>
+<body>
+<p>This tests deleting the composition text does not result in a crash.<br>
+To manually test, type in the box below using input method (e.g. Japanese or Chinese). WebKit on iOS should not crash.</p>
+<div id="editor" style="border: solid 2px blue; padding: 5px;" contenteditable></div>
+<div id="result"></div>
+<script src=""
+<script src=""
+<script>
+
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    testRunner.waitUntilDone();
+}
+
+editor.focus();
+
+async function runTest() {
+    if (window.textInputController) {
+        textInputController.setMarkedText("hello", 0, 5);
+        await UIHelper.ensurePresentationUpdate();
+        editor.firstChild.data = '';
+        await UIHelper.ensurePositionInformationUpdateForElement(editor);
+        result.textContent = 'PASS - WebKit did not crash';
+    }
+    testRunner.notifyDone();
+}
+
+window._onload_ = runTest;
+
+var successfullyParsed = true;
+
+</script>
+</body>
+</html>

Modified: branches/safari-608.1.34.0-branch/LayoutTests/resources/ui-helper.js (247260 => 247261)


--- branches/safari-608.1.34.0-branch/LayoutTests/resources/ui-helper.js	2019-07-09 17:44:11 UTC (rev 247260)
+++ branches/safari-608.1.34.0-branch/LayoutTests/resources/ui-helper.js	2019-07-09 17:46:03 UTC (rev 247261)
@@ -254,6 +254,25 @@
         });
     }
 
+    static ensurePositionInformationUpdateForElement(element)
+    {
+        const boundingRect = element.getBoundingClientRect();
+        const x = boundingRect.x + 5;
+        const y = boundingRect.y + 5;
+
+        if (!this.isWebKit2()) {
+            testRunner.display();
+            return Promise.resolve();
+        }
+
+        return new Promise(resolve => {
+            testRunner.runUIScript(`
+                uiController.ensurePositionInformationIsUpToDateAt(${x}, ${y}, function () {
+                    uiController.uiScriptComplete();
+                });`, resolve);
+        });
+    }
+
     static delayFor(ms)
     {
         return new Promise(resolve => setTimeout(resolve, ms));

Modified: branches/safari-608.1.34.0-branch/Source/WebCore/ChangeLog (247260 => 247261)


--- branches/safari-608.1.34.0-branch/Source/WebCore/ChangeLog	2019-07-09 17:44:11 UTC (rev 247260)
+++ branches/safari-608.1.34.0-branch/Source/WebCore/ChangeLog	2019-07-09 17:46:03 UTC (rev 247261)
@@ -1,3 +1,68 @@
+2019-07-09  Alan Coon  <[email protected]>
+
+        Cherry-pick r247180. rdar://problem/51597945
+
+    [iOS] Crash in WebKit::WebPage::positionInformation via Range::startPosition
+    https://bugs.webkit.org/show_bug.cgi?id=199503
+    
+    Reviewed by Wenson Hsieh.
+    
+    Source/WebCore:
+    
+    * editing/Editor.cpp:
+    (WebCore::Editor::compositionRange const): Added a FIXME.
+    
+    Source/WebKit:
+    
+    The crash was caused because focusedElementPositionInformation asssumes Editor::compositionRange is not null
+    whenever Editor::hasComposition returns true, which is not necessary the case when Editor::m_compositionNode
+    contains no text (data is of length 0).
+    
+    Fixed the crash by adding an early return for when Editor::compositionRange returns nullptr.
+    
+    * WebProcess/WebPage/ios/WebPageIOS.mm:
+    (WebKit::focusedElementPositionInformation):
+    
+    Tools:
+    
+    Added UIScriptController.ensurePositionInformationIsUpToDateAt using the existing WKWebView SPI:
+    _requestActivatedElementAtPosition
+    
+    * DumpRenderTree/ios/UIScriptControllerIOS.mm:
+    (WTR::UIScriptController::ensurePositionInformationIsUpToDateAt):
+    * DumpRenderTree/mac/UIScriptControllerMac.mm:
+    (WTR::UIScriptController::ensurePositionInformationIsUpToDateAt):
+    * TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
+    * TestRunnerShared/UIScriptContext/UIScriptController.cpp:
+    (WTR::UIScriptController::ensurePositionInformationIsUpToDateAt):
+    * TestRunnerShared/UIScriptContext/UIScriptController.h:
+    * WebKitTestRunner/ios/UIScriptControllerIOS.mm:
+    (WTR::UIScriptController::ensurePositionInformationIsUpToDateAt):
+    * WebKitTestRunner/ios/UIScriptControllerMac.mm:
+    (WTR::UIScriptController::ensurePositionInformationIsUpToDateAt):
+    
+    LayoutTests:
+    
+    Added a regression test for the crash.
+    
+    * editing/input/delete-text-in-composition-expected.txt: Added.
+    * editing/input/delete-text-in-composition.html: Added.
+    * resources/ui-helper.js:
+    (window.UIHelper.ensurePositionInformationUpdateForElement): Added.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247180 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-07-05  Ryosuke Niwa  <[email protected]>
+
+            [iOS] Crash in WebKit::WebPage::positionInformation via Range::startPosition
+            https://bugs.webkit.org/show_bug.cgi?id=199503
+
+            Reviewed by Wenson Hsieh.
+
+            * editing/Editor.cpp:
+            (WebCore::Editor::compositionRange const): Added a FIXME.
+
 2019-07-05  Babak Shafiei  <[email protected]>
 
         Revert r247115. rdar://problem/51288898

Modified: branches/safari-608.1.34.0-branch/Source/WebCore/editing/Editor.cpp (247260 => 247261)


--- branches/safari-608.1.34.0-branch/Source/WebCore/editing/Editor.cpp	2019-07-09 17:44:11 UTC (rev 247260)
+++ branches/safari-608.1.34.0-branch/Source/WebCore/editing/Editor.cpp	2019-07-09 17:46:03 UTC (rev 247261)
@@ -3077,6 +3077,7 @@
     unsigned length = m_compositionNode->length();
     unsigned start = std::min(m_compositionStart, length);
     unsigned end = std::min(std::max(start, m_compositionEnd), length);
+    // FIXME: Why is this early return neeed?
     if (start >= end)
         return nullptr;
     return Range::create(m_compositionNode->document(), m_compositionNode.get(), start, m_compositionNode.get(), end);

Modified: branches/safari-608.1.34.0-branch/Source/WebKit/ChangeLog (247260 => 247261)


--- branches/safari-608.1.34.0-branch/Source/WebKit/ChangeLog	2019-07-09 17:44:11 UTC (rev 247260)
+++ branches/safari-608.1.34.0-branch/Source/WebKit/ChangeLog	2019-07-09 17:46:03 UTC (rev 247261)
@@ -1,3 +1,74 @@
+2019-07-09  Alan Coon  <[email protected]>
+
+        Cherry-pick r247180. rdar://problem/51597945
+
+    [iOS] Crash in WebKit::WebPage::positionInformation via Range::startPosition
+    https://bugs.webkit.org/show_bug.cgi?id=199503
+    
+    Reviewed by Wenson Hsieh.
+    
+    Source/WebCore:
+    
+    * editing/Editor.cpp:
+    (WebCore::Editor::compositionRange const): Added a FIXME.
+    
+    Source/WebKit:
+    
+    The crash was caused because focusedElementPositionInformation asssumes Editor::compositionRange is not null
+    whenever Editor::hasComposition returns true, which is not necessary the case when Editor::m_compositionNode
+    contains no text (data is of length 0).
+    
+    Fixed the crash by adding an early return for when Editor::compositionRange returns nullptr.
+    
+    * WebProcess/WebPage/ios/WebPageIOS.mm:
+    (WebKit::focusedElementPositionInformation):
+    
+    Tools:
+    
+    Added UIScriptController.ensurePositionInformationIsUpToDateAt using the existing WKWebView SPI:
+    _requestActivatedElementAtPosition
+    
+    * DumpRenderTree/ios/UIScriptControllerIOS.mm:
+    (WTR::UIScriptController::ensurePositionInformationIsUpToDateAt):
+    * DumpRenderTree/mac/UIScriptControllerMac.mm:
+    (WTR::UIScriptController::ensurePositionInformationIsUpToDateAt):
+    * TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
+    * TestRunnerShared/UIScriptContext/UIScriptController.cpp:
+    (WTR::UIScriptController::ensurePositionInformationIsUpToDateAt):
+    * TestRunnerShared/UIScriptContext/UIScriptController.h:
+    * WebKitTestRunner/ios/UIScriptControllerIOS.mm:
+    (WTR::UIScriptController::ensurePositionInformationIsUpToDateAt):
+    * WebKitTestRunner/ios/UIScriptControllerMac.mm:
+    (WTR::UIScriptController::ensurePositionInformationIsUpToDateAt):
+    
+    LayoutTests:
+    
+    Added a regression test for the crash.
+    
+    * editing/input/delete-text-in-composition-expected.txt: Added.
+    * editing/input/delete-text-in-composition.html: Added.
+    * resources/ui-helper.js:
+    (window.UIHelper.ensurePositionInformationUpdateForElement): Added.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247180 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-07-05  Ryosuke Niwa  <[email protected]>
+
+            [iOS] Crash in WebKit::WebPage::positionInformation via Range::startPosition
+            https://bugs.webkit.org/show_bug.cgi?id=199503
+
+            Reviewed by Wenson Hsieh.
+
+            The crash was caused because focusedElementPositionInformation asssumes Editor::compositionRange is not null
+            whenever Editor::hasComposition returns true, which is not necessary the case when Editor::m_compositionNode
+            contains no text (data is of length 0).
+
+            Fixed the crash by adding an early return for when Editor::compositionRange returns nullptr.
+
+            * WebProcess/WebPage/ios/WebPageIOS.mm:
+            (WebKit::focusedElementPositionInformation):
+
 2019-07-08  Alan Coon  <[email protected]>
 
         Cherry-pick r247192. rdar://problem/52563665

Modified: branches/safari-608.1.34.0-branch/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (247260 => 247261)


--- branches/safari-608.1.34.0-branch/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2019-07-09 17:44:11 UTC (rev 247260)
+++ branches/safari-608.1.34.0-branch/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2019-07-09 17:46:03 UTC (rev 247261)
@@ -2505,6 +2505,9 @@
     VisiblePosition position = frame.visiblePositionForPoint(constrainedPoint);
 
     RefPtr<Range> compositionRange = frame.editor().compositionRange();
+    if (!compositionRange)
+        return;
+
     if (position < compositionRange->startPosition())
         position = compositionRange->startPosition();
     else if (position > compositionRange->endPosition())

Modified: branches/safari-608.1.34.0-branch/Tools/ChangeLog (247260 => 247261)


--- branches/safari-608.1.34.0-branch/Tools/ChangeLog	2019-07-09 17:44:11 UTC (rev 247260)
+++ branches/safari-608.1.34.0-branch/Tools/ChangeLog	2019-07-09 17:46:03 UTC (rev 247261)
@@ -1,3 +1,81 @@
+2019-07-09  Alan Coon  <[email protected]>
+
+        Cherry-pick r247180. rdar://problem/51597945
+
+    [iOS] Crash in WebKit::WebPage::positionInformation via Range::startPosition
+    https://bugs.webkit.org/show_bug.cgi?id=199503
+    
+    Reviewed by Wenson Hsieh.
+    
+    Source/WebCore:
+    
+    * editing/Editor.cpp:
+    (WebCore::Editor::compositionRange const): Added a FIXME.
+    
+    Source/WebKit:
+    
+    The crash was caused because focusedElementPositionInformation asssumes Editor::compositionRange is not null
+    whenever Editor::hasComposition returns true, which is not necessary the case when Editor::m_compositionNode
+    contains no text (data is of length 0).
+    
+    Fixed the crash by adding an early return for when Editor::compositionRange returns nullptr.
+    
+    * WebProcess/WebPage/ios/WebPageIOS.mm:
+    (WebKit::focusedElementPositionInformation):
+    
+    Tools:
+    
+    Added UIScriptController.ensurePositionInformationIsUpToDateAt using the existing WKWebView SPI:
+    _requestActivatedElementAtPosition
+    
+    * DumpRenderTree/ios/UIScriptControllerIOS.mm:
+    (WTR::UIScriptController::ensurePositionInformationIsUpToDateAt):
+    * DumpRenderTree/mac/UIScriptControllerMac.mm:
+    (WTR::UIScriptController::ensurePositionInformationIsUpToDateAt):
+    * TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
+    * TestRunnerShared/UIScriptContext/UIScriptController.cpp:
+    (WTR::UIScriptController::ensurePositionInformationIsUpToDateAt):
+    * TestRunnerShared/UIScriptContext/UIScriptController.h:
+    * WebKitTestRunner/ios/UIScriptControllerIOS.mm:
+    (WTR::UIScriptController::ensurePositionInformationIsUpToDateAt):
+    * WebKitTestRunner/ios/UIScriptControllerMac.mm:
+    (WTR::UIScriptController::ensurePositionInformationIsUpToDateAt):
+    
+    LayoutTests:
+    
+    Added a regression test for the crash.
+    
+    * editing/input/delete-text-in-composition-expected.txt: Added.
+    * editing/input/delete-text-in-composition.html: Added.
+    * resources/ui-helper.js:
+    (window.UIHelper.ensurePositionInformationUpdateForElement): Added.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247180 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-07-05  Ryosuke Niwa  <[email protected]>
+
+            [iOS] Crash in WebKit::WebPage::positionInformation via Range::startPosition
+            https://bugs.webkit.org/show_bug.cgi?id=199503
+
+            Reviewed by Wenson Hsieh.
+
+            Added UIScriptController.ensurePositionInformationIsUpToDateAt using the existing WKWebView SPI:
+            _requestActivatedElementAtPosition
+
+            * DumpRenderTree/ios/UIScriptControllerIOS.mm:
+            (WTR::UIScriptController::ensurePositionInformationIsUpToDateAt):
+            * DumpRenderTree/mac/UIScriptControllerMac.mm:
+            (WTR::UIScriptController::ensurePositionInformationIsUpToDateAt):
+            * TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
+            * TestRunnerShared/UIScriptContext/UIScriptController.cpp:
+            (WTR::UIScriptController::ensurePositionInformationIsUpToDateAt):
+            * TestRunnerShared/UIScriptContext/UIScriptController.h:
+            * WebKitTestRunner/ios/UIScriptControllerIOS.mm:
+            (WTR::UIScriptController::ensurePositionInformationIsUpToDateAt):
+            * WebKitTestRunner/ios/UIScriptControllerMac.mm:
+            (WTR::UIScriptController::ensurePositionInformationIsUpToDateAt):
+
 2019-07-04  Aakash Jain  <[email protected]>
 
         [ews-build] Remove GTK and WPE queue from old EWS and dashboard

Modified: branches/safari-608.1.34.0-branch/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm (247260 => 247261)


--- branches/safari-608.1.34.0-branch/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm	2019-07-09 17:44:11 UTC (rev 247260)
+++ branches/safari-608.1.34.0-branch/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm	2019-07-09 17:46:03 UTC (rev 247261)
@@ -63,6 +63,11 @@
     doAsyncTask(callback);
 }
 
+void UIScriptController::ensurePositionInformationIsUpToDateAt(long x, long y, JSValueRef callback)
+{
+    return doAsyncTask(callback);
+}
+
 void UIScriptController::doAfterVisibleContentRectUpdate(JSValueRef callback)
 {
     doAsyncTask(callback);

Modified: branches/safari-608.1.34.0-branch/Tools/DumpRenderTree/mac/UIScriptControllerMac.mm (247260 => 247261)


--- branches/safari-608.1.34.0-branch/Tools/DumpRenderTree/mac/UIScriptControllerMac.mm	2019-07-09 17:44:11 UTC (rev 247260)
+++ branches/safari-608.1.34.0-branch/Tools/DumpRenderTree/mac/UIScriptControllerMac.mm	2019-07-09 17:46:03 UTC (rev 247261)
@@ -61,6 +61,11 @@
     doAsyncTask(callback);
 }
 
+void UIScriptController::ensurePositionInformationIsUpToDateAt(long x, long y, JSValueRef callback)
+{
+    doAsyncTask(callback);
+}
+
 void UIScriptController::doAfterVisibleContentRectUpdate(JSValueRef callback)
 {
     doAsyncTask(callback);

Modified: branches/safari-608.1.34.0-branch/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl (247260 => 247261)


--- branches/safari-608.1.34.0-branch/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl	2019-07-09 17:44:11 UTC (rev 247260)
+++ branches/safari-608.1.34.0-branch/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl	2019-07-09 17:46:03 UTC (rev 247261)
@@ -45,7 +45,7 @@
 
     void doAfterPresentationUpdate(object callback); // Call the callback after sending a message to the WebProcess and receiving a subsequent update.
     void doAfterNextStablePresentationUpdate(object callback);
-
+    void ensurePositionInformationIsUpToDateAt(long x, long y, object callback);
     void doAfterVisibleContentRectUpdate(object callback);
 
     void simulateAccessibilitySettingsChangeNotification(object callback);

Modified: branches/safari-608.1.34.0-branch/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp (247260 => 247261)


--- branches/safari-608.1.34.0-branch/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp	2019-07-09 17:44:11 UTC (rev 247260)
+++ branches/safari-608.1.34.0-branch/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp	2019-07-09 17:46:03 UTC (rev 247261)
@@ -101,6 +101,10 @@
 {
 }
 
+void UIScriptController::ensurePositionInformationIsUpToDateAt(long x, long y, JSValueRef)
+{
+}
+
 void UIScriptController::doAfterVisibleContentRectUpdate(JSValueRef)
 {
 }

Modified: branches/safari-608.1.34.0-branch/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h (247260 => 247261)


--- branches/safari-608.1.34.0-branch/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h	2019-07-09 17:44:11 UTC (rev 247260)
+++ branches/safari-608.1.34.0-branch/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h	2019-07-09 17:46:03 UTC (rev 247261)
@@ -67,6 +67,7 @@
     void doAsyncTask(JSValueRef callback);
     void doAfterPresentationUpdate(JSValueRef callback);
     void doAfterNextStablePresentationUpdate(JSValueRef callback);
+    void ensurePositionInformationIsUpToDateAt(long x, long y, JSValueRef callback);
     void doAfterVisibleContentRectUpdate(JSValueRef callback);
 
     void zoomToScale(double scale, JSValueRef callback);

Modified: branches/safari-608.1.34.0-branch/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm (247260 => 247261)


--- branches/safari-608.1.34.0-branch/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm	2019-07-09 17:44:11 UTC (rev 247260)
+++ branches/safari-608.1.34.0-branch/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm	2019-07-09 17:46:03 UTC (rev 247261)
@@ -157,6 +157,18 @@
     }];
 }
 
+void UIScriptController::ensurePositionInformationIsUpToDateAt(long x, long y, JSValueRef callback)
+{
+    TestRunnerWKWebView *webView = TestController::singleton().mainWebView()->platformView();
+
+    unsigned callbackID = m_context->prepareForAsyncTask(callback, CallbackTypeNonPersistent);
+    [webView _requestActivatedElementAtPosition:CGPointMake(x, y) completionBlock:^(_WKActivatedElementInfo *) {
+        if (!m_context)
+            return;
+        m_context->asyncTaskComplete(callbackID);
+    }];
+}
+
 void UIScriptController::doAfterVisibleContentRectUpdate(JSValueRef callback)
 {
     TestRunnerWKWebView *webView = TestController::singleton().mainWebView()->platformView();

Modified: branches/safari-608.1.34.0-branch/Tools/WebKitTestRunner/mac/UIScriptControllerMac.mm (247260 => 247261)


--- branches/safari-608.1.34.0-branch/Tools/WebKitTestRunner/mac/UIScriptControllerMac.mm	2019-07-09 17:44:11 UTC (rev 247260)
+++ branches/safari-608.1.34.0-branch/Tools/WebKitTestRunner/mac/UIScriptControllerMac.mm	2019-07-09 17:46:03 UTC (rev 247261)
@@ -59,6 +59,11 @@
     doAsyncTask(callback);
 }
 
+void UIScriptController::ensurePositionInformationIsUpToDateAt(long, long, JSValueRef callback)
+{
+    doAsyncTask(callback);
+}
+
 void UIScriptController::doAfterVisibleContentRectUpdate(JSValueRef callback)
 {
     doAsyncTask(callback);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to