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

Unified Diff: third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp

Issue 2558053002: Add CSS support for font-variation-settings (Closed)
Patch Set: Remove empty if statement Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
diff --git a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
index 3ce7aed12b5ea4b503c6ba7cbac7eca337d4d8cf..e475167a3c6ab6f7597236a1cf2268fab4077252 100644
--- a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
+++ b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
@@ -39,6 +39,7 @@
#include "core/css/CSSCustomPropertyDeclaration.h"
#include "core/css/CSSFontFamilyValue.h"
#include "core/css/CSSFontFeatureValue.h"
+#include "core/css/CSSFontVariationValue.h"
#include "core/css/CSSFunctionValue.h"
#include "core/css/CSSGridLineNamesValue.h"
#include "core/css/CSSGridTemplateAreasValue.h"
@@ -2363,6 +2364,22 @@ const CSSValue* ComputedStyleCSSValueMapping::get(
}
return list;
}
+ case CSSPropertyFontVariationSettings: {
+ if (RuntimeEnabledFeatures::cssVariableFontsEnabled()) {
Timothy Loh 2016/12/08 03:36:05 I think this can be a DCHECK? Otherwise it's weird
drott 2016/12/09 10:25:50 Changed to DCHECK.
+ const FontVariationSettings* variationSettings =
+ style.getFontDescription().variationSettings();
+ if (!variationSettings || !variationSettings->size())
+ return CSSIdentifierValue::create(CSSValueNormal);
+ CSSValueList* list = CSSValueList::createCommaSeparated();
+ for (unsigned i = 0; i < variationSettings->size(); ++i) {
+ const FontVariationAxis& variationAxis = variationSettings->at(i);
+ CSSFontVariationValue* variationValue = CSSFontVariationValue::create(
+ variationAxis.tag(), variationAxis.value());
+ list->append(*variationValue);
+ }
+ return list;
+ }
+ }
case CSSPropertyGridAutoFlow: {
CSSValueList* list = CSSValueList::createSpaceSeparated();
switch (style.getGridAutoFlow()) {

Powered by Google App Engine
This is Rietveld 408576698