| OLD | NEW |
| 1 /* | 1 /* |
| 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) | 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) |
| 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) | 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) |
| 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) | 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) |
| 5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
| 6 Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. | 6 Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. |
| 7 | 7 |
| 8 This library is free software; you can redistribute it and/or | 8 This library is free software; you can redistribute it and/or |
| 9 modify it under the terms of the GNU Library General Public | 9 modify it under the terms of the GNU Library General Public |
| 10 License as published by the Free Software Foundation; either | 10 License as published by the Free Software Foundation; either |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 // Resource::didAddClient() must be before setCSSStyleSheet(), because | 89 // Resource::didAddClient() must be before setCSSStyleSheet(), because |
| 90 // setCSSStyleSheet() may cause scripts to be executed, which could destroy | 90 // setCSSStyleSheet() may cause scripts to be executed, which could destroy |
| 91 // 'c' if it is an instance of HTMLLinkElement. see the comment of | 91 // 'c' if it is an instance of HTMLLinkElement. see the comment of |
| 92 // HTMLLinkElement::setCSSStyleSheet. | 92 // HTMLLinkElement::setCSSStyleSheet. |
| 93 Resource::didAddClient(c); | 93 Resource::didAddClient(c); |
| 94 | 94 |
| 95 if (hasClient(c) && m_didNotifyFirstData) | 95 if (hasClient(c) && m_didNotifyFirstData) |
| 96 static_cast<StyleSheetResourceClient*>(c)->didAppendFirstData(this); | 96 static_cast<StyleSheetResourceClient*>(c)->didAppendFirstData(this); |
| 97 | 97 |
| 98 // |c| might be removed in didAppendFirstData, so ensure it is still a client. | 98 // |c| might be removed in didAppendFirstData, so ensure it is still a client. |
| 99 if (hasClient(c) && !isLoading()) | 99 if (hasClient(c) && !isLoading()) { |
| 100 static_cast<StyleSheetResourceClient*>(c)->setCSSStyleSheet( | 100 static_cast<StyleSheetResourceClient*>(c)->setCSSStyleSheet( |
| 101 resourceRequest().url(), response().url(), encoding(), this); | 101 resourceRequest().url(), response().url(), encoding(), this); |
| 102 } |
| 102 } | 103 } |
| 103 | 104 |
| 104 const String CSSStyleSheetResource::sheetText( | 105 const String CSSStyleSheetResource::sheetText( |
| 105 MIMETypeCheck mimeTypeCheck) const { | 106 MIMETypeCheck mimeTypeCheck) const { |
| 106 if (!canUseSheet(mimeTypeCheck)) | 107 if (!canUseSheet(mimeTypeCheck)) |
| 107 return String(); | 108 return String(); |
| 108 | 109 |
| 109 // Use cached decoded sheet text when available | 110 // Use cached decoded sheet text when available |
| 110 if (!m_decodedSheetText.isNull()) { | 111 if (!m_decodedSheetText.isNull()) { |
| 111 // We should have the decoded sheet text cached when the resource is fully | 112 // We should have the decoded sheet text cached when the resource is fully |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 // This stylesheet resource did conflict with another resource and was not | 214 // This stylesheet resource did conflict with another resource and was not |
| 214 // added to the cache. | 215 // added to the cache. |
| 215 setParsedStyleSheetCache(nullptr); | 216 setParsedStyleSheetCache(nullptr); |
| 216 return; | 217 return; |
| 217 } | 218 } |
| 218 setParsedStyleSheetCache(sheet); | 219 setParsedStyleSheetCache(sheet); |
| 219 setDecodedSize(m_parsedStyleSheetCache->estimatedSizeInBytes()); | 220 setDecodedSize(m_parsedStyleSheetCache->estimatedSizeInBytes()); |
| 220 } | 221 } |
| 221 | 222 |
| 222 } // namespace blink | 223 } // namespace blink |
| OLD | NEW |