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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 && fontFace->setPropertyFromStyle(properties, CSSPropertyFontDisplay) | 131 && fontFace->setPropertyFromStyle(properties, CSSPropertyFontDisplay) |
132 && !fontFace->family().isEmpty() | 132 && !fontFace->family().isEmpty() |
133 && fontFace->traits().bitfield()) { | 133 && fontFace->traits().bitfield()) { |
134 fontFace->initCSSFontFace(document, src); | 134 fontFace->initCSSFontFace(document, src); |
135 return fontFace.release(); | 135 return fontFace.release(); |
136 } | 136 } |
137 return nullptr; | 137 return nullptr; |
138 } | 138 } |
139 | 139 |
140 FontFace::FontFace(ExecutionContext* context) | 140 FontFace::FontFace(ExecutionContext* context) |
141 : ActiveDOMObject(context) | 141 : ActiveScriptWrappable(this) |
| 142 , ActiveDOMObject(context) |
142 , m_status(Unloaded) | 143 , m_status(Unloaded) |
143 { | 144 { |
144 suspendIfNeeded(); | 145 suspendIfNeeded(); |
145 } | 146 } |
146 | 147 |
147 FontFace::FontFace(ExecutionContext* context, const AtomicString& family, const
FontFaceDescriptors& descriptors) | 148 FontFace::FontFace(ExecutionContext* context, const AtomicString& family, const
FontFaceDescriptors& descriptors) |
148 : ActiveDOMObject(context) | 149 : ActiveScriptWrappable(this) |
| 150 , ActiveDOMObject(context) |
149 , m_family(family) | 151 , m_family(family) |
150 , m_status(Unloaded) | 152 , m_status(Unloaded) |
151 { | 153 { |
152 Document* document = toDocument(context); | 154 Document* document = toDocument(context); |
153 setPropertyFromString(document, descriptors.style(), CSSPropertyFontStyle); | 155 setPropertyFromString(document, descriptors.style(), CSSPropertyFontStyle); |
154 setPropertyFromString(document, descriptors.weight(), CSSPropertyFontWeight)
; | 156 setPropertyFromString(document, descriptors.weight(), CSSPropertyFontWeight)
; |
155 setPropertyFromString(document, descriptors.stretch(), CSSPropertyFontStretc
h); | 157 setPropertyFromString(document, descriptors.stretch(), CSSPropertyFontStretc
h); |
156 setPropertyFromString(document, descriptors.unicodeRange(), CSSPropertyUnico
deRange); | 158 setPropertyFromString(document, descriptors.unicodeRange(), CSSPropertyUnico
deRange); |
157 setPropertyFromString(document, descriptors.variant(), CSSPropertyFontVarian
t); | 159 setPropertyFromString(document, descriptors.variant(), CSSPropertyFontVarian
t); |
158 setPropertyFromString(document, descriptors.featureSettings(), CSSPropertyFo
ntFeatureSettings); | 160 setPropertyFromString(document, descriptors.featureSettings(), CSSPropertyFo
ntFeatureSettings); |
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
643 { | 645 { |
644 return m_cssFontFace->hadBlankText(); | 646 return m_cssFontFace->hadBlankText(); |
645 } | 647 } |
646 | 648 |
647 bool FontFace::hasPendingActivity() const | 649 bool FontFace::hasPendingActivity() const |
648 { | 650 { |
649 return m_status == Loading && getExecutionContext() && !getExecutionContext(
)->activeDOMObjectsAreStopped(); | 651 return m_status == Loading && getExecutionContext() && !getExecutionContext(
)->activeDOMObjectsAreStopped(); |
650 } | 652 } |
651 | 653 |
652 } // namespace blink | 654 } // namespace blink |
OLD | NEW |