OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 class CSSFontFace; | 43 class CSSFontFace; |
44 class CSSValueList; | 44 class CSSValueList; |
45 class Dictionary; | 45 class Dictionary; |
46 class Document; | 46 class Document; |
47 class ExceptionState; | 47 class ExceptionState; |
48 class FontFaceReadyPromiseResolver; | 48 class FontFaceReadyPromiseResolver; |
49 class StylePropertySet; | 49 class StylePropertySet; |
50 class StyleRuleFontFace; | 50 class StyleRuleFontFace; |
51 | 51 |
52 class FontFace : public RefCounted<FontFace> { | 52 class FontFace : public RefCountedWillBeRefCountedGarbageCollected<FontFace> { |
53 public: | 53 public: |
54 enum LoadStatus { Unloaded, Loading, Loaded, Error }; | 54 enum LoadStatus { Unloaded, Loading, Loaded, Error }; |
55 | 55 |
56 static PassRefPtr<FontFace> create(ExecutionContext*, const AtomicString& fa
mily, const String& source, const Dictionary&, ExceptionState&); | 56 static PassRefPtr<FontFace> create(ExecutionContext*, const AtomicString& fa
mily, const String& source, const Dictionary&, ExceptionState&); |
57 static PassRefPtr<FontFace> create(Document*, const StyleRuleFontFace*); | 57 static PassRefPtr<FontFace> create(Document*, const StyleRuleFontFace*); |
58 | 58 |
59 ~FontFace(); | 59 ~FontFace(); |
60 | 60 |
61 const AtomicString& family() const { return m_family; } | 61 const AtomicString& family() const { return m_family; } |
62 String style() const; | 62 String style() const; |
(...skipping 15 matching lines...) Expand all Loading... |
78 String status() const; | 78 String status() const; |
79 | 79 |
80 void load(ExecutionContext*); | 80 void load(ExecutionContext*); |
81 ScriptPromise ready(ExecutionContext*); | 81 ScriptPromise ready(ExecutionContext*); |
82 | 82 |
83 LoadStatus loadStatus() const { return m_status; } | 83 LoadStatus loadStatus() const { return m_status; } |
84 void setLoadStatus(LoadStatus); | 84 void setLoadStatus(LoadStatus); |
85 unsigned traitsMask() const; | 85 unsigned traitsMask() const; |
86 CSSFontFace* cssFontFace() { return m_cssFontFace.get(); } | 86 CSSFontFace* cssFontFace() { return m_cssFontFace.get(); } |
87 | 87 |
| 88 void trace(Visitor*); |
| 89 |
88 private: | 90 private: |
89 FontFace(PassRefPtrWillBeRawPtr<CSSValue> source); | 91 FontFace(PassRefPtrWillBeRawPtr<CSSValue> source); |
90 | 92 |
91 void initCSSFontFace(Document*); | 93 void initCSSFontFace(Document*); |
92 void setPropertyFromString(const Document*, const String&, CSSPropertyID, Ex
ceptionState&); | 94 void setPropertyFromString(const Document*, const String&, CSSPropertyID, Ex
ceptionState&); |
93 bool setPropertyFromStyle(const StylePropertySet&, CSSPropertyID); | 95 bool setPropertyFromStyle(const StylePropertySet&, CSSPropertyID); |
94 bool setPropertyValue(PassRefPtrWillBeRawPtr<CSSValue>, CSSPropertyID); | 96 bool setPropertyValue(PassRefPtrWillBeRawPtr<CSSValue>, CSSPropertyID); |
95 bool setFamilyValue(CSSValueList*); | 97 bool setFamilyValue(CSSValueList*); |
96 void resolveReadyPromises(); | 98 void resolveReadyPromises(); |
97 | 99 |
98 AtomicString m_family; | 100 AtomicString m_family; |
99 RefPtr<CSSValue> m_src; | 101 RefPtrWillBeMember<CSSValue> m_src; |
100 RefPtr<CSSValue> m_style; | 102 RefPtrWillBeMember<CSSValue> m_style; |
101 RefPtr<CSSValue> m_weight; | 103 RefPtrWillBeMember<CSSValue> m_weight; |
102 RefPtr<CSSValue> m_stretch; | 104 RefPtrWillBeMember<CSSValue> m_stretch; |
103 RefPtr<CSSValue> m_unicodeRange; | 105 RefPtrWillBeMember<CSSValue> m_unicodeRange; |
104 RefPtr<CSSValue> m_variant; | 106 RefPtrWillBeMember<CSSValue> m_variant; |
105 RefPtr<CSSValue> m_featureSettings; | 107 RefPtrWillBeMember<CSSValue> m_featureSettings; |
106 LoadStatus m_status; | 108 LoadStatus m_status; |
107 | 109 |
108 Vector<OwnPtr<FontFaceReadyPromiseResolver> > m_readyResolvers; | 110 Vector<OwnPtr<FontFaceReadyPromiseResolver> > m_readyResolvers; |
109 OwnPtr<CSSFontFace> m_cssFontFace; | 111 OwnPtr<CSSFontFace> m_cssFontFace; |
110 }; | 112 }; |
111 | 113 |
112 typedef Vector<RefPtr<FontFace> > FontFaceArray; | 114 typedef Vector<RefPtr<FontFace> > FontFaceArray; |
113 | 115 |
114 } // namespace WebCore | 116 } // namespace WebCore |
115 | 117 |
116 #endif // FontFace_h | 118 #endif // FontFace_h |
OLD | NEW |