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

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

Issue 2035373002: Made StylePropertySet::getPropertyCSSValue return a const CSSValue* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@_fix_cssparser_font_face_descriptor_to_return_const
Patch Set: Rebase Created 4 years, 5 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 | third_party/WebKit/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 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 FontFace* fontFace = new FontFace(context, family, descriptors); 105 FontFace* fontFace = new FontFace(context, family, descriptors);
106 fontFace->initCSSFontFace(static_cast<const unsigned char*>(source->baseAddr ess()), source->byteLength()); 106 fontFace->initCSSFontFace(static_cast<const unsigned char*>(source->baseAddr ess()), source->byteLength());
107 return fontFace; 107 return fontFace;
108 } 108 }
109 109
110 FontFace* FontFace::create(Document* document, const StyleRuleFontFace* fontFace Rule) 110 FontFace* FontFace::create(Document* document, const StyleRuleFontFace* fontFace Rule)
111 { 111 {
112 const StylePropertySet& properties = fontFaceRule->properties(); 112 const StylePropertySet& properties = fontFaceRule->properties();
113 113
114 // Obtain the font-family property and the src property. Both must be define d. 114 // Obtain the font-family property and the src property. Both must be define d.
115 CSSValue* family = properties.getPropertyCSSValue(CSSPropertyFontFamily); 115 const CSSValue* family = properties.getPropertyCSSValue(CSSPropertyFontFamil y);
116 if (!family || (!family->isFontFamilyValue() && !family->isPrimitiveValue()) ) 116 if (!family || (!family->isFontFamilyValue() && !family->isPrimitiveValue()) )
117 return nullptr; 117 return nullptr;
118 CSSValue* src = properties.getPropertyCSSValue(CSSPropertySrc); 118 const CSSValue* src = properties.getPropertyCSSValue(CSSPropertySrc);
119 if (!src || !src->isValueList()) 119 if (!src || !src->isValueList())
120 return nullptr; 120 return nullptr;
121 121
122 FontFace* fontFace = new FontFace(document); 122 FontFace* fontFace = new FontFace(document);
123 123
124 if (fontFace->setFamilyValue(*family) 124 if (fontFace->setFamilyValue(*family)
125 && fontFace->setPropertyFromStyle(properties, CSSPropertyFontStyle) 125 && fontFace->setPropertyFromStyle(properties, CSSPropertyFontStyle)
126 && fontFace->setPropertyFromStyle(properties, CSSPropertyFontWeight) 126 && fontFace->setPropertyFromStyle(properties, CSSPropertyFontWeight)
127 && fontFace->setPropertyFromStyle(properties, CSSPropertyFontStretch) 127 && fontFace->setPropertyFromStyle(properties, CSSPropertyFontStretch)
128 && fontFace->setPropertyFromStyle(properties, CSSPropertyUnicodeRange) 128 && fontFace->setPropertyFromStyle(properties, CSSPropertyUnicodeRange)
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 { 621 {
622 return m_cssFontFace->hadBlankText(); 622 return m_cssFontFace->hadBlankText();
623 } 623 }
624 624
625 bool FontFace::hasPendingActivity() const 625 bool FontFace::hasPendingActivity() const
626 { 626 {
627 return m_status == Loading && getExecutionContext() && !getExecutionContext( )->activeDOMObjectsAreStopped(); 627 return m_status == Loading && getExecutionContext() && !getExecutionContext( )->activeDOMObjectsAreStopped();
628 } 628 }
629 629
630 } // namespace blink 630 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/StylePropertySet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698