Initial crash is due to re-entrancy in function didBecomeCurrentDocumentInFrame. The re-entrancy was addressed with below change Style::PostResolutionCallbackDisabler disabler(*newDocument); WidgetHierarchyUpdatesSuspensionScope suspendWidgetHierarchyUpdates; ScriptDisallowedScope::InMainThread scriptDisallowedScope; But due to an orphan frame access later the crash was observed in initContentSecurityPolicy.
Created attachment 391574 [details] Patch
Ugh... looks like this patch broke WK1 :(
Comment on attachment 391574 [details] Patch r- because tests are failing. We need to figure out why.
<rdar://problem/57161887>