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

Unified Diff: Source/core/css/resolver/StyleBuilderCustom.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/css/resolver/StyleBuilderCustom.cpp
diff --git a/Source/core/css/resolver/StyleBuilderCustom.cpp b/Source/core/css/resolver/StyleBuilderCustom.cpp
index 748d54ff2cf00db0a36999b7f54dca3f89abbc54..b6ed836b4640b1eebcc305344600c4a8627aafcf 100644
--- a/Source/core/css/resolver/StyleBuilderCustom.cpp
+++ b/Source/core/css/resolver/StyleBuilderCustom.cpp
@@ -84,6 +84,7 @@
#include "core/css/resolver/StyleResolverState.h"
#include "core/css/resolver/TransformBuilder.h"
#include "core/css/resolver/ViewportStyleResolver.h"
+#include "core/dom/CSSSelectorWatch.h"
#include "core/dom/DocumentStyleSheetCollection.h"
#include "core/dom/Text.h"
#include "core/dom/shadow/ShadowRoot.h"
@@ -1707,6 +1708,22 @@ void StyleBuilder::oldApplyProperty(CSSPropertyID id, StyleResolver* styleResolv
state.style()->setTapHighlightColor(col);
return;
}
+ case CSSPropertyInternalCallback: {
+ if (isInherit || isInitial)
+ return;
+ if (primitiveValue) {
+ switch (primitiveValue->getValueID()) {
+ case CSSValueInternalPresence:
+ state.style()->addCallbackSelector(
+ state.rule()->selectorList().selectorsText(),
esprehn 2013/07/17 07:14:32 This dynamically recreates the text of the selecto
Jeffrey Yasskin 2013/08/02 01:34:07 Right, but the "div" case didn't show up as signif
+ CSSSelectorWatch::from(state.element()->document()));
esprehn 2013/07/17 07:14:32 The hash table lookup hiding in here is going to h
Jeffrey Yasskin 2013/08/02 01:34:07 A hash table lookup is generally cheaper than an a
+ return;
+ default:
+ break;
+ }
+ }
+ break;
+ }
case CSSPropertyInvalid:
return;
// Directional properties are resolved by resolveDirectionAwareProperty() before the switch.

Powered by Google App Engine
This is Rietveld 408576698