Title: [288450] trunk/Source/WebCore
Revision
288450
Author
[email protected]
Date
2022-01-24 09:38:07 -0800 (Mon, 24 Jan 2022)

Log Message

Remove customElements when transitioning documents
https://bugs.webkit.org/show_bug.cgi?id=222727

Patch by Rob Buis <[email protected]> on 2022-01-24
Reviewed by Ryosuke Niwa.

Remove customElements when transitioning documents
of Window since the old document may be gone.

Test: fast/js-promise/js-promise-invalid-context-access.html

* page/DOMWindow.cpp:
(WebCore::DOMWindow::didSecureTransitionTo):
(WebCore::DOMWindow::ensureCustomElementRegistry):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (288449 => 288450)


--- trunk/Source/WebCore/ChangeLog	2022-01-24 17:36:10 UTC (rev 288449)
+++ trunk/Source/WebCore/ChangeLog	2022-01-24 17:38:07 UTC (rev 288450)
@@ -1,3 +1,19 @@
+2022-01-24  Rob Buis  <[email protected]>
+
+        Remove customElements when transitioning documents
+        https://bugs.webkit.org/show_bug.cgi?id=222727
+
+        Reviewed by Ryosuke Niwa.
+
+        Remove customElements when transitioning documents
+        of Window since the old document may be gone.
+
+        Test: fast/js-promise/js-promise-invalid-context-access.html
+
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::didSecureTransitionTo):
+        (WebCore::DOMWindow::ensureCustomElementRegistry):
+
 2022-01-24  Carlos Garcia Campos  <[email protected]>
 
         [GTK][a11y] Do not expose the slider thumb to ATs with ATSPI

Modified: trunk/Source/WebCore/page/DOMWindow.cpp (288449 => 288450)


--- trunk/Source/WebCore/page/DOMWindow.cpp	2022-01-24 17:36:10 UTC (rev 288449)
+++ trunk/Source/WebCore/page/DOMWindow.cpp	2022-01-24 17:38:07 UTC (rev 288450)
@@ -403,6 +403,7 @@
     m_crypto = nullptr;
     m_navigator = nullptr;
     m_performance = nullptr;
+    m_customElementRegistry = nullptr;
 }
 
 void DOMWindow::prewarmLocalStorageIfNecessary()
@@ -571,6 +572,7 @@
 {
     if (!m_customElementRegistry)
         m_customElementRegistry = CustomElementRegistry::create(*this, scriptExecutionContext());
+    ASSERT(m_customElementRegistry->scriptExecutionContext() == document());
     return *m_customElementRegistry;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to