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

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

Issue 203523002: Reland "Add plumbing for font-stretch" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: w/fix for ASSERT Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/css/resolver/FontBuilder.cpp ('k') | Source/core/css/resolver/StyleResolver.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 * 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 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 StyleBuilderConverter::createImplicitNamedGridLinesFromGridArea(newNamedGrid Areas, namedGridColumnLines, ForColumns); 375 StyleBuilderConverter::createImplicitNamedGridLinesFromGridArea(newNamedGrid Areas, namedGridColumnLines, ForColumns);
376 StyleBuilderConverter::createImplicitNamedGridLinesFromGridArea(newNamedGrid Areas, namedGridRowLines, ForRows); 376 StyleBuilderConverter::createImplicitNamedGridLinesFromGridArea(newNamedGrid Areas, namedGridRowLines, ForRows);
377 state.style()->setNamedGridColumnLines(namedGridColumnLines); 377 state.style()->setNamedGridColumnLines(namedGridColumnLines);
378 state.style()->setNamedGridRowLines(namedGridRowLines); 378 state.style()->setNamedGridRowLines(namedGridRowLines);
379 379
380 state.style()->setNamedGridArea(newNamedGridAreas); 380 state.style()->setNamedGridArea(newNamedGridAreas);
381 state.style()->setNamedGridAreaRowCount(gridTemplateAreasValue->rowCount()); 381 state.style()->setNamedGridAreaRowCount(gridTemplateAreasValue->rowCount());
382 state.style()->setNamedGridAreaColumnCount(gridTemplateAreasValue->columnCou nt()); 382 state.style()->setNamedGridAreaColumnCount(gridTemplateAreasValue->columnCou nt());
383 } 383 }
384 384
385 void StyleBuilderFunctions::applyInitialCSSPropertyFontStretch(StyleResolverStat e& state)
386 {
387 state.fontBuilder().setStretch(FontStretchNormal);
388 }
389
390 void StyleBuilderFunctions::applyInheritCSSPropertyFontStretch(StyleResolverStat e& state)
391 {
392 state.fontBuilder().setStretch(state.parentFontDescription().stretch());
393 }
394
395 void StyleBuilderFunctions::applyValueCSSPropertyFontStretch(StyleResolverState& state, CSSValue* value)
396 {
397 if (!value->isPrimitiveValue())
398 return;
399 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
400 switch (primitiveValue->getValueID()) {
401 case CSSValueInvalid:
402 ASSERT_NOT_REACHED();
403 break;
404 case CSSValueUltraCondensed:
405 state.fontBuilder().setStretch(FontStretchUltraCondensed);
406 break;
407 case CSSValueExtraCondensed:
408 state.fontBuilder().setStretch(FontStretchExtraCondensed);
409 break;
410 case CSSValueCondensed:
411 state.fontBuilder().setStretch(FontStretchCondensed);
412 break;
413 case CSSValueSemiCondensed:
414 state.fontBuilder().setStretch(FontStretchSemiCondensed);
415 break;
416 case CSSValueNormal:
417 state.fontBuilder().setStretch(FontStretchNormal);
418 break;
419 case CSSValueSemiExpanded:
420 state.fontBuilder().setStretch(FontStretchSemiExpanded);
421 break;
422 case CSSValueExpanded:
423 state.fontBuilder().setStretch(FontStretchExpanded);
424 break;
425 case CSSValueExtraExpanded:
426 state.fontBuilder().setStretch(FontStretchExtraExpanded);
427 break;
428 case CSSValueUltraExpanded:
429 state.fontBuilder().setStretch(FontStretchUltraExpanded);
430 break;
431 default:
432 return;
433 }
434 }
435
385 void StyleBuilderFunctions::applyValueCSSPropertyLineHeight(StyleResolverState& state, CSSValue* value) 436 void StyleBuilderFunctions::applyValueCSSPropertyLineHeight(StyleResolverState& state, CSSValue* value)
386 { 437 {
387 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 438 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
388 Length lineHeight; 439 Length lineHeight;
389 440
390 if (primitiveValue->getValueID() == CSSValueNormal) { 441 if (primitiveValue->getValueID() == CSSValueNormal) {
391 lineHeight = RenderStyle::initialLineHeight(); 442 lineHeight = RenderStyle::initialLineHeight();
392 } else if (primitiveValue->isLength()) { 443 } else if (primitiveValue->isLength()) {
393 float multiplier = state.style()->effectiveZoom(); 444 float multiplier = state.style()->effectiveZoom();
394 if (LocalFrame* frame = state.document().frame()) 445 if (LocalFrame* frame = state.document().frame())
(...skipping 1063 matching lines...) Expand 10 before | Expand all | Expand 10 after
1458 break; 1509 break;
1459 default: 1510 default:
1460 ASSERT_NOT_REACHED(); 1511 ASSERT_NOT_REACHED();
1461 break; 1512 break;
1462 } 1513 }
1463 1514
1464 state.style()->setGridAutoFlow(autoFlow); 1515 state.style()->setGridAutoFlow(autoFlow);
1465 } 1516 }
1466 1517
1467 } // namespace blink 1518 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/resolver/FontBuilder.cpp ('k') | Source/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698