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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 return parsedStyle->getPropertyCSSValue(propertyID); | 103 return parsedStyle->getPropertyCSSValue(propertyID); |
104 } | 104 } |
105 | 105 |
106 static bool initFontFace(FontFace* fontFace, ExecutionContext* context, const At
omicString& family, const Dictionary& descriptors, ExceptionState& exceptionStat
e) | 106 static bool initFontFace(FontFace* fontFace, ExecutionContext* context, const At
omicString& family, const Dictionary& descriptors, ExceptionState& exceptionStat
e) |
107 { | 107 { |
108 fontFace->setFamily(context, family, exceptionState); | 108 fontFace->setFamily(context, family, exceptionState); |
109 if (exceptionState.hadException()) | 109 if (exceptionState.hadException()) |
110 return false; | 110 return false; |
111 | 111 |
112 String value; | 112 String value; |
113 if (descriptors.get("style", value)) { | 113 if (DictionaryHelper::get(descriptors, "style", value)) { |
114 fontFace->setStyle(context, value, exceptionState); | 114 fontFace->setStyle(context, value, exceptionState); |
115 if (exceptionState.hadException()) | 115 if (exceptionState.hadException()) |
116 return false; | 116 return false; |
117 } | 117 } |
118 if (descriptors.get("weight", value)) { | 118 if (DictionaryHelper::get(descriptors, "weight", value)) { |
119 fontFace->setWeight(context, value, exceptionState); | 119 fontFace->setWeight(context, value, exceptionState); |
120 if (exceptionState.hadException()) | 120 if (exceptionState.hadException()) |
121 return false; | 121 return false; |
122 } | 122 } |
123 if (descriptors.get("stretch", value)) { | 123 if (DictionaryHelper::get(descriptors, "stretch", value)) { |
124 fontFace->setStretch(context, value, exceptionState); | 124 fontFace->setStretch(context, value, exceptionState); |
125 if (exceptionState.hadException()) | 125 if (exceptionState.hadException()) |
126 return false; | 126 return false; |
127 } | 127 } |
128 if (descriptors.get("unicodeRange", value)) { | 128 if (DictionaryHelper::get(descriptors, "unicodeRange", value)) { |
129 fontFace->setUnicodeRange(context, value, exceptionState); | 129 fontFace->setUnicodeRange(context, value, exceptionState); |
130 if (exceptionState.hadException()) | 130 if (exceptionState.hadException()) |
131 return false; | 131 return false; |
132 } | 132 } |
133 if (descriptors.get("variant", value)) { | 133 if (DictionaryHelper::get(descriptors, "variant", value)) { |
134 fontFace->setVariant(context, value, exceptionState); | 134 fontFace->setVariant(context, value, exceptionState); |
135 if (exceptionState.hadException()) | 135 if (exceptionState.hadException()) |
136 return false; | 136 return false; |
137 } | 137 } |
138 if (descriptors.get("featureSettings", value)) { | 138 if (DictionaryHelper::get(descriptors, "featureSettings", value)) { |
139 fontFace->setFeatureSettings(context, value, exceptionState); | 139 fontFace->setFeatureSettings(context, value, exceptionState); |
140 if (exceptionState.hadException()) | 140 if (exceptionState.hadException()) |
141 return false; | 141 return false; |
142 } | 142 } |
143 return true; | 143 return true; |
144 } | 144 } |
145 | 145 |
146 PassRefPtrWillBeRawPtr<FontFace> FontFace::create(ExecutionContext* context, con
st AtomicString& family, const String& source, const Dictionary& descriptors, Ex
ceptionState& exceptionState) | 146 PassRefPtrWillBeRawPtr<FontFace> FontFace::create(ExecutionContext* context, con
st AtomicString& family, const String& source, const Dictionary& descriptors, Ex
ceptionState& exceptionState) |
147 { | 147 { |
148 RefPtrWillBeRawPtr<CSSValue> src = parseCSSValue(toDocument(context), source
, CSSPropertySrc); | 148 RefPtrWillBeRawPtr<CSSValue> src = parseCSSValue(toDocument(context), source
, CSSPropertySrc); |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 visitor->trace(m_cssFontFace); | 630 visitor->trace(m_cssFontFace); |
631 visitor->trace(m_callbacks); | 631 visitor->trace(m_callbacks); |
632 } | 632 } |
633 | 633 |
634 bool FontFace::hadBlankText() const | 634 bool FontFace::hadBlankText() const |
635 { | 635 { |
636 return m_cssFontFace->hadBlankText(); | 636 return m_cssFontFace->hadBlankText(); |
637 } | 637 } |
638 | 638 |
639 } // namespace WebCore | 639 } // namespace WebCore |
OLD | NEW |