[Webkit-unassigned] [Bug 234113] Do not immediately execute an event if another event is ongoing
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Dec 10 07:58:15 PST 2021
https://bugs.webkit.org/show_bug.cgi?id=234113
Chris Dumez <cdumez at apple.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #446644|review? |review-
Flags| |
--- 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));
});
```
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20211210/e2464033/attachment.htm>
More information about the webkit-unassigned
mailing list