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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Document.h
diff --git a/Source/core/dom/Document.h b/Source/core/dom/Document.h
index 724a87a6b183a4eb20ede0df5e0b578eb376252f..dcea6ad54fc233ad068b9574221c3079c87b74b5 100644
--- a/Source/core/dom/Document.h
+++ b/Source/core/dom/Document.h
@@ -141,7 +141,9 @@ class SegmentedString;
class SelectorQueryCache;
class SerializedScriptValue;
class Settings;
+class StyleRareNonInheritedData;
class StyleResolver;
+class StyleRule;
class StyleSheet;
class StyleSheetContents;
class StyleSheetList;
@@ -450,6 +452,11 @@ public:
void evaluateMediaQueryList();
+#if ENABLE(CSS_CALLBACKS)
+ void watchCssSelectors(const Vector<String>& selectors);
+ const Vector<RefPtr<StyleRule> >& watchedCallbackSelectors() const { return m_watchedCallbackSelectors; }
+#endif
+
// Never returns 0.
FormController* formController();
Vector<String> formElementsState() const;
@@ -1031,6 +1038,11 @@ public:
bool inStyleRecalc() { return m_inStyleRecalc; }
+#if ENABLE(CSS_CALLBACKS)
+ void addSelectorMatch(const String& selector, StyleRareNonInheritedData*);
+ void removeSelectorMatch(const String& selector);
+#endif
+
// Return a Locale for the default locale if the argument is null or empty.
Locale& getCachedLocale(const AtomicString& locale = nullAtom);
@@ -1126,6 +1138,12 @@ private:
void addListenerType(ListenerType listenerType) { m_listenerTypes |= listenerType; }
void addMutationEventListenerTypeIfEnabled(ListenerType);
+#if ENABLE(CSS_CALLBACKS)
+ // Runs FrameLoaderClient::selectorMatchChanged with the updated value of
+ // m_callbackSelectorChange.
+ void callbackSelectorChangeTimerFired(Timer<Document>*);
+#endif
+
void didAssociateFormControlsTimerFired(Timer<Document>*);
void styleResolverThrowawayTimerFired(Timer<Document>*);
@@ -1344,6 +1362,18 @@ private:
RefPtr<NamedFlowCollection> m_namedFlows;
+#if ENABLE(CSS_CALLBACKS)
+ Vector<RefPtr<StyleRule> > m_watchedCallbackSelectors;
+ // Maps a CSS selector string with a -webkit-callback property to the number
+ // of matching RenderStyle objects in this document.
+ HashMap<String, int> m_matchingCallbackSelectors;
+ // Selectors are relative to m_matchingCallbackSelectors's contents at
+ // the previous call to selectorMatchChanged.
+ HashSet<String> m_addedSelectors;
+ HashSet<String> m_removedSelectors;
+ Timer<Document> m_callbackSelectorChangeTimer;
+#endif
+
RefPtr<DOMSecurityPolicy> m_domSecurityPolicy;
void sharedObjectPoolClearTimerFired(Timer<Document>*);
« 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