OLD | NEW |
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 18 matching lines...) Expand all Loading... |
29 #define Document_h | 29 #define Document_h |
30 | 30 |
31 #include "bindings/core/v8/ExceptionStatePlaceholder.h" | 31 #include "bindings/core/v8/ExceptionStatePlaceholder.h" |
32 #include "bindings/core/v8/ScriptValue.h" | 32 #include "bindings/core/v8/ScriptValue.h" |
33 #include "core/animation/AnimationClock.h" | 33 #include "core/animation/AnimationClock.h" |
34 #include "core/animation/CompositorPendingAnimations.h" | 34 #include "core/animation/CompositorPendingAnimations.h" |
35 #include "core/dom/ContainerNode.h" | 35 #include "core/dom/ContainerNode.h" |
36 #include "core/dom/DocumentEncodingData.h" | 36 #include "core/dom/DocumentEncodingData.h" |
37 #include "core/dom/DocumentInit.h" | 37 #include "core/dom/DocumentInit.h" |
38 #include "core/dom/DocumentLifecycle.h" | 38 #include "core/dom/DocumentLifecycle.h" |
39 #include "core/dom/DocumentLifecycleNotifier.h" | |
40 #include "core/dom/DocumentSupplementable.h" | 39 #include "core/dom/DocumentSupplementable.h" |
41 #include "core/dom/DocumentTiming.h" | 40 #include "core/dom/DocumentTiming.h" |
42 #include "core/dom/ExecutionContext.h" | 41 #include "core/dom/ExecutionContext.h" |
43 #include "core/dom/MutationObserver.h" | 42 #include "core/dom/MutationObserver.h" |
44 #include "core/dom/TextLinkColors.h" | 43 #include "core/dom/TextLinkColors.h" |
45 #include "core/dom/TreeScope.h" | 44 #include "core/dom/TreeScope.h" |
46 #include "core/dom/UserActionElementSet.h" | 45 #include "core/dom/UserActionElementSet.h" |
47 #include "core/dom/ViewportDescription.h" | 46 #include "core/dom/ViewportDescription.h" |
48 #include "core/dom/custom/CustomElement.h" | 47 #include "core/dom/custom/CustomElement.h" |
49 #include "core/frame/DOMTimerCoordinator.h" | 48 #include "core/frame/DOMTimerCoordinator.h" |
(...skipping 25 matching lines...) Expand all Loading... |
75 class CanvasRenderingContext2DOrWebGLRenderingContext; | 74 class CanvasRenderingContext2DOrWebGLRenderingContext; |
76 class Chrome; | 75 class Chrome; |
77 class Comment; | 76 class Comment; |
78 class ConsoleMessage; | 77 class ConsoleMessage; |
79 class ContextFeatures; | 78 class ContextFeatures; |
80 class CustomElementMicrotaskRunQueue; | 79 class CustomElementMicrotaskRunQueue; |
81 class CustomElementRegistrationContext; | 80 class CustomElementRegistrationContext; |
82 class DOMImplementation; | 81 class DOMImplementation; |
83 class DOMWindow; | 82 class DOMWindow; |
84 class DocumentFragment; | 83 class DocumentFragment; |
| 84 class DocumentLifecycleNotifier; |
85 class DocumentLoader; | 85 class DocumentLoader; |
86 class DocumentMarkerController; | 86 class DocumentMarkerController; |
87 class DocumentNameCollection; | 87 class DocumentNameCollection; |
88 class DocumentParser; | 88 class DocumentParser; |
89 class DocumentState; | 89 class DocumentState; |
90 class DocumentType; | 90 class DocumentType; |
91 class Element; | 91 class Element; |
92 class ElementDataCache; | 92 class ElementDataCache; |
93 class ElementRegistrationOptions; | 93 class ElementRegistrationOptions; |
94 class Event; | 94 class Event; |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 virtual void trace(Visitor*); | 212 virtual void trace(Visitor*); |
213 | 213 |
214 private: | 214 private: |
215 void registerObserver(Document&); | 215 void registerObserver(Document&); |
216 void unregisterObserver(); | 216 void unregisterObserver(); |
217 | 217 |
218 RawPtrWillBeMember<Document> m_document; | 218 RawPtrWillBeMember<Document> m_document; |
219 }; | 219 }; |
220 | 220 |
221 class Document : public ContainerNode, public TreeScope, public SecurityContext,
public ExecutionContext | 221 class Document : public ContainerNode, public TreeScope, public SecurityContext,
public ExecutionContext |
222 , public DocumentSupplementable, public DocumentLifecycleNotifier { | 222 , public DocumentSupplementable, public LifecycleContext<Document> { |
223 DEFINE_WRAPPERTYPEINFO(); | 223 DEFINE_WRAPPERTYPEINFO(); |
224 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(Document); | 224 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(Document); |
225 public: | 225 public: |
226 static PassRefPtrWillBeRawPtr<Document> create(const DocumentInit& initializ
er = DocumentInit()) | 226 static PassRefPtrWillBeRawPtr<Document> create(const DocumentInit& initializ
er = DocumentInit()) |
227 { | 227 { |
228 return adoptRefWillBeNoop(new Document(initializer)); | 228 return adoptRefWillBeNoop(new Document(initializer)); |
229 } | 229 } |
230 virtual ~Document(); | 230 virtual ~Document(); |
231 | 231 |
232 MediaQueryMatcher& mediaQueryMatcher(); | 232 MediaQueryMatcher& mediaQueryMatcher(); |
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1015 // TODO(thestig): Rename these and related functions, since we can call them | 1015 // TODO(thestig): Rename these and related functions, since we can call them |
1016 // for labels and input fields outside of forms as well. | 1016 // for labels and input fields outside of forms as well. |
1017 void didAssociateFormControl(Element*); | 1017 void didAssociateFormControl(Element*); |
1018 void removeFormAssociation(Element*); | 1018 void removeFormAssociation(Element*); |
1019 | 1019 |
1020 virtual void addConsoleMessage(PassRefPtrWillBeRawPtr<ConsoleMessage>) overr
ide final; | 1020 virtual void addConsoleMessage(PassRefPtrWillBeRawPtr<ConsoleMessage>) overr
ide final; |
1021 | 1021 |
1022 virtual LocalDOMWindow* executingWindow() override final; | 1022 virtual LocalDOMWindow* executingWindow() override final; |
1023 LocalFrame* executingFrame(); | 1023 LocalFrame* executingFrame(); |
1024 | 1024 |
| 1025 DocumentLifecycleNotifier& lifecycleNotifier(); |
1025 DocumentLifecycle& lifecycle() { return m_lifecycle; } | 1026 DocumentLifecycle& lifecycle() { return m_lifecycle; } |
1026 bool isActive() const { return m_lifecycle.isActive(); } | 1027 bool isActive() const { return m_lifecycle.isActive(); } |
1027 bool isDetached() const { return m_lifecycle.state() >= DocumentLifecycle::S
topping; } | 1028 bool isDetached() const { return m_lifecycle.state() >= DocumentLifecycle::S
topping; } |
1028 bool isStopped() const { return m_lifecycle.state() == DocumentLifecycle::St
opped; } | 1029 bool isStopped() const { return m_lifecycle.state() == DocumentLifecycle::St
opped; } |
1029 bool isDisposed() const { return m_lifecycle.state() == DocumentLifecycle::D
isposed; } | 1030 bool isDisposed() const { return m_lifecycle.state() == DocumentLifecycle::D
isposed; } |
1030 | 1031 |
1031 enum HttpRefreshType { | 1032 enum HttpRefreshType { |
1032 HttpRefreshFromHeader, | 1033 HttpRefreshFromHeader, |
1033 HttpRefreshFromMetaTag | 1034 HttpRefreshFromMetaTag |
1034 }; | 1035 }; |
1035 void maybeHandleHttpRefresh(const String&, HttpRefreshType); | 1036 void maybeHandleHttpRefresh(const String&, HttpRefreshType); |
1036 | 1037 |
1037 void updateSecurityOrigin(PassRefPtr<SecurityOrigin>); | 1038 void updateSecurityOrigin(PassRefPtr<SecurityOrigin>); |
| 1039 PassOwnPtr<LifecycleNotifier<Document>> createLifecycleNotifier(); |
1038 | 1040 |
1039 void setHasViewportUnits() { m_hasViewportUnits = true; } | 1041 void setHasViewportUnits() { m_hasViewportUnits = true; } |
1040 bool hasViewportUnits() const { return m_hasViewportUnits; } | 1042 bool hasViewportUnits() const { return m_hasViewportUnits; } |
1041 void notifyResizeForViewportUnits(); | 1043 void notifyResizeForViewportUnits(); |
1042 | 1044 |
1043 void registerVisibilityObserver(DocumentVisibilityObserver*); | 1045 void registerVisibilityObserver(DocumentVisibilityObserver*); |
1044 void unregisterVisibilityObserver(DocumentVisibilityObserver*); | 1046 void unregisterVisibilityObserver(DocumentVisibilityObserver*); |
1045 | 1047 |
1046 void updateStyleInvalidationIfNeeded(); | 1048 void updateStyleInvalidationIfNeeded(); |
1047 | 1049 |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1430 DEFINE_TYPE_CASTS(TreeScope, Document, document, true, true); | 1432 DEFINE_TYPE_CASTS(TreeScope, Document, document, true, true); |
1431 | 1433 |
1432 } // namespace blink | 1434 } // namespace blink |
1433 | 1435 |
1434 #ifndef NDEBUG | 1436 #ifndef NDEBUG |
1435 // Outside the WebCore namespace for ease of invocation from gdb. | 1437 // Outside the WebCore namespace for ease of invocation from gdb. |
1436 void showLiveDocumentInstances(); | 1438 void showLiveDocumentInstances(); |
1437 #endif | 1439 #endif |
1438 | 1440 |
1439 #endif // Document_h | 1441 #endif // Document_h |
OLD | NEW |