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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 | 179 |
180 AtomicString FontFaceSet::status() const | 180 AtomicString FontFaceSet::status() const |
181 { | 181 { |
182 DEFINE_STATIC_LOCAL(AtomicString, loading, ("loading", AtomicString::Constru
ctFromLiteral)); | 182 DEFINE_STATIC_LOCAL(AtomicString, loading, ("loading", AtomicString::Constru
ctFromLiteral)); |
183 DEFINE_STATIC_LOCAL(AtomicString, loaded, ("loaded", AtomicString::Construct
FromLiteral)); | 183 DEFINE_STATIC_LOCAL(AtomicString, loaded, ("loaded", AtomicString::Construct
FromLiteral)); |
184 return (!m_loadingFonts.isEmpty() || hasLoadedFonts()) ? loading : loaded; | 184 return (!m_loadingFonts.isEmpty() || hasLoadedFonts()) ? loading : loaded; |
185 } | 185 } |
186 | 186 |
187 void FontFaceSet::handlePendingEventsAndPromisesSoon() | 187 void FontFaceSet::handlePendingEventsAndPromisesSoon() |
188 { | 188 { |
189 // setPendingActivity() is unnecessary because m_asyncRunner will be | 189 // m_asyncRunner will be automatically stopped on destruction. |
190 // automatically stopped on destruction. | |
191 m_asyncRunner.runAsync(); | 190 m_asyncRunner.runAsync(); |
192 } | 191 } |
193 | 192 |
194 void FontFaceSet::didLayout() | 193 void FontFaceSet::didLayout() |
195 { | 194 { |
196 if (document()->frame()->isMainFrame() && m_loadingFonts.isEmpty()) | 195 if (document()->frame()->isMainFrame() && m_loadingFonts.isEmpty()) |
197 m_histogram.record(); | 196 m_histogram.record(); |
198 if (!RuntimeEnabledFeatures::fontLoadEventsEnabled()) | 197 if (!RuntimeEnabledFeatures::fontLoadEventsEnabled()) |
199 return; | 198 return; |
200 if (!m_loadingFonts.isEmpty() || (!hasLoadedFonts() && m_readyResolvers.isEm
pty())) | 199 if (!m_loadingFonts.isEmpty() || (!hasLoadedFonts() && m_readyResolvers.isEm
pty())) |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 visitor->trace(m_loadingFonts); | 597 visitor->trace(m_loadingFonts); |
599 visitor->trace(m_loadedFonts); | 598 visitor->trace(m_loadedFonts); |
600 visitor->trace(m_failedFonts); | 599 visitor->trace(m_failedFonts); |
601 visitor->trace(m_nonCSSConnectedFaces); | 600 visitor->trace(m_nonCSSConnectedFaces); |
602 DocumentSupplement::trace(visitor); | 601 DocumentSupplement::trace(visitor); |
603 EventTargetWithInlineData::trace(visitor); | 602 EventTargetWithInlineData::trace(visitor); |
604 } | 603 } |
605 #endif | 604 #endif |
606 | 605 |
607 } // namespace WebCore | 606 } // namespace WebCore |
OLD | NEW |