Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Side by Side Diff: Source/core/css/FontFace.cpp

Issue 534133002: [WIP] bindings: Introduce PropertyBag (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/animation/TimingInput.cpp ('k') | Source/core/dom/DOMPoint.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 : m_status(Unloaded) 129 : m_status(Unloaded)
130 { 130 {
131 } 131 }
132 132
133 FontFace::FontFace(ExecutionContext* context, const AtomicString& family, const Dictionary& descriptors) 133 FontFace::FontFace(ExecutionContext* context, const AtomicString& family, const Dictionary& descriptors)
134 : m_family(family) 134 : m_family(family)
135 , m_status(Unloaded) 135 , m_status(Unloaded)
136 { 136 {
137 Document* document = toDocument(context); 137 Document* document = toDocument(context);
138 String value; 138 String value;
139 if (DictionaryHelper::get(descriptors, "style", value)) 139 if (descriptors.get("style", value))
140 setPropertyFromString(document, value, CSSPropertyFontStyle); 140 setPropertyFromString(document, value, CSSPropertyFontStyle);
141 if (DictionaryHelper::get(descriptors, "weight", value)) 141 if (descriptors.get("weight", value))
142 setPropertyFromString(document, value, CSSPropertyFontWeight); 142 setPropertyFromString(document, value, CSSPropertyFontWeight);
143 if (DictionaryHelper::get(descriptors, "stretch", value)) 143 if (descriptors.get("stretch", value))
144 setPropertyFromString(document, value, CSSPropertyFontStretch); 144 setPropertyFromString(document, value, CSSPropertyFontStretch);
145 if (DictionaryHelper::get(descriptors, "unicodeRange", value)) 145 if (descriptors.get("unicodeRange", value))
146 setPropertyFromString(document, value, CSSPropertyUnicodeRange); 146 setPropertyFromString(document, value, CSSPropertyUnicodeRange);
147 if (DictionaryHelper::get(descriptors, "variant", value)) 147 if (descriptors.get("variant", value))
148 setPropertyFromString(document, value, CSSPropertyFontVariant); 148 setPropertyFromString(document, value, CSSPropertyFontVariant);
149 if (DictionaryHelper::get(descriptors, "featureSettings", value)) 149 if (descriptors.get("featureSettings", value))
150 setPropertyFromString(document, value, CSSPropertyWebkitFontFeatureSetti ngs); 150 setPropertyFromString(document, value, CSSPropertyWebkitFontFeatureSetti ngs);
151 } 151 }
152 152
153 FontFace::~FontFace() 153 FontFace::~FontFace()
154 { 154 {
155 } 155 }
156 156
157 String FontFace::style() const 157 String FontFace::style() const
158 { 158 {
159 return m_style ? m_style->cssText() : "normal"; 159 return m_style ? m_style->cssText() : "normal";
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 visitor->trace(m_cssFontFace); 591 visitor->trace(m_cssFontFace);
592 visitor->trace(m_callbacks); 592 visitor->trace(m_callbacks);
593 } 593 }
594 594
595 bool FontFace::hadBlankText() const 595 bool FontFace::hadBlankText() const
596 { 596 {
597 return m_cssFontFace->hadBlankText(); 597 return m_cssFontFace->hadBlankText();
598 } 598 }
599 599
600 } // namespace blink 600 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/animation/TimingInput.cpp ('k') | Source/core/dom/DOMPoint.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698