Title: [248643] branches/safari-608-branch/Tools
Revision
248643
Author
ryanhad...@apple.com
Date
2019-08-13 16:58:45 -0700 (Tue, 13 Aug 2019)

Log Message

Cherry-pick r248496. rdar://problem/54280310

    KeyboardInputTests.CaretSelectionRectAfterRestoringFirstResponder API tests time out on iPad
    https://bugs.webkit.org/show_bug.cgi?id=200604
    <rdar://problem/51273130>

    Reviewed by Megan Gardner.

    Tweak some API tests so that they work on iPad simulator. These tests checked that the final caret rect was
    {{16, 13}, {2, 15}}; however, this is only correct behavior on iPhone, where we will scale the page so that the
    focused element's font size is legible. Note that when the page is scaled, we scale the height but not the
    width of the caret, which is why the width of the caret (in content coordinates) decreases while the height
    remains the same.

    We don't have the same behavior on iPad, so the expected caret rect is {{16, 13}, {3, 15}}, which is equal to
    the caret rect at initial scale 1.

    * TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm:

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

Modified Paths

Diff

Modified: branches/safari-608-branch/Tools/ChangeLog (248642 => 248643)


--- branches/safari-608-branch/Tools/ChangeLog	2019-08-13 23:31:19 UTC (rev 248642)
+++ branches/safari-608-branch/Tools/ChangeLog	2019-08-13 23:58:45 UTC (rev 248643)
@@ -1,3 +1,46 @@
+2019-08-13  Ryan Haddad  <ryanhad...@apple.com>
+
+        Cherry-pick r248496. rdar://problem/54280310
+
+    KeyboardInputTests.CaretSelectionRectAfterRestoringFirstResponder API tests time out on iPad
+    https://bugs.webkit.org/show_bug.cgi?id=200604
+    <rdar://problem/51273130>
+    
+    Reviewed by Megan Gardner.
+    
+    Tweak some API tests so that they work on iPad simulator. These tests checked that the final caret rect was
+    {{16, 13}, {2, 15}}; however, this is only correct behavior on iPhone, where we will scale the page so that the
+    focused element's font size is legible. Note that when the page is scaled, we scale the height but not the
+    width of the caret, which is why the width of the caret (in content coordinates) decreases while the height
+    remains the same.
+    
+    We don't have the same behavior on iPad, so the expected caret rect is {{16, 13}, {3, 15}}, which is equal to
+    the caret rect at initial scale 1.
+    
+    * TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm:
+    
+    
+    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@248496 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-08-09  Wenson Hsieh  <wenson_hs...@apple.com>
+
+            KeyboardInputTests.CaretSelectionRectAfterRestoringFirstResponder API tests time out on iPad
+            https://bugs.webkit.org/show_bug.cgi?id=200604
+            <rdar://problem/51273130>
+
+            Reviewed by Megan Gardner.
+
+            Tweak some API tests so that they work on iPad simulator. These tests checked that the final caret rect was
+            {{16, 13}, {2, 15}}; however, this is only correct behavior on iPhone, where we will scale the page so that the
+            focused element's font size is legible. Note that when the page is scaled, we scale the height but not the
+            width of the caret, which is why the width of the caret (in content coordinates) decreases while the height
+            remains the same.
+
+            We don't have the same behavior on iPad, so the expected caret rect is {{16, 13}, {3, 15}}, which is equal to
+            the caret rect at initial scale 1.
+
+            * TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm:
+
 2019-08-13  Alan Coon  <alanc...@apple.com>
 
         Cherry-pick r248548. rdar://problem/54237813

Modified: branches/safari-608-branch/Tools/TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm (248642 => 248643)


--- branches/safari-608-branch/Tools/TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm	2019-08-13 23:31:19 UTC (rev 248642)
+++ branches/safari-608-branch/Tools/TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm	2019-08-13 23:58:45 UTC (rev 248643)
@@ -325,7 +325,8 @@
 
 TEST(KeyboardInputTests, CaretSelectionRectAfterRestoringFirstResponderWithRetainActiveFocusedState)
 {
-    auto expectedCaretRect = CGRectMake(16, 13, 2, 15);
+    // This difference in caret width is due to the fact that we don't zoom in to the input field on iPad, but do on iPhone.
+    auto expectedCaretRect = CGRectMake(16, 13, UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad ? 3 : 2, 15);
     auto webView = webViewWithAutofocusedInput();
     EXPECT_WK_STREQ("INPUT", [webView stringByEvaluatingJavaScript:@"document.activeElement.tagName"]);
     [webView waitForCaretViewFrameToBecome:expectedCaretRect];
@@ -360,7 +361,8 @@
 
 TEST(KeyboardInputTests, CaretSelectionRectAfterRestoringFirstResponder)
 {
-    auto expectedCaretRect = CGRectMake(16, 13, 2, 15);
+    // This difference in caret width is due to the fact that we don't zoom in to the input field on iPad, but do on iPhone.
+    auto expectedCaretRect = CGRectMake(16, 13, UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad ? 3 : 2, 15);
     auto webView = webViewWithAutofocusedInput();
     EXPECT_WK_STREQ("INPUT", [webView stringByEvaluatingJavaScript:@"document.activeElement.tagName"]);
     [webView waitForCaretViewFrameToBecome:expectedCaretRect];
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to