Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(771)

Side by Side Diff: third_party/WebKit/Source/core/css/FontFaceSet.h

Issue 2340273002: Fix FontFaceSet state getting stuck at loading (Closed)
Patch Set: Separate test case Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 class CSSFontSelector; 50 class CSSFontSelector;
51 class Dictionary; 51 class Dictionary;
52 class ExceptionState; 52 class ExceptionState;
53 class Font; 53 class Font;
54 class FontFaceCache; 54 class FontFaceCache;
55 class FontResource; 55 class FontResource;
56 class ExecutionContext; 56 class ExecutionContext;
57 57
58 using FontFaceSetIterable = PairIterable<Member<FontFace>, Member<FontFace>>; 58 using FontFaceSetIterable = PairIterable<Member<FontFace>, Member<FontFace>>;
59 59
60 class FontFaceSet final : public EventTargetWithInlineData, public Supplement<Do cument>, public ActiveDOMObject, public FontFaceSetIterable { 60 class FontFaceSet final : public EventTargetWithInlineData, public Supplement<Do cument>, public ActiveDOMObject, public FontFaceSetIterable, public FontFace::Lo adFontCallback {
61 USING_GARBAGE_COLLECTED_MIXIN(FontFaceSet); 61 USING_GARBAGE_COLLECTED_MIXIN(FontFaceSet);
62 DEFINE_WRAPPERTYPEINFO(); 62 DEFINE_WRAPPERTYPEINFO();
63 WTF_MAKE_NONCOPYABLE(FontFaceSet); 63 WTF_MAKE_NONCOPYABLE(FontFaceSet);
64 public: 64 public:
65 ~FontFaceSet() override; 65 ~FontFaceSet() override;
66 66
67 DEFINE_ATTRIBUTE_EVENT_LISTENER(loading); 67 DEFINE_ATTRIBUTE_EVENT_LISTENER(loading);
68 DEFINE_ATTRIBUTE_EVENT_LISTENER(loadingdone); 68 DEFINE_ATTRIBUTE_EVENT_LISTENER(loadingdone);
69 DEFINE_ATTRIBUTE_EVENT_LISTENER(loadingerror); 69 DEFINE_ATTRIBUTE_EVENT_LISTENER(loadingerror);
70 70
71 bool check(const String& font, const String& text, ExceptionState&); 71 bool check(const String& font, const String& text, ExceptionState&);
72 ScriptPromise load(ScriptState*, const String& font, const String& text); 72 ScriptPromise load(ScriptState*, const String& font, const String& text);
73 ScriptPromise ready(ScriptState*); 73 ScriptPromise ready(ScriptState*);
74 74
75 FontFaceSet* addForBinding(ScriptState*, FontFace*, ExceptionState&); 75 FontFaceSet* addForBinding(ScriptState*, FontFace*, ExceptionState&);
76 void clearForBinding(ScriptState*, ExceptionState&); 76 void clearForBinding(ScriptState*, ExceptionState&);
77 bool deleteForBinding(ScriptState*, FontFace*, ExceptionState&); 77 bool deleteForBinding(ScriptState*, FontFace*, ExceptionState&);
78 bool hasForBinding(ScriptState*, FontFace*, ExceptionState&) const; 78 bool hasForBinding(ScriptState*, FontFace*, ExceptionState&) const;
79 79
80 size_t size() const; 80 size_t size() const;
81 AtomicString status() const; 81 AtomicString status() const;
82 82
83 ExecutionContext* getExecutionContext() const override; 83 ExecutionContext* getExecutionContext() const override;
84 const AtomicString& interfaceName() const override; 84 const AtomicString& interfaceName() const override;
85 85
86 Document* document() const; 86 Document* document() const;
87 87
88 void didLayout(); 88 void didLayout();
89 void beginFontLoading(FontFace*); 89 void beginFontLoading(FontFace*);
90 void fontLoaded(FontFace*); 90
91 void loadError(FontFace*); 91 // FontFace::LoadFontCallback
92 void notifyLoaded(FontFace*) override;
93 void notifyError(FontFace*) override;
92 94
93 size_t approximateBlankCharacterCount() const; 95 size_t approximateBlankCharacterCount() const;
94 96
95 // ActiveDOMObject 97 // ActiveDOMObject
96 void suspend() override; 98 void suspend() override;
97 void resume() override; 99 void resume() override;
98 void stop() override; 100 void stop() override;
99 101
100 static FontFaceSet* from(Document&); 102 static FontFaceSet* from(Document&);
101 static void didLayout(Document&); 103 static void didLayout(Document&);
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 HeapListHashSet<Member<FontFace>> m_nonCSSConnectedFaces; 178 HeapListHashSet<Member<FontFace>> m_nonCSSConnectedFaces;
177 179
178 Member<AsyncMethodRunner<FontFaceSet>> m_asyncRunner; 180 Member<AsyncMethodRunner<FontFaceSet>> m_asyncRunner;
179 181
180 FontLoadHistogram m_histogram; 182 FontLoadHistogram m_histogram;
181 }; 183 };
182 184
183 } // namespace blink 185 } // namespace blink
184 186
185 #endif // FontFaceSet_h 187 #endif // FontFaceSet_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/FontFace.cpp ('k') | third_party/WebKit/Source/core/css/FontFaceSet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698