)]}' { "commit": "45249b19c12d1b35861209062b2b19bc3a714a9c", "tree": "83b51bbe66c96b23d0732d64b79d33b0764caaa3", "parents": [ "07d16c5b09b13ea13587fc97899c29619a02f304" ], "author": { "name": "wenson_hsieh@apple.com", "email": "wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc", "time": "Sat Jan 15 00:56:22 2022 +0000" }, "committer": { "name": "wenson_hsieh@apple.com", "email": "wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc", "time": "Sat Jan 15 00:56:22 2022 +0000" }, "message": "[iOS] Occasional crash under -[UITargetedPreview initWithView:parameters:target:] when focusing form controls\nhttps://bugs.webkit.org/show_bug.cgi?id\u003d235248\nrdar://79220540\n\nReviewed by Tim Horton and Aditya Keerthi.\n\nSource/WebKit:\n\nIt\u0027s possible for `-resizableSnapshotViewFromRect:afterScreenUpdates:withCapInsets:` to return a `nil` snapshot\nview in the case where a screen update has not been performed yet (among other scenarios). In the case where\nUIKit returns `nil` when we\u0027re creating the targeted preview for the context menu when focusing a select element\nor file input, we\u0027ll crash due to an Objective-C exception in the initializer of UITargetedPreview. Mitigate\nthis by falling back to an empty UIView after requesting the snapshot view to make our code robust against this\nscenario.\n\nTest: KeyboardInputTests.DoNotCrashWhenFocusingSelectWithoutViewSnapshot\n\n* UIProcess/ios/WKContentViewInteraction.mm:\n(createFallbackTargetedPreview):\n\nTools:\n\nAdd an API test that exercises the crash by forcing `-resizableSnapshotViewFromRect:afterScreenUpdates:withCapInsets:`\nto return nil via swizzling.\n\n* TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm:\n(TestWebKitAPI::nilResizableSnapshotViewFromRect):\n(TestWebKitAPI::TEST):\n\n\ngit-svn-id: http://svn.webkit.org/repository/webkit/trunk@288039 268f45cc-cd09-0410-ab3c-d52691b4dbfc\n", "tree_diff": [ { "type": "modify", "old_id": "83054a23e4fa111f7ae4001e7c15bf13bef2e6a0", "old_mode": 33188, "old_path": "Source/WebKit/ChangeLog", "new_id": "d49de30c94f83b3b07539c9abe81edf05db28643", "new_mode": 33188, "new_path": "Source/WebKit/ChangeLog" }, { "type": "modify", "old_id": "798755e7a501736c39063d29cf1dc68c1f58ef35", "old_mode": 33188, "old_path": "Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm", "new_id": "e7211bd5a92d2389e71ebac917752218e407dfd8", "new_mode": 33188, "new_path": "Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm" }, { "type": "modify", "old_id": "d61c34ee4e9b2fc913857698ff537e57732c3f65", "old_mode": 33188, "old_path": "Tools/ChangeLog", "new_id": "68ddf133fd1fde2948c093efa8d505dfc7aaa8bc", "new_mode": 33188, "new_path": "Tools/ChangeLog" }, { "type": "modify", "old_id": "1f5366d0801efe88aa4d0625391d0c83b79eadcd", "old_mode": 33188, "old_path": "Tools/TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm", "new_id": "84854dd7acb161f3bc704a83e71d85305e2f5626", "new_mode": 33188, "new_path": "Tools/TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm" } ] }