OLD | NEW |
1 /* | 1 /* |
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) | 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2004, 2006, 2007, 2012 Apple Inc. All rights reserved. | 3 * Copyright (C) 2004, 2006, 2007, 2012 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 const AtomicString& StyleSheetContents::namespaceURIFromPrefix(const AtomicStrin
g& prefix) | 315 const AtomicString& StyleSheetContents::namespaceURIFromPrefix(const AtomicStrin
g& prefix) |
316 { | 316 { |
317 return m_namespaces.get(prefix); | 317 return m_namespaces.get(prefix); |
318 } | 318 } |
319 | 319 |
320 void StyleSheetContents::parseAuthorStyleSheet(const CSSStyleSheetResource* cach
edStyleSheet, const SecurityOrigin* securityOrigin) | 320 void StyleSheetContents::parseAuthorStyleSheet(const CSSStyleSheetResource* cach
edStyleSheet, const SecurityOrigin* securityOrigin) |
321 { | 321 { |
322 TRACE_EVENT1("blink,devtools.timeline", "ParseAuthorStyleSheet", "data", Ins
pectorParseAuthorStyleSheetEvent::data(cachedStyleSheet)); | 322 TRACE_EVENT1("blink,devtools.timeline", "ParseAuthorStyleSheet", "data", Ins
pectorParseAuthorStyleSheetEvent::data(cachedStyleSheet)); |
323 | 323 |
324 bool isSameOriginRequest = securityOrigin && securityOrigin->canRequest(base
URL()); | 324 bool isSameOriginRequest = securityOrigin && securityOrigin->canRequest(base
URL()); |
| 325 |
| 326 // When the response was fetched via the Service Worker, the original URL ma
y not be same as the base URL. |
| 327 // TODO(horo): When we will use the original URL as the base URL, we can rem
ove this check. crbug.com/553535 |
| 328 if (cachedStyleSheet->response().wasFetchedViaServiceWorker()) { |
| 329 const KURL originalURL(cachedStyleSheet->response().originalURLViaServic
eWorker()); |
| 330 // |originalURL| is empty when the response is created in the SW. |
| 331 if (!originalURL.isEmpty() && !securityOrigin->canRequest(originalURL)) |
| 332 isSameOriginRequest = false; |
| 333 } |
| 334 |
325 CSSStyleSheetResource::MIMETypeCheck mimeTypeCheck = isQuirksModeBehavior(m_
parserContext.mode()) && isSameOriginRequest ? CSSStyleSheetResource::MIMETypeCh
eck::Lax : CSSStyleSheetResource::MIMETypeCheck::Strict; | 335 CSSStyleSheetResource::MIMETypeCheck mimeTypeCheck = isQuirksModeBehavior(m_
parserContext.mode()) && isSameOriginRequest ? CSSStyleSheetResource::MIMETypeCh
eck::Lax : CSSStyleSheetResource::MIMETypeCheck::Strict; |
326 String sheetText = cachedStyleSheet->sheetText(mimeTypeCheck); | 336 String sheetText = cachedStyleSheet->sheetText(mimeTypeCheck); |
327 | 337 |
328 const ResourceResponse& response = cachedStyleSheet->response(); | 338 const ResourceResponse& response = cachedStyleSheet->response(); |
329 m_sourceMapURL = response.httpHeaderField(HTTPNames::SourceMap); | 339 m_sourceMapURL = response.httpHeaderField(HTTPNames::SourceMap); |
330 if (m_sourceMapURL.isEmpty()) { | 340 if (m_sourceMapURL.isEmpty()) { |
331 // Try to get deprecated header. | 341 // Try to get deprecated header. |
332 m_sourceMapURL = response.httpHeaderField(HTTPNames::X_SourceMap); | 342 m_sourceMapURL = response.httpHeaderField(HTTPNames::X_SourceMap); |
333 } | 343 } |
334 | 344 |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 visitor->trace(m_ownerRule); | 675 visitor->trace(m_ownerRule); |
666 visitor->trace(m_importRules); | 676 visitor->trace(m_importRules); |
667 visitor->trace(m_namespaceRules); | 677 visitor->trace(m_namespaceRules); |
668 visitor->trace(m_childRules); | 678 visitor->trace(m_childRules); |
669 visitor->trace(m_loadingClients); | 679 visitor->trace(m_loadingClients); |
670 visitor->trace(m_completedClients); | 680 visitor->trace(m_completedClients); |
671 visitor->trace(m_ruleSet); | 681 visitor->trace(m_ruleSet); |
672 } | 682 } |
673 | 683 |
674 } // namespace blink | 684 } // namespace blink |
OLD | NEW |