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

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

Issue 21032002: Introduce toSVGFontFaceElement, and use it (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 4 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
« no previous file with comments | « no previous file | Source/core/svg/SVGFontFaceElement.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, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2010, 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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 } 137 }
138 138
139 if (!m_externalSVGFontElement) 139 if (!m_externalSVGFontElement)
140 return 0; 140 return 0;
141 141
142 SVGFontFaceElement* fontFaceElement = 0; 142 SVGFontFaceElement* fontFaceElement = 0;
143 143
144 // Select first <font-face> child 144 // Select first <font-face> child
145 for (Node* fontChild = m_externalSVGFontElement->firstChild(); f ontChild; fontChild = fontChild->nextSibling()) { 145 for (Node* fontChild = m_externalSVGFontElement->firstChild(); f ontChild; fontChild = fontChild->nextSibling()) {
146 if (fontChild->hasTagName(SVGNames::font_faceTag)) { 146 if (fontChild->hasTagName(SVGNames::font_faceTag)) {
147 fontFaceElement = static_cast<SVGFontFaceElement*>(fontC hild); 147 fontFaceElement = toSVGFontFaceElement(fontChild);
148 break; 148 break;
149 } 149 }
150 } 150 }
151 151
152 if (fontFaceElement) { 152 if (fontFaceElement) {
153 if (!m_svgFontFaceElement) { 153 if (!m_svgFontFaceElement) {
154 // We're created using a CSS @font-face rule, that means we're not associated with a SVGFontFaceElement. 154 // We're created using a CSS @font-face rule, that means we're not associated with a SVGFontFaceElement.
155 // Use the imported <font-face> tag as referencing font- face element for these cases. 155 // Use the imported <font-face> tag as referencing font- face element for these cases.
156 m_svgFontFaceElement = fontFaceElement; 156 m_svgFontFaceElement = fontFaceElement;
157 } 157 }
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 if (size < 50 * 1024) 260 if (size < 50 * 1024)
261 return "WebFont.LoadTime.1.10KBTo50KB"; 261 return "WebFont.LoadTime.1.10KBTo50KB";
262 if (size < 100 * 1024) 262 if (size < 100 * 1024)
263 return "WebFont.LoadTime.2.50KBTo100KB"; 263 return "WebFont.LoadTime.2.50KBTo100KB";
264 if (size < 1024 * 1024) 264 if (size < 1024 * 1024)
265 return "WebFont.LoadTime.3.100KBTo1MB"; 265 return "WebFont.LoadTime.3.100KBTo1MB";
266 return "WebFont.LoadTime.4.Over1MB"; 266 return "WebFont.LoadTime.4.Over1MB";
267 } 267 }
268 268
269 } 269 }
OLDNEW
« no previous file with comments | « no previous file | Source/core/svg/SVGFontFaceElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698