Skip to content

Commit

Permalink
REGRESSION (259678@main): [ iOS17 ] ASSERTION FAILED: task.callback f…
Browse files Browse the repository at this point in the history
…or fast/dom/Orientation/no-orientation-change-event-when-unparenting-view.html result of a consistent crash

https://bugs.webkit.org/show_bug.cgi?id=267934
rdar://121454476

Reviewed by Ryosuke Niwa.

Make sure we clear the `rotationDidEndCallback` delegate on the WKWebView once
it has been called. Otherwise, we may end up trying to call the callback several
times, which would hit the assertion we were seeing.

* Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptControllerIOS::simulateRotation):

Canonical link: https://commits.webkit.org/275423@main
  • Loading branch information
cdumez committed Feb 28, 2024
1 parent 9a69a50 commit f42d30f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1110,9 +1110,9 @@ static UIDeviceOrientation toUIDeviceOrientation(DeviceOrientation orientation)
{
auto callbackID = m_context->prepareForAsyncTask(callback, CallbackTypeNonPersistent);
webView().rotationDidEndCallback = makeBlockPtr([this, protectedThis = Ref { *this }, callbackID] {
if (!m_context)
return;
m_context->asyncTaskComplete(callbackID);
if (m_context)
m_context->asyncTaskComplete(callbackID);
webView().rotationDidEndCallback = nil;
}).get();

#if HAVE(UI_WINDOW_SCENE_GEOMETRY_PREFERENCES)
Expand Down

0 comments on commit f42d30f

Please sign in to comment.