OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2010 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 25 matching lines...) Expand all Loading... |
36 #include "core/loader/MixedContentChecker.h" | 36 #include "core/loader/MixedContentChecker.h" |
37 #include "platform/CrossOriginAttributeValue.h" | 37 #include "platform/CrossOriginAttributeValue.h" |
38 #include "platform/fonts/FontCache.h" | 38 #include "platform/fonts/FontCache.h" |
39 #include "platform/fonts/FontCustomPlatformData.h" | 39 #include "platform/fonts/FontCustomPlatformData.h" |
40 #include "platform/weborigin/SecurityPolicy.h" | 40 #include "platform/weborigin/SecurityPolicy.h" |
41 #include "wtf/text/StringBuilder.h" | 41 #include "wtf/text/StringBuilder.h" |
42 | 42 |
43 namespace blink { | 43 namespace blink { |
44 | 44 |
45 bool CSSFontFaceSrcValue::isSupportedFormat() const { | 45 bool CSSFontFaceSrcValue::isSupportedFormat() const { |
46 // Normally we would just check the format, but in order to avoid conflicts wi
th the old WinIE style of font-face, | 46 // Normally we would just check the format, but in order to avoid conflicts |
47 // we will also check to see if the URL ends with .eot. If so, we'll go ahead
and assume that we shouldn't load it. | 47 // with the old WinIE style of font-face, we will also check to see if the URL |
| 48 // ends with .eot. If so, we'll go ahead and assume that we shouldn't load |
| 49 // it. |
48 if (m_format.isEmpty()) | 50 if (m_format.isEmpty()) |
49 return m_absoluteResource.startsWith("data:", TextCaseInsensitive) || | 51 return m_absoluteResource.startsWith("data:", TextCaseInsensitive) || |
50 !m_absoluteResource.endsWith(".eot", TextCaseInsensitive); | 52 !m_absoluteResource.endsWith(".eot", TextCaseInsensitive); |
51 | 53 |
52 return FontCustomPlatformData::supportsFormat(m_format); | 54 return FontCustomPlatformData::supportsFormat(m_format); |
53 } | 55 } |
54 | 56 |
55 String CSSFontFaceSrcValue::customCSSText() const { | 57 String CSSFontFaceSrcValue::customCSSText() const { |
56 StringBuilder result; | 58 StringBuilder result; |
57 if (isLocal()) { | 59 if (isLocal()) { |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 ResourceFetcher::ResourceLoadingFromCache); | 131 ResourceFetcher::ResourceLoadingFromCache); |
130 } | 132 } |
131 | 133 |
132 bool CSSFontFaceSrcValue::equals(const CSSFontFaceSrcValue& other) const { | 134 bool CSSFontFaceSrcValue::equals(const CSSFontFaceSrcValue& other) const { |
133 return m_isLocal == other.m_isLocal && m_format == other.m_format && | 135 return m_isLocal == other.m_isLocal && m_format == other.m_format && |
134 m_specifiedResource == other.m_specifiedResource && | 136 m_specifiedResource == other.m_specifiedResource && |
135 m_absoluteResource == other.m_absoluteResource; | 137 m_absoluteResource == other.m_absoluteResource; |
136 } | 138 } |
137 | 139 |
138 } // namespace blink | 140 } // namespace blink |
OLD | NEW |