Chromium Code Reviews| 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..bc0bd8fcea443aa5c358975fde13085b0ebf312b 100644 |
| --- a/Source/core/rendering/style/RenderStyle.cpp |
| +++ b/Source/core/rendering/style/RenderStyle.cpp |
| @@ -26,6 +26,7 @@ |
| #include <algorithm> |
| #include "CSSPropertyNames.h" |
| #include "core/css/resolver/StyleResolver.h" |
| +#include "core/dom/CSSSelectorWatch.h" |
| #include "core/dom/WebCoreMemoryInstrumentation.h" |
| #include "core/platform/graphics/Font.h" |
| #include "core/platform/graphics/FontSelector.h" |
| @@ -692,6 +693,28 @@ void RenderStyle::clearCursorList() |
| rareInheritedData.access()->cursorData = 0; |
| } |
| +void RenderStyle::addCallbackSelector(const String& selector, CSSSelectorWatch* selectorWatch) |
| +{ |
| + ASSERT(!rareNonInheritedData->m_selectorWatch.get() |
| + || rareNonInheritedData->m_selectorWatch.get() == selectorWatch); |
| + if (!rareNonInheritedData->m_callbackSelectors.contains(selector)) { |
| + StyleRareNonInheritedData* data = rareNonInheritedData.access(); |
| + data->m_callbackSelectors.append(selector); |
| + // Assigns a WeakPtr to |selectorWatch| to data->m_selectorWatch. |
| + selectorWatch->addSelectorMatch(selector, data); |
| + } |
| +} |
| + |
| +void RenderStyle::removeCallbackSelector(const String& selector) |
|
esprehn
2013/07/17 07:14:32
Nothing ever calls this, can you just remove it?
Jeffrey Yasskin
2013/08/02 01:34:07
Done.
|
| +{ |
| + size_t index = rareNonInheritedData->m_callbackSelectors.find(selector); |
| + if (index != notFound) { |
| + rareNonInheritedData.access()->m_callbackSelectors.remove(index); |
| + if (CSSSelectorWatch* selectorWatch = rareNonInheritedData->m_selectorWatch.get()) |
| + selectorWatch->removeSelectorMatch(selector); |
| + } |
| +} |
| + |
| void RenderStyle::clearContent() |
| { |
| if (rareNonInheritedData->m_content) |