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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 ExceptionState&) const { | 303 ExceptionState&) const { |
304 ASSERT(fontFace); | 304 ASSERT(fontFace); |
305 if (!inActiveDocumentContext()) | 305 if (!inActiveDocumentContext()) |
306 return false; | 306 return false; |
307 return m_nonCSSConnectedFaces.contains(fontFace) || | 307 return m_nonCSSConnectedFaces.contains(fontFace) || |
308 isCSSConnectedFontFace(fontFace); | 308 isCSSConnectedFontFace(fontFace); |
309 } | 309 } |
310 | 310 |
311 const HeapListHashSet<Member<FontFace>>& FontFaceSet::cssConnectedFontFaceList() | 311 const HeapListHashSet<Member<FontFace>>& FontFaceSet::cssConnectedFontFaceList() |
312 const { | 312 const { |
313 Document* document = this->document(); | 313 Document* d = document(); |
314 document->updateActiveStyle(); | 314 d->ensureStyleResolver(); // Flush pending style changes. |
315 return document->styleEngine() | 315 return d->styleEngine() |
316 .fontSelector() | 316 .fontSelector() |
317 ->fontFaceCache() | 317 ->fontFaceCache() |
318 ->cssConnectedFontFaces(); | 318 ->cssConnectedFontFaces(); |
319 } | 319 } |
320 | 320 |
321 bool FontFaceSet::isCSSConnectedFontFace(FontFace* fontFace) const { | 321 bool FontFaceSet::isCSSConnectedFontFace(FontFace* fontFace) const { |
322 return cssConnectedFontFaceList().contains(fontFace); | 322 return cssConnectedFontFaceList().contains(fontFace); |
323 } | 323 } |
324 | 324 |
325 size_t FontFaceSet::size() const { | 325 size_t FontFaceSet::size() const { |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 | 460 |
461 FontDescription defaultFontDescription; | 461 FontDescription defaultFontDescription; |
462 defaultFontDescription.setFamily(fontFamily); | 462 defaultFontDescription.setFamily(fontFamily); |
463 defaultFontDescription.setSpecifiedSize(defaultFontSize); | 463 defaultFontDescription.setSpecifiedSize(defaultFontSize); |
464 defaultFontDescription.setComputedSize(defaultFontSize); | 464 defaultFontDescription.setComputedSize(defaultFontSize); |
465 | 465 |
466 style->setFontDescription(defaultFontDescription); | 466 style->setFontDescription(defaultFontDescription); |
467 | 467 |
468 style->font().update(style->font().getFontSelector()); | 468 style->font().update(style->font().getFontSelector()); |
469 | 469 |
470 document()->updateActiveStyle(); | |
471 document()->ensureStyleResolver().computeFont(style.get(), *parsedStyle); | 470 document()->ensureStyleResolver().computeFont(style.get(), *parsedStyle); |
472 | 471 |
473 font = style->font(); | 472 font = style->font(); |
474 font.update(document()->styleEngine().fontSelector()); | 473 font.update(document()->styleEngine().fontSelector()); |
475 return true; | 474 return true; |
476 } | 475 } |
477 | 476 |
478 void FontFaceSet::FontLoadHistogram::updateStatus(FontFace* fontFace) { | 477 void FontFaceSet::FontLoadHistogram::updateStatus(FontFace* fontFace) { |
479 if (m_status == Reported) | 478 if (m_status == Reported) |
480 return; | 479 return; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 visitor->trace(m_failedFonts); | 559 visitor->trace(m_failedFonts); |
561 visitor->trace(m_nonCSSConnectedFaces); | 560 visitor->trace(m_nonCSSConnectedFaces); |
562 visitor->trace(m_asyncRunner); | 561 visitor->trace(m_asyncRunner); |
563 EventTargetWithInlineData::trace(visitor); | 562 EventTargetWithInlineData::trace(visitor); |
564 Supplement<Document>::trace(visitor); | 563 Supplement<Document>::trace(visitor); |
565 SuspendableObject::trace(visitor); | 564 SuspendableObject::trace(visitor); |
566 FontFace::LoadFontCallback::trace(visitor); | 565 FontFace::LoadFontCallback::trace(visitor); |
567 } | 566 } |
568 | 567 |
569 } // namespace blink | 568 } // namespace blink |
OLD | NEW |