| 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* d = document(); | 313 Document* document = this->document(); |
| 314 d->ensureStyleResolver(); // Flush pending style changes. | 314 document->updateActiveStyle(); |
| 315 return d->styleEngine() | 315 return document->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(); |
| 470 document()->ensureStyleResolver().computeFont(style.get(), *parsedStyle); | 471 document()->ensureStyleResolver().computeFont(style.get(), *parsedStyle); |
| 471 | 472 |
| 472 font = style->font(); | 473 font = style->font(); |
| 473 font.update(document()->styleEngine().fontSelector()); | 474 font.update(document()->styleEngine().fontSelector()); |
| 474 return true; | 475 return true; |
| 475 } | 476 } |
| 476 | 477 |
| 477 void FontFaceSet::FontLoadHistogram::updateStatus(FontFace* fontFace) { | 478 void FontFaceSet::FontLoadHistogram::updateStatus(FontFace* fontFace) { |
| 478 if (m_status == Reported) | 479 if (m_status == Reported) |
| 479 return; | 480 return; |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 visitor->trace(m_failedFonts); | 560 visitor->trace(m_failedFonts); |
| 560 visitor->trace(m_nonCSSConnectedFaces); | 561 visitor->trace(m_nonCSSConnectedFaces); |
| 561 visitor->trace(m_asyncRunner); | 562 visitor->trace(m_asyncRunner); |
| 562 EventTargetWithInlineData::trace(visitor); | 563 EventTargetWithInlineData::trace(visitor); |
| 563 Supplement<Document>::trace(visitor); | 564 Supplement<Document>::trace(visitor); |
| 564 SuspendableObject::trace(visitor); | 565 SuspendableObject::trace(visitor); |
| 565 FontFace::LoadFontCallback::trace(visitor); | 566 FontFace::LoadFontCallback::trace(visitor); |
| 566 } | 567 } |
| 567 | 568 |
| 568 } // namespace blink | 569 } // namespace blink |
| OLD | NEW |