Chromium Code Reviews| 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 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 400 return; | 400 return; |
| 401 | 401 |
| 402 // If the layout was invalidated in between when we thought layout | 402 // If the layout was invalidated in between when we thought layout |
| 403 // was updated and when we're ready to fire the event, just wait | 403 // was updated and when we're ready to fire the event, just wait |
| 404 // until after the next layout before firing events. | 404 // until after the next layout before firing events. |
| 405 Document* d = document(); | 405 Document* d = document(); |
| 406 if (!d->view() || d->view()->needsLayout()) | 406 if (!d->view() || d->view()->needsLayout()) |
| 407 return; | 407 return; |
| 408 | 408 |
| 409 if (hasLoadedFonts()) { | 409 if (hasLoadedFonts()) { |
| 410 RefPtr<CSSFontFaceLoadEvent> doneEvent; | 410 RefPtrWillBeRawPtr<CSSFontFaceLoadEvent> doneEvent = nullptr; |
| 411 RefPtr<CSSFontFaceLoadEvent> errorEvent; | 411 RefPtrWillBeRawPtr<CSSFontFaceLoadEvent> errorEvent = nullptr; |
|
haraken
2014/04/03 10:39:31
These '= nullptr's were necessary.
| |
| 412 doneEvent = CSSFontFaceLoadEvent::createForFontFaces(EventTypeNames::loa dingdone, m_loadedFonts); | 412 doneEvent = CSSFontFaceLoadEvent::createForFontFaces(EventTypeNames::loa dingdone, m_loadedFonts); |
| 413 m_loadedFonts.clear(); | 413 m_loadedFonts.clear(); |
| 414 if (!m_failedFonts.isEmpty()) { | 414 if (!m_failedFonts.isEmpty()) { |
| 415 errorEvent = CSSFontFaceLoadEvent::createForFontFaces(EventTypeNames ::loadingerror, m_failedFonts); | 415 errorEvent = CSSFontFaceLoadEvent::createForFontFaces(EventTypeNames ::loadingerror, m_failedFonts); |
| 416 m_failedFonts.clear(); | 416 m_failedFonts.clear(); |
| 417 } | 417 } |
| 418 dispatchEvent(doneEvent); | 418 dispatchEvent(doneEvent); |
| 419 if (errorEvent) | 419 if (errorEvent) |
| 420 dispatchEvent(errorEvent); | 420 dispatchEvent(errorEvent); |
| 421 } | 421 } |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 566 } | 566 } |
| 567 | 567 |
| 568 void FontFaceSet::didLayout(Document& document) | 568 void FontFaceSet::didLayout(Document& document) |
| 569 { | 569 { |
| 570 if (FontFaceSet* fonts = static_cast<FontFaceSet*>(SupplementType::from(docu ment, supplementName()))) | 570 if (FontFaceSet* fonts = static_cast<FontFaceSet*>(SupplementType::from(docu ment, supplementName()))) |
| 571 fonts->didLayout(); | 571 fonts->didLayout(); |
| 572 } | 572 } |
| 573 | 573 |
| 574 | 574 |
| 575 } // namespace WebCore | 575 } // namespace WebCore |
| OLD | NEW |