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

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

Issue 18371008: Add a WebDocument::watchCssSelectors(selectors) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@pinned
Patch Set: Fix most comments; TODO benchmark and use Element::recalcStyle 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/StyleRareNonInheritedData.cpp
diff --git a/Source/core/rendering/style/StyleRareNonInheritedData.cpp b/Source/core/rendering/style/StyleRareNonInheritedData.cpp
index e4d640ab9c00c38bc0e79353794b367adcc39b72..a185c73b86d94f584e8547214e9b447e491e7b92 100644
--- a/Source/core/rendering/style/StyleRareNonInheritedData.cpp
+++ b/Source/core/rendering/style/StyleRareNonInheritedData.cpp
@@ -22,6 +22,7 @@
#include "config.h"
#include "core/rendering/style/StyleRareNonInheritedData.h"
+#include "core/dom/CSSSelectorWatch.h"
#include "core/dom/WebCoreMemoryInstrumentation.h"
#include "core/rendering/style/ContentData.h"
#include "core/rendering/style/RenderStyle.h"
@@ -156,6 +157,11 @@ StyleRareNonInheritedData::StyleRareNonInheritedData(const StyleRareNonInherited
StyleRareNonInheritedData::~StyleRareNonInheritedData()
{
+ if (!m_callbackSelectors.isEmpty() && m_selectorWatch.get()) {
+ for (Vector<String>::const_iterator it = m_callbackSelectors.begin(), end = m_callbackSelectors.end();
+ it != end; ++it)
+ m_selectorWatch.get()->removeSelectorMatch(*it);
+ }
}
bool StyleRareNonInheritedData::operator==(const StyleRareNonInheritedData& o) const
@@ -199,6 +205,8 @@ bool StyleRareNonInheritedData::operator==(const StyleRareNonInheritedData& o) c
&& m_visitedLinkBorderTopColor == o.m_visitedLinkBorderTopColor
&& m_visitedLinkBorderBottomColor == o.m_visitedLinkBorderBottomColor
&& m_order == o.m_order
+ && m_callbackSelectors == o.m_callbackSelectors
+ && m_selectorWatch.get() == o.m_selectorWatch.get()
&& m_flowThread == o.m_flowThread
&& m_regionThread == o.m_regionThread
&& m_regionFragment == o.m_regionFragment

Powered by Google App Engine
This is Rietveld 408576698