[webkit-reviews] review granted: [Bug 45586] Having an empty listener to beforeload events changes the behavior of other scripts : [Attachment 107152] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Sep 13 08:35:35 PDT 2011


Darin Adler <darin at apple.com> has granted mitz at webkit.org's request for review:
Bug 45586: Having an empty listener to beforeload events changes the behavior
of other scripts
https://bugs.webkit.org/show_bug.cgi?id=45586

Attachment 107152: Patch
https://bugs.webkit.org/attachment.cgi?id=107152&action=review

------- Additional Comments from Darin Adler <darin at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=107152&action=review


> Source/WebCore/loader/ImageLoader.cpp:209
>	       if
(!m_element->document()->hasListenerType(Document::BEFORELOAD_LISTENER))
>		   dispatchPendingBeforeLoadEvent();
>	       else
>		   beforeLoadEventSender().dispatchEventSoon(this);
> +	       newImage->addClient(this);

I think it’s worth adding a comment here. It’s probably not obvious to most
readers that addClient often results in a load event dispatch and that the
order here is important so that beforeload goes before load. A brief "why"
comment could make that clear without making the code unpleasant.


More information about the webkit-reviews mailing list