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

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

Issue 15856002: First step of HTMLImports (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 7 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 | Annotate | Revision Log
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 22 matching lines...) Expand all
33 #include "core/dom/DocumentEventQueue.h" 33 #include "core/dom/DocumentEventQueue.h"
34 #include "core/dom/DocumentTiming.h" 34 #include "core/dom/DocumentTiming.h"
35 #include "core/dom/IconURL.h" 35 #include "core/dom/IconURL.h"
36 #include "core/dom/MutationObserver.h" 36 #include "core/dom/MutationObserver.h"
37 #include "core/dom/QualifiedName.h" 37 #include "core/dom/QualifiedName.h"
38 #include "core/dom/ScriptExecutionContext.h" 38 #include "core/dom/ScriptExecutionContext.h"
39 #include "core/dom/TreeScope.h" 39 #include "core/dom/TreeScope.h"
40 #include "core/dom/UserActionElementSet.h" 40 #include "core/dom/UserActionElementSet.h"
41 #include "core/dom/ViewportArguments.h" 41 #include "core/dom/ViewportArguments.h"
42 #include "core/html/CollectionType.h" 42 #include "core/html/CollectionType.h"
43 #include "core/html/HTMLImportsHost.h"
43 #include "core/inspector/InspectorCounters.h" 44 #include "core/inspector/InspectorCounters.h"
44 #include "core/page/FocusDirection.h" 45 #include "core/page/FocusDirection.h"
45 #include "core/page/PageVisibilityState.h" 46 #include "core/page/PageVisibilityState.h"
46 #include "core/platform/PlatformScreen.h" 47 #include "core/platform/PlatformScreen.h"
47 #include "weborigin/ReferrerPolicy.h" 48 #include "weborigin/ReferrerPolicy.h"
48 #include "core/platform/Timer.h" 49 #include "core/platform/Timer.h"
49 #include "core/platform/graphics/Color.h" 50 #include "core/platform/graphics/Color.h"
50 #include "core/platform/graphics/IntRect.h" 51 #include "core/platform/graphics/IntRect.h"
51 #include "core/platform/text/StringWithDirection.h" 52 #include "core/platform/text/StringWithDirection.h"
52 #include "core/rendering/HitTestRequest.h" 53 #include "core/rendering/HitTestRequest.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 HTMLDocumentClass = 1, 194 HTMLDocumentClass = 1,
194 XHTMLDocumentClass = 1 << 1, 195 XHTMLDocumentClass = 1 << 1,
195 ImageDocumentClass = 1 << 2, 196 ImageDocumentClass = 1 << 2,
196 PluginDocumentClass = 1 << 3, 197 PluginDocumentClass = 1 << 3,
197 MediaDocumentClass = 1 << 4, 198 MediaDocumentClass = 1 << 4,
198 SVGDocumentClass = 1 << 5, 199 SVGDocumentClass = 1 << 5,
199 }; 200 };
200 201
201 typedef unsigned char DocumentClassFlags; 202 typedef unsigned char DocumentClassFlags;
202 203
203 class Document : public ContainerNode, public TreeScope, public ScriptExecutionC ontext { 204 class Document : public ContainerNode, public TreeScope, public HTMLImportsHost, public ScriptExecutionContext {
204 public: 205 public:
205 static PassRefPtr<Document> create(Frame* frame, const KURL& url) 206 static PassRefPtr<Document> create(Frame* frame, const KURL& url)
206 { 207 {
207 return adoptRef(new Document(frame, url)); 208 return adoptRef(new Document(frame, url));
208 } 209 }
209 static PassRefPtr<Document> createXHTML(Frame* frame, const KURL& url) 210 static PassRefPtr<Document> createXHTML(Frame* frame, const KURL& url)
210 { 211 {
211 return adoptRef(new Document(frame, url, XHTMLDocumentClass)); 212 return adoptRef(new Document(frame, url, XHTMLDocumentClass));
212 } 213 }
213 virtual ~Document(); 214 virtual ~Document();
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 StyleResolver* styleResolver() 423 StyleResolver* styleResolver()
423 { 424 {
424 if (!m_styleResolver) 425 if (!m_styleResolver)
425 createStyleResolver(); 426 createStyleResolver();
426 return m_styleResolver.get(); 427 return m_styleResolver.get();
427 } 428 }
428 429
429 void notifyRemovePendingSheetIfNeeded(); 430 void notifyRemovePendingSheetIfNeeded();
430 431
431 bool haveStylesheetsLoaded() const; 432 bool haveStylesheetsLoaded() const;
433 bool haveStylesheetsAndImportsLoaded() const { return haveImportsLoaded() && haveStylesheetsLoaded(); }
432 434
433 // This is a DOM function. 435 // This is a DOM function.
434 StyleSheetList* styleSheets(); 436 StyleSheetList* styleSheets();
435 437
436 DocumentStyleSheetCollection* styleSheetCollection() { return m_styleSheetCo llection.get(); } 438 DocumentStyleSheetCollection* styleSheetCollection() { return m_styleSheetCo llection.get(); }
437 439
438 bool gotoAnchorNeededAfterStylesheetsLoad() { return m_gotoAnchorNeededAfter StylesheetsLoad; } 440 bool gotoAnchorNeededAfterStylesheetsLoad() { return m_gotoAnchorNeededAfter StylesheetsLoad; }
439 void setGotoAnchorNeededAfterStylesheetsLoad(bool b) { m_gotoAnchorNeededAft erStylesheetsLoad = b; } 441 void setGotoAnchorNeededAfterStylesheetsLoad(bool b) { m_gotoAnchorNeededAft erStylesheetsLoad = b; }
440 442
441 /** 443 /**
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after
1054 Prerenderer* prerenderer() { return m_prerenderer.get(); } 1056 Prerenderer* prerenderer() { return m_prerenderer.get(); }
1055 1057
1056 TextAutosizer* textAutosizer() { return m_textAutosizer.get(); } 1058 TextAutosizer* textAutosizer() { return m_textAutosizer.get(); }
1057 1059
1058 PassRefPtr<Element> createElement(const AtomicString& localName, const Atomi cString& typeExtension, ExceptionCode&); 1060 PassRefPtr<Element> createElement(const AtomicString& localName, const Atomi cString& typeExtension, ExceptionCode&);
1059 PassRefPtr<Element> createElementNS(const AtomicString& namespaceURI, const String& qualifiedName, const AtomicString& typeExtension, ExceptionCode&); 1061 PassRefPtr<Element> createElementNS(const AtomicString& namespaceURI, const String& qualifiedName, const AtomicString& typeExtension, ExceptionCode&);
1060 PassRefPtr<CustomElementConstructor> registerElement(WebCore::ScriptState*, const AtomicString& name, ExceptionCode&); 1062 PassRefPtr<CustomElementConstructor> registerElement(WebCore::ScriptState*, const AtomicString& name, ExceptionCode&);
1061 PassRefPtr<CustomElementConstructor> registerElement(WebCore::ScriptState*, const AtomicString& name, const Dictionary& options, ExceptionCode&); 1063 PassRefPtr<CustomElementConstructor> registerElement(WebCore::ScriptState*, const AtomicString& name, const Dictionary& options, ExceptionCode&);
1062 CustomElementRegistry* registry() const { return m_registry.get(); } 1064 CustomElementRegistry* registry() const { return m_registry.get(); }
1063 CustomElementRegistry* ensureCustomElementRegistry(); 1065 CustomElementRegistry* ensureCustomElementRegistry();
1066 HTMLImports* imports();
1064 1067
1065 void adjustFloatQuadsForScrollAndAbsoluteZoom(Vector<FloatQuad>&, RenderObje ct*); 1068 void adjustFloatQuadsForScrollAndAbsoluteZoom(Vector<FloatQuad>&, RenderObje ct*);
1066 void adjustFloatRectForScrollAndAbsoluteZoom(FloatRect&, RenderObject*); 1069 void adjustFloatRectForScrollAndAbsoluteZoom(FloatRect&, RenderObject*);
1067 1070
1068 bool hasActiveParser(); 1071 bool hasActiveParser();
1069 unsigned activeParserCount() { return m_activeParserCount; } 1072 unsigned activeParserCount() { return m_activeParserCount; }
1070 void incrementActiveParserCount() { ++m_activeParserCount; } 1073 void incrementActiveParserCount() { ++m_activeParserCount; }
1071 void decrementActiveParserCount(); 1074 void decrementActiveParserCount();
1072 1075
1073 void setContextFeatures(PassRefPtr<ContextFeatures>); 1076 void setContextFeatures(PassRefPtr<ContextFeatures>);
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
1145 virtual double timerAlignmentInterval() const; 1148 virtual double timerAlignmentInterval() const;
1146 1149
1147 void updateTitle(const StringWithDirection&); 1150 void updateTitle(const StringWithDirection&);
1148 void updateFocusAppearanceTimerFired(Timer<Document>*); 1151 void updateFocusAppearanceTimerFired(Timer<Document>*);
1149 void updateBaseURL(); 1152 void updateBaseURL();
1150 1153
1151 void buildAccessKeyMap(TreeScope* root); 1154 void buildAccessKeyMap(TreeScope* root);
1152 1155
1153 void createStyleResolver(); 1156 void createStyleResolver();
1154 1157
1158 void executeScriptsWaitingForResourcesIfNeeded();
1159
1160 bool haveImportsLoaded() const;
1161 // HTMLImportsHost
1162 virtual void didLoadAllImports() OVERRIDE;
1163 virtual SecurityContext* importsContext() OVERRIDE;
1164
1155 void seamlessParentUpdatedStylesheets(); 1165 void seamlessParentUpdatedStylesheets();
1156 1166
1157 PassRefPtr<NodeList> handleZeroPadding(const HitTestRequest&, HitTestResult& ) const; 1167 PassRefPtr<NodeList> handleZeroPadding(const HitTestRequest&, HitTestResult& ) const;
1158 1168
1159 void loadEventDelayTimerFired(Timer<Document>*); 1169 void loadEventDelayTimerFired(Timer<Document>*);
1160 1170
1161 void pendingTasksTimerFired(Timer<Document>*); 1171 void pendingTasksTimerFired(Timer<Document>*);
1162 1172
1163 static void didReceiveTask(void*); 1173 static void didReceiveTask(void*);
1164 1174
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
1403 RefPtr<ScriptedAnimationController> m_scriptedAnimationController; 1413 RefPtr<ScriptedAnimationController> m_scriptedAnimationController;
1404 1414
1405 Timer<Document> m_pendingTasksTimer; 1415 Timer<Document> m_pendingTasksTimer;
1406 Vector<OwnPtr<Task> > m_pendingTasks; 1416 Vector<OwnPtr<Task> > m_pendingTasks;
1407 1417
1408 OwnPtr<Prerenderer> m_prerenderer; 1418 OwnPtr<Prerenderer> m_prerenderer;
1409 1419
1410 OwnPtr<TextAutosizer> m_textAutosizer; 1420 OwnPtr<TextAutosizer> m_textAutosizer;
1411 1421
1412 RefPtr<CustomElementRegistry> m_registry; 1422 RefPtr<CustomElementRegistry> m_registry;
1423 OwnPtr<HTMLImports> m_imports;
1413 1424
1414 bool m_scheduledTasksAreSuspended; 1425 bool m_scheduledTasksAreSuspended;
1415 1426
1416 RefPtr<NamedFlowCollection> m_namedFlows; 1427 RefPtr<NamedFlowCollection> m_namedFlows;
1417 1428
1418 RefPtr<DOMSecurityPolicy> m_domSecurityPolicy; 1429 RefPtr<DOMSecurityPolicy> m_domSecurityPolicy;
1419 1430
1420 void sharedObjectPoolClearTimerFired(Timer<Document>*); 1431 void sharedObjectPoolClearTimerFired(Timer<Document>*);
1421 Timer<Document> m_sharedObjectPoolClearTimer; 1432 Timer<Document> m_sharedObjectPoolClearTimer;
1422 1433
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
1506 trackForDebugging(); 1517 trackForDebugging();
1507 #endif 1518 #endif
1508 InspectorCounters::incrementCounter(InspectorCounters::NodeCounter); 1519 InspectorCounters::incrementCounter(InspectorCounters::NodeCounter);
1509 } 1520 }
1510 1521
1511 Node* eventTargetNodeForDocument(Document*); 1522 Node* eventTargetNodeForDocument(Document*);
1512 1523
1513 } // namespace WebCore 1524 } // namespace WebCore
1514 1525
1515 #endif // Document_h 1526 #endif // Document_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698