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

Side by Side Diff: third_party/WebKit/Source/core/css/StyleRuleImport.cpp

Issue 2776163002: Change CSSParserContext to either take explicit or implicit referrer (Closed)
Patch Set: updates Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * (C) 2002-2003 Dirk Mueller (mueller@kde.org) 3 * (C) 2002-2003 Dirk Mueller (mueller@kde.org)
4 * Copyright (C) 2002, 2005, 2006, 2008, 2009, 2010, 2012 Apple Inc. All rights 4 * Copyright (C) 2002, 2005, 2006, 2008, 2009, 2010, 2012 Apple Inc. All rights
5 * reserved. 5 * reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 const CSSStyleSheetResource* cachedStyleSheet) { 71 const CSSStyleSheetResource* cachedStyleSheet) {
72 if (m_styleSheet) 72 if (m_styleSheet)
73 m_styleSheet->clearOwnerRule(); 73 m_styleSheet->clearOwnerRule();
74 74
75 Document* document = nullptr; 75 Document* document = nullptr;
76 const CSSParserContext* context = strictCSSParserContext(); 76 const CSSParserContext* context = strictCSSParserContext();
77 if (m_parentStyleSheet) { 77 if (m_parentStyleSheet) {
78 document = m_parentStyleSheet->singleOwnerDocument(); 78 document = m_parentStyleSheet->singleOwnerDocument();
79 context = m_parentStyleSheet->parserContext(); 79 context = m_parentStyleSheet->parserContext();
80 } 80 }
81 context = CSSParserContext::create( 81 context =
82 context, baseURL, charset, 82 CSSParserContext::create(context, baseURL,
83 (!baseURL.isNull() && document) 83 document ? document->getReferrerPolicy()
84 ? Referrer(baseURL.strippedForUseAsReferrer(), 84 : context->referrer().referrerPolicy,
estark 2017/03/28 11:02:34 This looks like it will result in a different refe
jochen (gone - plz use gerrit) 2017/03/28 11:21:23 good point. I think it's correct(er) now. If we h
85 document->getReferrerPolicy()) 85 charset, document);
86 : context->referrer(),
87 document);
88 86
89 m_styleSheet = StyleSheetContents::create(this, href, context); 87 m_styleSheet = StyleSheetContents::create(this, href, context);
90 88
91 m_styleSheet->parseAuthorStyleSheet( 89 m_styleSheet->parseAuthorStyleSheet(
92 cachedStyleSheet, document ? document->getSecurityOrigin() : 0); 90 cachedStyleSheet, document ? document->getSecurityOrigin() : 0);
93 91
94 m_loading = false; 92 m_loading = false;
95 93
96 if (m_parentStyleSheet) { 94 if (m_parentStyleSheet) {
97 m_parentStyleSheet->notifyLoadedSheet(cachedStyleSheet); 95 m_parentStyleSheet->notifyLoadedSheet(cachedStyleSheet);
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 // the sheet being imported is pending. 141 // the sheet being imported is pending.
144 if (m_parentStyleSheet && m_parentStyleSheet->loadCompleted() && 142 if (m_parentStyleSheet && m_parentStyleSheet->loadCompleted() &&
145 rootSheet == m_parentStyleSheet) 143 rootSheet == m_parentStyleSheet)
146 m_parentStyleSheet->startLoadingDynamicSheet(); 144 m_parentStyleSheet->startLoadingDynamicSheet();
147 m_loading = true; 145 m_loading = true;
148 m_resource->addClient(m_styleSheetClient); 146 m_resource->addClient(m_styleSheetClient);
149 } 147 }
150 } 148 }
151 149
152 } // namespace blink 150 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/FontFace.cpp ('k') | third_party/WebKit/Source/core/css/parser/CSSParserContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698