Chromium Code Reviews| 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 121 class LayoutPoint; | 121 class LayoutPoint; |
| 122 class LiveNodeListBase; | 122 class LiveNodeListBase; |
| 123 class Locale; | 123 class Locale; |
| 124 class LocalFrame; | 124 class LocalFrame; |
| 125 class Location; | 125 class Location; |
| 126 class MainThreadTaskRunner; | 126 class MainThreadTaskRunner; |
| 127 class MediaQueryListListener; | 127 class MediaQueryListListener; |
| 128 class MediaQueryMatcher; | 128 class MediaQueryMatcher; |
| 129 class NodeFilter; | 129 class NodeFilter; |
| 130 class NodeIterator; | 130 class NodeIterator; |
| 131 class NthIndexCache; | |
| 131 class Page; | 132 class Page; |
| 132 class PlatformMouseEvent; | 133 class PlatformMouseEvent; |
| 133 class ProcessingInstruction; | 134 class ProcessingInstruction; |
| 134 class QualifiedName; | 135 class QualifiedName; |
| 135 class Range; | 136 class Range; |
| 136 class LayoutView; | 137 class LayoutView; |
| 137 class RequestAnimationFrameCallback; | 138 class RequestAnimationFrameCallback; |
| 138 class ResourceFetcher; | 139 class ResourceFetcher; |
| 139 class SVGDocumentExtensions; | 140 class SVGDocumentExtensions; |
| 140 class SVGUseElement; | 141 class SVGUseElement; |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 240 using ContainerNode::ref; | 241 using ContainerNode::ref; |
| 241 using ContainerNode::deref; | 242 using ContainerNode::deref; |
| 242 #endif | 243 #endif |
| 243 using SecurityContext::securityOrigin; | 244 using SecurityContext::securityOrigin; |
| 244 using SecurityContext::contentSecurityPolicy; | 245 using SecurityContext::contentSecurityPolicy; |
| 245 using TreeScope::getElementById; | 246 using TreeScope::getElementById; |
| 246 | 247 |
| 247 virtual bool canContainRangeEndPoint() const override { return true; } | 248 virtual bool canContainRangeEndPoint() const override { return true; } |
| 248 | 249 |
| 249 SelectorQueryCache& selectorQueryCache(); | 250 SelectorQueryCache& selectorQueryCache(); |
| 251 NthIndexCache* nthIndexCache(); | |
| 250 | 252 |
| 251 // Focus Management. | 253 // Focus Management. |
| 252 Element* activeElement() const; | 254 Element* activeElement() const; |
| 253 bool hasFocus() const; | 255 bool hasFocus() const; |
| 254 | 256 |
| 255 // DOM methods & attributes for Document | 257 // DOM methods & attributes for Document |
| 256 | 258 |
| 257 DEFINE_ATTRIBUTE_EVENT_LISTENER(beforecopy); | 259 DEFINE_ATTRIBUTE_EVENT_LISTENER(beforecopy); |
| 258 DEFINE_ATTRIBUTE_EVENT_LISTENER(beforecut); | 260 DEFINE_ATTRIBUTE_EVENT_LISTENER(beforecut); |
| 259 DEFINE_ATTRIBUTE_EVENT_LISTENER(beforepaste); | 261 DEFINE_ATTRIBUTE_EVENT_LISTENER(beforepaste); |
| (...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1073 #endif | 1075 #endif |
| 1074 | 1076 |
| 1075 virtual PassRefPtrWillBeRawPtr<Document> cloneDocumentWithoutChildren(); | 1077 virtual PassRefPtrWillBeRawPtr<Document> cloneDocumentWithoutChildren(); |
| 1076 | 1078 |
| 1077 bool importContainerNodeChildren(ContainerNode* oldContainerNode, PassRefPtr WillBeRawPtr<ContainerNode> newContainerNode, ExceptionState&); | 1079 bool importContainerNodeChildren(ContainerNode* oldContainerNode, PassRefPtr WillBeRawPtr<ContainerNode> newContainerNode, ExceptionState&); |
| 1078 void lockCompatibilityMode() { m_compatibilityModeLocked = true; } | 1080 void lockCompatibilityMode() { m_compatibilityModeLocked = true; } |
| 1079 ParserSynchronizationPolicy parserSynchronizationPolicy() const { return m_p arserSyncPolicy; } | 1081 ParserSynchronizationPolicy parserSynchronizationPolicy() const { return m_p arserSyncPolicy; } |
| 1080 | 1082 |
| 1081 private: | 1083 private: |
| 1082 friend class IgnoreDestructiveWriteCountIncrementer; | 1084 friend class IgnoreDestructiveWriteCountIncrementer; |
| 1085 friend class NthIndexCacheScope; | |
| 1083 | 1086 |
| 1084 bool isDocumentFragment() const = delete; // This will catch anyone doing an unnecessary check. | 1087 bool isDocumentFragment() const = delete; // This will catch anyone doing an unnecessary check. |
| 1085 bool isDocumentNode() const = delete; // This will catch anyone doing an unn ecessary check. | 1088 bool isDocumentNode() const = delete; // This will catch anyone doing an unn ecessary check. |
| 1086 bool isElementNode() const = delete; // This will catch anyone doing an unne cessary check. | 1089 bool isElementNode() const = delete; // This will catch anyone doing an unne cessary check. |
| 1087 | 1090 |
| 1088 ScriptedAnimationController& ensureScriptedAnimationController(); | 1091 ScriptedAnimationController& ensureScriptedAnimationController(); |
| 1089 virtual SecurityContext& securityContext() override final { return *this; } | 1092 virtual SecurityContext& securityContext() override final { return *this; } |
| 1090 virtual EventQueue* eventQueue() const override final; | 1093 virtual EventQueue* eventQueue() const override final; |
| 1091 | 1094 |
| 1092 // FIXME: Rename the StyleRecalc state to RenderTreeUpdate. | 1095 // FIXME: Rename the StyleRecalc state to RenderTreeUpdate. |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1165 bool haveStylesheetsLoaded() const; | 1168 bool haveStylesheetsLoaded() const; |
| 1166 | 1169 |
| 1167 void setHoverNode(PassRefPtrWillBeRawPtr<Node>); | 1170 void setHoverNode(PassRefPtrWillBeRawPtr<Node>); |
| 1168 Node* hoverNode() const { return m_hoverNode.get(); } | 1171 Node* hoverNode() const { return m_hoverNode.get(); } |
| 1169 | 1172 |
| 1170 using EventFactorySet = HashSet<OwnPtr<EventFactoryBase>>; | 1173 using EventFactorySet = HashSet<OwnPtr<EventFactoryBase>>; |
| 1171 static EventFactorySet& eventFactories(); | 1174 static EventFactorySet& eventFactories(); |
| 1172 | 1175 |
| 1173 void updateElementOpacity(const AtomicString& cssSelector, double opacity); | 1176 void updateElementOpacity(const AtomicString& cssSelector, double opacity); |
| 1174 | 1177 |
| 1178 bool useNthIndexCache() const { return m_useNthIndexCache; } | |
| 1179 void setUseNthIndexCache(bool); | |
|
esprehn
2015/03/30 22:55:31
This is the same as null checking the OwnPtr. You
| |
| 1180 | |
| 1175 DocumentLifecycle m_lifecycle; | 1181 DocumentLifecycle m_lifecycle; |
| 1176 | 1182 |
| 1177 bool m_hasNodesWithPlaceholderStyle; | 1183 bool m_hasNodesWithPlaceholderStyle; |
| 1178 bool m_evaluateMediaQueriesOnStyleRecalc; | 1184 bool m_evaluateMediaQueriesOnStyleRecalc; |
| 1179 | 1185 |
| 1180 // If we do ignore the pending stylesheet count, then we need to add a boole an | 1186 // If we do ignore the pending stylesheet count, then we need to add a boole an |
| 1181 // to track that this happened so that we can do a full repaint when the sty lesheets | 1187 // to track that this happened so that we can do a full repaint when the sty lesheets |
| 1182 // do eventually load. | 1188 // do eventually load. |
| 1183 PendingSheetLayout m_pendingSheetLayout; | 1189 PendingSheetLayout m_pendingSheetLayout; |
| 1184 | 1190 |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1310 | 1316 |
| 1311 OwnPtrWillBeMember<SVGDocumentExtensions> m_svgExtensions; | 1317 OwnPtrWillBeMember<SVGDocumentExtensions> m_svgExtensions; |
| 1312 | 1318 |
| 1313 Vector<AnnotatedRegionValue> m_annotatedRegions; | 1319 Vector<AnnotatedRegionValue> m_annotatedRegions; |
| 1314 bool m_hasAnnotatedRegions; | 1320 bool m_hasAnnotatedRegions; |
| 1315 bool m_annotatedRegionsDirty; | 1321 bool m_annotatedRegionsDirty; |
| 1316 | 1322 |
| 1317 WillBeHeapHashMap<String, RefPtrWillBeMember<HTMLCanvasElement>> m_cssCanvas Elements; | 1323 WillBeHeapHashMap<String, RefPtrWillBeMember<HTMLCanvasElement>> m_cssCanvas Elements; |
| 1318 | 1324 |
| 1319 OwnPtr<SelectorQueryCache> m_selectorQueryCache; | 1325 OwnPtr<SelectorQueryCache> m_selectorQueryCache; |
| 1326 OwnPtrWillBeMember<NthIndexCache> m_nthIndexCache; | |
| 1320 | 1327 |
| 1321 bool m_useSecureKeyboardEntryWhenActive; | 1328 bool m_useSecureKeyboardEntryWhenActive; |
| 1322 | 1329 |
| 1323 DocumentClassFlags m_documentClasses; | 1330 DocumentClassFlags m_documentClasses; |
| 1324 | 1331 |
| 1325 bool m_isViewSource; | 1332 bool m_isViewSource; |
| 1326 bool m_sawElementsInKnownNamespaces; | 1333 bool m_sawElementsInKnownNamespaces; |
| 1327 bool m_isSrcdocDocument; | 1334 bool m_isSrcdocDocument; |
| 1328 bool m_isMobileDocument; | 1335 bool m_isMobileDocument; |
| 1329 bool m_isTransitionDocument; | 1336 bool m_isTransitionDocument; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1390 bool m_hasViewportUnits; | 1397 bool m_hasViewportUnits; |
| 1391 | 1398 |
| 1392 using DocumentVisibilityObserverSet = WillBeHeapHashSet<RawPtrWillBeWeakMemb er<DocumentVisibilityObserver>>; | 1399 using DocumentVisibilityObserverSet = WillBeHeapHashSet<RawPtrWillBeWeakMemb er<DocumentVisibilityObserver>>; |
| 1393 DocumentVisibilityObserverSet m_visibilityObservers; | 1400 DocumentVisibilityObserverSet m_visibilityObservers; |
| 1394 | 1401 |
| 1395 int m_styleRecalcElementCounter; | 1402 int m_styleRecalcElementCounter; |
| 1396 | 1403 |
| 1397 ParserSynchronizationPolicy m_parserSyncPolicy; | 1404 ParserSynchronizationPolicy m_parserSyncPolicy; |
| 1398 | 1405 |
| 1399 OriginsUsingFeatures::Value m_originsUsingFeaturesValue; | 1406 OriginsUsingFeatures::Value m_originsUsingFeaturesValue; |
| 1407 | |
| 1408 bool m_useNthIndexCache; | |
| 1400 }; | 1409 }; |
| 1401 | 1410 |
| 1402 inline bool Document::shouldOverrideLegacyDescription(ViewportDescription::Type origin) | 1411 inline bool Document::shouldOverrideLegacyDescription(ViewportDescription::Type origin) |
| 1403 { | 1412 { |
| 1404 // The different (legacy) meta tags have different priorities based on the t ype | 1413 // The different (legacy) meta tags have different priorities based on the t ype |
| 1405 // regardless of which order they appear in the DOM. The priority is given b y the | 1414 // regardless of which order they appear in the DOM. The priority is given b y the |
| 1406 // ViewportDescription::Type enum. | 1415 // ViewportDescription::Type enum. |
| 1407 return origin >= m_legacyViewportDescription.type; | 1416 return origin >= m_legacyViewportDescription.type; |
| 1408 } | 1417 } |
| 1409 | 1418 |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 1437 DEFINE_TYPE_CASTS(TreeScope, Document, document, true, true); | 1446 DEFINE_TYPE_CASTS(TreeScope, Document, document, true, true); |
| 1438 | 1447 |
| 1439 } // namespace blink | 1448 } // namespace blink |
| 1440 | 1449 |
| 1441 #ifndef NDEBUG | 1450 #ifndef NDEBUG |
| 1442 // Outside the WebCore namespace for ease of invocation from gdb. | 1451 // Outside the WebCore namespace for ease of invocation from gdb. |
| 1443 void showLiveDocumentInstances(); | 1452 void showLiveDocumentInstances(); |
| 1444 #endif | 1453 #endif |
| 1445 | 1454 |
| 1446 #endif // Document_h | 1455 #endif // Document_h |
| OLD | NEW |