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

Side by Side Diff: third_party/WebKit/Source/core/dom/Document.h

Issue 1778753003: Fire visibilitychange event on unload (behind the flag) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix tests Created 4 years, 9 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
9 * Copyright (C) 2011 Google Inc. All rights reserved. 9 * Copyright (C) 2011 Google Inc. All rights reserved.
10 * 10 *
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 void close(ExceptionState&); 478 void close(ExceptionState&);
479 // This is used internally and does not handle exceptions. 479 // This is used internally and does not handle exceptions.
480 void close(); 480 void close();
481 // implicitClose() actually does the work of closing the input stream. 481 // implicitClose() actually does the work of closing the input stream.
482 void implicitClose(); 482 void implicitClose();
483 483
484 bool dispatchBeforeUnloadEvent(ChromeClient&, bool isReload, bool& didAllowN avigation); 484 bool dispatchBeforeUnloadEvent(ChromeClient&, bool isReload, bool& didAllowN avigation);
485 void dispatchUnloadEvents(); 485 void dispatchUnloadEvents();
486 486
487 enum PageDismissalType { 487 enum PageDismissalType {
488 NoDismissal = 0, 488 NoDismissal,
489 BeforeUnloadDismissal = 1, 489 BeforeUnloadDismissal,
490 PageHideDismissal = 2, 490 PageHideDismissal,
491 UnloadDismissal = 3 491 UnloadVisibilityChangeDismissal,
492 UnloadDismissal
492 }; 493 };
493 PageDismissalType pageDismissalEventBeingDispatched() const; 494 PageDismissalType pageDismissalEventBeingDispatched() const;
494 495
495 void cancelParsing(); 496 void cancelParsing();
496 497
497 void write(const SegmentedString& text, Document* enteredDocument = nullptr, ExceptionState& = ASSERT_NO_EXCEPTION); 498 void write(const SegmentedString& text, Document* enteredDocument = nullptr, ExceptionState& = ASSERT_NO_EXCEPTION);
498 void write(const String& text, Document* enteredDocument = nullptr, Exceptio nState& = ASSERT_NO_EXCEPTION); 499 void write(const String& text, Document* enteredDocument = nullptr, Exceptio nState& = ASSERT_NO_EXCEPTION);
499 void writeln(const String& text, Document* enteredDocument = nullptr, Except ionState& = ASSERT_NO_EXCEPTION); 500 void writeln(const String& text, Document* enteredDocument = nullptr, Except ionState& = ASSERT_NO_EXCEPTION);
500 void write(LocalDOMWindow*, const Vector<String>& text, ExceptionState&); 501 void write(LocalDOMWindow*, const Vector<String>& text, ExceptionState&);
501 void writeln(LocalDOMWindow*, const Vector<String>& text, ExceptionState&); 502 void writeln(LocalDOMWindow*, const Vector<String>& text, ExceptionState&);
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 868
868 void statePopped(PassRefPtr<SerializedScriptValue>); 869 void statePopped(PassRefPtr<SerializedScriptValue>);
869 870
870 enum LoadEventProgress { 871 enum LoadEventProgress {
871 LoadEventNotRun, 872 LoadEventNotRun,
872 LoadEventInProgress, 873 LoadEventInProgress,
873 LoadEventCompleted, 874 LoadEventCompleted,
874 BeforeUnloadEventInProgress, 875 BeforeUnloadEventInProgress,
875 BeforeUnloadEventCompleted, 876 BeforeUnloadEventCompleted,
876 PageHideInProgress, 877 PageHideInProgress,
878 UnloadVisibilityChangeInProgress,
877 UnloadEventInProgress, 879 UnloadEventInProgress,
878 UnloadEventHandled 880 UnloadEventHandled
879 }; 881 };
880 bool loadEventStillNeeded() const { return m_loadEventProgress == LoadEventN otRun; } 882 bool loadEventStillNeeded() const { return m_loadEventProgress == LoadEventN otRun; }
881 bool processingLoadEvent() const { return m_loadEventProgress == LoadEventIn Progress; } 883 bool processingLoadEvent() const { return m_loadEventProgress == LoadEventIn Progress; }
882 bool loadEventFinished() const { return m_loadEventProgress >= LoadEventComp leted; } 884 bool loadEventFinished() const { return m_loadEventProgress >= LoadEventComp leted; }
883 bool unloadStarted() const { return m_loadEventProgress >= PageHideInProgres s; } 885 bool unloadStarted() const { return m_loadEventProgress >= PageHideInProgres s; }
884 bool processingBeforeUnload() const { return m_loadEventProgress == BeforeUn loadEventInProgress; } 886 bool processingBeforeUnload() const { return m_loadEventProgress == BeforeUn loadEventInProgress; }
885 void suppressLoadEvent(); 887 void suppressLoadEvent();
886 888
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after
1449 DEFINE_TYPE_CASTS(TreeScope, Document, document, true, true); 1451 DEFINE_TYPE_CASTS(TreeScope, Document, document, true, true);
1450 1452
1451 } // namespace blink 1453 } // namespace blink
1452 1454
1453 #ifndef NDEBUG 1455 #ifndef NDEBUG
1454 // Outside the WebCore namespace for ease of invocation from gdb. 1456 // Outside the WebCore namespace for ease of invocation from gdb.
1455 CORE_EXPORT void showLiveDocumentInstances(); 1457 CORE_EXPORT void showLiveDocumentInstances();
1456 #endif 1458 #endif
1457 1459
1458 #endif // Document_h 1460 #endif // Document_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698