Skip to content

Commit

Permalink
REGRESSION (270359@main): [ macOS wk1 ] ASSERTION FAILED: ownerDocume…
Browse files Browse the repository at this point in the history
…nt->loader() /Volumes/Data/worker/Apple-Sonoma-Debug-Build/build/Source/WebCore/bindings/js/ScriptController.cpp

https://bugs.webkit.org/show_bug.cgi?id=265403
rdar://118850236

Unreviewed, very partial revert of 270359@main to address the regression.

* Source/WebCore/bindings/js/ScriptController.cpp:
(WebCore::ScriptController::executeJavaScriptURL):

Canonical link: https://commits.webkit.org/271174@main
  • Loading branch information
cdumez committed Nov 27, 2023
1 parent c68f7ca commit cbfb2e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/WebCore/bindings/js/ScriptController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,7 @@ void ScriptController::executeJavaScriptURL(const URL& url, RefPtr<SecurityOrigi
// http://bugs.webkit.org/show_bug.cgi?id=16782
if (shouldReplaceDocumentIfJavaScriptURL == ReplaceDocumentIfJavaScriptURL) {
// We're still in a frame, so there should be a DocumentLoader.
ASSERT(ownerDocument->loader());
ASSERT(m_frame.document()->loader());

// Signal to FrameLoader to disable navigations within this frame while replacing it with the result of executing javascript
// FIXME: https://bugs.webkit.org/show_bug.cgi?id=200523
Expand All @@ -868,7 +868,7 @@ void ScriptController::executeJavaScriptURL(const URL& url, RefPtr<SecurityOrigi

// DocumentWriter::replaceDocumentWithResultOfExecutingJavascriptURL can cause the DocumentLoader to get deref'ed and possible destroyed,
// so protect it with a RefPtr.
if (RefPtr loader = ownerDocument->loader()) {
if (RefPtr loader = m_frame.document()->loader()) {
loader->writer().replaceDocumentWithResultOfExecutingJavascriptURL(scriptResult, ownerDocument.get());
didReplaceDocument = true;
}
Expand Down

0 comments on commit cbfb2e4

Please sign in to comment.