Title: [288215] trunk
Revision
288215
Author
[email protected]
Date
2022-01-19 10:16:22 -0800 (Wed, 19 Jan 2022)

Log Message

Null check m_progressTracker in clearProvisionalLoad
https://bugs.webkit.org/show_bug.cgi?id=233063

Patch by Rob Buis <[email protected]> on 2022-01-19
Reviewed by Alex Christensen.

Source/WebCore:

Null check m_progressTracker in clearProvisionalLoad.

Test: fast/frames/contentFrame-disconnecting-crash.html

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::clearProvisionalLoad):

LayoutTests:

* platform/mac/fast/frames/contentFrame-disconnecting-crash-expected.txt: Added.
* platform/mac/fast/frames/contentFrame-disconnecting-crash.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (288214 => 288215)


--- trunk/LayoutTests/ChangeLog	2022-01-19 18:07:36 UTC (rev 288214)
+++ trunk/LayoutTests/ChangeLog	2022-01-19 18:16:22 UTC (rev 288215)
@@ -1,3 +1,13 @@
+2022-01-19  Rob Buis  <[email protected]>
+
+        Null check m_progressTracker in clearProvisionalLoad
+        https://bugs.webkit.org/show_bug.cgi?id=233063
+
+        Reviewed by Alex Christensen.
+
+        * platform/mac/fast/frames/contentFrame-disconnecting-crash-expected.txt: Added.
+        * platform/mac/fast/frames/contentFrame-disconnecting-crash.html: Added.
+
 2022-01-19  Alexey Shvayka  <[email protected]>
 
         Callback functions / interfaces should use global object of its _value_ for errors and lifecycle

Added: trunk/LayoutTests/platform/mac/fast/frames/contentFrame-disconnecting-crash-expected.txt (0 => 288215)


--- trunk/LayoutTests/platform/mac/fast/frames/contentFrame-disconnecting-crash-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/fast/frames/contentFrame-disconnecting-crash-expected.txt	2022-01-19 18:16:22 UTC (rev 288215)
@@ -0,0 +1 @@
+PASS: There was no crash.

Added: trunk/LayoutTests/platform/mac/fast/frames/contentFrame-disconnecting-crash.html (0 => 288215)


--- trunk/LayoutTests/platform/mac/fast/frames/contentFrame-disconnecting-crash.html	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/fast/frames/contentFrame-disconnecting-crash.html	2022-01-19 18:16:22 UTC (rev 288215)
@@ -0,0 +1,24 @@
+<script>
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    testRunner.waitUntilDone();
+}
+  _onload_ = () => {
+    let img = document.createElement('img');
+    img._onerror_ = () => {
+      document.execCommand('Undo');
+      document.write('PASS: There was no crash.');
+      testRunner.notifyDone();
+    };
+    img.src = '';
+    document.designMode = 'on';
+    document.execCommand('SelectAll');
+    document.execCommand('InsertImage', false, '#');
+    document.execCommand('SelectAll');
+    document.execCommand('Bold');
+    document.execCommand('Italic');
+    let embed = document.createElement('embed');
+    document.querySelector('i').appendChild(embed);
+    embed.src = '';
+  };
+</script>

Modified: trunk/Source/WebCore/ChangeLog (288214 => 288215)


--- trunk/Source/WebCore/ChangeLog	2022-01-19 18:07:36 UTC (rev 288214)
+++ trunk/Source/WebCore/ChangeLog	2022-01-19 18:16:22 UTC (rev 288215)
@@ -1,3 +1,17 @@
+2022-01-19  Rob Buis  <[email protected]>
+
+        Null check m_progressTracker in clearProvisionalLoad
+        https://bugs.webkit.org/show_bug.cgi?id=233063
+
+        Reviewed by Alex Christensen.
+
+        Null check m_progressTracker in clearProvisionalLoad.
+
+        Test: fast/frames/contentFrame-disconnecting-crash.html
+
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::clearProvisionalLoad):
+
 2022-01-19  Youenn Fablet  <[email protected]>
 
         Improve computation of service worker FetchEvent.resultingClientId

Modified: trunk/Source/WebCore/loader/FrameLoader.cpp (288214 => 288215)


--- trunk/Source/WebCore/loader/FrameLoader.cpp	2022-01-19 18:07:36 UTC (rev 288214)
+++ trunk/Source/WebCore/loader/FrameLoader.cpp	2022-01-19 18:16:22 UTC (rev 288215)
@@ -1998,7 +1998,8 @@
 {
     FRAMELOADER_RELEASE_LOG(ResourceLoading, "clearProvisionalLoad: Clearing provisional document loader (m_provisionalDocumentLoader=%p)", m_provisionalDocumentLoader.get());
     setProvisionalDocumentLoader(nullptr);
-    m_progressTracker->progressCompleted();
+    if (m_progressTracker)
+        m_progressTracker->progressCompleted();
     setState(FrameState::Complete);
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to