Changeset 95228 in webkit
- Timestamp:
- Sep 15, 2011 2:21:11 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r95226 r95228 1 2011-09-15 Andy Estes <aestes@apple.com> 2 3 Having an empty listener to beforeload events changes the behavior of other scripts 4 https://bugs.webkit.org/show_bug.cgi?id=45586 5 6 Reviewed by Darin Adler. 7 8 * fast/dom/beforeload/cached-image-before-load-expected.txt: Added. 9 * fast/dom/beforeload/cached-image-before-load.html: Added. 10 1 11 2011-09-15 Jon Lee <jonlee@apple.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r95227 r95228 1 2011-09-15 Andy Estes <aestes@apple.com> 2 3 Having an empty listener to beforeload events changes the behavior of other scripts 4 https://bugs.webkit.org/show_bug.cgi?id=45586 5 6 Reviewed by Darin Adler. 7 8 Test: fast/dom/beforeload/cached-image-before-load.html 9 10 When loading a cached image after a beforeload handler has been 11 installed on the document, ImageLoader would dispatch both the 12 beforeload and load events asynchronously in such a way that caused 13 load to fire first. Since a side effect of firing the beforeload event 14 is to wire up the CachedImage to its associated RenderImage object, 15 this work was not done by the time load fired, and scripts that queried 16 renderer-dependent attributes of the image in an onload handler would 17 get bogus values in return. 18 19 Fix this by ensuring load fires after beforeload in the cached image case. 20 21 * loader/ImageLoader.cpp: 22 (WebCore::ImageLoader::updateFromElement): Call setClient() after 23 dispatching beforeload, since setClient() will dispatch the load event 24 if the image is cached. 25 1 26 2011-09-15 Anders Carlsson <andersca@apple.com> 2 27 -
trunk/Source/WebCore/loader/ImageLoader.cpp
r94427 r95228 203 203 204 204 if (newImage) { 205 newImage->addClient(this);206 205 if (!m_element->document()->hasListenerType(Document::BEFORELOAD_LISTENER)) 207 206 dispatchPendingBeforeLoadEvent(); 208 207 else 209 208 beforeLoadEventSender().dispatchEventSoon(this); 209 210 // If newImage is cached, addClient() will result in the load event 211 // being queued to fire. Ensure this happens after beforeload is 212 // dispatched. 213 newImage->addClient(this); 210 214 } 211 215 if (oldImage)
Note: See TracChangeset
for help on using the changeset viewer.