| 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 enum DocumentClass { | 139 enum DocumentClass { |
| 140 DefaultDocumentClass = 0, | 140 DefaultDocumentClass = 0, |
| 141 HTMLDocumentClass = 1, | 141 HTMLDocumentClass = 1, |
| 142 MediaDocumentClass = 1 << 4, | 142 MediaDocumentClass = 1 << 4, |
| 143 }; | 143 }; |
| 144 | 144 |
| 145 typedef unsigned char DocumentClassFlags; | 145 typedef unsigned char DocumentClassFlags; |
| 146 | 146 |
| 147 class Document; | 147 class Document; |
| 148 | 148 |
| 149 class DocumentVisibilityObserver { | |
| 150 public: | |
| 151 DocumentVisibilityObserver(Document&); | |
| 152 virtual ~DocumentVisibilityObserver(); | |
| 153 | |
| 154 virtual void didChangeVisibilityState(PageVisibilityState) = 0; | |
| 155 | |
| 156 // Classes that inherit Node and DocumentVisibilityObserver must have a | |
| 157 // virtual override of Node::didMoveToNewDocument that calls | |
| 158 // DocumentVisibilityObserver::setDocument | |
| 159 void setObservedDocument(Document&); | |
| 160 | |
| 161 private: | |
| 162 void registerObserver(Document&); | |
| 163 void unregisterObserver(); | |
| 164 | |
| 165 RawPtr<Document> m_document; | |
| 166 }; | |
| 167 | |
| 168 class Document : public ContainerNode, public TreeScope, public ExecutionContext
, public ExecutionContextClient | 149 class Document : public ContainerNode, public TreeScope, public ExecutionContext
, public ExecutionContextClient |
| 169 , public DocumentSupplementable, public LifecycleContext<Document>, public R
esourceClient { | 150 , public DocumentSupplementable, public LifecycleContext<Document>, public R
esourceClient { |
| 170 DEFINE_WRAPPERTYPEINFO(); | 151 DEFINE_WRAPPERTYPEINFO(); |
| 171 public: | 152 public: |
| 172 static PassRefPtr<Document> create(const DocumentInit& initializer = Documen
tInit()) | 153 static PassRefPtr<Document> create(const DocumentInit& initializer = Documen
tInit()) |
| 173 { | 154 { |
| 174 return adoptRef(new Document(initializer)); | 155 return adoptRef(new Document(initializer)); |
| 175 } | 156 } |
| 176 virtual ~Document(); | 157 virtual ~Document(); |
| 177 | 158 |
| (...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 HttpRefreshFromMetaTag | 591 HttpRefreshFromMetaTag |
| 611 }; | 592 }; |
| 612 void maybeHandleHttpRefresh(const String&, HttpRefreshType); | 593 void maybeHandleHttpRefresh(const String&, HttpRefreshType); |
| 613 | 594 |
| 614 PassOwnPtr<LifecycleNotifier<Document> > createLifecycleNotifier(); | 595 PassOwnPtr<LifecycleNotifier<Document> > createLifecycleNotifier(); |
| 615 | 596 |
| 616 void setHasViewportUnits() { m_hasViewportUnits = true; } | 597 void setHasViewportUnits() { m_hasViewportUnits = true; } |
| 617 bool hasViewportUnits() const { return m_hasViewportUnits; } | 598 bool hasViewportUnits() const { return m_hasViewportUnits; } |
| 618 void notifyResizeForViewportUnits(); | 599 void notifyResizeForViewportUnits(); |
| 619 | 600 |
| 620 void registerVisibilityObserver(DocumentVisibilityObserver*); | |
| 621 void unregisterVisibilityObserver(DocumentVisibilityObserver*); | |
| 622 | |
| 623 void didRecalculateStyleForElement() { ++m_styleRecalcElementCounter; } | 601 void didRecalculateStyleForElement() { ++m_styleRecalcElementCounter; } |
| 624 | 602 |
| 625 virtual v8::Handle<v8::Object> wrap(v8::Handle<v8::Object> creationContext,
v8::Isolate*) override; | 603 virtual v8::Handle<v8::Object> wrap(v8::Handle<v8::Object> creationContext,
v8::Isolate*) override; |
| 626 | 604 |
| 627 protected: | 605 protected: |
| 628 Document(const DocumentInit&, DocumentClassFlags = DefaultDocumentClass); | 606 Document(const DocumentInit&, DocumentClassFlags = DefaultDocumentClass); |
| 629 | 607 |
| 630 #if !ENABLE(OILPAN) | 608 #if !ENABLE(OILPAN) |
| 631 virtual void dispose() override; | 609 virtual void dispose() override; |
| 632 #endif | 610 #endif |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 824 CompositorPendingAnimations m_compositorPendingAnimations; | 802 CompositorPendingAnimations m_compositorPendingAnimations; |
| 825 | 803 |
| 826 RefPtr<Document> m_templateDocument; | 804 RefPtr<Document> m_templateDocument; |
| 827 // With Oilpan the templateDocument and the templateDocumentHost | 805 // With Oilpan the templateDocument and the templateDocumentHost |
| 828 // live and die together. Without Oilpan, the templateDocumentHost | 806 // live and die together. Without Oilpan, the templateDocumentHost |
| 829 // is a manually managed backpointer from m_templateDocument. | 807 // is a manually managed backpointer from m_templateDocument. |
| 830 RawPtr<Document> m_templateDocumentHost; | 808 RawPtr<Document> m_templateDocumentHost; |
| 831 | 809 |
| 832 bool m_hasViewportUnits; | 810 bool m_hasViewportUnits; |
| 833 | 811 |
| 834 typedef HashSet<RawPtr<DocumentVisibilityObserver> > DocumentVisibilityObser
verSet; | |
| 835 DocumentVisibilityObserverSet m_visibilityObservers; | |
| 836 | |
| 837 int m_styleRecalcElementCounter; | 812 int m_styleRecalcElementCounter; |
| 838 mutable DocumentLoadTiming m_documentLoadTiming; | 813 mutable DocumentLoadTiming m_documentLoadTiming; |
| 839 }; | 814 }; |
| 840 | 815 |
| 841 inline void Document::scheduleRenderTreeUpdateIfNeeded() | 816 inline void Document::scheduleRenderTreeUpdateIfNeeded() |
| 842 { | 817 { |
| 843 // Inline early out to avoid the function calls below. | 818 // Inline early out to avoid the function calls below. |
| 844 if (hasPendingStyleRecalc()) | 819 if (hasPendingStyleRecalc()) |
| 845 return; | 820 return; |
| 846 if (shouldScheduleRenderTreeUpdate() && needsRenderTreeUpdate()) | 821 if (shouldScheduleRenderTreeUpdate() && needsRenderTreeUpdate()) |
| (...skipping 20 matching lines...) Expand all Loading... |
| 867 Node* eventTargetNodeForDocument(Document*); | 842 Node* eventTargetNodeForDocument(Document*); |
| 868 | 843 |
| 869 } // namespace blink | 844 } // namespace blink |
| 870 | 845 |
| 871 #ifndef NDEBUG | 846 #ifndef NDEBUG |
| 872 // Outside the WebCore namespace for ease of invocation from gdb. | 847 // Outside the WebCore namespace for ease of invocation from gdb. |
| 873 void showLiveDocumentInstances(); | 848 void showLiveDocumentInstances(); |
| 874 #endif | 849 #endif |
| 875 | 850 |
| 876 #endif // Document_h | 851 #endif // Document_h |
| OLD | NEW |