Changeset 54044 in webkit
- Timestamp:
- Jan 28, 2010 10:41:40 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r54029 r54044 1 2010-01-28 Michael Nordman <michaeln@google.com> 2 3 Reviewed by Alexey Proskuryakov. 4 5 ApplicationCache events should be deferred until after Document onload has fired. 6 https://bugs.webkit.org/show_bug.cgi?id=29690 7 8 * http/tests/appcache/deferred-events-expected.txt: Added. 9 * http/tests/appcache/deferred-events.html: Added. 10 * http/tests/appcache/deferred-events-delete-while-raising-expected.txt: Added. 11 * http/tests/appcache/deferred-events-delete-while-raising.html: Added. 12 1 13 2010-01-28 Alex Milowski <alex@milowski.com> 2 14 -
trunk/WebCore/ChangeLog
r54042 r54044 1 2010-01-28 Michael Nordman <michaeln@google.com> 2 3 Reviewed by Alexey Proskuryakov. 4 5 ApplicationCache events should be deferred until after Document onload has fired. 6 https://bugs.webkit.org/show_bug.cgi?id=29690 7 8 Test: http/tests/appcache/deferred-events.html 9 10 * loader/FrameLoader.cpp: 11 (WebCore::FrameLoader::handledOnloadEvents): Tells the ApplicationCacheHost to stop deferring events. 12 * loader/appcache/ApplicationCacheHost.cpp: 13 (WebCore::ApplicationCacheHost::ApplicationCacheHost): Initialize m_isDeferringEvents to true. 14 (WebCore::ApplicationCacheHost::notifyDOMApplicationCache): Depending, defer or raise the event. 15 (WebCore::ApplicationCacheHost::stopDeferringEvents): Raise any deferred events and reset the flag. 16 * loader/appcache/ApplicationCacheHost.h: Declare new data members and method. 17 1 18 2010-01-28 Kavita Kanetkar <kkanetkar@chromium.org> 2 19 -
trunk/WebCore/loader/FrameLoader.cpp
r53950 r54044 3148 3148 { 3149 3149 m_client->dispatchDidHandleOnloadEvents(); 3150 #if ENABLE(OFFLINE_WEB_APPLICATIONS) 3151 if (documentLoader()) 3152 documentLoader()->applicationCacheHost()->stopDeferringEvents(); 3153 #endif 3150 3154 } 3151 3155 -
trunk/WebCore/loader/appcache/ApplicationCacheHost.cpp
r48701 r54044 47 47 : m_domApplicationCache(0) 48 48 , m_documentLoader(documentLoader) 49 , m_defersEvents(true) 49 50 , m_candidateApplicationCacheGroup(0) 50 51 { … … 230 231 void ApplicationCacheHost::notifyDOMApplicationCache(EventID id) 231 232 { 233 if (m_defersEvents) { 234 // Events are deferred until document.onload has fired. 235 m_deferredEvents.append(id); 236 return; 237 } 232 238 if (m_domApplicationCache) { 233 239 ExceptionCode ec = 0; … … 235 241 ASSERT(!ec); 236 242 } 243 } 244 245 void ApplicationCacheHost::stopDeferringEvents() 246 { 247 RefPtr<DocumentLoader> protect(documentLoader()); 248 for (unsigned i = 0; i < m_deferredEvents.size(); ++i) { 249 EventID id = m_deferredEvents[i]; 250 if (m_domApplicationCache) { 251 ExceptionCode ec = 0; 252 m_domApplicationCache->dispatchEvent(Event::create(DOMApplicationCache::toEventType(id), false, false), ec); 253 ASSERT(!ec); 254 } 255 } 256 m_deferredEvents.clear(); 257 m_defersEvents = false; 237 258 } 238 259 -
trunk/WebCore/loader/appcache/ApplicationCacheHost.h
r50748 r54044 34 34 #if ENABLE(OFFLINE_WEB_APPLICATIONS) 35 35 36 #include <wtf/Deque.h> 36 37 #include <wtf/OwnPtr.h> 37 38 #include <wtf/PassRefPtr.h> … … 111 112 void notifyDOMApplicationCache(EventID id); 112 113 114 void stopDeferringEvents(); // Also raises the events that have been queued up. 115 113 116 private: 114 117 bool isApplicationCacheEnabled(); … … 117 120 DOMApplicationCache* m_domApplicationCache; 118 121 DocumentLoader* m_documentLoader; 122 bool m_defersEvents; // Events are deferred until after document onload. 123 Vector<EventID> m_deferredEvents; 119 124 120 125 #if PLATFORM(CHROMIUM) -
trunk/WebKit/chromium/ChangeLog
r54015 r54044 1 2010-01-28 Michael Nordman <michaeln@google.com> 2 3 Reviewed by Alexey Proskuryakov. 4 5 ApplicationCache events should be deferred until after Document onload has fired. 6 https://bugs.webkit.org/show_bug.cgi?id=29690 7 8 * src/ApplicationCacheHost.cpp: 9 (WebCore::ApplicationCacheHost::ApplicationCacheHost): Initialize m_isDeferringEvents to true. 10 (WebCore::ApplicationCacheHost::notifyDOMApplicationCache): Depending, defer or raise the event. 11 (WebCore::ApplicationCacheHost::stopDeferringEvents): Raise any deferred events and reset the flag. 12 1 13 2010-01-27 Aaron Boodman <aa@chromium.org> 2 14 -
trunk/WebKit/chromium/src/ApplicationCacheHost.cpp
r53671 r54044 56 56 : m_domApplicationCache(0) 57 57 , m_documentLoader(documentLoader) 58 , m_defersEvents(true) 58 59 { 59 60 ASSERT(m_documentLoader); … … 197 198 void ApplicationCacheHost::notifyDOMApplicationCache(EventID id) 198 199 { 200 if (m_defersEvents) { 201 m_deferredEvents.append(id); 202 return; 203 } 199 204 if (m_domApplicationCache) { 200 205 ExceptionCode ec = 0; 201 m_domApplicationCache->dispatchEvent( 202 Event::create(DOMApplicationCache::toEventType(id), false, false), 203 ec); 206 m_domApplicationCache->dispatchEvent(Event::create(DOMApplicationCache::toEventType(id), false, false), ec); 204 207 ASSERT(!ec); 205 208 } 209 } 210 211 void ApplicationCacheHost::stopDeferringEvents() 212 { 213 RefPtr<DocumentLoader> protect(documentLoader()); 214 for (unsigned i = 0; i < m_deferredEvents.size(); ++i) { 215 EventID id = m_deferredEvents[i]; 216 if (m_domApplicationCache) { 217 ExceptionCode ec = 0; 218 m_domApplicationCache->dispatchEvent(Event::create(DOMApplicationCache::toEventType(id), false, false), ec); 219 ASSERT(!ec); 220 } 221 } 222 m_deferredEvents.clear(); 223 m_defersEvents = false; 206 224 } 207 225
Note: See TracChangeset
for help on using the changeset viewer.