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

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: Remove whitespace and clarified TODOs 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 2d164d9cda42f5c8ccc4a7659162653c56b87843..cd6c4f58e38c53a8b57941302253d31842339933 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");
@@ -154,6 +154,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.
@@ -271,8 +278,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.f[0]);
+ addToHash(hash, m_fieldsAsUnsigned.f[1]);
return hash;
}

Powered by Google App Engine
This is Rietveld 408576698