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

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: ExpectedResultForLinuxIsUpdated Created 5 years, 10 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) 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 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
874 CSSPrimitiveValue* primitiveValueZ = toCSSPrimitiveValue(list->item(2)); 884 CSSPrimitiveValue* primitiveValueZ = toCSSPrimitiveValue(list->item(2));
875 885
876 return TransformOrigin( 886 return TransformOrigin(
877 convertOriginLength<CSSValueLeft, CSSValueRight>(state, primitiveValueX) , 887 convertOriginLength<CSSValueLeft, CSSValueRight>(state, primitiveValueX) ,
878 convertOriginLength<CSSValueTop, CSSValueBottom>(state, primitiveValueY) , 888 convertOriginLength<CSSValueTop, CSSValueBottom>(state, primitiveValueY) ,
879 StyleBuilderConverter::convertComputedLength<float>(state, primitiveValu eZ) 889 StyleBuilderConverter::convertComputedLength<float>(state, primitiveValu eZ)
880 ); 890 );
881 } 891 }
882 892
883 } // namespace blink 893 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698