| 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 if (!enforceMIMEType && !hasValidMIMEType) | 116 if (!enforceMIMEType && !hasValidMIMEType) |
| 117 return true; | 117 return true; |
| 118 | 118 |
| 119 // This check exactly matches Firefox. Note that we grab the Content-Type | 119 // This check exactly matches Firefox. Note that we grab the Content-Type |
| 120 // header directly because we want to see what the value is BEFORE content | 120 // header directly because we want to see what the value is BEFORE content |
| 121 // sniffing. Firefox does this by setting a "type hint" on the channel. | 121 // sniffing. Firefox does this by setting a "type hint" on the channel. |
| 122 // This implementation should be observationally equivalent. | 122 // This implementation should be observationally equivalent. |
| 123 // | 123 // |
| 124 // This code defaults to allowing the stylesheet for non-HTTP protocols so | 124 // This code defaults to allowing the stylesheet for non-HTTP protocols so |
| 125 // folks can use standards mode for local HTML documents. | 125 // folks can use standards mode for local HTML documents. |
| 126 AtomicString mimeType = extractMIMETypeFromMediaType(response().httpHeaderFi
eld("Content-Type")); | 126 const AtomicString& mimeType = extractMIMETypeFromMediaType(response().httpH
eaderField("Content-Type")); |
| 127 bool typeOK = mimeType.isEmpty() || equalIgnoringCase(mimeType, "text/css")
|| equalIgnoringCase(mimeType, "application/x-unknown-content-type"); | 127 bool typeOK = mimeType.isEmpty() || equalIgnoringCase(mimeType, "text/css")
|| equalIgnoringCase(mimeType, "application/x-unknown-content-type"); |
| 128 if (hasValidMIMEType) | 128 if (hasValidMIMEType) |
| 129 *hasValidMIMEType = typeOK; | 129 *hasValidMIMEType = typeOK; |
| 130 if (!enforceMIMEType) | 130 if (!enforceMIMEType) |
| 131 return true; | 131 return true; |
| 132 return typeOK; | 132 return typeOK; |
| 133 } | 133 } |
| 134 | 134 |
| 135 void CSSStyleSheetResource::destroyDecodedData() | 135 void CSSStyleSheetResource::destroyDecodedData() |
| 136 { | 136 { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 | 174 |
| 175 if (m_parsedStyleSheetCache) | 175 if (m_parsedStyleSheetCache) |
| 176 m_parsedStyleSheetCache->removedFromMemoryCache(); | 176 m_parsedStyleSheetCache->removedFromMemoryCache(); |
| 177 m_parsedStyleSheetCache = sheet; | 177 m_parsedStyleSheetCache = sheet; |
| 178 m_parsedStyleSheetCache->addedToMemoryCache(); | 178 m_parsedStyleSheetCache->addedToMemoryCache(); |
| 179 | 179 |
| 180 setDecodedSize(m_parsedStyleSheetCache->estimatedSizeInBytes()); | 180 setDecodedSize(m_parsedStyleSheetCache->estimatedSizeInBytes()); |
| 181 } | 181 } |
| 182 | 182 |
| 183 } | 183 } |
| OLD | NEW |