| 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 met: | 5 * modification, are permitted provided that the following conditions are met: |
| 6 * | 6 * |
| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 class FontFaceSet final : public EventTargetWithInlineData, public HeapSupplemen
t<Document>, public ActiveDOMObject { | 61 class FontFaceSet final : public EventTargetWithInlineData, public HeapSupplemen
t<Document>, public ActiveDOMObject { |
| 62 USING_GARBAGE_COLLECTED_MIXIN(FontFaceSet); | 62 USING_GARBAGE_COLLECTED_MIXIN(FontFaceSet); |
| 63 typedef HeapSupplement<Document> SupplementType; | 63 typedef HeapSupplement<Document> SupplementType; |
| 64 #else | 64 #else |
| 65 class FontFaceSet final : public EventTargetWithInlineData, public RefCountedSup
plement<Document, FontFaceSet>, public ActiveDOMObject { | 65 class FontFaceSet final : public EventTargetWithInlineData, public RefCountedSup
plement<Document, FontFaceSet>, public ActiveDOMObject { |
| 66 REFCOUNTED_EVENT_TARGET(FontFaceSet); | 66 REFCOUNTED_EVENT_TARGET(FontFaceSet); |
| 67 typedef RefCountedSupplement<Document, FontFaceSet> SupplementType; | 67 typedef RefCountedSupplement<Document, FontFaceSet> SupplementType; |
| 68 #endif | 68 #endif |
| 69 DEFINE_WRAPPERTYPEINFO(); | 69 DEFINE_WRAPPERTYPEINFO(); |
| 70 public: | 70 public: |
| 71 virtual ~FontFaceSet(); | 71 ~FontFaceSet() override; |
| 72 | 72 |
| 73 DEFINE_ATTRIBUTE_EVENT_LISTENER(loading); | 73 DEFINE_ATTRIBUTE_EVENT_LISTENER(loading); |
| 74 DEFINE_ATTRIBUTE_EVENT_LISTENER(loadingdone); | 74 DEFINE_ATTRIBUTE_EVENT_LISTENER(loadingdone); |
| 75 DEFINE_ATTRIBUTE_EVENT_LISTENER(loadingerror); | 75 DEFINE_ATTRIBUTE_EVENT_LISTENER(loadingerror); |
| 76 | 76 |
| 77 bool check(const String& font, const String& text, ExceptionState&); | 77 bool check(const String& font, const String& text, ExceptionState&); |
| 78 ScriptPromise load(ScriptState*, const String& font, const String& text); | 78 ScriptPromise load(ScriptState*, const String& font, const String& text); |
| 79 ScriptPromise ready(ScriptState*); | 79 ScriptPromise ready(ScriptState*); |
| 80 | 80 |
| 81 void add(FontFace*, ExceptionState&); | 81 void add(FontFace*, ExceptionState&); |
| 82 void clear(); | 82 void clear(); |
| 83 bool remove(FontFace*, ExceptionState&); | 83 bool remove(FontFace*, ExceptionState&); |
| 84 void forEach(FontFaceSetForEachCallback*, const ScriptValue& thisArg) const; | 84 void forEach(FontFaceSetForEachCallback*, const ScriptValue& thisArg) const; |
| 85 void forEach(FontFaceSetForEachCallback*) const; | 85 void forEach(FontFaceSetForEachCallback*) const; |
| 86 bool has(FontFace*, ExceptionState&) const; | 86 bool has(FontFace*, ExceptionState&) const; |
| 87 | 87 |
| 88 unsigned long size() const; | 88 unsigned long size() const; |
| 89 AtomicString status() const; | 89 AtomicString status() const; |
| 90 | 90 |
| 91 virtual ExecutionContext* executionContext() const override; | 91 ExecutionContext* executionContext() const override; |
| 92 virtual const AtomicString& interfaceName() const override; | 92 const AtomicString& interfaceName() const override; |
| 93 | 93 |
| 94 Document* document() const; | 94 Document* document() const; |
| 95 | 95 |
| 96 void didLayout(); | 96 void didLayout(); |
| 97 void beginFontLoading(FontFace*); | 97 void beginFontLoading(FontFace*); |
| 98 void fontLoaded(FontFace*); | 98 void fontLoaded(FontFace*); |
| 99 void loadError(FontFace*); | 99 void loadError(FontFace*); |
| 100 | 100 |
| 101 // ActiveDOMObject | 101 // ActiveDOMObject |
| 102 virtual void suspend() override; | 102 void suspend() override; |
| 103 virtual void resume() override; | 103 void resume() override; |
| 104 virtual void stop() override; | 104 void stop() override; |
| 105 | 105 |
| 106 static PassRefPtrWillBeRawPtr<FontFaceSet> from(Document&); | 106 static PassRefPtrWillBeRawPtr<FontFaceSet> from(Document&); |
| 107 static void didLayout(Document&); | 107 static void didLayout(Document&); |
| 108 | 108 |
| 109 void addFontFacesToFontFaceCache(FontFaceCache*, CSSFontSelector*); | 109 void addFontFacesToFontFaceCache(FontFaceCache*, CSSFontSelector*); |
| 110 | 110 |
| 111 DECLARE_VIRTUAL_TRACE(); | 111 DECLARE_VIRTUAL_TRACE(); |
| 112 | 112 |
| 113 private: | 113 private: |
| 114 static PassRefPtrWillBeRawPtr<FontFaceSet> create(Document& document) | 114 static PassRefPtrWillBeRawPtr<FontFaceSet> create(Document& document) |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 WillBeHeapListHashSet<RefPtrWillBeMember<FontFace>> m_nonCSSConnectedFaces; | 154 WillBeHeapListHashSet<RefPtrWillBeMember<FontFace>> m_nonCSSConnectedFaces; |
| 155 | 155 |
| 156 AsyncMethodRunner<FontFaceSet> m_asyncRunner; | 156 AsyncMethodRunner<FontFaceSet> m_asyncRunner; |
| 157 | 157 |
| 158 FontLoadHistogram m_histogram; | 158 FontLoadHistogram m_histogram; |
| 159 }; | 159 }; |
| 160 | 160 |
| 161 } // namespace blink | 161 } // namespace blink |
| 162 | 162 |
| 163 #endif // FontFaceSet_h | 163 #endif // FontFaceSet_h |
| OLD | NEW |