| 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 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 { | 319 { |
| 320 ASSERT(fontFace); | 320 ASSERT(fontFace); |
| 321 if (!inActiveDocumentContext()) | 321 if (!inActiveDocumentContext()) |
| 322 return false; | 322 return false; |
| 323 return m_nonCSSConnectedFaces.contains(fontFace) || isCSSConnectedFontFace(f
ontFace); | 323 return m_nonCSSConnectedFaces.contains(fontFace) || isCSSConnectedFontFace(f
ontFace); |
| 324 } | 324 } |
| 325 | 325 |
| 326 const HeapListHashSet<Member<FontFace>>& FontFaceSet::cssConnectedFontFaceList()
const | 326 const HeapListHashSet<Member<FontFace>>& FontFaceSet::cssConnectedFontFaceList()
const |
| 327 { | 327 { |
| 328 Document* d = document(); | 328 Document* d = document(); |
| 329 d->ensureStyleResolver(); // Flush pending style changes. | 329 d->styleEngine().updateActiveStyle(); |
| 330 return d->styleEngine().fontSelector()->fontFaceCache()->cssConnectedFontFac
es(); | 330 return d->styleEngine().fontSelector()->fontFaceCache()->cssConnectedFontFac
es(); |
| 331 } | 331 } |
| 332 | 332 |
| 333 bool FontFaceSet::isCSSConnectedFontFace(FontFace* fontFace) const | 333 bool FontFaceSet::isCSSConnectedFontFace(FontFace* fontFace) const |
| 334 { | 334 { |
| 335 return cssConnectedFontFaceList().contains(fontFace); | 335 return cssConnectedFontFaceList().contains(fontFace); |
| 336 } | 336 } |
| 337 | 337 |
| 338 size_t FontFaceSet::size() const | 338 size_t FontFaceSet::size() const |
| 339 { | 339 { |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 | 456 |
| 457 FontDescription defaultFontDescription; | 457 FontDescription defaultFontDescription; |
| 458 defaultFontDescription.setFamily(fontFamily); | 458 defaultFontDescription.setFamily(fontFamily); |
| 459 defaultFontDescription.setSpecifiedSize(defaultFontSize); | 459 defaultFontDescription.setSpecifiedSize(defaultFontSize); |
| 460 defaultFontDescription.setComputedSize(defaultFontSize); | 460 defaultFontDescription.setComputedSize(defaultFontSize); |
| 461 | 461 |
| 462 style->setFontDescription(defaultFontDescription); | 462 style->setFontDescription(defaultFontDescription); |
| 463 | 463 |
| 464 style->font().update(style->font().getFontSelector()); | 464 style->font().update(style->font().getFontSelector()); |
| 465 | 465 |
| 466 document()->styleEngine().updateActiveStyle(); |
| 466 document()->ensureStyleResolver().computeFont(style.get(), *parsedStyle); | 467 document()->ensureStyleResolver().computeFont(style.get(), *parsedStyle); |
| 467 | 468 |
| 468 font = style->font(); | 469 font = style->font(); |
| 469 font.update(document()->styleEngine().fontSelector()); | 470 font.update(document()->styleEngine().fontSelector()); |
| 470 return true; | 471 return true; |
| 471 } | 472 } |
| 472 | 473 |
| 473 void FontFaceSet::FontLoadHistogram::updateStatus(FontFace* fontFace) | 474 void FontFaceSet::FontLoadHistogram::updateStatus(FontFace* fontFace) |
| 474 { | 475 { |
| 475 if (m_status == Reported) | 476 if (m_status == Reported) |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 550 visitor->trace(m_loadedFonts); | 551 visitor->trace(m_loadedFonts); |
| 551 visitor->trace(m_failedFonts); | 552 visitor->trace(m_failedFonts); |
| 552 visitor->trace(m_nonCSSConnectedFaces); | 553 visitor->trace(m_nonCSSConnectedFaces); |
| 553 visitor->trace(m_asyncRunner); | 554 visitor->trace(m_asyncRunner); |
| 554 EventTargetWithInlineData::trace(visitor); | 555 EventTargetWithInlineData::trace(visitor); |
| 555 Supplement<Document>::trace(visitor); | 556 Supplement<Document>::trace(visitor); |
| 556 ActiveDOMObject::trace(visitor); | 557 ActiveDOMObject::trace(visitor); |
| 557 } | 558 } |
| 558 | 559 |
| 559 } // namespace blink | 560 } // namespace blink |
| OLD | NEW |