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

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

Issue 18371008: Add a WebDocument::watchCssSelectors(selectors) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@pinned
Patch Set: Initial Created 7 years, 5 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
« no previous file with comments | « Source/core/css/resolver/StyleResolverState.cpp ('k') | Source/core/dom/Document.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 class SVGDocumentExtensions; 134 class SVGDocumentExtensions;
135 class ScriptElementData; 135 class ScriptElementData;
136 class ScriptRunner; 136 class ScriptRunner;
137 class ScriptableDocumentParser; 137 class ScriptableDocumentParser;
138 class ScriptedAnimationController; 138 class ScriptedAnimationController;
139 class SecurityOrigin; 139 class SecurityOrigin;
140 class SegmentedString; 140 class SegmentedString;
141 class SelectorQueryCache; 141 class SelectorQueryCache;
142 class SerializedScriptValue; 142 class SerializedScriptValue;
143 class Settings; 143 class Settings;
144 class StyleRareNonInheritedData;
144 class StyleResolver; 145 class StyleResolver;
146 class StyleRule;
145 class StyleSheet; 147 class StyleSheet;
146 class StyleSheetContents; 148 class StyleSheetContents;
147 class StyleSheetList; 149 class StyleSheetList;
148 class Text; 150 class Text;
149 class TextAutosizer; 151 class TextAutosizer;
150 class TextResourceDecoder; 152 class TextResourceDecoder;
151 class Touch; 153 class Touch;
152 class TouchList; 154 class TouchList;
153 class TransformSource; 155 class TransformSource;
154 class TreeWalker; 156 class TreeWalker;
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 bool gotoAnchorNeededAfterStylesheetsLoad() { return m_gotoAnchorNeededAfter StylesheetsLoad; } 445 bool gotoAnchorNeededAfterStylesheetsLoad() { return m_gotoAnchorNeededAfter StylesheetsLoad; }
444 void setGotoAnchorNeededAfterStylesheetsLoad(bool b) { m_gotoAnchorNeededAft erStylesheetsLoad = b; } 446 void setGotoAnchorNeededAfterStylesheetsLoad(bool b) { m_gotoAnchorNeededAft erStylesheetsLoad = b; }
445 447
446 // Called when one or more stylesheets in the document may have been added, removed, or changed. 448 // Called when one or more stylesheets in the document may have been added, removed, or changed.
447 void styleResolverChanged(StyleResolverUpdateType, StyleResolverUpdateMode = FullStyleUpdate); 449 void styleResolverChanged(StyleResolverUpdateType, StyleResolverUpdateMode = FullStyleUpdate);
448 450
449 void didAccessStyleResolver(); 451 void didAccessStyleResolver();
450 452
451 void evaluateMediaQueryList(); 453 void evaluateMediaQueryList();
452 454
455 #if ENABLE(CSS_CALLBACKS)
456 void watchCssSelectors(const Vector<String>& selectors);
457 const Vector<RefPtr<StyleRule> >& watchedCallbackSelectors() const { return m_watchedCallbackSelectors; }
458 #endif
459
453 // Never returns 0. 460 // Never returns 0.
454 FormController* formController(); 461 FormController* formController();
455 Vector<String> formElementsState() const; 462 Vector<String> formElementsState() const;
456 void setStateForNewFormElements(const Vector<String>&); 463 void setStateForNewFormElements(const Vector<String>&);
457 464
458 FrameView* view() const; // can be NULL 465 FrameView* view() const; // can be NULL
459 Frame* frame() const { return m_frame; } // can be NULL 466 Frame* frame() const { return m_frame; } // can be NULL
460 Page* page() const; // can be NULL 467 Page* page() const; // can be NULL
461 Settings* settings() const; // can be NULL 468 Settings* settings() const; // can be NULL
462 469
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
1024 1031
1025 DocumentSharedObjectPool* sharedObjectPool() { return m_sharedObjectPool.get (); } 1032 DocumentSharedObjectPool* sharedObjectPool() { return m_sharedObjectPool.get (); }
1026 1033
1027 void didRemoveAllPendingStylesheet(); 1034 void didRemoveAllPendingStylesheet();
1028 void setNeedsNotifyRemoveAllPendingStylesheet() { m_needsNotifyRemoveAllPend ingStylesheet = true; } 1035 void setNeedsNotifyRemoveAllPendingStylesheet() { m_needsNotifyRemoveAllPend ingStylesheet = true; }
1029 void clearStyleResolver(); 1036 void clearStyleResolver();
1030 void notifySeamlessChildDocumentsOfStylesheetUpdate() const; 1037 void notifySeamlessChildDocumentsOfStylesheetUpdate() const;
1031 1038
1032 bool inStyleRecalc() { return m_inStyleRecalc; } 1039 bool inStyleRecalc() { return m_inStyleRecalc; }
1033 1040
1041 #if ENABLE(CSS_CALLBACKS)
1042 void addSelectorMatch(const String& selector, StyleRareNonInheritedData*);
1043 void removeSelectorMatch(const String& selector);
1044 #endif
1045
1034 // Return a Locale for the default locale if the argument is null or empty. 1046 // Return a Locale for the default locale if the argument is null or empty.
1035 Locale& getCachedLocale(const AtomicString& locale = nullAtom); 1047 Locale& getCachedLocale(const AtomicString& locale = nullAtom);
1036 1048
1037 DocumentTimeline* timeline() { return m_timeline.get(); } 1049 DocumentTimeline* timeline() { return m_timeline.get(); }
1038 1050
1039 void addToTopLayer(Element*, const Element* before = 0); 1051 void addToTopLayer(Element*, const Element* before = 0);
1040 void removeFromTopLayer(Element*); 1052 void removeFromTopLayer(Element*);
1041 const Vector<RefPtr<Element> >& topLayerElements() const { return m_topLayer Elements; } 1053 const Vector<RefPtr<Element> >& topLayerElements() const { return m_topLayer Elements; }
1042 Element* activeModalDialog() const { return !m_topLayerElements.isEmpty() ? m_topLayerElements.last().get() : 0; } 1054 Element* activeModalDialog() const { return !m_topLayerElements.isEmpty() ? m_topLayerElements.last().get() : 0; }
1043 1055
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
1119 PassRefPtr<HTMLCollection> ensureCachedCollection(CollectionType); 1131 PassRefPtr<HTMLCollection> ensureCachedCollection(CollectionType);
1120 1132
1121 // Note that dispatching a window load event may cause the DOMWindow to be d etached from 1133 // Note that dispatching a window load event may cause the DOMWindow to be d etached from
1122 // the Frame, so callers should take a reference to the DOMWindow (which own s us) to 1134 // the Frame, so callers should take a reference to the DOMWindow (which own s us) to
1123 // prevent the Document from getting blown away from underneath them. 1135 // prevent the Document from getting blown away from underneath them.
1124 void dispatchWindowLoadEvent(); 1136 void dispatchWindowLoadEvent();
1125 1137
1126 void addListenerType(ListenerType listenerType) { m_listenerTypes |= listene rType; } 1138 void addListenerType(ListenerType listenerType) { m_listenerTypes |= listene rType; }
1127 void addMutationEventListenerTypeIfEnabled(ListenerType); 1139 void addMutationEventListenerTypeIfEnabled(ListenerType);
1128 1140
1141 #if ENABLE(CSS_CALLBACKS)
1142 // Runs FrameLoaderClient::selectorMatchChanged with the updated value of
1143 // m_callbackSelectorChange.
1144 void callbackSelectorChangeTimerFired(Timer<Document>*);
1145 #endif
1146
1129 void didAssociateFormControlsTimerFired(Timer<Document>*); 1147 void didAssociateFormControlsTimerFired(Timer<Document>*);
1130 1148
1131 void styleResolverThrowawayTimerFired(Timer<Document>*); 1149 void styleResolverThrowawayTimerFired(Timer<Document>*);
1132 Timer<Document> m_styleResolverThrowawayTimer; 1150 Timer<Document> m_styleResolverThrowawayTimer;
1133 double m_lastStyleResolverAccessTime; 1151 double m_lastStyleResolverAccessTime;
1134 1152
1135 OwnPtr<StyleResolver> m_styleResolver; 1153 OwnPtr<StyleResolver> m_styleResolver;
1136 bool m_didCalculateStyleResolver; 1154 bool m_didCalculateStyleResolver;
1137 bool m_hasNodesWithPlaceholderStyle; 1155 bool m_hasNodesWithPlaceholderStyle;
1138 bool m_needsNotifyRemoveAllPendingStylesheet; 1156 bool m_needsNotifyRemoveAllPendingStylesheet;
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
1337 1355
1338 OwnPtr<TextAutosizer> m_textAutosizer; 1356 OwnPtr<TextAutosizer> m_textAutosizer;
1339 1357
1340 RefPtr<CustomElementRegistry> m_registry; 1358 RefPtr<CustomElementRegistry> m_registry;
1341 RefPtr<HTMLImportsController> m_imports; 1359 RefPtr<HTMLImportsController> m_imports;
1342 1360
1343 bool m_scheduledTasksAreSuspended; 1361 bool m_scheduledTasksAreSuspended;
1344 1362
1345 RefPtr<NamedFlowCollection> m_namedFlows; 1363 RefPtr<NamedFlowCollection> m_namedFlows;
1346 1364
1365 #if ENABLE(CSS_CALLBACKS)
1366 Vector<RefPtr<StyleRule> > m_watchedCallbackSelectors;
1367 // Maps a CSS selector string with a -webkit-callback property to the number
1368 // of matching RenderStyle objects in this document.
1369 HashMap<String, int> m_matchingCallbackSelectors;
1370 // Selectors are relative to m_matchingCallbackSelectors's contents at
1371 // the previous call to selectorMatchChanged.
1372 HashSet<String> m_addedSelectors;
1373 HashSet<String> m_removedSelectors;
1374 Timer<Document> m_callbackSelectorChangeTimer;
1375 #endif
1376
1347 RefPtr<DOMSecurityPolicy> m_domSecurityPolicy; 1377 RefPtr<DOMSecurityPolicy> m_domSecurityPolicy;
1348 1378
1349 void sharedObjectPoolClearTimerFired(Timer<Document>*); 1379 void sharedObjectPoolClearTimerFired(Timer<Document>*);
1350 Timer<Document> m_sharedObjectPoolClearTimer; 1380 Timer<Document> m_sharedObjectPoolClearTimer;
1351 1381
1352 OwnPtr<DocumentSharedObjectPool> m_sharedObjectPool; 1382 OwnPtr<DocumentSharedObjectPool> m_sharedObjectPool;
1353 1383
1354 #ifndef NDEBUG 1384 #ifndef NDEBUG
1355 bool m_didDispatchViewportPropertiesChanged; 1385 bool m_didDispatchViewportPropertiesChanged;
1356 #endif 1386 #endif
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
1416 inline bool Node::isDocumentNode() const 1446 inline bool Node::isDocumentNode() const
1417 { 1447 {
1418 return this == documentInternal(); 1448 return this == documentInternal();
1419 } 1449 }
1420 1450
1421 Node* eventTargetNodeForDocument(Document*); 1451 Node* eventTargetNodeForDocument(Document*);
1422 1452
1423 } // namespace WebCore 1453 } // namespace WebCore
1424 1454
1425 #endif // Document_h 1455 #endif // Document_h
OLDNEW
« no previous file with comments | « Source/core/css/resolver/StyleResolverState.cpp ('k') | Source/core/dom/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698