[webkit-reviews] review denied: [Bug 234113] Do not immediately execute an event if another event is ongoing : [Attachment 446644] patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Dec 10 07:58:15 PST 2021
Chris Dumez <cdumez at apple.com> has denied Brandon <brandonstewart at apple.com>'s
request for review:
Bug 234113: Do not immediately execute an event if another event is ongoing
https://bugs.webkit.org/show_bug.cgi?id=234113
Attachment 446644: patch
https://bugs.webkit.org/attachment.cgi?id=446644&action=review
--- Comment #5 from Chris Dumez <cdumez at apple.com> ---
Comment on attachment 446644
--> https://bugs.webkit.org/attachment.cgi?id=446644
patch
View in context: https://bugs.webkit.org/attachment.cgi?id=446644&action=review
> Source/WebCore/html/HTMLImageLoader.cpp:64
> +
element().document().queueTaskToDispatchEvent(TaskSource::DOMManipulation,
WTFMove(event));
I was wrong, despite us setting the event target,
Document::queueTaskToDispatchEvent() will dispatch the event at the Document
(not the image element).
You'll likely need to do something like this instead:
```
element.document().eventLoop().queueTask(TaskSource::DOMManipulation, [element
= Ref { element() }, errorOccurred] {
element.dispatchEvent(Event::create(errorOccurred ? eventNames().errorEvent
: eventNames().loadEvent, Event::CanBubble::No, Event::IsCancelable::No));
});
```
More information about the webkit-reviews
mailing list