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..19939afd7e824dc388c5d04d3db7a67c27507d47 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/Document.h" |
#include "core/dom/WebCoreMemoryInstrumentation.h" |
#include "core/rendering/style/ContentData.h" |
#include "core/rendering/style/RenderStyle.h" |
@@ -52,6 +53,9 @@ StyleRareNonInheritedData::StyleRareNonInheritedData() |
, m_clipPath(RenderStyle::initialClipPath()) |
, m_visitedLinkBackgroundColor(RenderStyle::initialBackgroundColor()) |
, m_order(RenderStyle::initialOrder()) |
+#if ENABLE(CSS_CALLBACKS) |
+ , m_document() |
abarth-chromium
2013/07/12 23:44:11
Why do you need this explicit call to the construc
Jeffrey Yasskin
2013/07/16 00:38:51
I don't. That's a remnant from an earlier version
|
+#endif |
, m_flowThread(RenderStyle::initialFlowThread()) |
, m_regionThread(RenderStyle::initialRegionThread()) |
, m_regionFragment(RenderStyle::initialRegionFragment()) |
@@ -124,6 +128,9 @@ StyleRareNonInheritedData::StyleRareNonInheritedData(const StyleRareNonInherited |
, m_visitedLinkBorderTopColor(o.m_visitedLinkBorderTopColor) |
, m_visitedLinkBorderBottomColor(o.m_visitedLinkBorderBottomColor) |
, m_order(o.m_order) |
+#if ENABLE(CSS_CALLBACKS) |
+ , m_document() |
+#endif |
, m_flowThread(o.m_flowThread) |
, m_regionThread(o.m_regionThread) |
, m_regionFragment(o.m_regionFragment) |
@@ -156,6 +163,14 @@ StyleRareNonInheritedData::StyleRareNonInheritedData(const StyleRareNonInherited |
StyleRareNonInheritedData::~StyleRareNonInheritedData() |
{ |
+#if ENABLE(CSS_CALLBACKS) |
+ if (!m_callbackSelectors.isEmpty() && m_document.get()) { |
+ Document* document = m_document.get(); |
+ for (Vector<String>::const_iterator it = m_callbackSelectors.begin(), end = m_callbackSelectors.end(); |
+ it != end; ++it) |
+ document->removeSelectorMatch(*it); |
esprehn
2013/07/13 01:43:01
No need to cache the ptr, m_document->...() is fin
Jeffrey Yasskin
2013/07/16 00:38:51
WTF's WeakPtr doesn't actually have an operator->,
|
+ } |
+#endif |
} |
bool StyleRareNonInheritedData::operator==(const StyleRareNonInheritedData& o) const |
@@ -199,6 +214,10 @@ bool StyleRareNonInheritedData::operator==(const StyleRareNonInheritedData& o) c |
&& m_visitedLinkBorderTopColor == o.m_visitedLinkBorderTopColor |
&& m_visitedLinkBorderBottomColor == o.m_visitedLinkBorderBottomColor |
&& m_order == o.m_order |
+#if ENABLE(CSS_CALLBACKS) |
+ && m_callbackSelectors == o.m_callbackSelectors |
+ && m_document.get() == o.m_document.get() |
+#endif |
&& m_flowThread == o.m_flowThread |
&& m_regionThread == o.m_regionThread |
&& m_regionFragment == o.m_regionFragment |