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

Side by Side Diff: Source/core/rendering/RenderText.cpp

Issue 248473005: Make CSSFontFace::willUseFontData() load fonts with unicode-range (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 6 years, 7 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/CSSSegmentedFontFace.cpp ('k') | Source/platform/fonts/Font.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 * (C) 1999 Lars Knoll (knoll@kde.org) 2 * (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Dirk Mueller (mueller@kde.org) 3 * (C) 2000 Dirk Mueller (mueller@kde.org)
4 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) 5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net)
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 setNeedsLayoutAndPrefWidthsRecalc(); 197 setNeedsLayoutAndPrefWidthsRecalc();
198 m_knownToHaveNoOverflowAndNoFallbackFonts = false; 198 m_knownToHaveNoOverflowAndNoFallbackFonts = false;
199 } 199 }
200 200
201 RenderStyle* newStyle = style(); 201 RenderStyle* newStyle = style();
202 ETextTransform oldTransform = oldStyle ? oldStyle->textTransform() : TTNONE; 202 ETextTransform oldTransform = oldStyle ? oldStyle->textTransform() : TTNONE;
203 ETextSecurity oldSecurity = oldStyle ? oldStyle->textSecurity() : TSNONE; 203 ETextSecurity oldSecurity = oldStyle ? oldStyle->textSecurity() : TSNONE;
204 if (oldTransform != newStyle->textTransform() || oldSecurity != newStyle->te xtSecurity()) 204 if (oldTransform != newStyle->textTransform() || oldSecurity != newStyle->te xtSecurity())
205 transformText(); 205 transformText();
206 206
207 // This is an optimization that kicks off font load before layout.
208 // In order to make it fast, we only check if the first character of the
209 // text is included in the unicode ranges of the fonts.
207 if (!text().containsOnlyWhitespace()) 210 if (!text().containsOnlyWhitespace())
208 newStyle->font().willUseFontData(); 211 newStyle->font().willUseFontData(text().characterStartingAt(0));
209 } 212 }
210 213
211 void RenderText::removeAndDestroyTextBoxes() 214 void RenderText::removeAndDestroyTextBoxes()
212 { 215 {
213 if (!documentBeingDestroyed()) { 216 if (!documentBeingDestroyed()) {
214 if (firstTextBox()) { 217 if (firstTextBox()) {
215 if (isBR()) { 218 if (isBR()) {
216 RootInlineBox* next = firstTextBox()->root().nextRootBox(); 219 RootInlineBox* next = firstTextBox()->root().nextRootBox();
217 if (next) 220 if (next)
218 next->markDirty(); 221 next->markDirty();
(...skipping 1644 matching lines...) Expand 10 before | Expand all | Expand 10 after
1863 } 1866 }
1864 secureTextTimer->restartWithNewText(lastTypedCharacterOffset); 1867 secureTextTimer->restartWithNewText(lastTypedCharacterOffset);
1865 } 1868 }
1866 1869
1867 PassRefPtr<AbstractInlineTextBox> RenderText::firstAbstractInlineTextBox() 1870 PassRefPtr<AbstractInlineTextBox> RenderText::firstAbstractInlineTextBox()
1868 { 1871 {
1869 return AbstractInlineTextBox::getOrCreate(this, m_firstTextBox); 1872 return AbstractInlineTextBox::getOrCreate(this, m_firstTextBox);
1870 } 1873 }
1871 1874
1872 } // namespace WebCore 1875 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/CSSSegmentedFontFace.cpp ('k') | Source/platform/fonts/Font.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698