WebKit Bugzilla
Attachment 346635 Details for
Bug 188322
: [iOS] Caret disappears after resigning and becoming first responder if active focus state is retained
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Adjust the API test
bug-188322-20180806110629.patch (text/plain), 3.15 KB, created by
Wenson Hsieh
on 2018-08-06 11:06:30 PDT
(
hide
)
Description:
Adjust the API test
Filename:
MIME Type:
Creator:
Wenson Hsieh
Created:
2018-08-06 11:06:30 PDT
Size:
3.15 KB
patch
obsolete
>Subversion Revision: 234601 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 658bd91077a5d47a7a0aa2138f14d8dd56ec1bd9..4aa60444e92e5756f60b809006d1b3692ca2a73c 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,20 @@ >+2018-08-06 Wenson Hsieh <wenson_hsieh@apple.com> >+ >+ [iOS] Caret disappears after resigning and becoming first responder if active focus state is retained >+ https://bugs.webkit.org/show_bug.cgi?id=188322 >+ <rdar://problem/42455270> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Fixes an API test added in r234600, which had incorrect test expectations â namely, the width of the caret rect >+ was not in content view coordinates, unlike the x, y, and height. >+ >+ * TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm: >+ (rounded): >+ (-[TestWKWebView waitForCaretViewFrameToBecome:]): >+ (-[TestWKWebView waitForSelectionViewRectsToBecome:]): >+ (TestWebKitAPI::TEST): >+ > 2018-08-06 Wenson Hsieh <wenson_hsieh@apple.com> > > [iOS] Tests that try to interact with the QuickType bar time out on iOS 11+ >diff --git a/Tools/TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm b/Tools/TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm >index 39bdba4c96d52e20fa7add3d57353257617494fc..c162b87d7ab3415e2d751d69c59a056b966334e8 100644 >--- a/Tools/TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm >+++ b/Tools/TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm >@@ -36,13 +36,18 @@ > > @implementation TestWKWebView (KeyboardInputTests) > >+static CGRect rounded(CGRect rect) >+{ >+ return CGRectMake(roundl(rect.origin.x), roundl(rect.origin.y), roundl(rect.size.width), roundl(rect.size.height)); >+} >+ > - (void)waitForCaretViewFrameToBecome:(CGRect)frame > { > BOOL hasEmittedWarning = NO; > NSTimeInterval secondsToWaitUntilWarning = 2; > NSTimeInterval startTime = [NSDate timeIntervalSinceReferenceDate]; > while ([[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantPast]]) { >- CGRect currentFrame = self.caretViewRectInContentCoordinates; >+ CGRect currentFrame = rounded(self.caretViewRectInContentCoordinates); > if (CGRectEqualToRect(currentFrame, frame)) > break; > >@@ -64,7 +69,7 @@ > BOOL selectionRectsMatch = YES; > if (currentRects.count == selectionRects.count) { > for (NSUInteger index = 0; index < selectionRects.count; ++index) >- selectionRectsMatch |= [selectionRects[index] isEqualToValue:currentRects[index]]; >+ selectionRectsMatch |= CGRectEqualToRect(selectionRects[index].CGRectValue, rounded(currentRects[index].CGRectValue)); > } else > selectionRectsMatch = NO; > >@@ -124,7 +129,7 @@ TEST(KeyboardInputTests, CanHandleKeyEventInCompletionHandler) > > TEST(KeyboardInputTests, CaretSelectionRectAfterRestoringFirstResponder) > { >- auto expectedCaretRect = CGRectMake(16, 13, 3, 15); >+ auto expectedCaretRect = CGRectMake(16, 13, 2, 15); > auto webView = webViewWithAutofocusedInput(); > EXPECT_WK_STREQ("INPUT", [webView stringByEvaluatingJavaScript:@"document.activeElement.tagName"]); > [webView waitForCaretViewFrameToBecome:expectedCaretRect];
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188322
:
346566
|
346569
|
346595
|
346596
|
346597
| 346635 |
346682