| 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 14 matching lines...) Expand all Loading... |
| 25 * | 25 * |
| 26 */ | 26 */ |
| 27 | 27 |
| 28 #ifndef Document_h | 28 #ifndef Document_h |
| 29 #define Document_h | 29 #define Document_h |
| 30 | 30 |
| 31 #include "bindings/v8/ScriptValue.h" | 31 #include "bindings/v8/ScriptValue.h" |
| 32 #include "core/dom/ContainerNode.h" | 32 #include "core/dom/ContainerNode.h" |
| 33 #include "core/dom/DOMTimeStamp.h" | 33 #include "core/dom/DOMTimeStamp.h" |
| 34 #include "core/dom/DocumentEventQueue.h" | 34 #include "core/dom/DocumentEventQueue.h" |
| 35 #include "core/dom/DocumentInit.h" |
| 35 #include "core/dom/DocumentTiming.h" | 36 #include "core/dom/DocumentTiming.h" |
| 36 #include "core/dom/IconURL.h" | 37 #include "core/dom/IconURL.h" |
| 37 #include "core/dom/MutationObserver.h" | 38 #include "core/dom/MutationObserver.h" |
| 38 #include "core/dom/QualifiedName.h" | 39 #include "core/dom/QualifiedName.h" |
| 39 #include "core/dom/ScriptExecutionContext.h" | 40 #include "core/dom/ScriptExecutionContext.h" |
| 40 #include "core/dom/TextLinkColors.h" | 41 #include "core/dom/TextLinkColors.h" |
| 41 #include "core/dom/TreeScope.h" | 42 #include "core/dom/TreeScope.h" |
| 42 #include "core/dom/UserActionElementSet.h" | 43 #include "core/dom/UserActionElementSet.h" |
| 43 #include "core/dom/ViewportArguments.h" | 44 #include "core/dom/ViewportArguments.h" |
| 44 #include "core/html/CollectionType.h" | 45 #include "core/html/CollectionType.h" |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 ImageDocumentClass = 1 << 2, | 200 ImageDocumentClass = 1 << 2, |
| 200 PluginDocumentClass = 1 << 3, | 201 PluginDocumentClass = 1 << 3, |
| 201 MediaDocumentClass = 1 << 4, | 202 MediaDocumentClass = 1 << 4, |
| 202 SVGDocumentClass = 1 << 5, | 203 SVGDocumentClass = 1 << 5, |
| 203 }; | 204 }; |
| 204 | 205 |
| 205 typedef unsigned char DocumentClassFlags; | 206 typedef unsigned char DocumentClassFlags; |
| 206 | 207 |
| 207 class Document : public ContainerNode, public TreeScope, public ScriptExecutionC
ontext { | 208 class Document : public ContainerNode, public TreeScope, public ScriptExecutionC
ontext { |
| 208 public: | 209 public: |
| 209 static PassRefPtr<Document> create(Frame* frame, const KURL& url) | 210 static PassRefPtr<Document> create(const DocumentInit& initializer = Documen
tInit()) |
| 210 { | 211 { |
| 211 return adoptRef(new Document(frame, url)); | 212 return adoptRef(new Document(initializer)); |
| 212 } | 213 } |
| 213 static PassRefPtr<Document> createXHTML(Frame* frame, const KURL& url) | 214 static PassRefPtr<Document> createXHTML(const DocumentInit& initializer = Do
cumentInit()) |
| 214 { | 215 { |
| 215 return adoptRef(new Document(frame, url, XHTMLDocumentClass)); | 216 return adoptRef(new Document(initializer, XHTMLDocumentClass)); |
| 216 } | 217 } |
| 217 virtual ~Document(); | 218 virtual ~Document(); |
| 218 | 219 |
| 219 MediaQueryMatcher* mediaQueryMatcher(); | 220 MediaQueryMatcher* mediaQueryMatcher(); |
| 220 | 221 |
| 221 using ContainerNode::ref; | 222 using ContainerNode::ref; |
| 222 using ContainerNode::deref; | 223 using ContainerNode::deref; |
| 223 | 224 |
| 224 Element* getElementById(const AtomicString& id) const; | 225 Element* getElementById(const AtomicString& id) const; |
| 225 | 226 |
| (...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 907 void setHasAnnotatedRegions(bool f) { m_hasAnnotatedRegions = f; } | 908 void setHasAnnotatedRegions(bool f) { m_hasAnnotatedRegions = f; } |
| 908 const Vector<AnnotatedRegionValue>& annotatedRegions() const; | 909 const Vector<AnnotatedRegionValue>& annotatedRegions() const; |
| 909 void setAnnotatedRegions(const Vector<AnnotatedRegionValue>&); | 910 void setAnnotatedRegions(const Vector<AnnotatedRegionValue>&); |
| 910 | 911 |
| 911 virtual void removeAllEventListeners(); | 912 virtual void removeAllEventListeners(); |
| 912 | 913 |
| 913 const SVGDocumentExtensions* svgExtensions(); | 914 const SVGDocumentExtensions* svgExtensions(); |
| 914 SVGDocumentExtensions* accessSVGExtensions(); | 915 SVGDocumentExtensions* accessSVGExtensions(); |
| 915 | 916 |
| 916 void initSecurityContext(); | 917 void initSecurityContext(); |
| 918 void initSecurityContext(const DocumentInit&); |
| 917 void initContentSecurityPolicy(); | 919 void initContentSecurityPolicy(); |
| 918 | 920 |
| 919 void updateURLForPushOrReplaceState(const KURL&); | 921 void updateURLForPushOrReplaceState(const KURL&); |
| 920 void statePopped(PassRefPtr<SerializedScriptValue>); | 922 void statePopped(PassRefPtr<SerializedScriptValue>); |
| 921 | 923 |
| 922 bool processingLoadEvent() const { return m_processingLoadEvent; } | 924 bool processingLoadEvent() const { return m_processingLoadEvent; } |
| 923 bool loadEventFinished() const { return m_loadEventFinished; } | 925 bool loadEventFinished() const { return m_loadEventFinished; } |
| 924 | 926 |
| 925 virtual bool isContextThread() const; | 927 virtual bool isContextThread() const; |
| 926 virtual bool isJSExecutionForbidden() const { return false; } | 928 virtual bool isJSExecutionForbidden() const { return false; } |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1040 void didAssociateFormControl(Element*); | 1042 void didAssociateFormControl(Element*); |
| 1041 | 1043 |
| 1042 virtual void addConsoleMessage(MessageSource, MessageLevel, const String& me
ssage, unsigned long requestIdentifier = 0); | 1044 virtual void addConsoleMessage(MessageSource, MessageLevel, const String& me
ssage, unsigned long requestIdentifier = 0); |
| 1043 | 1045 |
| 1044 virtual const SecurityOrigin* topOrigin() const OVERRIDE; | 1046 virtual const SecurityOrigin* topOrigin() const OVERRIDE; |
| 1045 | 1047 |
| 1046 PassRefPtr<FontLoader> fontloader(); | 1048 PassRefPtr<FontLoader> fontloader(); |
| 1047 DocumentLifecycleNotifier* lifecycleNotifier(); | 1049 DocumentLifecycleNotifier* lifecycleNotifier(); |
| 1048 | 1050 |
| 1049 protected: | 1051 protected: |
| 1050 Document(Frame*, const KURL&, DocumentClassFlags = DefaultDocumentClass); | 1052 Document(const DocumentInit&, DocumentClassFlags = DefaultDocumentClass); |
| 1051 | 1053 |
| 1052 virtual void didUpdateSecurityOrigin() OVERRIDE; | 1054 virtual void didUpdateSecurityOrigin() OVERRIDE; |
| 1053 | 1055 |
| 1054 void clearXMLVersion() { m_xmlVersion = String(); } | 1056 void clearXMLVersion() { m_xmlVersion = String(); } |
| 1055 | 1057 |
| 1056 virtual void dispose() OVERRIDE; | 1058 virtual void dispose() OVERRIDE; |
| 1057 | 1059 |
| 1058 private: | 1060 private: |
| 1059 friend class Node; | 1061 friend class Node; |
| 1060 friend class IgnoreDestructiveWriteCountIncrementer; | 1062 friend class IgnoreDestructiveWriteCountIncrementer; |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1136 // force an immediate layout when requested by JS. | 1138 // force an immediate layout when requested by JS. |
| 1137 bool m_ignorePendingStylesheets; | 1139 bool m_ignorePendingStylesheets; |
| 1138 | 1140 |
| 1139 // If we do ignore the pending stylesheet count, then we need to add a boole
an | 1141 // If we do ignore the pending stylesheet count, then we need to add a boole
an |
| 1140 // to track that this happened so that we can do a full repaint when the sty
lesheets | 1142 // to track that this happened so that we can do a full repaint when the sty
lesheets |
| 1141 // do eventually load. | 1143 // do eventually load. |
| 1142 PendingSheetLayout m_pendingSheetLayout; | 1144 PendingSheetLayout m_pendingSheetLayout; |
| 1143 | 1145 |
| 1144 Frame* m_frame; | 1146 Frame* m_frame; |
| 1145 DOMWindow* m_domWindow; | 1147 DOMWindow* m_domWindow; |
| 1148 HTMLImport* m_import; |
| 1146 | 1149 |
| 1147 RefPtr<CachedResourceLoader> m_cachedResourceLoader; | 1150 RefPtr<CachedResourceLoader> m_cachedResourceLoader; |
| 1148 RefPtr<DocumentParser> m_parser; | 1151 RefPtr<DocumentParser> m_parser; |
| 1149 unsigned m_activeParserCount; | 1152 unsigned m_activeParserCount; |
| 1150 RefPtr<ContextFeatures> m_contextFeatures; | 1153 RefPtr<ContextFeatures> m_contextFeatures; |
| 1151 | 1154 |
| 1152 bool m_wellFormed; | 1155 bool m_wellFormed; |
| 1153 | 1156 |
| 1154 // Document URLs. | 1157 // Document URLs. |
| 1155 KURL m_url; // Document.URL: The URL from which this document was retrieved. | 1158 KURL m_url; // Document.URL: The URL from which this document was retrieved. |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1325 RefPtr<ScriptedAnimationController> m_scriptedAnimationController; | 1328 RefPtr<ScriptedAnimationController> m_scriptedAnimationController; |
| 1326 | 1329 |
| 1327 Timer<Document> m_pendingTasksTimer; | 1330 Timer<Document> m_pendingTasksTimer; |
| 1328 Vector<OwnPtr<Task> > m_pendingTasks; | 1331 Vector<OwnPtr<Task> > m_pendingTasks; |
| 1329 | 1332 |
| 1330 OwnPtr<Prerenderer> m_prerenderer; | 1333 OwnPtr<Prerenderer> m_prerenderer; |
| 1331 | 1334 |
| 1332 OwnPtr<TextAutosizer> m_textAutosizer; | 1335 OwnPtr<TextAutosizer> m_textAutosizer; |
| 1333 | 1336 |
| 1334 RefPtr<CustomElementRegistrationContext> m_registrationContext; | 1337 RefPtr<CustomElementRegistrationContext> m_registrationContext; |
| 1335 HTMLImport* m_import; | |
| 1336 | 1338 |
| 1337 bool m_scheduledTasksAreSuspended; | 1339 bool m_scheduledTasksAreSuspended; |
| 1338 | 1340 |
| 1339 RefPtr<NamedFlowCollection> m_namedFlows; | 1341 RefPtr<NamedFlowCollection> m_namedFlows; |
| 1340 | 1342 |
| 1341 RefPtr<DOMSecurityPolicy> m_domSecurityPolicy; | 1343 RefPtr<DOMSecurityPolicy> m_domSecurityPolicy; |
| 1342 | 1344 |
| 1343 void sharedObjectPoolClearTimerFired(Timer<Document>*); | 1345 void sharedObjectPoolClearTimerFired(Timer<Document>*); |
| 1344 Timer<Document> m_sharedObjectPoolClearTimer; | 1346 Timer<Document> m_sharedObjectPoolClearTimer; |
| 1345 | 1347 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1410 inline bool Node::isDocumentNode() const | 1412 inline bool Node::isDocumentNode() const |
| 1411 { | 1413 { |
| 1412 return this == documentInternal(); | 1414 return this == documentInternal(); |
| 1413 } | 1415 } |
| 1414 | 1416 |
| 1415 Node* eventTargetNodeForDocument(Document*); | 1417 Node* eventTargetNodeForDocument(Document*); |
| 1416 | 1418 |
| 1417 } // namespace WebCore | 1419 } // namespace WebCore |
| 1418 | 1420 |
| 1419 #endif // Document_h | 1421 #endif // Document_h |
| OLD | NEW |