| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |