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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
86 LoadStatus loadStatus() const { return m_status; } | 86 LoadStatus loadStatus() const { return m_status; } |
87 void setLoadStatus(LoadStatus); | 87 void setLoadStatus(LoadStatus); |
88 DOMError* error() const { return m_error.get(); } | 88 DOMError* error() const { return m_error.get(); } |
89 FontTraits traits() const; | 89 FontTraits traits() const; |
90 CSSFontFace* cssFontFace() { return m_cssFontFace.get(); } | 90 CSSFontFace* cssFontFace() { return m_cssFontFace.get(); } |
91 | 91 |
92 void trace(Visitor*); | 92 void trace(Visitor*); |
93 | 93 |
94 bool hadBlankText() const; | 94 bool hadBlankText() const; |
95 | 95 |
96 class LoadFontCallback : public RefCounted<LoadFontCallback> { | |
97 public: | |
98 virtual ~LoadFontCallback() { } | |
99 virtual void notifyLoaded(FontFace*) = 0; | |
100 virtual void notifyError(FontFace*) = 0; | |
101 }; | |
102 void load(PassRefPtr<LoadFontCallback>, ExecutionContext*); | |
dglazkov
2014/03/19 15:42:34
"Load" overload :)
You even have loadInternal now
Kunihiko Sakamoto
2014/03/20 01:06:32
Renamed to loadWithCallback.
| |
103 | |
96 private: | 104 private: |
97 FontFace(); | 105 FontFace(); |
98 | 106 |
99 void initCSSFontFace(Document*, PassRefPtrWillBeRawPtr<CSSValue> src); | 107 void initCSSFontFace(Document*, PassRefPtrWillBeRawPtr<CSSValue> src); |
100 void initCSSFontFace(const unsigned char* data, unsigned size); | 108 void initCSSFontFace(const unsigned char* data, unsigned size); |
101 void setPropertyFromString(const Document*, const String&, CSSPropertyID, Ex ceptionState&); | 109 void setPropertyFromString(const Document*, const String&, CSSPropertyID, Ex ceptionState&); |
102 bool setPropertyFromStyle(const StylePropertySet&, CSSPropertyID); | 110 bool setPropertyFromStyle(const StylePropertySet&, CSSPropertyID); |
103 bool setPropertyValue(PassRefPtrWillBeRawPtr<CSSValue>, CSSPropertyID); | 111 bool setPropertyValue(PassRefPtrWillBeRawPtr<CSSValue>, CSSPropertyID); |
104 bool setFamilyValue(CSSValueList*); | 112 bool setFamilyValue(CSSValueList*); |
105 void resolveReadyPromises(); | 113 void resolveReadyPromises(); |
114 void loadInternal(ExecutionContext*); | |
106 | 115 |
107 AtomicString m_family; | 116 AtomicString m_family; |
108 RefPtrWillBeMember<CSSValue> m_src; | 117 RefPtrWillBeMember<CSSValue> m_src; |
109 RefPtrWillBeMember<CSSValue> m_style; | 118 RefPtrWillBeMember<CSSValue> m_style; |
110 RefPtrWillBeMember<CSSValue> m_weight; | 119 RefPtrWillBeMember<CSSValue> m_weight; |
111 RefPtrWillBeMember<CSSValue> m_stretch; | 120 RefPtrWillBeMember<CSSValue> m_stretch; |
112 RefPtrWillBeMember<CSSValue> m_unicodeRange; | 121 RefPtrWillBeMember<CSSValue> m_unicodeRange; |
113 RefPtrWillBeMember<CSSValue> m_variant; | 122 RefPtrWillBeMember<CSSValue> m_variant; |
114 RefPtrWillBeMember<CSSValue> m_featureSettings; | 123 RefPtrWillBeMember<CSSValue> m_featureSettings; |
115 LoadStatus m_status; | 124 LoadStatus m_status; |
116 RefPtrWillBeMember<DOMError> m_error; | 125 RefPtrWillBeMember<DOMError> m_error; |
117 | 126 |
118 Vector<OwnPtr<FontFaceReadyPromiseResolver> > m_readyResolvers; | 127 Vector<OwnPtr<FontFaceReadyPromiseResolver> > m_readyResolvers; |
119 OwnPtr<CSSFontFace> m_cssFontFace; | 128 OwnPtr<CSSFontFace> m_cssFontFace; |
129 Vector<RefPtr<LoadFontCallback> > m_callbacks; | |
120 }; | 130 }; |
121 | 131 |
122 typedef Vector<RefPtr<FontFace> > FontFaceArray; | 132 typedef Vector<RefPtr<FontFace> > FontFaceArray; |
123 | 133 |
124 } // namespace WebCore | 134 } // namespace WebCore |
125 | 135 |
126 #endif // FontFace_h | 136 #endif // FontFace_h |
OLD | NEW |