Steps to reproduce: Using a hardware keyboard. 1. Load a PDF 2. Press the Command key on the keyboard. Then assert !(_keyboardFlags & WebEventKeyboardInputModifierFlagsChanged) fails in -[WebEvent charactersIgnoringModifiers]: [[ #1 0x000000011ab0c3b0 in WTFCrashWithInfo(int, char const*, char const*, int) at /Volumes/.../Source/WTF/wtf/Assertions.h:671 #2 0x000000011e1f8e58 in -[WebEvent charactersIgnoringModifiers] at /Volumes/.../Source/WebCore/platform/ios/WebEvent.mm:389 #3 0x000000010921c908 in -[WKKeyboardScrollingAnimator keyboardScrollForEvent:] at /Volumes/.../Source/WebKit/UIProcess/ios/WKKeyboardScrollingAnimator.mm:187 #4 0x000000010921d320 in -[WKKeyboardScrollingAnimator beginWithEvent:] at /Volumes/.../Source/WebKit/UIProcess/ios/WKKeyboardScrollingAnimator.mm:314 #5 0x000000010921eca8 in -[WKKeyboardScrollViewAnimator beginWithEvent:] at /Volumes/.../Source/WebKit/UIProcess/ios/WKKeyboardScrollingAnimator.mm:546 #6 0x0000000109222e5c in -[WKPDFView web_handleKeyEvent:] at /Volumes/.../Source/WebKit/UIProcess/ios/WKPDFView.mm:96 #7 0x0000000108d97a0c in -[WKWebView(WKViewInternalIOS) _handleKeyUIEvent:] at /Volumes/.../Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm:443 ... ]]
Created attachment 398561 [details] Patch
Tried to write a test, but it timesout: [[ <!DOCTYPE html><!-- webkit-test-runner [ enableBackForwardCache=true ] --> <html> <head> <script> if (!window.testRunner) document.write("Must run in WebKitTestRunner"); else { testRunner.dumpAsText(); testRunner.queueLoad("resources/test.pdf"); testRunner.queueLoadingScript('testRunner.runUIScript(`uiController.keyDown("", ["leftCommand"])`, () => { testRunner.queueBackNavigation(1); })'); } </script> </head> <body>PASS</body> </html> ]]
(In reply to Daniel Bates from comment #2) > Tried to write a test, but it timesout: > > [[ > <!DOCTYPE html><!-- webkit-test-runner [ enableBackForwardCache=true ] --> > <html> > <head> > <script> > if (!window.testRunner) > document.write("Must run in WebKitTestRunner"); > else { > testRunner.dumpAsText(); > testRunner.queueLoad("resources/test.pdf"); > > testRunner.queueLoadingScript('testRunner.runUIScript(`uiController. > keyDown("", ["leftCommand"])`, () => { testRunner.queueBackNavigation(1); > })'); > } > </script> > </head> > <body>PASS</body> > </html> > ]] ^^^ Test triggers to assertion failure without the patch, but times out with the patch.
(In reply to Daniel Bates from comment #3) > (In reply to Daniel Bates from comment #2) > > Tried to write a test, but it timesout: > > > > [[ > > <!DOCTYPE html><!-- webkit-test-runner [ enableBackForwardCache=true ] --> > > <html> > > <head> > > <script> > > if (!window.testRunner) > > document.write("Must run in WebKitTestRunner"); > > else { > > testRunner.dumpAsText(); > > testRunner.queueLoad("resources/test.pdf"); > > > > testRunner.queueLoadingScript('testRunner.runUIScript(`uiController. > > keyDown("", ["leftCommand"])`, () => { testRunner.queueBackNavigation(1); > > })'); > > } > > </script> > > </head> > > <body>PASS</body> > > </html> > > ]] > > ^^^ Test triggers to assertion failure without the patch, but times out with > the patch. My guess, timeout because testRunner.queueLoadingScript() just eval()s the string, but that string, registers a callback, which is never run. I need to wait until the UI process has processed the script though...
Comment on attachment 398561 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=398561&action=review > Source/WebKit/ChangeLog:12 > + I tried to write a test for this using testRunner.queueLoad() and queueLoadingScript(), > + but I couldn't get it to not timeout. For some reason script execution doesn't seem to > + work after loading the PDF. Hope you haven’t given up entirely.
Created attachment 398571 [details] Patch and test Now with a test.
Thanks for the review, Darin.
Comment on attachment 398571 [details] Patch and test Clearing flags on attachment: 398571 Committed r261240: <https://trac.webkit.org/changeset/261240>
All reviewed patches have been landed. Closing bug.
<rdar://problem/62938942>