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

Side by Side Diff: Source/core/css/resolver/StyleBuilderConverter.cpp

Issue 943463002: Initial implementation of font-size-adjust (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add some tests which need a rebaseline to TestExpectation Created 5 years, 9 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
« no previous file with comments | « Source/core/css/resolver/StyleBuilderConverter.h ('k') | Source/core/frame/UseCounter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * * Redistributions of source code must retain the above copyright 4 * * Redistributions of source code must retain the above copyright
5 * notice, this list of conditions and the following disclaimer. 5 * notice, this list of conditions and the following disclaimer.
6 * * Redistributions in binary form must reproduce the above 6 * * Redistributions in binary form must reproduce the above
7 * copyright notice, this list of conditions and the following disclaimer 7 * copyright notice, this list of conditions and the following disclaimer
8 * in the documentation and/or other materials provided with the 8 * in the documentation and/or other materials provided with the
9 * distribution. 9 * distribution.
10 * * Neither the name of Google Inc. nor the names of its 10 * * Neither the name of Google Inc. nor the names of its
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 } 238 }
239 239
240 bool parentIsAbsoluteSize = state.parentFontDescription().isAbsoluteSize(); 240 bool parentIsAbsoluteSize = state.parentFontDescription().isAbsoluteSize();
241 241
242 if (primitiveValue->isPercentage()) 242 if (primitiveValue->isPercentage())
243 return FontDescription::Size(0, (primitiveValue->getFloatValue() * paren tSize.value / 100.0f), parentIsAbsoluteSize); 243 return FontDescription::Size(0, (primitiveValue->getFloatValue() * paren tSize.value / 100.0f), parentIsAbsoluteSize);
244 244
245 return FontDescription::Size(0, computeFontSize(state, primitiveValue, paren tSize), parentIsAbsoluteSize || !primitiveValue->isFontRelativeLength()); 245 return FontDescription::Size(0, computeFontSize(state, primitiveValue, paren tSize), parentIsAbsoluteSize || !primitiveValue->isFontRelativeLength());
246 } 246 }
247 247
248 float StyleBuilderConverter::convertFontSizeAdjust(StyleResolverState& state, CS SValue* value)
249 {
250 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
251 if (primitiveValue->getValueID() == CSSValueNone)
252 return FontBuilder::initialSizeAdjust();
253
254 ASSERT(primitiveValue->isNumber());
255 return primitiveValue->getFloatValue();
256 }
257
248 FontWeight StyleBuilderConverter::convertFontWeight(StyleResolverState& state, C SSValue* value) 258 FontWeight StyleBuilderConverter::convertFontWeight(StyleResolverState& state, C SSValue* value)
249 { 259 {
250 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 260 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
251 switch (primitiveValue->getValueID()) { 261 switch (primitiveValue->getValueID()) {
252 case CSSValueBolder: 262 case CSSValueBolder:
253 return FontDescription::bolderWeight(state.parentStyle()->fontDescriptio n().weight()); 263 return FontDescription::bolderWeight(state.parentStyle()->fontDescriptio n().weight());
254 case CSSValueLighter: 264 case CSSValueLighter:
255 return FontDescription::lighterWeight(state.parentStyle()->fontDescripti on().weight()); 265 return FontDescription::lighterWeight(state.parentStyle()->fontDescripti on().weight());
256 default: 266 default:
257 return *primitiveValue; 267 return *primitiveValue;
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 CSSPrimitiveValue* primitiveValueZ = toCSSPrimitiveValue(list->item(2)); 877 CSSPrimitiveValue* primitiveValueZ = toCSSPrimitiveValue(list->item(2));
868 878
869 return TransformOrigin( 879 return TransformOrigin(
870 convertOriginLength<CSSValueLeft, CSSValueRight>(state, primitiveValueX) , 880 convertOriginLength<CSSValueLeft, CSSValueRight>(state, primitiveValueX) ,
871 convertOriginLength<CSSValueTop, CSSValueBottom>(state, primitiveValueY) , 881 convertOriginLength<CSSValueTop, CSSValueBottom>(state, primitiveValueY) ,
872 StyleBuilderConverter::convertComputedLength<float>(state, primitiveValu eZ) 882 StyleBuilderConverter::convertComputedLength<float>(state, primitiveValu eZ)
873 ); 883 );
874 } 884 }
875 885
876 } // namespace blink 886 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/resolver/StyleBuilderConverter.h ('k') | Source/core/frame/UseCounter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698