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

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

Issue 1186833003: Split up CSSPrimitiveValue::isString into isString and isCustomIdent (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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 | « Source/core/css/CSSPrimitiveValue.h ('k') | Source/core/css/parser/CSSPropertyParser.cpp » ('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 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 } 271 }
272 272
273 bool FontFace::setFamilyValue(CSSValueList* familyList) 273 bool FontFace::setFamilyValue(CSSValueList* familyList)
274 { 274 {
275 // The font-family descriptor has to have exactly one family name. 275 // The font-family descriptor has to have exactly one family name.
276 if (familyList->length() != 1) 276 if (familyList->length() != 1)
277 return false; 277 return false;
278 278
279 CSSPrimitiveValue* familyValue = toCSSPrimitiveValue(familyList->item(0)); 279 CSSPrimitiveValue* familyValue = toCSSPrimitiveValue(familyList->item(0));
280 AtomicString family; 280 AtomicString family;
281 if (familyValue->isString()) { 281 if (familyValue->isCustomIdent()) {
282 family = AtomicString(familyValue->getStringValue()); 282 family = AtomicString(familyValue->getStringValue());
283 } else if (familyValue->isValueID()) { 283 } else if (familyValue->isValueID()) {
284 // We need to use the raw text for all the generic family types, since @ font-face is a way of actually 284 // We need to use the raw text for all the generic family types, since @ font-face is a way of actually
285 // defining what font to use for those types. 285 // defining what font to use for those types.
286 switch (familyValue->getValueID()) { 286 switch (familyValue->getValueID()) {
287 case CSSValueSerif: 287 case CSSValueSerif:
288 family = FontFamilyNames::webkit_serif; 288 family = FontFamilyNames::webkit_serif;
289 break; 289 break;
290 case CSSValueSansSerif: 290 case CSSValueSansSerif:
291 family = FontFamilyNames::webkit_sans_serif; 291 family = FontFamilyNames::webkit_sans_serif;
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 { 580 {
581 return m_cssFontFace->hadBlankText(); 581 return m_cssFontFace->hadBlankText();
582 } 582 }
583 583
584 bool FontFace::hasPendingActivity() const 584 bool FontFace::hasPendingActivity() const
585 { 585 {
586 return m_status == Loading && executionContext() && !executionContext()->act iveDOMObjectsAreStopped(); 586 return m_status == Loading && executionContext() && !executionContext()->act iveDOMObjectsAreStopped();
587 } 587 }
588 588
589 } // namespace blink 589 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/CSSPrimitiveValue.h ('k') | Source/core/css/parser/CSSPropertyParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698