RESOLVED FIXED Bug 122143
Document::dispatchFullScreenChangeOrErrorEvent repeats the same loop twice
https://bugs.webkit.org/show_bug.cgi?id=122143
Summary Document::dispatchFullScreenChangeOrErrorEvent repeats the same loop twice
Ryosuke Niwa
Reported 2013-10-01 00:59:18 PDT
Cleanup Document::dispatchFullScreenChangeOrErrorEvent
Attachments
Cleanup (4.31 KB, patch)
2013-10-01 00:59 PDT, Ryosuke Niwa
no flags
Updated per comments (4.22 KB, patch)
2013-10-01 11:46 PDT, Ryosuke Niwa
no flags
Ryosuke Niwa
Comment 1 2013-10-01 00:59:55 PDT
Darin Adler
Comment 2 2013-10-01 01:16:44 PDT
Comment on attachment 213063 [details] Cleanup View in context: https://bugs.webkit.org/attachment.cgi?id=213063&action=review > Source/WebCore/dom/Document.cpp:5405 > - if (!contains(node.get()) && !node->inDocument()) > + if (!node->inDocument() && &node->document() == this) This new code is very different from the old. I don’t understand this change at all.
Ryosuke Niwa
Comment 3 2013-10-01 01:42:10 PDT
(In reply to comment #2) > (From update of attachment 213063 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=213063&action=review > > > Source/WebCore/dom/Document.cpp:5405 > > - if (!contains(node.get()) && !node->inDocument()) > > + if (!node->inDocument() && &node->document() == this) > > This new code is very different from the old. I don’t understand this change at all. Not really. We're looking for a node that is detached from a document that hasn't been inserted into any other document yet.
Andrei Bucur
Comment 4 2013-10-01 04:42:17 PDT
Comment on attachment 213063 [details] Cleanup View in context: https://bugs.webkit.org/attachment.cgi?id=213063&action=review >>> Source/WebCore/dom/Document.cpp:5405 >>> + if (!node->inDocument() && &node->document() == this) >> >> This new code is very different from the old. I don’t understand this change at all. > > Not really. We're looking for a node that is detached from a document that hasn't been inserted into any other document yet. Not convinced it's the same. Correct me if I'm wrong (I'm not familiar with the spec): Before the change, the code was taking a snapshot of the change queue, a snapshot of the error queue and then it dispatched the events to the change queue and then to the error queue. After the change, you snapshot the change queue, dispatch the events, snapshot the error queue and dispatch the events. Is it possible to change the error queue while dispatching the change events? If true, with the initial code this was invisible to the error queue because it was copied before any dispatch took place.
Ryosuke Niwa
Comment 5 2013-10-01 11:41:03 PDT
(In reply to comment #4) > Not convinced it's the same. Correct me if I'm wrong (I'm not familiar with the spec): > Before the change, the code was taking a snapshot of the change queue, a snapshot of the error queue and then it dispatched the events to the change queue and then to the error queue. > After the change, you snapshot the change queue, dispatch the events, snapshot the error queue and dispatch the events. Is it possible to change the error queue while dispatching the change events? > If true, with the initial code this was invisible to the error queue because it was copied before any dispatch took place. That's a separate concern than the one Darin pointed out but it's a valid one. Will fix.
Ryosuke Niwa
Comment 6 2013-10-01 11:46:08 PDT
Created attachment 213103 [details] Updated per comments
WebKit Commit Bot
Comment 7 2013-10-01 14:10:47 PDT
Comment on attachment 213103 [details] Updated per comments Clearing flags on attachment: 213103 Committed r156733: <http://trac.webkit.org/changeset/156733>
WebKit Commit Bot
Comment 8 2013-10-01 14:10:51 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.