With input events on: - Start typing something in an editable area (e.g. “tes”). The candidate bar on iOS should show an autocompletion candidate (e.g. “test” or “testing”) - Select the candidate - Observe that `beforeinput` and `input` events of type “insertText” were fired, when they should really be of type “insertReplacementText”.
<rdar://problem/28987810>
Created attachment 293229 [details] Patch
Comment on attachment 293229 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=293229&action=review > Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm:260 > + ASSERT(index >= 0 && index < 3); This should not assert if it's possible for the JS to send in arbitrary values, but ideally it would trigger an error if too big. > Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm:283 > + float offsetX = (index * 2 + 1) * CGRectGetWidth(predictionViewFrame) / 6; > + float offsetY = CGRectGetHeight(webView.window.frame) - CGRectGetHeight([UIKeyboardPredictionView activeInstance].superview.frame) + CGRectGetHeight(predictionViewFrame) / 2; > + [[HIDEventGenerator sharedHIDEventGenerator] tap:CGPointMake(offsetX, offsetY) completionBlock:^{ > + if (m_context) > + m_context->asyncTaskComplete(callbackID); > + }]; Seems fragile in the face of UI changes, but oh well. > LayoutTests/fast/events/ios/before-input-events-prevent-candidate-insertion.html:16 > + uiController.singleTapAtPoint(100, 50, function() {}); You should get the coordinates via getBoundingClientRect, like other tests. > LayoutTests/fast/events/ios/input-events-insert-replacement-text.html:16 > + uiController.singleTapAtPoint(100, 100, function() {}); Ditto.
Created attachment 293244 [details] [For EWS] Fix DRT and implement feedback
Comment on attachment 293229 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=293229&action=review >> Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm:260 >> + ASSERT(index >= 0 && index < 3); > > This should not assert if it's possible for the JS to send in arbitrary values, but ideally it would trigger an error if too big. Yes, this is reasonable. There are a few other places where we should use exceptions (e.g. typeCharacterUsingHardwareKeyboard with an invalid string, or zoomToScale with a negative scale). I'll file a followup to make these throw exceptions on receiving bad arguments. >> Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm:283 >> + }]; > > Seems fragile in the face of UI changes, but oh well. I agree :( Since we want to eventually test using the software keyboard as well, we should reach out to the keyboards team and see if we can get any SPI to make this more robust. >> LayoutTests/fast/events/ios/before-input-events-prevent-candidate-insertion.html:16 >> + uiController.singleTapAtPoint(100, 50, function() {}); > > You should get the coordinates via getBoundingClientRect, like other tests. Sounds good! Done. >> LayoutTests/fast/events/ios/input-events-insert-replacement-text.html:16 >> + uiController.singleTapAtPoint(100, 100, function() {}); > > Ditto. Done.
Created attachment 293249 [details] [For EWS] Fix iOS OpenSource build.
Created attachment 293257 [details] Patch for landing
Comment on attachment 293257 [details] Patch for landing Clearing flags on attachment: 293257 Committed r208090: <http://trac.webkit.org/changeset/208090>
Build fix in r208094