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

Side by Side Diff: third_party/WebKit/Source/core/css/resolver/FontBuilder.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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
4 * Copyright (C) 2013 Google Inc. All rights reserved. 4 * Copyright (C) 2013 Google Inc. All rights reserved.
5 * Copyright (C) 2015 Collabora Ltd. All rights reserved. 5 * Copyright (C) 2015 Collabora Ltd. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 m_fontDescription.setVariantCaps(caps); 162 m_fontDescription.setVariantCaps(caps);
163 } 163 }
164 164
165 void FontBuilder::setVariantLigatures(const FontDescription::VariantLigatures& l igatures) 165 void FontBuilder::setVariantLigatures(const FontDescription::VariantLigatures& l igatures)
166 { 166 {
167 set(PropertySetFlag::VariantLigatures); 167 set(PropertySetFlag::VariantLigatures);
168 168
169 m_fontDescription.setVariantLigatures(ligatures); 169 m_fontDescription.setVariantLigatures(ligatures);
170 } 170 }
171 171
172 void FontBuilder::setVariantNumeric(const FontVariantNumeric& variantNumeric)
173 {
174 set(PropertySetFlag::VariantNumeric);
175
176 m_fontDescription.setVariantNumeric(variantNumeric);
177 }
178
172 void FontBuilder::setTextRendering(TextRenderingMode textRenderingMode) 179 void FontBuilder::setTextRendering(TextRenderingMode textRenderingMode)
173 { 180 {
174 set(PropertySetFlag::TextRendering); 181 set(PropertySetFlag::TextRendering);
175 182
176 m_fontDescription.setTextRendering(textRenderingMode); 183 m_fontDescription.setTextRendering(textRenderingMode);
177 } 184 }
178 185
179 void FontBuilder::setKerning(FontDescription::Kerning kerning) 186 void FontBuilder::setKerning(FontDescription::Kerning kerning)
180 { 187 {
181 set(PropertySetFlag::Kerning); 188 set(PropertySetFlag::Kerning);
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 if (isSet(PropertySetFlag::FeatureSettings)) 371 if (isSet(PropertySetFlag::FeatureSettings))
365 description.setFeatureSettings(m_fontDescription.featureSettings()); 372 description.setFeatureSettings(m_fontDescription.featureSettings());
366 if (isSet(PropertySetFlag::Locale)) 373 if (isSet(PropertySetFlag::Locale))
367 description.setLocale(m_fontDescription.locale(false)); 374 description.setLocale(m_fontDescription.locale(false));
368 if (isSet(PropertySetFlag::Style)) 375 if (isSet(PropertySetFlag::Style))
369 description.setStyle(m_fontDescription.style()); 376 description.setStyle(m_fontDescription.style());
370 if (isSet(PropertySetFlag::VariantCaps)) 377 if (isSet(PropertySetFlag::VariantCaps))
371 description.setVariantCaps(m_fontDescription.variantCaps()); 378 description.setVariantCaps(m_fontDescription.variantCaps());
372 if (isSet(PropertySetFlag::VariantLigatures)) 379 if (isSet(PropertySetFlag::VariantLigatures))
373 description.setVariantLigatures(m_fontDescription.getVariantLigatures()) ; 380 description.setVariantLigatures(m_fontDescription.getVariantLigatures()) ;
381 if (isSet(PropertySetFlag::VariantNumeric))
382 description.setVariantNumeric(m_fontDescription.variantNumeric());
374 if (isSet(PropertySetFlag::TextRendering)) 383 if (isSet(PropertySetFlag::TextRendering))
375 description.setTextRendering(m_fontDescription.textRendering()); 384 description.setTextRendering(m_fontDescription.textRendering());
376 if (isSet(PropertySetFlag::Kerning)) 385 if (isSet(PropertySetFlag::Kerning))
377 description.setKerning(m_fontDescription.getKerning()); 386 description.setKerning(m_fontDescription.getKerning());
378 if (isSet(PropertySetFlag::FontSmoothing)) 387 if (isSet(PropertySetFlag::FontSmoothing))
379 description.setFontSmoothing(m_fontDescription.fontSmoothing()); 388 description.setFontSmoothing(m_fontDescription.fontSmoothing());
380 if (isSet(PropertySetFlag::TextOrientation) || isSet(PropertySetFlag::Writin gMode)) 389 if (isSet(PropertySetFlag::TextOrientation) || isSet(PropertySetFlag::Writin gMode))
381 updateOrientation(description, style); 390 updateOrientation(description, style);
382 391
383 updateSpecifiedSize(description, style); 392 updateSpecifiedSize(description, style);
(...skipping 14 matching lines...) Expand all
398 setSize(fontDescription, FontDescription::Size(FontSize::initialKeywordSize( ), 0.0f, false)); 407 setSize(fontDescription, FontDescription::Size(FontSize::initialKeywordSize( ), 0.0f, false));
399 updateSpecifiedSize(fontDescription, documentStyle); 408 updateSpecifiedSize(fontDescription, documentStyle);
400 updateComputedSize(fontDescription, documentStyle); 409 updateComputedSize(fontDescription, documentStyle);
401 410
402 updateOrientation(fontDescription, documentStyle); 411 updateOrientation(fontDescription, documentStyle);
403 documentStyle.setFontDescription(fontDescription); 412 documentStyle.setFontDescription(fontDescription);
404 documentStyle.font().update(fontSelector); 413 documentStyle.font().update(fontSelector);
405 } 414 }
406 415
407 } // namespace blink 416 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698