OLD | NEW |
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
reserved. | 4 * Copyright (C) 2002, 2005, 2006, 2008, 2009, 2010, 2012 Apple Inc. All rights
reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 StyleRuleBase::traceAfterDispatch(visitor); | 67 StyleRuleBase::traceAfterDispatch(visitor); |
68 } | 68 } |
69 | 69 |
70 void StyleRuleImport::setCSSStyleSheet(const String& href, const KURL& baseURL,
const String& charset, const CSSStyleSheetResource* cachedStyleSheet) | 70 void StyleRuleImport::setCSSStyleSheet(const String& href, const KURL& baseURL,
const String& charset, const CSSStyleSheetResource* cachedStyleSheet) |
71 { | 71 { |
72 if (m_styleSheet) | 72 if (m_styleSheet) |
73 m_styleSheet->clearOwnerRule(); | 73 m_styleSheet->clearOwnerRule(); |
74 | 74 |
75 CSSParserContext context = m_parentStyleSheet ? m_parentStyleSheet->parserCo
ntext() : strictCSSParserContext(); | 75 CSSParserContext context = m_parentStyleSheet ? m_parentStyleSheet->parserCo
ntext() : strictCSSParserContext(); |
76 context.setCharset(charset); | 76 context.setCharset(charset); |
77 if (!baseURL.isNull()) | 77 Document* document = m_parentStyleSheet ? m_parentStyleSheet->singleOwnerDoc
ument() : 0; |
| 78 if (!baseURL.isNull()) { |
78 context.setBaseURL(baseURL); | 79 context.setBaseURL(baseURL); |
| 80 if (document) |
| 81 context.setReferrer(Referrer(baseURL.strippedForUseAsReferrer(), doc
ument->referrerPolicy())); |
| 82 } |
79 | 83 |
80 m_styleSheet = StyleSheetContents::create(this, href, context); | 84 m_styleSheet = StyleSheetContents::create(this, href, context); |
81 | 85 |
82 Document* document = m_parentStyleSheet ? m_parentStyleSheet->singleOwnerDoc
ument() : 0; | |
83 m_styleSheet->parseAuthorStyleSheet(cachedStyleSheet, document ? document->s
ecurityOrigin() : 0); | 86 m_styleSheet->parseAuthorStyleSheet(cachedStyleSheet, document ? document->s
ecurityOrigin() : 0); |
84 | 87 |
85 m_loading = false; | 88 m_loading = false; |
86 | 89 |
87 if (m_parentStyleSheet) { | 90 if (m_parentStyleSheet) { |
88 m_parentStyleSheet->notifyLoadedSheet(cachedStyleSheet); | 91 m_parentStyleSheet->notifyLoadedSheet(cachedStyleSheet); |
89 m_parentStyleSheet->checkLoaded(); | 92 m_parentStyleSheet->checkLoaded(); |
90 } | 93 } |
91 } | 94 } |
92 | 95 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 // removed from the pending sheet count, so let the doc know | 134 // removed from the pending sheet count, so let the doc know |
132 // the sheet being imported is pending. | 135 // the sheet being imported is pending. |
133 if (m_parentStyleSheet && m_parentStyleSheet->loadCompleted() && rootShe
et == m_parentStyleSheet) | 136 if (m_parentStyleSheet && m_parentStyleSheet->loadCompleted() && rootShe
et == m_parentStyleSheet) |
134 m_parentStyleSheet->startLoadingDynamicSheet(); | 137 m_parentStyleSheet->startLoadingDynamicSheet(); |
135 m_loading = true; | 138 m_loading = true; |
136 m_resource->addClient(&m_styleSheetClient); | 139 m_resource->addClient(&m_styleSheetClient); |
137 } | 140 } |
138 } | 141 } |
139 | 142 |
140 } // namespace WebCore | 143 } // namespace WebCore |
OLD | NEW |