| 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 // header directly because we want to see what the value is BEFORE content | 194 // header directly because we want to see what the value is BEFORE content |
| 195 // sniffing. Firefox does this by setting a "type hint" on the channel. This | 195 // sniffing. Firefox does this by setting a "type hint" on the channel. This |
| 196 // implementation should be observationally equivalent. | 196 // implementation should be observationally equivalent. |
| 197 // | 197 // |
| 198 // This code defaults to allowing the stylesheet for non-HTTP protocols so | 198 // This code defaults to allowing the stylesheet for non-HTTP protocols so |
| 199 // folks can use standards mode for local HTML documents. | 199 // folks can use standards mode for local HTML documents. |
| 200 if (mime_type_check == MIMETypeCheck::kLax) | 200 if (mime_type_check == MIMETypeCheck::kLax) |
| 201 return true; | 201 return true; |
| 202 AtomicString content_type = HttpContentType(); | 202 AtomicString content_type = HttpContentType(); |
| 203 return content_type.IsEmpty() || | 203 return content_type.IsEmpty() || |
| 204 EqualIgnoringCase(content_type, "text/css") || | 204 DeprecatedEqualIgnoringCase(content_type, "text/css") || |
| 205 EqualIgnoringCase(content_type, "application/x-unknown-content-type"); | 205 DeprecatedEqualIgnoringCase(content_type, |
| 206 "application/x-unknown-content-type"); |
| 206 } | 207 } |
| 207 | 208 |
| 208 StyleSheetContents* CSSStyleSheetResource::RestoreParsedStyleSheet( | 209 StyleSheetContents* CSSStyleSheetResource::RestoreParsedStyleSheet( |
| 209 const CSSParserContext* context) { | 210 const CSSParserContext* context) { |
| 210 if (!parsed_style_sheet_cache_) | 211 if (!parsed_style_sheet_cache_) |
| 211 return nullptr; | 212 return nullptr; |
| 212 if (parsed_style_sheet_cache_->HasFailedOrCanceledSubresources()) { | 213 if (parsed_style_sheet_cache_->HasFailedOrCanceledSubresources()) { |
| 213 SetParsedStyleSheetCache(nullptr); | 214 SetParsedStyleSheetCache(nullptr); |
| 214 return nullptr; | 215 return nullptr; |
| 215 } | 216 } |
| (...skipping 29 matching lines...) Expand all Loading... |
| 245 } | 246 } |
| 246 | 247 |
| 247 void CSSStyleSheetResource::UpdateDecodedSize() { | 248 void CSSStyleSheetResource::UpdateDecodedSize() { |
| 248 size_t decoded_size = decoded_sheet_text_.CharactersSizeInBytes(); | 249 size_t decoded_size = decoded_sheet_text_.CharactersSizeInBytes(); |
| 249 if (parsed_style_sheet_cache_) | 250 if (parsed_style_sheet_cache_) |
| 250 decoded_size += parsed_style_sheet_cache_->EstimatedSizeInBytes(); | 251 decoded_size += parsed_style_sheet_cache_->EstimatedSizeInBytes(); |
| 251 SetDecodedSize(decoded_size); | 252 SetDecodedSize(decoded_size); |
| 252 } | 253 } |
| 253 | 254 |
| 254 } // namespace blink | 255 } // namespace blink |
| OLD | NEW |