Title: [291650] branches/safari-613-branch/Source/WebCore
Revision
291650
Author
alanc...@apple.com
Date
2022-03-22 10:55:40 -0700 (Tue, 22 Mar 2022)

Log Message

Cherry-pick r290878. rdar://problem/89000777

    Release_Assert | WebCore::Document::addTopLayerElement()
    https://bugs.webkit.org/show_bug.cgi?id=237307

    Patch by Frédéric Wang <fw...@igalia.com> on 2022-03-07
    Reviewed by Chris Dumez.

    setBooleanAttribute() call in HTMLDialogElement::showModal() dispatches a DOMSubtreeModified
    event. Postpone it so that listeners cannot disconnect the dialog element.

    * html/HTMLDialogElement.cpp:
    (WebCore::HTMLDialogElement::showModal): Add a queue to postpone event.

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290878 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-613-branch/Source/WebCore/ChangeLog (291649 => 291650)


--- branches/safari-613-branch/Source/WebCore/ChangeLog	2022-03-22 17:55:37 UTC (rev 291649)
+++ branches/safari-613-branch/Source/WebCore/ChangeLog	2022-03-22 17:55:40 UTC (rev 291650)
@@ -1,5 +1,36 @@
 2022-03-21  Alan Coon  <alanc...@apple.com>
 
+        Cherry-pick r290878. rdar://problem/89000777
+
+    Release_Assert | WebCore::Document::addTopLayerElement()
+    https://bugs.webkit.org/show_bug.cgi?id=237307
+    
+    Patch by Frédéric Wang <fw...@igalia.com> on 2022-03-07
+    Reviewed by Chris Dumez.
+    
+    setBooleanAttribute() call in HTMLDialogElement::showModal() dispatches a DOMSubtreeModified
+    event. Postpone it so that listeners cannot disconnect the dialog element.
+    
+    * html/HTMLDialogElement.cpp:
+    (WebCore::HTMLDialogElement::showModal): Add a queue to postpone event.
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2022-03-07  Frédéric Wang  <fw...@igalia.com>
+
+            Release_Assert | WebCore::Document::addTopLayerElement()
+            https://bugs.webkit.org/show_bug.cgi?id=237307
+
+            Reviewed by Chris Dumez.
+
+            setBooleanAttribute() call in HTMLDialogElement::showModal() dispatches a DOMSubtreeModified
+            event. Postpone it so that listeners cannot disconnect the dialog element.
+
+            * html/HTMLDialogElement.cpp:
+            (WebCore::HTMLDialogElement::showModal): Add a queue to postpone event.
+
+2022-03-21  Alan Coon  <alanc...@apple.com>
+
         Cherry-pick r290856. rdar://problem/89569036
 
     REGRESSION (r284472): [ Monterey ] http/tests/websocket/tests/hybi/inspector/send-and-recieve-debugger.html is failing

Modified: branches/safari-613-branch/Source/WebCore/html/HTMLDialogElement.cpp (291649 => 291650)


--- branches/safari-613-branch/Source/WebCore/html/HTMLDialogElement.cpp	2022-03-22 17:55:37 UTC (rev 291649)
+++ branches/safari-613-branch/Source/WebCore/html/HTMLDialogElement.cpp	2022-03-22 17:55:40 UTC (rev 291650)
@@ -33,6 +33,7 @@
 #include "GCReachableRef.h"
 #include "HTMLNames.h"
 #include "RenderElement.h"
+#include "ScopedEventQueue.h"
 #include "TypedElementDescendantIterator.h"
 #include <wtf/IsoMallocInlines.h>
 
@@ -70,6 +71,9 @@
     if (!isConnected())
         return Exception { InvalidStateError };
 
+    // setBooleanAttribute will dispatch a DOMSubtreeModified event.
+    // Postpone callback execution that can potentially make the dialog disconnected.
+    EventQueueScope scope;
     setBooleanAttribute(openAttr, true);
 
     m_isModal = true;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to