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

Unified Diff: third_party/WebKit/Source/platform/fonts/FontDescription.cpp

Issue 1955723004: Implement font-variant-numeric (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/fonts/FontDescription.cpp
diff --git a/third_party/WebKit/Source/platform/fonts/FontDescription.cpp b/third_party/WebKit/Source/platform/fonts/FontDescription.cpp
index f661da242b643e087e39c8feb80c9782b4cc8d86..b7e838ca9c28ce90b70ee07a3c2312f150f9c396 100644
--- a/third_party/WebKit/Source/platform/fonts/FontDescription.cpp
+++ b/third_party/WebKit/Source/platform/fonts/FontDescription.cpp
@@ -42,7 +42,7 @@ struct SameSizeAsFontDescription {
RefPtr<FontFeatureSettings> m_featureSettings;
AtomicString locale;
float sizes[6];
- uint32_t bitfields[2];
+ FieldsAsUnsignedType bitfields;
};
static_assert(sizeof(FontDescription) == sizeof(SameSizeAsFontDescription), "FontDescription should stay small");
@@ -161,6 +161,13 @@ void FontDescription::setVariantLigatures(const VariantLigatures& ligatures)
updateTypesettingFeatures();
}
+void FontDescription::setVariantNumeric(const FontVariantNumeric& variantNumeric)
+{
+ m_fields.m_variantNumeric = variantNumeric.m_fieldsAsUnsigned;
+
+ updateTypesettingFeatures();
+}
+
float FontDescription::effectiveFontSize() const
{
// Ensure that the effective precision matches the font-cache precision.
@@ -281,8 +288,8 @@ unsigned FontDescription::styleHashWithoutFamilyList() const
addFloatToHash(hash, m_sizeAdjust);
addFloatToHash(hash, m_letterSpacing);
addFloatToHash(hash, m_wordSpacing);
- addToHash(hash, m_fieldsAsUnsigned[0]);
- addToHash(hash, m_fieldsAsUnsigned[1]);
+ addToHash(hash, m_fieldsAsUnsigned.parts[0]);
+ addToHash(hash, m_fieldsAsUnsigned.parts[1]);
return hash;
}

Powered by Google App Engine
This is Rietveld 408576698