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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 | 112 |
113 bool hadBlankText() const; | 113 bool hadBlankText() const; |
114 | 114 |
115 class LoadFontCallback : public GarbageCollectedMixin { | 115 class LoadFontCallback : public GarbageCollectedMixin { |
116 public: | 116 public: |
117 virtual ~LoadFontCallback() {} | 117 virtual ~LoadFontCallback() {} |
118 virtual void notifyLoaded(FontFace*) = 0; | 118 virtual void notifyLoaded(FontFace*) = 0; |
119 virtual void notifyError(FontFace*) = 0; | 119 virtual void notifyError(FontFace*) = 0; |
120 DEFINE_INLINE_VIRTUAL_TRACE() {} | 120 DEFINE_INLINE_VIRTUAL_TRACE() {} |
121 }; | 121 }; |
122 void loadWithCallback(LoadFontCallback*, ExecutionContext*); | 122 void loadWithCallback(LoadFontCallback*); |
123 void addCallback(LoadFontCallback*); | 123 void addCallback(LoadFontCallback*); |
124 | 124 |
125 // ScriptWrappable: | 125 // ScriptWrappable: |
126 bool hasPendingActivity() const final; | 126 bool hasPendingActivity() const final; |
127 | 127 |
128 private: | 128 private: |
129 static FontFace* create(ExecutionContext*, | 129 static FontFace* create(ExecutionContext*, |
130 const AtomicString& family, | 130 const AtomicString& family, |
131 DOMArrayBuffer* source, | 131 DOMArrayBuffer* source, |
132 const FontFaceDescriptors&); | 132 const FontFaceDescriptors&); |
(...skipping 13 matching lines...) Expand all Loading... |
146 | 146 |
147 void initCSSFontFace(Document*, const CSSValue* src); | 147 void initCSSFontFace(Document*, const CSSValue* src); |
148 void initCSSFontFace(const unsigned char* data, size_t); | 148 void initCSSFontFace(const unsigned char* data, size_t); |
149 void setPropertyFromString(const Document*, | 149 void setPropertyFromString(const Document*, |
150 const String&, | 150 const String&, |
151 CSSPropertyID, | 151 CSSPropertyID, |
152 ExceptionState* = 0); | 152 ExceptionState* = 0); |
153 bool setPropertyFromStyle(const StylePropertySet&, CSSPropertyID); | 153 bool setPropertyFromStyle(const StylePropertySet&, CSSPropertyID); |
154 bool setPropertyValue(const CSSValue*, CSSPropertyID); | 154 bool setPropertyValue(const CSSValue*, CSSPropertyID); |
155 bool setFamilyValue(const CSSValue&); | 155 bool setFamilyValue(const CSSValue&); |
156 void loadInternal(ExecutionContext*); | |
157 ScriptPromise fontStatusPromise(ScriptState*); | 156 ScriptPromise fontStatusPromise(ScriptState*); |
158 | 157 |
159 using LoadedProperty = ScriptPromiseProperty<Member<FontFace>, | 158 using LoadedProperty = ScriptPromiseProperty<Member<FontFace>, |
160 Member<FontFace>, | 159 Member<FontFace>, |
161 Member<DOMException>>; | 160 Member<DOMException>>; |
162 | 161 |
163 AtomicString m_family; | 162 AtomicString m_family; |
164 String m_otsParseMessage; | 163 String m_otsParseMessage; |
165 Member<const CSSValue> m_style; | 164 Member<const CSSValue> m_style; |
166 Member<const CSSValue> m_weight; | 165 Member<const CSSValue> m_weight; |
167 Member<const CSSValue> m_stretch; | 166 Member<const CSSValue> m_stretch; |
168 Member<const CSSValue> m_unicodeRange; | 167 Member<const CSSValue> m_unicodeRange; |
169 Member<const CSSValue> m_variant; | 168 Member<const CSSValue> m_variant; |
170 Member<const CSSValue> m_featureSettings; | 169 Member<const CSSValue> m_featureSettings; |
171 Member<const CSSValue> m_display; | 170 Member<const CSSValue> m_display; |
172 LoadStatusType m_status; | 171 LoadStatusType m_status; |
173 Member<DOMException> m_error; | 172 Member<DOMException> m_error; |
174 | 173 |
175 Member<LoadedProperty> m_loadedProperty; | 174 Member<LoadedProperty> m_loadedProperty; |
176 Member<CSSFontFace> m_cssFontFace; | 175 Member<CSSFontFace> m_cssFontFace; |
177 HeapVector<Member<LoadFontCallback>> m_callbacks; | 176 HeapVector<Member<LoadFontCallback>> m_callbacks; |
178 }; | 177 }; |
179 | 178 |
180 using FontFaceArray = HeapVector<Member<FontFace>>; | 179 using FontFaceArray = HeapVector<Member<FontFace>>; |
181 | 180 |
182 } // namespace blink | 181 } // namespace blink |
183 | 182 |
184 #endif // FontFace_h | 183 #endif // FontFace_h |
OLD | NEW |