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

Unified Diff: Source/core/rendering/style/RenderStyle.cpp

Issue 18371008: Add a WebDocument::watchCssSelectors(selectors) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@pinned
Patch Set: Omit split CLs 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
Index: Source/core/rendering/style/RenderStyle.cpp
diff --git a/Source/core/rendering/style/RenderStyle.cpp b/Source/core/rendering/style/RenderStyle.cpp
index 1ffb016b2fbd11bc963a16c1ebf6540dbc66ac96..026291731afd9e9323fdd4dfb330a2a2891ffd03 100644
--- a/Source/core/rendering/style/RenderStyle.cpp
+++ b/Source/core/rendering/style/RenderStyle.cpp
@@ -692,6 +692,30 @@ void RenderStyle::clearCursorList()
rareInheritedData.access()->cursorData = 0;
}
+#if ENABLE(CSS_CALLBACKS)
+void RenderStyle::addCallbackSelector(const String& selector, Document* document)
+{
+ ASSERT(!rareNonInheritedData->m_document.get()
+ || rareNonInheritedData->m_document.get() == document);
+ if (!rareNonInheritedData->m_callbackSelectors.contains(selector)) {
+ StyleRareNonInheritedData* data = rareNonInheritedData.access();
+ data->m_callbackSelectors.append(selector);
+ // Assigns a WeakPtr to |document| to data->m_document.
+ document->addSelectorMatch(selector, data);
esprehn 2013/07/13 01:43:01 Please do this call outside this function. Return
Jeffrey Yasskin 2013/08/13 00:29:29 This went away with the move to Element.
+ }
+}
+
+void RenderStyle::removeCallbackSelector(const String& selector)
+{
+ size_t index = rareNonInheritedData->m_callbackSelectors.find(selector);
+ if (index != notFound) {
+ rareNonInheritedData.access()->m_callbackSelectors.remove(index);
+ if (Document* document = rareNonInheritedData->m_document.get())
+ document->removeSelectorMatch(selector);
esprehn 2013/07/13 01:43:01 Ditto, mutating the RenderStyle should have no sid
+ }
+}
+#endif
+
void RenderStyle::clearContent()
{
if (rareNonInheritedData->m_content)

Powered by Google App Engine
This is Rietveld 408576698