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

Unified Diff: Source/core/css/DocumentRuleSets.cpp

Issue 66383005: Remove the concept of user stylesheets. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix WebFrameCSSCallbackTest tests 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
« no previous file with comments | « Source/core/css/DocumentRuleSets.h ('k') | Source/core/css/InspectorCSSOMWrappers.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/DocumentRuleSets.cpp
diff --git a/Source/core/css/DocumentRuleSets.cpp b/Source/core/css/DocumentRuleSets.cpp
index dc17860b56f703a2b43e8b631bf480ba106da37e..27f082f121d815b0e55eb982cc1b4168b5d92853 100644
--- a/Source/core/css/DocumentRuleSets.cpp
+++ b/Source/core/css/DocumentRuleSets.cpp
@@ -47,30 +47,13 @@ DocumentRuleSets::~DocumentRuleSets()
{
}
-void DocumentRuleSets::initUserStyle(StyleEngine* styleSheetCollection, const Vector<RefPtr<StyleRule> >& watchedSelectors, const MediaQueryEvaluator& medium, StyleResolver& resolver)
-{
- OwnPtr<RuleSet> tempUserStyle = RuleSet::create();
- if (CSSStyleSheet* pageUserSheet = styleSheetCollection->pageUserSheet())
- tempUserStyle->addRulesFromSheet(pageUserSheet->contents(), medium, &resolver);
- collectRulesFromUserStyleSheets(styleSheetCollection->documentUserStyleSheets(), *tempUserStyle, medium, resolver);
- collectRulesFromWatchedSelectors(watchedSelectors, *tempUserStyle);
- if (tempUserStyle->ruleCount() > 0 || tempUserStyle->pageRules().size() > 0)
- m_userStyle = tempUserStyle.release();
-}
-
-void DocumentRuleSets::collectRulesFromUserStyleSheets(const Vector<RefPtr<CSSStyleSheet> >& userSheets, RuleSet& userStyle, const MediaQueryEvaluator& medium, StyleResolver& resolver)
-{
- for (unsigned i = 0; i < userSheets.size(); ++i) {
- ASSERT(userSheets[i]->contents()->isUserStyleSheet());
- userStyle.addRulesFromSheet(userSheets[i]->contents(), medium, &resolver);
- resolver.addFontFaceRules(userStyle.fontFaceRules());
- }
-}
-
-void DocumentRuleSets::collectRulesFromWatchedSelectors(const Vector<RefPtr<StyleRule> >& watchedSelectors, RuleSet& userStyle)
+void DocumentRuleSets::initWatchedSelectorRules(const Vector<RefPtr<StyleRule> >& watchedSelectors)
{
+ if (!watchedSelectors.size())
+ return;
+ m_watchedSelectorsRules = RuleSet::create();
for (unsigned i = 0; i < watchedSelectors.size(); ++i)
- userStyle.addStyleRule(watchedSelectors[i].get(), RuleHasNoSpecialState);
+ m_watchedSelectorsRules->addStyleRule(watchedSelectors[i].get(), RuleHasNoSpecialState);
}
void DocumentRuleSets::resetAuthorStyle()
@@ -89,8 +72,8 @@ void DocumentRuleSets::collectFeaturesTo(RuleFeatureSet& features, bool isViewSo
if (isViewSource)
features.add(CSSDefaultStyleSheets::viewSourceStyle()->features());
- if (m_userStyle)
- features.add(m_userStyle->features());
+ if (m_watchedSelectorsRules)
+ features.add(m_watchedSelectorsRules->features());
m_treeBoundaryCrossingRules.collectFeaturesTo(features);
}
« no previous file with comments | « Source/core/css/DocumentRuleSets.h ('k') | Source/core/css/InspectorCSSOMWrappers.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698