| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv
ed. | 5 * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv
ed. |
| 6 * Copyright (C) 2009 Rob Buis (rwlbuis@gmail.com) | 6 * Copyright (C) 2009 Rob Buis (rwlbuis@gmail.com) |
| 7 * Copyright (C) 2011 Google Inc. All rights reserved. | 7 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 return m_owner->document(); | 503 return m_owner->document(); |
| 504 } | 504 } |
| 505 | 505 |
| 506 void LinkStyle::setCSSStyleSheet(const String& href, const KURL& baseURL, const
String& charset, const CSSStyleSheetResource* cachedStyleSheet) | 506 void LinkStyle::setCSSStyleSheet(const String& href, const KURL& baseURL, const
String& charset, const CSSStyleSheetResource* cachedStyleSheet) |
| 507 { | 507 { |
| 508 if (!m_owner->inDocument()) { | 508 if (!m_owner->inDocument()) { |
| 509 ASSERT(!m_sheet); | 509 ASSERT(!m_sheet); |
| 510 return; | 510 return; |
| 511 } | 511 } |
| 512 | 512 |
| 513 // See the comment in ScriptLoader.cpp about why this check is necessary |
| 514 // here. https://crbug.com/500701. |
| 513 if (!cachedStyleSheet->errorOccurred() && !SubresourceIntegrity::CheckSubres
ourceIntegrity(*m_owner, cachedStyleSheet->sheetText(), KURL(baseURL, href), *ca
chedStyleSheet)) { | 515 if (!cachedStyleSheet->errorOccurred() && !SubresourceIntegrity::CheckSubres
ourceIntegrity(*m_owner, cachedStyleSheet->sheetText(), KURL(baseURL, href), *ca
chedStyleSheet)) { |
| 514 m_loading = false; | 516 m_loading = false; |
| 515 removePendingSheet(); | 517 removePendingSheet(); |
| 516 notifyLoadedSheetAndAllCriticalSubresources(Node::ErrorOccurredLoadingSu
bresource); | 518 notifyLoadedSheetAndAllCriticalSubresources(Node::ErrorOccurredLoadingSu
bresource); |
| 517 return; | 519 return; |
| 518 } | 520 } |
| 519 | 521 |
| 520 // Completing the sheet load may cause scripts to execute. | 522 // Completing the sheet load may cause scripts to execute. |
| 521 RefPtrWillBeRawPtr<Node> protector(m_owner.get()); | 523 RefPtrWillBeRawPtr<Node> protector(m_owner.get()); |
| 522 | 524 |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 768 removePendingSheet(); | 770 removePendingSheet(); |
| 769 } | 771 } |
| 770 | 772 |
| 771 DEFINE_TRACE(LinkStyle) | 773 DEFINE_TRACE(LinkStyle) |
| 772 { | 774 { |
| 773 visitor->trace(m_sheet); | 775 visitor->trace(m_sheet); |
| 774 LinkResource::trace(visitor); | 776 LinkResource::trace(visitor); |
| 775 } | 777 } |
| 776 | 778 |
| 777 } // namespace blink | 779 } // namespace blink |
| OLD | NEW |