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

Unified Diff: third_party/WebKit/Source/core/css/StyleRuleImport.cpp

Issue 2777433003: Remove base URL, referrer, and charset setters from CSSParserContext (Closed)
Patch Set: Created 3 years, 9 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 | « no previous file | third_party/WebKit/Source/core/css/parser/CSSParserContext.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/css/StyleRuleImport.cpp
diff --git a/third_party/WebKit/Source/core/css/StyleRuleImport.cpp b/third_party/WebKit/Source/core/css/StyleRuleImport.cpp
index 4a05f29261200a9dae8605cea2a336665a2e9085..9693c45b9ab606f0abcef7d415df11deabc2bdbc 100644
--- a/third_party/WebKit/Source/core/css/StyleRuleImport.cpp
+++ b/third_party/WebKit/Source/core/css/StyleRuleImport.cpp
@@ -72,20 +72,19 @@ void StyleRuleImport::setCSSStyleSheet(
if (m_styleSheet)
m_styleSheet->clearOwnerRule();
- CSSParserContext* context = CSSParserContext::create(
- m_parentStyleSheet ? m_parentStyleSheet->parserContext()
- : strictCSSParserContext(),
- nullptr);
- context->setCharset(charset);
- Document* document =
- m_parentStyleSheet ? m_parentStyleSheet->singleOwnerDocument() : nullptr;
- if (!baseURL.isNull()) {
- context->setBaseURL(baseURL);
- if (document) {
- context->setReferrer(Referrer(baseURL.strippedForUseAsReferrer(),
- document->getReferrerPolicy()));
- }
+ Document* document = nullptr;
+ const CSSParserContext* context = strictCSSParserContext();
+ if (m_parentStyleSheet) {
+ document = m_parentStyleSheet->singleOwnerDocument();
+ context = m_parentStyleSheet->parserContext();
}
+ context = CSSParserContext::create(
+ context, baseURL, charset,
+ (!baseURL.isNull() && document)
+ ? Referrer(baseURL.strippedForUseAsReferrer(),
+ document->getReferrerPolicy())
+ : context->referrer(),
+ document);
m_styleSheet = StyleSheetContents::create(this, href, context);
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/parser/CSSParserContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698