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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSFontFace.cpp

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) 2007, 2008, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2011 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 { 182 {
183 ASSERT(m_fontFace); 183 ASSERT(m_fontFace);
184 if (newStatus == FontFace::Error) 184 if (newStatus == FontFace::Error)
185 m_fontFace->setError(); 185 m_fontFace->setError();
186 else 186 else
187 m_fontFace->setLoadStatus(newStatus); 187 m_fontFace->setLoadStatus(newStatus);
188 188
189 if (!m_segmentedFontFace) 189 if (!m_segmentedFontFace)
190 return; 190 return;
191 Document* document = m_segmentedFontFace->fontSelector()->document(); 191 Document* document = m_segmentedFontFace->fontSelector()->document();
192 if (!document) 192 if (document && newStatus == FontFace::Loading)
193 return;
194
195 switch (newStatus) {
196 case FontFace::Loading:
197 FontFaceSet::from(*document)->beginFontLoading(m_fontFace); 193 FontFaceSet::from(*document)->beginFontLoading(m_fontFace);
198 break;
199 case FontFace::Loaded:
200 FontFaceSet::from(*document)->fontLoaded(m_fontFace);
201 break;
202 case FontFace::Error:
203 FontFaceSet::from(*document)->loadError(m_fontFace);
204 break;
205 default:
206 break;
207 }
208 } 194 }
209 195
210 DEFINE_TRACE(CSSFontFace) 196 DEFINE_TRACE(CSSFontFace)
211 { 197 {
212 visitor->trace(m_segmentedFontFace); 198 visitor->trace(m_segmentedFontFace);
213 visitor->trace(m_sources); 199 visitor->trace(m_sources);
214 visitor->trace(m_fontFace); 200 visitor->trace(m_fontFace);
215 } 201 }
216 202
217 } // namespace blink 203 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698