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

Unified Diff: Source/core/css/resolver/FontBuilder.cpp

Issue 447443003: Remove custom style building for font-variant-ligatures. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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
« no previous file with comments | « Source/core/css/resolver/FontBuilder.h ('k') | Source/core/css/resolver/StyleBuilderConverter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/FontBuilder.cpp
diff --git a/Source/core/css/resolver/FontBuilder.cpp b/Source/core/css/resolver/FontBuilder.cpp
index ebe3114a6a287b910a12d80c8ce006324ae12346..009e557cef48b9b4234c5d610a8ed6fc0f3d8200 100644
--- a/Source/core/css/resolver/FontBuilder.cpp
+++ b/Source/core/css/resolver/FontBuilder.cpp
@@ -381,87 +381,6 @@ void FontBuilder::setStretch(FontStretch fontStretch)
scope.fontDescription().setStretch(fontStretch);
}
-void FontBuilder::setFontVariantLigaturesInitial()
-{
- FontDescriptionChangeScope scope(this);
-
- scope.fontDescription().setCommonLigaturesState(FontDescription::NormalLigaturesState);
- scope.fontDescription().setDiscretionaryLigaturesState(FontDescription::NormalLigaturesState);
- scope.fontDescription().setHistoricalLigaturesState(FontDescription::NormalLigaturesState);
- scope.fontDescription().setContextualLigaturesState(FontDescription::NormalLigaturesState);
-}
-
-void FontBuilder::setFontVariantLigaturesInherit(const FontDescription& parentFontDescription)
-{
- FontDescriptionChangeScope scope(this);
-
- scope.fontDescription().setCommonLigaturesState(parentFontDescription.commonLigaturesState());
- scope.fontDescription().setDiscretionaryLigaturesState(parentFontDescription.discretionaryLigaturesState());
- scope.fontDescription().setHistoricalLigaturesState(parentFontDescription.historicalLigaturesState());
- scope.fontDescription().setContextualLigaturesState(parentFontDescription.historicalLigaturesState());
-}
-
-void FontBuilder::setFontVariantLigaturesValue(CSSValue* value)
-{
- FontDescriptionChangeScope scope(this);
-
- FontDescription::LigaturesState commonLigaturesState = FontDescription::NormalLigaturesState;
- FontDescription::LigaturesState discretionaryLigaturesState = FontDescription::NormalLigaturesState;
- FontDescription::LigaturesState historicalLigaturesState = FontDescription::NormalLigaturesState;
- FontDescription::LigaturesState contextualLigaturesState = FontDescription::NormalLigaturesState;
-
- if (value->isValueList()) {
- CSSValueList* valueList = toCSSValueList(value);
- for (size_t i = 0; i < valueList->length(); ++i) {
- CSSValue* item = valueList->item(i);
- ASSERT(item->isPrimitiveValue());
- if (item->isPrimitiveValue()) {
- CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(item);
- switch (primitiveValue->getValueID()) {
- case CSSValueNoCommonLigatures:
- commonLigaturesState = FontDescription::DisabledLigaturesState;
- break;
- case CSSValueCommonLigatures:
- commonLigaturesState = FontDescription::EnabledLigaturesState;
- break;
- case CSSValueNoDiscretionaryLigatures:
- discretionaryLigaturesState = FontDescription::DisabledLigaturesState;
- break;
- case CSSValueDiscretionaryLigatures:
- discretionaryLigaturesState = FontDescription::EnabledLigaturesState;
- break;
- case CSSValueNoHistoricalLigatures:
- historicalLigaturesState = FontDescription::DisabledLigaturesState;
- break;
- case CSSValueHistoricalLigatures:
- historicalLigaturesState = FontDescription::EnabledLigaturesState;
- break;
- case CSSValueNoContextual:
- contextualLigaturesState = FontDescription::DisabledLigaturesState;
- break;
- case CSSValueContextual:
- contextualLigaturesState = FontDescription::EnabledLigaturesState;
- break;
- default:
- ASSERT_NOT_REACHED();
- break;
- }
- }
- }
- }
-#if ENABLE(ASSERT)
- else {
- ASSERT_WITH_SECURITY_IMPLICATION(value->isPrimitiveValue());
- ASSERT(toCSSPrimitiveValue(value)->getValueID() == CSSValueNormal);
- }
-#endif
-
- scope.fontDescription().setCommonLigaturesState(commonLigaturesState);
- scope.fontDescription().setDiscretionaryLigaturesState(discretionaryLigaturesState);
- scope.fontDescription().setHistoricalLigaturesState(historicalLigaturesState);
- scope.fontDescription().setContextualLigaturesState(contextualLigaturesState);
-}
-
void FontBuilder::setScript(const String& locale)
{
FontDescriptionChangeScope scope(this);
@@ -484,6 +403,13 @@ void FontBuilder::setVariant(FontVariant smallCaps)
scope.fontDescription().setVariant(smallCaps);
}
+void FontBuilder::setVariantLigatures(const FontDescription::VariantLigatures& ligatures)
+{
+ FontDescriptionChangeScope scope(this);
+
+ scope.fontDescription().setVariantLigatures(ligatures);
+}
+
void FontBuilder::setTextRendering(TextRenderingMode textRenderingMode)
{
FontDescriptionChangeScope scope(this);
« no previous file with comments | « Source/core/css/resolver/FontBuilder.h ('k') | Source/core/css/resolver/StyleBuilderConverter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698