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

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

Issue 15864004: Move create() methods from StylePropertySet to MutableStylePropertySet. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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/DOMWindowCSS.cpp ('k') | Source/core/css/StylePropertySet.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) 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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 } 299 }
300 300
301 static void applyPropertyToCurrentStyle(StyleResolver* styleResolver, CSSPropert yID id, const RefPtr<StylePropertySet>& parsedStyle) 301 static void applyPropertyToCurrentStyle(StyleResolver* styleResolver, CSSPropert yID id, const RefPtr<StylePropertySet>& parsedStyle)
302 { 302 {
303 styleResolver->applyPropertyToCurrentStyle(id, parsedStyle->getPropertyCSSVa lue(id).get()); 303 styleResolver->applyPropertyToCurrentStyle(id, parsedStyle->getPropertyCSSVa lue(id).get());
304 } 304 }
305 305
306 bool FontLoader::resolveFontStyle(const String& fontString, Font& font) 306 bool FontLoader::resolveFontStyle(const String& fontString, Font& font)
307 { 307 {
308 // Interpret fontString in the same way as the 'font' attribute of CanvasRen deringContext2D. 308 // Interpret fontString in the same way as the 'font' attribute of CanvasRen deringContext2D.
309 RefPtr<StylePropertySet> parsedStyle = StylePropertySet::create(); 309 RefPtr<MutableStylePropertySet> parsedStyle = MutableStylePropertySet::creat e();
310 CSSParser::parseValue(parsedStyle.get(), CSSPropertyFont, fontString, true, CSSStrictMode, 0); 310 CSSParser::parseValue(parsedStyle.get(), CSSPropertyFont, fontString, true, CSSStrictMode, 0);
311 if (parsedStyle->isEmpty()) 311 if (parsedStyle->isEmpty())
312 return false; 312 return false;
313 313
314 String fontValue = parsedStyle->getPropertyValue(CSSPropertyFont); 314 String fontValue = parsedStyle->getPropertyValue(CSSPropertyFont);
315 if (fontValue == "inherit" || fontValue == "initial") 315 if (fontValue == "inherit" || fontValue == "initial")
316 return false; 316 return false;
317 317
318 RefPtr<RenderStyle> style = RenderStyle::create(); 318 RefPtr<RenderStyle> style = RenderStyle::create();
319 319
(...skipping 23 matching lines...) Expand all
343 applyPropertyToCurrentStyle(styleResolver, CSSPropertyFontSize, parsedStyle) ; 343 applyPropertyToCurrentStyle(styleResolver, CSSPropertyFontSize, parsedStyle) ;
344 styleResolver->updateFont(); 344 styleResolver->updateFont();
345 applyPropertyToCurrentStyle(styleResolver, CSSPropertyLineHeight, parsedStyl e); 345 applyPropertyToCurrentStyle(styleResolver, CSSPropertyLineHeight, parsedStyl e);
346 346
347 font = style->font(); 347 font = style->font();
348 font.update(styleResolver->fontSelector()); 348 font.update(styleResolver->fontSelector());
349 return true; 349 return true;
350 } 350 }
351 351
352 } // namespace WebCore 352 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/DOMWindowCSS.cpp ('k') | Source/core/css/StylePropertySet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698