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

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

Issue 171823002: Make text visible when font loading takes longer than 3 seconds (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 6 years, 9 months 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/css/CSSFontFace.h ('k') | Source/core/css/CSSFontFaceSource.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 m_sources.removeFirst(); 80 m_sources.removeFirst();
81 if (!isValid()) 81 if (!isValid())
82 setLoadStatus(FontFace::Error); 82 setLoadStatus(FontFace::Error);
83 } 83 }
84 } 84 }
85 85
86 if (m_segmentedFontFace) 86 if (m_segmentedFontFace)
87 m_segmentedFontFace->fontLoaded(this); 87 m_segmentedFontFace->fontLoaded(this);
88 } 88 }
89 89
90 void CSSFontFace::fontLoadWaitLimitExceeded(CSSFontFaceSource* source)
91 {
92 if (!isValid() || source != m_sources.first())
93 return;
94 if (m_segmentedFontFace)
95 m_segmentedFontFace->fontLoadWaitLimitExceeded(this);
96 }
97
90 PassRefPtr<SimpleFontData> CSSFontFace::getFontData(const FontDescription& fontD escription) 98 PassRefPtr<SimpleFontData> CSSFontFace::getFontData(const FontDescription& fontD escription)
91 { 99 {
92 if (!isValid()) 100 if (!isValid())
93 return nullptr; 101 return nullptr;
94 102
95 while (!m_sources.isEmpty()) { 103 while (!m_sources.isEmpty()) {
96 OwnPtr<CSSFontFaceSource>& source = m_sources.first(); 104 OwnPtr<CSSFontFaceSource>& source = m_sources.first();
97 if (RefPtr<SimpleFontData> result = source->getFontData(fontDescription) ) { 105 if (RefPtr<SimpleFontData> result = source->getFontData(fontDescription) ) {
98 if (loadStatus() == FontFace::Unloaded && (source->isLoading() || so urce->isLoaded())) 106 if (loadStatus() == FontFace::Unloaded && (source->isLoading() || so urce->isLoaded()))
99 setLoadStatus(FontFace::Loading); 107 setLoadStatus(FontFace::Loading);
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 UChar32 c = text.characterStartingAt(index); 224 UChar32 c = text.characterStartingAt(index);
217 index += U16_LENGTH(c); 225 index += U16_LENGTH(c);
218 Vector<UnicodeRange>::const_iterator it = std::lower_bound(m_ranges.begi n(), m_ranges.end(), c); 226 Vector<UnicodeRange>::const_iterator it = std::lower_bound(m_ranges.begi n(), m_ranges.end(), c);
219 if (it != m_ranges.end() && it->contains(c)) 227 if (it != m_ranges.end() && it->contains(c))
220 return true; 228 return true;
221 } 229 }
222 return false; 230 return false;
223 } 231 }
224 232
225 } 233 }
OLDNEW
« no previous file with comments | « Source/core/css/CSSFontFace.h ('k') | Source/core/css/CSSFontFaceSource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698