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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 #include "wtf/text/WTFString.h" | 43 #include "wtf/text/WTFString.h" |
44 | 44 |
45 namespace blink { | 45 namespace blink { |
46 | 46 |
47 class CSSFontFace; | 47 class CSSFontFace; |
48 class CSSValue; | 48 class CSSValue; |
49 class DOMArrayBuffer; | 49 class DOMArrayBuffer; |
50 class DOMArrayBufferView; | 50 class DOMArrayBufferView; |
51 class Document; | 51 class Document; |
52 class ExceptionState; | 52 class ExceptionState; |
| 53 class FontDescription; |
53 class FontFaceDescriptors; | 54 class FontFaceDescriptors; |
54 class StringOrArrayBufferOrArrayBufferView; | 55 class StringOrArrayBufferOrArrayBufferView; |
55 class StylePropertySet; | 56 class StylePropertySet; |
56 class StyleRuleFontFace; | 57 class StyleRuleFontFace; |
57 | 58 |
58 class FontFace : public GarbageCollectedFinalized<FontFace>, public ScriptWrappa
ble, public ActiveScriptWrappable, public ActiveDOMObject { | 59 class FontFace : public GarbageCollectedFinalized<FontFace>, public ScriptWrappa
ble, public ActiveScriptWrappable, public ActiveDOMObject { |
59 DEFINE_WRAPPERTYPEINFO(); | 60 DEFINE_WRAPPERTYPEINFO(); |
60 USING_GARBAGE_COLLECTED_MIXIN(FontFace); | 61 USING_GARBAGE_COLLECTED_MIXIN(FontFace); |
61 public: | 62 public: |
62 enum LoadStatusType { Unloaded, Loading, Loaded, Error }; | 63 enum LoadStatusType { Unloaded, Loading, Loaded, Error }; |
(...skipping 24 matching lines...) Expand all Loading... |
87 ScriptPromise loaded(ScriptState* scriptState) { return fontStatusPromise(sc
riptState); } | 88 ScriptPromise loaded(ScriptState* scriptState) { return fontStatusPromise(sc
riptState); } |
88 | 89 |
89 ScriptPromise load(ScriptState*); | 90 ScriptPromise load(ScriptState*); |
90 | 91 |
91 LoadStatusType loadStatus() const { return m_status; } | 92 LoadStatusType loadStatus() const { return m_status; } |
92 void setLoadStatus(LoadStatusType); | 93 void setLoadStatus(LoadStatusType); |
93 void setError(DOMException* = nullptr); | 94 void setError(DOMException* = nullptr); |
94 DOMException* error() const { return m_error; } | 95 DOMException* error() const { return m_error; } |
95 FontTraits traits() const; | 96 FontTraits traits() const; |
96 CSSFontFace* cssFontFace() { return m_cssFontFace.get(); } | 97 CSSFontFace* cssFontFace() { return m_cssFontFace.get(); } |
| 98 bool isBlank() const; |
| 99 bool willUseFontData(const FontDescription&, const String& text); |
97 | 100 |
98 DECLARE_VIRTUAL_TRACE(); | 101 DECLARE_VIRTUAL_TRACE(); |
99 | 102 |
100 bool hadBlankText() const; | 103 bool hadBlankText() const; |
101 | 104 |
102 class LoadFontCallback : public GarbageCollectedFinalized<LoadFontCallback>
{ | 105 class LoadFontCallback : public GarbageCollectedFinalized<LoadFontCallback>
{ |
103 public: | 106 public: |
104 virtual ~LoadFontCallback() { } | 107 virtual ~LoadFontCallback() { } |
105 virtual void notifyLoaded(FontFace*) = 0; | 108 virtual void notifyLoaded(FontFace*) = 0; |
106 virtual void notifyError(FontFace*) = 0; | 109 virtual void notifyError(FontFace*) = 0; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 Member<CSSValue> m_unicodeRange; | 141 Member<CSSValue> m_unicodeRange; |
139 Member<CSSValue> m_variant; | 142 Member<CSSValue> m_variant; |
140 Member<CSSValue> m_featureSettings; | 143 Member<CSSValue> m_featureSettings; |
141 Member<CSSValue> m_display; | 144 Member<CSSValue> m_display; |
142 LoadStatusType m_status; | 145 LoadStatusType m_status; |
143 Member<DOMException> m_error; | 146 Member<DOMException> m_error; |
144 | 147 |
145 Member<LoadedProperty> m_loadedProperty; | 148 Member<LoadedProperty> m_loadedProperty; |
146 Member<CSSFontFace> m_cssFontFace; | 149 Member<CSSFontFace> m_cssFontFace; |
147 HeapVector<Member<LoadFontCallback>> m_callbacks; | 150 HeapVector<Member<LoadFontCallback>> m_callbacks; |
| 151 unsigned m_charCount = 0; |
148 }; | 152 }; |
149 | 153 |
150 using FontFaceArray = HeapVector<Member<FontFace>>; | 154 using FontFaceArray = HeapVector<Member<FontFace>>; |
151 | 155 |
152 } // namespace blink | 156 } // namespace blink |
153 | 157 |
154 #endif // FontFace_h | 158 #endif // FontFace_h |
OLD | NEW |