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

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

Issue 444413003: Make style building for font-weight less custom. (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 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 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
4 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 5 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
10 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 10 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 void StyleBuilderFunctions::applyInheritCSSPropertyFontSize(StyleResolverState& state) 300 void StyleBuilderFunctions::applyInheritCSSPropertyFontSize(StyleResolverState& state)
301 { 301 {
302 state.fontBuilder().setFontSizeInherit(state.parentFontDescription()); 302 state.fontBuilder().setFontSizeInherit(state.parentFontDescription());
303 } 303 }
304 304
305 void StyleBuilderFunctions::applyValueCSSPropertyFontSize(StyleResolverState& st ate, CSSValue* value) 305 void StyleBuilderFunctions::applyValueCSSPropertyFontSize(StyleResolverState& st ate, CSSValue* value)
306 { 306 {
307 state.fontBuilder().setFontSizeValue(value, state.parentStyle(), state.rootE lementStyle()); 307 state.fontBuilder().setFontSizeValue(value, state.parentStyle(), state.rootE lementStyle());
308 } 308 }
309 309
310 void StyleBuilderFunctions::applyInitialCSSPropertyFontWeight(StyleResolverState & state)
311 {
312 state.fontBuilder().setWeight(FontWeightNormal);
313 }
314
315 void StyleBuilderFunctions::applyInheritCSSPropertyFontWeight(StyleResolverState & state)
316 {
317 state.fontBuilder().setWeight(state.parentFontDescription().weight());
318 }
319
320 void StyleBuilderFunctions::applyValueCSSPropertyFontWeight(StyleResolverState& state, CSSValue* value)
321 {
322 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
323 switch (primitiveValue->getValueID()) {
324 case CSSValueInvalid:
325 ASSERT_NOT_REACHED();
326 break;
327 case CSSValueBolder:
328 state.fontBuilder().setWeight(state.parentStyle()->fontDescription().wei ght());
329 state.fontBuilder().setWeightBolder();
330 break;
331 case CSSValueLighter:
332 state.fontBuilder().setWeight(state.parentStyle()->fontDescription().wei ght());
333 state.fontBuilder().setWeightLighter();
334 break;
335 default:
336 state.fontBuilder().setWeight(*primitiveValue);
337 }
338 }
339
340 void StyleBuilderFunctions::applyValueCSSPropertyGlyphOrientationVertical(StyleR esolverState& state, CSSValue* value) 310 void StyleBuilderFunctions::applyValueCSSPropertyGlyphOrientationVertical(StyleR esolverState& state, CSSValue* value)
341 { 311 {
342 if (value->isPrimitiveValue() && toCSSPrimitiveValue(value)->getValueID() == CSSValueAuto) 312 if (value->isPrimitiveValue() && toCSSPrimitiveValue(value)->getValueID() == CSSValueAuto)
343 state.style()->accessSVGStyle().setGlyphOrientationVertical(GO_AUTO); 313 state.style()->accessSVGStyle().setGlyphOrientationVertical(GO_AUTO);
344 else 314 else
345 state.style()->accessSVGStyle().setGlyphOrientationVertical(StyleBuilder Converter::convertGlyphOrientation(state, value)); 315 state.style()->accessSVGStyle().setGlyphOrientationVertical(StyleBuilder Converter::convertGlyphOrientation(state, value));
346 } 316 }
347 317
348 void StyleBuilderFunctions::applyInitialCSSPropertyGridTemplateAreas(StyleResolv erState& state) 318 void StyleBuilderFunctions::applyInitialCSSPropertyGridTemplateAreas(StyleResolv erState& state)
349 { 319 {
(...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after
1398 break; 1368 break;
1399 default: 1369 default:
1400 ASSERT_NOT_REACHED(); 1370 ASSERT_NOT_REACHED();
1401 break; 1371 break;
1402 } 1372 }
1403 1373
1404 state.style()->setGridAutoFlow(autoFlow); 1374 state.style()->setGridAutoFlow(autoFlow);
1405 } 1375 }
1406 1376
1407 } // namespace blink 1377 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/resolver/StyleBuilderConverter.cpp ('k') | Source/platform/fonts/FontDescription.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698