Changeset 52116 in webkit
- Timestamp:
- Dec 14, 2009 1:47:04 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r52114 r52116 1 2009-12-14 Alexey Proskuryakov <ap@apple.com> 2 3 Reviewed by Dave Hyatt. 4 5 https://bugs.webkit.org/show_bug.cgi?id=31660 6 REGRESSION (r49394): Image load event fires before the document fragment is attached. 7 8 * fast/images/image-load-event-in-fragment-expected.txt: Added. 9 * fast/images/image-load-event-in-fragment.html: Added. 10 1 11 2009-12-14 Brian Weinstein <bweinstein@apple.com> 2 12 -
trunk/WebCore/ChangeLog
r52115 r52116 1 2009-12-14 Alexey Proskuryakov <ap@apple.com> 2 3 Reviewed by Dave Hyatt. 4 5 https://bugs.webkit.org/show_bug.cgi?id=31660 6 REGRESSION (r49394): Image load event fires before the document fragment is attached. 7 8 Test: fast/images/image-load-event-in-fragment.html 9 10 We cannot fire load events immediately after parsing a fragment - an element inserted via 11 innerHTML or equivalent should be reachable via getElementById() by the time its load event 12 fires. 13 14 * dom/Document.cpp: (WebCore::Document::implicitClose): Call dispatchPendingBeforeLoadEvents() 15 and dispatchPendingLoadEvents() individually. I'm not sure why these calls are here, just 16 preserving existing behavior. 17 18 * dom/XMLTokenizer.cpp: (WebCore::XMLTokenizer::write): 19 * html/HTMLTokenizer.cpp: (WebCore::HTMLTokenizer::write): 20 Load events for elements that have just been parsed cannot be dispatched yet, we should give 21 the elements a chance to be inserted into a document first. There is no compatibility baggage 22 for beforeload, so it seems OK to dispatch it right away. 23 24 * loader/ImageLoader.cpp: 25 (WebCore::ImageLoader::dispatchPendingBeforeLoadEvents): 26 (WebCore::ImageLoader::dispatchPendingLoadEvents): 27 * loader/ImageLoader.h: 28 Separated dispatchPendingEvents() into individual functions for each event kind. 29 1 30 2009-12-14 Jakob Petsovits <jpetsovits@rim.com> 2 31 -
trunk/WebCore/dom/Document.cpp
r52096 r52116 1725 1725 f->animation()->resumeAnimations(this); 1726 1726 1727 ImageLoader::dispatchPendingEvents(); 1727 ImageLoader::dispatchPendingBeforeLoadEvents(); 1728 ImageLoader::dispatchPendingLoadEvents(); 1728 1729 dispatchWindowLoadEvent(); 1729 1730 dispatchWindowEvent(PageTransitionEvent::create(eventNames().pageshowEvent, false), this); -
trunk/WebCore/dom/XMLTokenizer.cpp
r51962 r52116 135 135 doWrite(s.toString()); 136 136 137 // After parsing, go ahead and dispatch image beforeload /loadevents.138 ImageLoader::dispatchPending Events();137 // After parsing, go ahead and dispatch image beforeload events. 138 ImageLoader::dispatchPendingBeforeLoadEvents(); 139 139 } 140 140 -
trunk/WebCore/html/HTMLTokenizer.cpp
r52091 r52116 1809 1809 end(); // this actually causes us to be deleted 1810 1810 1811 // After parsing, go ahead and dispatch image beforeload /loadevents.1812 ImageLoader::dispatchPending Events();1811 // After parsing, go ahead and dispatch image beforeload events. 1812 ImageLoader::dispatchPendingBeforeLoadEvents(); 1813 1813 } 1814 1814 -
trunk/WebCore/loader/ImageLoader.cpp
r50748 r52116 232 232 } 233 233 234 void ImageLoader::dispatchPending Events()234 void ImageLoader::dispatchPendingBeforeLoadEvents() 235 235 { 236 236 beforeLoadEventSender().dispatchPendingEvents(); 237 } 238 239 void ImageLoader::dispatchPendingLoadEvents() 240 { 237 241 loadEventSender().dispatchPendingEvents(); 238 242 } -
trunk/WebCore/loader/ImageLoader.h
r49394 r52116 57 57 bool haveFiredLoadEvent() const { return m_firedLoad; } 58 58 59 static void dispatchPendingEvents(); 59 static void dispatchPendingBeforeLoadEvents(); 60 static void dispatchPendingLoadEvents(); 60 61 61 62 protected:
Note: See TracChangeset
for help on using the changeset viewer.