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

Unified Diff: Source/core/css/StyleRule.h

Issue 42543007: StyleResolver should update RuleSets lazily. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Revised Created 7 years, 1 month 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/StyleRule.h
diff --git a/Source/core/css/StyleRule.h b/Source/core/css/StyleRule.h
index aa319ed734416358497681eebc5c1765e301f7cd..5a0bf89f765427ad6540bd053238877ca2aa5295 100644
--- a/Source/core/css/StyleRule.h
+++ b/Source/core/css/StyleRule.h
@@ -156,6 +156,12 @@ private:
RefPtr<StylePropertySet> m_properties;
};
+inline const StyleRuleFontFace* toStyleRuleFontFace(const StyleRuleBase* rule)
+{
+ ASSERT_WITH_SECURITY_IMPLICATION(!rule || rule->isFontFaceRule());
+ return static_cast<const StyleRuleFontFace*>(rule);
+}
+
class StyleRulePage : public StyleRuleBase {
public:
static PassRefPtr<StyleRulePage> create() { return adoptRef(new StyleRulePage); }
@@ -290,6 +296,12 @@ inline const StyleRuleMedia* toStyleRuleMedia(const StyleRuleGroup* rule)
return static_cast<const StyleRuleMedia*>(rule);
}
+inline const StyleRuleMedia* toStyleRuleMedia(const StyleRuleBase* rule)
+{
+ ASSERT_WITH_SECURITY_IMPLICATION(!rule || rule->isMediaRule());
+ return static_cast<const StyleRuleMedia*>(rule);
+}
+
inline const StyleRuleSupports* toStyleRuleSupports(const StyleRuleGroup* rule)
{
ASSERT_WITH_SECURITY_IMPLICATION(!rule || rule->isSupportsRule());
@@ -302,6 +314,12 @@ inline const StyleRuleRegion* toStyleRuleRegion(const StyleRuleGroup* rule)
return static_cast<const StyleRuleRegion*>(rule);
}
+inline StyleRuleViewport* toStyleRuleViewport(StyleRuleBase* rule)
+{
+ ASSERT_WITH_SECURITY_IMPLICATION(!rule || rule->isViewportRule());
+ return static_cast<StyleRuleViewport*>(rule);
+}
+
class StyleRuleFilter : public StyleRuleBase {
public:
static PassRefPtr<StyleRuleFilter> create(const String& filterName) { return adoptRef(new StyleRuleFilter(filterName)); }

Powered by Google App Engine
This is Rietveld 408576698