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

Unified Diff: Source/core/dom/StyleEngine.cpp

Issue 25505007: Remove bogus use of the term "user style" in Blink and Blink API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Patch for landing Created 7 years, 2 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
« no previous file with comments | « Source/core/dom/StyleEngine.h ('k') | Source/core/page/InjectedStyleSheet.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/StyleEngine.cpp
diff --git a/Source/core/dom/StyleEngine.cpp b/Source/core/dom/StyleEngine.cpp
index 70a47e015bde0ec2a25c40501cd07e460989da0e..2f5b2cacefa046643377dabfe6a66ec425f02ccc 100644
--- a/Source/core/dom/StyleEngine.cpp
+++ b/Source/core/dom/StyleEngine.cpp
@@ -45,8 +45,8 @@
#include "core/page/Page.h"
#include "core/page/PageGroup.h"
#include "core/page/Settings.h"
-#include "core/page/UserContentURLPattern.h"
#include "core/svg/SVGStyleElement.h"
+#include "platform/URLPatternMatcher.h"
namespace WebCore {
@@ -71,8 +71,6 @@ StyleEngine::~StyleEngine()
{
if (m_pageUserSheet)
m_pageUserSheet->clearOwnerNode();
- for (unsigned i = 0; i < m_injectedUserStyleSheets.size(); ++i)
- m_injectedUserStyleSheets[i]->clearOwnerNode();
for (unsigned i = 0; i < m_injectedAuthorStyleSheets.size(); ++i)
m_injectedAuthorStyleSheets[i]->clearOwnerNode();
for (unsigned i = 0; i < m_userStyleSheets.size(); ++i)
@@ -206,12 +204,6 @@ void StyleEngine::updatePageUserSheet()
m_document.addedStyleSheet(addedSheet, RecalcStyleImmediately);
}
-const Vector<RefPtr<CSSStyleSheet> >& StyleEngine::injectedUserStyleSheets() const
-{
- updateInjectedStyleSheetCache();
- return m_injectedUserStyleSheets;
-}
-
const Vector<RefPtr<CSSStyleSheet> >& StyleEngine::injectedAuthorStyleSheets() const
{
updateInjectedStyleSheetCache();
@@ -223,7 +215,6 @@ void StyleEngine::updateInjectedStyleSheetCache() const
if (m_injectedStyleSheetCacheValid)
return;
m_injectedStyleSheetCacheValid = true;
- m_injectedUserStyleSheets.clear();
m_injectedAuthorStyleSheets.clear();
Page* owningPage = m_document.page();
@@ -231,20 +222,16 @@ void StyleEngine::updateInjectedStyleSheetCache() const
return;
const PageGroup& pageGroup = owningPage->group();
- const UserStyleSheetVector& sheets = pageGroup.userStyleSheets();
+ const InjectedStyleSheetVector& sheets = pageGroup.injectedStyleSheets();
for (unsigned i = 0; i < sheets.size(); ++i) {
- const UserStyleSheet* sheet = sheets[i].get();
- if (sheet->injectedFrames() == InjectInTopFrameOnly && m_document.ownerElement())
+ const InjectedStyleSheet* sheet = sheets[i].get();
+ if (sheet->injectedFrames() == InjectStyleInTopFrameOnly && m_document.ownerElement())
continue;
- if (!UserContentURLPattern::matchesPatterns(m_document.url(), sheet->whitelist(), sheet->blacklist()))
+ if (!URLPatternMatcher::matchesPatterns(m_document.url(), sheet->whitelist()))
continue;
- RefPtr<CSSStyleSheet> groupSheet = CSSStyleSheet::createInline(const_cast<Document*>(&m_document), sheet->url());
- bool isUserStyleSheet = sheet->level() == UserStyleUserLevel;
- if (isUserStyleSheet)
- m_injectedUserStyleSheets.append(groupSheet);
- else
- m_injectedAuthorStyleSheets.append(groupSheet);
- groupSheet->contents()->setIsUserStyleSheet(isUserStyleSheet);
+ RefPtr<CSSStyleSheet> groupSheet = CSSStyleSheet::createInline(const_cast<Document*>(&m_document), KURL());
+ m_injectedAuthorStyleSheets.append(groupSheet);
+ groupSheet->contents()->setIsUserStyleSheet(false);
groupSheet->contents()->parseString(sheet->source());
}
}
« no previous file with comments | « Source/core/dom/StyleEngine.h ('k') | Source/core/page/InjectedStyleSheet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698