Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(135)

Side by Side Diff: third_party/WebKit/Source/core/css/CSSFontFace.cpp

Issue 1429713004: Implement CSS font-display (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2011 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 if (loadStatus() == FontFace::Loading) { 63 if (loadStatus() == FontFace::Loading) {
64 if (source->isValid()) { 64 if (source->isValid()) {
65 setLoadStatus(FontFace::Loaded); 65 setLoadStatus(FontFace::Loaded);
66 } else { 66 } else {
67 m_sources.removeFirst(); 67 m_sources.removeFirst();
68 load(); 68 load();
69 } 69 }
70 } 70 }
71 71
72 if (m_segmentedFontFace) 72 if (m_segmentedFontFace)
73 m_segmentedFontFace->fontLoaded(this); 73 m_segmentedFontFace->fontFaceInvalidated();
74 } 74 }
75 75
76 void CSSFontFace::fontLoadWaitLimitExceeded(RemoteFontFaceSource* source) 76 void CSSFontFace::fontDataInvalidated(RemoteFontFaceSource* source)
77 { 77 {
78 if (!isValid() || source != m_sources.first()) 78 if (!isValid() || source != m_sources.first())
79 return; 79 return;
80 if (m_segmentedFontFace) 80 if (m_segmentedFontFace)
81 m_segmentedFontFace->fontLoadWaitLimitExceeded(this); 81 m_segmentedFontFace->fontFaceInvalidated();
82 } 82 }
83 83
84 PassRefPtr<SimpleFontData> CSSFontFace::getFontData(const FontDescription& fontD escription) 84 PassRefPtr<SimpleFontData> CSSFontFace::getFontData(const FontDescription& fontD escription)
85 { 85 {
86 if (!isValid()) 86 if (!isValid())
87 return nullptr; 87 return nullptr;
88 88
89 while (!m_sources.isEmpty()) { 89 while (!m_sources.isEmpty()) {
90 OwnPtrWillBeMember<CSSFontFaceSource>& source = m_sources.first(); 90 OwnPtrWillBeMember<CSSFontFaceSource>& source = m_sources.first();
91 if (RefPtr<SimpleFontData> result = source->getFontData(fontDescription) ) { 91 if (RefPtr<SimpleFontData> result = source->getFontData(fontDescription) ) {
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 } 254 }
255 255
256 DEFINE_TRACE(CSSFontFace) 256 DEFINE_TRACE(CSSFontFace)
257 { 257 {
258 visitor->trace(m_segmentedFontFace); 258 visitor->trace(m_segmentedFontFace);
259 visitor->trace(m_sources); 259 visitor->trace(m_sources);
260 visitor->trace(m_fontFace); 260 visitor->trace(m_fontFace);
261 } 261 }
262 262
263 } 263 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698