| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 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 10 matching lines...) Expand all Loading... |
| 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #ifndef CSSFontFaceSrcValue_h | 26 #ifndef CSSFontFaceSrcValue_h |
| 27 #define CSSFontFaceSrcValue_h | 27 #define CSSFontFaceSrcValue_h |
| 28 | 28 |
| 29 #include "core/css/CSSValue.h" | 29 #include "core/css/CSSValue.h" |
| 30 #include "core/fetch/ResourcePtr.h" | 30 #include "core/fetch/ResourcePtr.h" |
| 31 #include "platform/weborigin/Referrer.h" |
| 31 #include "wtf/PassRefPtr.h" | 32 #include "wtf/PassRefPtr.h" |
| 32 #include "wtf/text/WTFString.h" | 33 #include "wtf/text/WTFString.h" |
| 33 | 34 |
| 34 namespace WebCore { | 35 namespace WebCore { |
| 35 | 36 |
| 36 class FontResource; | 37 class FontResource; |
| 37 class Document; | 38 class Document; |
| 38 class SVGFontFaceElement; | 39 class SVGFontFaceElement; |
| 39 | 40 |
| 40 class CSSFontFaceSrcValue : public CSSValue { | 41 class CSSFontFaceSrcValue : public CSSValue { |
| 41 public: | 42 public: |
| 42 static PassRefPtrWillBeRawPtr<CSSFontFaceSrcValue> create(const String& reso
urce) | 43 static PassRefPtrWillBeRawPtr<CSSFontFaceSrcValue> create(const String& reso
urce) |
| 43 { | 44 { |
| 44 return adoptRefWillBeNoop(new CSSFontFaceSrcValue(resource, false)); | 45 return adoptRefWillBeNoop(new CSSFontFaceSrcValue(resource, false)); |
| 45 } | 46 } |
| 46 static PassRefPtrWillBeRawPtr<CSSFontFaceSrcValue> createLocal(const String&
resource) | 47 static PassRefPtrWillBeRawPtr<CSSFontFaceSrcValue> createLocal(const String&
resource) |
| 47 { | 48 { |
| 48 return adoptRefWillBeNoop(new CSSFontFaceSrcValue(resource, true)); | 49 return adoptRefWillBeNoop(new CSSFontFaceSrcValue(resource, true)); |
| 49 } | 50 } |
| 50 | 51 |
| 51 const String& resource() const { return m_resource; } | 52 const String& resource() const { return m_resource; } |
| 52 const String& format() const { return m_format; } | 53 const String& format() const { return m_format; } |
| 53 bool isLocal() const { return m_isLocal; } | 54 bool isLocal() const { return m_isLocal; } |
| 54 | 55 |
| 55 void setFormat(const String& format) { m_format = format; } | 56 void setFormat(const String& format) { m_format = format; } |
| 57 void setReferrer(const Referrer& referrer) { m_referrer = referrer; } |
| 56 | 58 |
| 57 bool isSupportedFormat() const; | 59 bool isSupportedFormat() const; |
| 58 | 60 |
| 59 #if ENABLE(SVG_FONTS) | 61 #if ENABLE(SVG_FONTS) |
| 60 bool isSVGFontFaceSrc() const; | 62 bool isSVGFontFaceSrc() const; |
| 61 | 63 |
| 62 SVGFontFaceElement* svgFontFaceElement() const { return m_svgFontFaceElement
; } | 64 SVGFontFaceElement* svgFontFaceElement() const { return m_svgFontFaceElement
; } |
| 63 void setSVGFontFaceElement(SVGFontFaceElement* element) { m_svgFontFaceEleme
nt = element; } | 65 void setSVGFontFaceElement(SVGFontFaceElement* element) { m_svgFontFaceEleme
nt = element; } |
| 64 #endif | 66 #endif |
| 65 | 67 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 82 , m_svgFontFaceElement(0) | 84 , m_svgFontFaceElement(0) |
| 83 #endif | 85 #endif |
| 84 { | 86 { |
| 85 } | 87 } |
| 86 | 88 |
| 87 void restoreCachedResourceIfNeeded(Document*); | 89 void restoreCachedResourceIfNeeded(Document*); |
| 88 bool shouldSetCrossOriginAccessControl(const KURL& resource, SecurityOrigin*
); | 90 bool shouldSetCrossOriginAccessControl(const KURL& resource, SecurityOrigin*
); |
| 89 | 91 |
| 90 String m_resource; | 92 String m_resource; |
| 91 String m_format; | 93 String m_format; |
| 94 Referrer m_referrer; |
| 92 bool m_isLocal; | 95 bool m_isLocal; |
| 93 | 96 |
| 94 ResourcePtr<FontResource> m_fetched; | 97 ResourcePtr<FontResource> m_fetched; |
| 95 | 98 |
| 96 #if ENABLE(SVG_FONTS) | 99 #if ENABLE(SVG_FONTS) |
| 97 SVGFontFaceElement* m_svgFontFaceElement; | 100 SVGFontFaceElement* m_svgFontFaceElement; |
| 98 #endif | 101 #endif |
| 99 }; | 102 }; |
| 100 | 103 |
| 101 DEFINE_CSS_VALUE_TYPE_CASTS(CSSFontFaceSrcValue, isFontFaceSrcValue()); | 104 DEFINE_CSS_VALUE_TYPE_CASTS(CSSFontFaceSrcValue, isFontFaceSrcValue()); |
| 102 | 105 |
| 103 } | 106 } |
| 104 | 107 |
| 105 #endif | 108 #endif |
| OLD | NEW |