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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 && fontFace->traits().bitfield()) { | 121 && fontFace->traits().bitfield()) { |
122 fontFace->initCSSFontFace(document, src); | 122 fontFace->initCSSFontFace(document, src); |
123 return fontFace.release(); | 123 return fontFace.release(); |
124 } | 124 } |
125 return nullptr; | 125 return nullptr; |
126 } | 126 } |
127 | 127 |
128 FontFace::FontFace() | 128 FontFace::FontFace() |
129 : m_status(Unloaded) | 129 : m_status(Unloaded) |
130 { | 130 { |
131 ScriptWrappable::init(this); | |
132 } | 131 } |
133 | 132 |
134 FontFace::FontFace(ExecutionContext* context, const AtomicString& family, const
Dictionary& descriptors) | 133 FontFace::FontFace(ExecutionContext* context, const AtomicString& family, const
Dictionary& descriptors) |
135 : m_family(family) | 134 : m_family(family) |
136 , m_status(Unloaded) | 135 , m_status(Unloaded) |
137 { | 136 { |
138 ScriptWrappable::init(this); | |
139 | |
140 Document* document = toDocument(context); | 137 Document* document = toDocument(context); |
141 String value; | 138 String value; |
142 if (DictionaryHelper::get(descriptors, "style", value)) | 139 if (DictionaryHelper::get(descriptors, "style", value)) |
143 setPropertyFromString(document, value, CSSPropertyFontStyle); | 140 setPropertyFromString(document, value, CSSPropertyFontStyle); |
144 if (DictionaryHelper::get(descriptors, "weight", value)) | 141 if (DictionaryHelper::get(descriptors, "weight", value)) |
145 setPropertyFromString(document, value, CSSPropertyFontWeight); | 142 setPropertyFromString(document, value, CSSPropertyFontWeight); |
146 if (DictionaryHelper::get(descriptors, "stretch", value)) | 143 if (DictionaryHelper::get(descriptors, "stretch", value)) |
147 setPropertyFromString(document, value, CSSPropertyFontStretch); | 144 setPropertyFromString(document, value, CSSPropertyFontStretch); |
148 if (DictionaryHelper::get(descriptors, "unicodeRange", value)) | 145 if (DictionaryHelper::get(descriptors, "unicodeRange", value)) |
149 setPropertyFromString(document, value, CSSPropertyUnicodeRange); | 146 setPropertyFromString(document, value, CSSPropertyUnicodeRange); |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
594 visitor->trace(m_cssFontFace); | 591 visitor->trace(m_cssFontFace); |
595 visitor->trace(m_callbacks); | 592 visitor->trace(m_callbacks); |
596 } | 593 } |
597 | 594 |
598 bool FontFace::hadBlankText() const | 595 bool FontFace::hadBlankText() const |
599 { | 596 { |
600 return m_cssFontFace->hadBlankText(); | 597 return m_cssFontFace->hadBlankText(); |
601 } | 598 } |
602 | 599 |
603 } // namespace blink | 600 } // namespace blink |
OLD | NEW |