| 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 | 170 |
| 171 void FontFaceSet::handlePendingEventsAndPromisesSoon() | 171 void FontFaceSet::handlePendingEventsAndPromisesSoon() |
| 172 { | 172 { |
| 173 // setPendingActivity() is unnecessary because m_asyncRunner will be | 173 // setPendingActivity() is unnecessary because m_asyncRunner will be |
| 174 // automatically stopped on destruction. | 174 // automatically stopped on destruction. |
| 175 m_asyncRunner.runAsync(); | 175 m_asyncRunner.runAsync(); |
| 176 } | 176 } |
| 177 | 177 |
| 178 void FontFaceSet::didLayout() | 178 void FontFaceSet::didLayout() |
| 179 { | 179 { |
| 180 Document* d = document(); | 180 if (document()->frame()->isMainFrame()) |
| 181 if (d->page() && d->page()->mainFrame() == d->frame()) | |
| 182 m_histogram.record(); | 181 m_histogram.record(); |
| 183 if (!RuntimeEnabledFeatures::fontLoadEventsEnabled()) | 182 if (!RuntimeEnabledFeatures::fontLoadEventsEnabled()) |
| 184 return; | 183 return; |
| 185 if (m_loadingCount || (!hasLoadedFonts() && m_readyResolvers.isEmpty())) | 184 if (m_loadingCount || (!hasLoadedFonts() && m_readyResolvers.isEmpty())) |
| 186 return; | 185 return; |
| 187 handlePendingEventsAndPromisesSoon(); | 186 handlePendingEventsAndPromisesSoon(); |
| 188 } | 187 } |
| 189 | 188 |
| 190 void FontFaceSet::handlePendingEventsAndPromises() | 189 void FontFaceSet::handlePendingEventsAndPromises() |
| 191 { | 190 { |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 } | 455 } |
| 457 | 456 |
| 458 void FontFaceSet::didLayout(Document* document) | 457 void FontFaceSet::didLayout(Document* document) |
| 459 { | 458 { |
| 460 if (FontFaceSet* fonts = static_cast<FontFaceSet*>(SupplementType::from(docu
ment, supplementName()))) | 459 if (FontFaceSet* fonts = static_cast<FontFaceSet*>(SupplementType::from(docu
ment, supplementName()))) |
| 461 fonts->didLayout(); | 460 fonts->didLayout(); |
| 462 } | 461 } |
| 463 | 462 |
| 464 | 463 |
| 465 } // namespace WebCore | 464 } // namespace WebCore |
| OLD | NEW |