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

Unified Diff: Source/core/css/resolver/StyleResolverState.h

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/StyleResolverState.h
diff --git a/Source/core/css/resolver/StyleResolverState.h b/Source/core/css/resolver/StyleResolverState.h
index 0e53805164613484c857d224732913b6a37ca5c6..fbb2906acf2a3080efad3e04e56a6f856169ecc5 100644
--- a/Source/core/css/resolver/StyleResolverState.h
+++ b/Source/core/css/resolver/StyleResolverState.h
@@ -38,6 +38,7 @@ namespace WebCore {
class FontDescription;
class RenderRegion;
+class StyleRule;
// ElementResolveContext is immutable and serves as an input to the style resolve process.
class ElementResolveContext {
@@ -92,6 +93,7 @@ public:
, m_lineHeightValue(0)
, m_fontDirty(false)
, m_styleMap(*this, m_elementStyleResources)
+ , m_rule(0)
{ }
// These are all just pass-through methods to ElementResolveContext.
@@ -113,6 +115,9 @@ public:
const RenderRegion* regionForStyling() const { return m_regionForStyling; }
+ void setRule(StyleRule* rule) { m_rule = rule; }
+ const StyleRule* rule() const { return m_rule; }
+
// FIXME: These are effectively side-channel "out parameters" for the various
// map functions. When we map from CSS to style objects we use this state object
// to track various meta-data about that mapping (e.g. if it's cache-able).
@@ -212,8 +217,9 @@ private:
// CSSToStyleMap is a pure-logic class and only contains
// a back-pointer to this object.
CSSToStyleMap m_styleMap;
-};
+ StyleRule* m_rule;
+};
} // namespace WebCore
#endif // StyleResolverState_h

Powered by Google App Engine
This is Rietveld 408576698