Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(206)

Side by Side Diff: Source/core/frame/DOMWindow.cpp

Issue 136463002: Don't fire popstate event on initial document load (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 void DOMWindow::dispatchWindowLoadEvent() 443 void DOMWindow::dispatchWindowLoadEvent()
444 { 444 {
445 ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden()); 445 ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden());
446 dispatchLoadEvent(); 446 dispatchLoadEvent();
447 } 447 }
448 448
449 void DOMWindow::documentWasClosed() 449 void DOMWindow::documentWasClosed()
450 { 450 {
451 dispatchWindowLoadEvent(); 451 dispatchWindowLoadEvent();
452 enqueuePageshowEvent(PageshowEventNotPersisted); 452 enqueuePageshowEvent(PageshowEventNotPersisted);
453 enqueuePopstateEvent(m_pendingStateObject ? m_pendingStateObject.release() : SerializedScriptValue::nullValue()); 453 if (m_pendingStateObject)
454 enqueuePopstateEvent(m_pendingStateObject.release());
454 } 455 }
455 456
456 void DOMWindow::enqueuePageshowEvent(PageshowEventPersistence persisted) 457 void DOMWindow::enqueuePageshowEvent(PageshowEventPersistence persisted)
457 { 458 {
458 // FIXME: https://bugs.webkit.org/show_bug.cgi?id=36334 Pageshow event needs to fire asynchronously. 459 // FIXME: https://bugs.webkit.org/show_bug.cgi?id=36334 Pageshow event needs to fire asynchronously.
459 dispatchEvent(PageTransitionEvent::create(EventTypeNames::pageshow, persiste d), m_document.get()); 460 dispatchEvent(PageTransitionEvent::create(EventTypeNames::pageshow, persiste d), m_document.get());
460 } 461 }
461 462
462 void DOMWindow::enqueueHashchangeEvent(const String& oldURL, const String& newUR L) 463 void DOMWindow::enqueueHashchangeEvent(const String& oldURL, const String& newUR L)
463 { 464 {
(...skipping 1398 matching lines...) Expand 10 before | Expand all | Expand 10 after
1862 return static_cast<DOMWindowLifecycleNotifier&>(LifecycleContext<DOMWindow>: :lifecycleNotifier()); 1863 return static_cast<DOMWindowLifecycleNotifier&>(LifecycleContext<DOMWindow>: :lifecycleNotifier());
1863 } 1864 }
1864 1865
1865 PassOwnPtr<LifecycleNotifier<DOMWindow> > DOMWindow::createLifecycleNotifier() 1866 PassOwnPtr<LifecycleNotifier<DOMWindow> > DOMWindow::createLifecycleNotifier()
1866 { 1867 {
1867 return DOMWindowLifecycleNotifier::create(this); 1868 return DOMWindowLifecycleNotifier::create(this);
1868 } 1869 }
1869 1870
1870 1871
1871 } // namespace WebCore 1872 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698