| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 FontFace* FontFace::create(ExecutionContext* context, | 73 FontFace* FontFace::create(ExecutionContext* context, |
| 74 const AtomicString& family, | 74 const AtomicString& family, |
| 75 StringOrArrayBufferOrArrayBufferView& source, | 75 StringOrArrayBufferOrArrayBufferView& source, |
| 76 const FontFaceDescriptors& descriptors) { | 76 const FontFaceDescriptors& descriptors) { |
| 77 if (source.isString()) | 77 if (source.isString()) |
| 78 return create(context, family, source.getAsString(), descriptors); | 78 return create(context, family, source.getAsString(), descriptors); |
| 79 if (source.isArrayBuffer()) | 79 if (source.isArrayBuffer()) |
| 80 return create(context, family, source.getAsArrayBuffer(), descriptors); | 80 return create(context, family, source.getAsArrayBuffer(), descriptors); |
| 81 if (source.isArrayBufferView()) | 81 if (source.isArrayBufferView()) |
| 82 return create(context, family, source.getAsArrayBufferView(), descriptors); | 82 return create(context, family, source.getAsArrayBufferView(), descriptors); |
| 83 ASSERT_NOT_REACHED(); | 83 NOTREACHED(); |
| 84 return nullptr; | 84 return nullptr; |
| 85 } | 85 } |
| 86 | 86 |
| 87 FontFace* FontFace::create(ExecutionContext* context, | 87 FontFace* FontFace::create(ExecutionContext* context, |
| 88 const AtomicString& family, | 88 const AtomicString& family, |
| 89 const String& source, | 89 const String& source, |
| 90 const FontFaceDescriptors& descriptors) { | 90 const FontFaceDescriptors& descriptors) { |
| 91 FontFace* fontFace = new FontFace(context, family, descriptors); | 91 FontFace* fontFace = new FontFace(context, family, descriptors); |
| 92 | 92 |
| 93 const CSSValue* src = | 93 const CSSValue* src = |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 case CSSPropertyFontVariant: | 291 case CSSPropertyFontVariant: |
| 292 m_variant = value; | 292 m_variant = value; |
| 293 break; | 293 break; |
| 294 case CSSPropertyFontFeatureSettings: | 294 case CSSPropertyFontFeatureSettings: |
| 295 m_featureSettings = value; | 295 m_featureSettings = value; |
| 296 break; | 296 break; |
| 297 case CSSPropertyFontDisplay: | 297 case CSSPropertyFontDisplay: |
| 298 m_display = value; | 298 m_display = value; |
| 299 break; | 299 break; |
| 300 default: | 300 default: |
| 301 ASSERT_NOT_REACHED(); | 301 NOTREACHED(); |
| 302 return false; | 302 return false; |
| 303 } | 303 } |
| 304 return true; | 304 return true; |
| 305 } | 305 } |
| 306 | 306 |
| 307 bool FontFace::setFamilyValue(const CSSValue& familyValue) { | 307 bool FontFace::setFamilyValue(const CSSValue& familyValue) { |
| 308 AtomicString family; | 308 AtomicString family; |
| 309 if (familyValue.isFontFamilyValue()) { | 309 if (familyValue.isFontFamilyValue()) { |
| 310 family = AtomicString(toCSSFontFamilyValue(familyValue).value()); | 310 family = AtomicString(toCSSFontFamilyValue(familyValue).value()); |
| 311 } else if (familyValue.isIdentifierValue()) { | 311 } else if (familyValue.isIdentifierValue()) { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 switch (m_status) { | 343 switch (m_status) { |
| 344 case Unloaded: | 344 case Unloaded: |
| 345 return "unloaded"; | 345 return "unloaded"; |
| 346 case Loading: | 346 case Loading: |
| 347 return "loading"; | 347 return "loading"; |
| 348 case Loaded: | 348 case Loaded: |
| 349 return "loaded"; | 349 return "loaded"; |
| 350 case Error: | 350 case Error: |
| 351 return "error"; | 351 return "error"; |
| 352 default: | 352 default: |
| 353 ASSERT_NOT_REACHED(); | 353 NOTREACHED(); |
| 354 } | 354 } |
| 355 return emptyString(); | 355 return emptyString(); |
| 356 } | 356 } |
| 357 | 357 |
| 358 void FontFace::setLoadStatus(LoadStatusType status) { | 358 void FontFace::setLoadStatus(LoadStatusType status) { |
| 359 m_status = status; | 359 m_status = status; |
| 360 ASSERT(m_status != Error || m_error); | 360 ASSERT(m_status != Error || m_error); |
| 361 | 361 |
| 362 if (m_status == Loaded || m_status == Error) { | 362 if (m_status == Loaded || m_status == Error) { |
| 363 if (m_loadedProperty) { | 363 if (m_loadedProperty) { |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 650 bool FontFace::hadBlankText() const { | 650 bool FontFace::hadBlankText() const { |
| 651 return m_cssFontFace->hadBlankText(); | 651 return m_cssFontFace->hadBlankText(); |
| 652 } | 652 } |
| 653 | 653 |
| 654 bool FontFace::hasPendingActivity() const { | 654 bool FontFace::hasPendingActivity() const { |
| 655 return m_status == Loading && getExecutionContext() && | 655 return m_status == Loading && getExecutionContext() && |
| 656 !getExecutionContext()->activeDOMObjectsAreStopped(); | 656 !getExecutionContext()->activeDOMObjectsAreStopped(); |
| 657 } | 657 } |
| 658 | 658 |
| 659 } // namespace blink | 659 } // namespace blink |
| OLD | NEW |