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

Side by Side Diff: Source/core/css/CSSPrimitiveValueMappings.h

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/CSSFontValue.cpp ('k') | Source/core/css/CSSProperties.in » ('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) 2007 Alexey Proskuryakov <ap@nypop.com>. 2 * Copyright (C) 2007 Alexey Proskuryakov <ap@nypop.com>.
3 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
4 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 4 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
5 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com> 5 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com>
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
(...skipping 3495 matching lines...) Expand 10 before | Expand all | Expand 10 after
3506 return FontStyleItalic; 3506 return FontStyleItalic;
3507 case CSSValueNormal: 3507 case CSSValueNormal:
3508 return FontStyleNormal; 3508 return FontStyleNormal;
3509 default: 3509 default:
3510 break; 3510 break;
3511 } 3511 }
3512 ASSERT_NOT_REACHED(); 3512 ASSERT_NOT_REACHED();
3513 return FontStyleNormal; 3513 return FontStyleNormal;
3514 } 3514 }
3515 3515
3516 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(FontStretch stretch)
3517 : CSSValue(PrimitiveClass)
3518 {
3519 fprintf(stderr, "CSSPrimitiveValue::CSSPrimitiveValue(FontStretch stretch)\n ");
3520 m_primitiveUnitType = CSS_VALUE_ID;
3521 switch (stretch) {
3522 case FontStretchUltraCondensed:
3523 m_value.valueID = CSSValueUltraCondensed;
3524 return;
3525 case FontStretchExtraCondensed:
3526 m_value.valueID = CSSValueExtraCondensed;
3527 return;
3528 case FontStretchCondensed:
3529 m_value.valueID = CSSValueCondensed;
3530 return;
3531 case FontStretchSemiCondensed:
3532 m_value.valueID = CSSValueSemiCondensed;
3533 return;
3534 case FontStretchNormal:
3535 m_value.valueID = CSSValueNormal;
3536 return;
3537 case FontStretchSemiExpanded:
3538 m_value.valueID = CSSValueSemiExpanded;
3539 return;
3540 case FontStretchExpanded:
3541 m_value.valueID = CSSValueExpanded;
3542 return;
3543 case FontStretchExtraExpanded:
3544 m_value.valueID = CSSValueExtraExpanded;
3545 return;
3546 case FontStretchUltraExpanded:
3547 m_value.valueID = CSSValueUltraExpanded;
3548 return;
3549 }
3550
3551 ASSERT_NOT_REACHED();
3552 m_value.valueID = CSSValueNormal;
3553 }
3554
3555 template<> inline CSSPrimitiveValue::operator FontStretch() const
3556 {
3557 fprintf(stderr, "CSSPrimitiveValue::operator FontStretch\n");
3558 ASSERT(isValueID());
3559 switch (m_value.valueID) {
3560 case CSSValueUltraCondensed:
3561 return FontStretchUltraCondensed;
3562 case CSSValueExtraCondensed:
3563 return FontStretchExtraCondensed;
3564 case CSSValueCondensed:
3565 return FontStretchCondensed;
3566 case CSSValueSemiCondensed:
3567 return FontStretchSemiCondensed;
3568 case CSSValueNormal:
3569 return FontStretchNormal;
3570 case CSSValueSemiExpanded:
3571 return FontStretchSemiExpanded;
3572 case CSSValueExpanded:
3573 return FontStretchExpanded;
3574 case CSSValueExtraExpanded:
3575 return FontStretchExtraExpanded;
3576 case CSSValueUltraExpanded:
3577 return FontStretchUltraExpanded;
3578 default:
3579 break;
3580 }
3581
3582 ASSERT_NOT_REACHED();
3583 return FontStretchNormal;
3584 }
3585
3516 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(FontVariant smallCaps) 3586 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(FontVariant smallCaps)
3517 : CSSValue(PrimitiveClass) 3587 : CSSValue(PrimitiveClass)
3518 { 3588 {
3519 m_primitiveUnitType = CSS_VALUE_ID; 3589 m_primitiveUnitType = CSS_VALUE_ID;
3520 switch (smallCaps) { 3590 switch (smallCaps) {
3521 case FontVariantNormal: 3591 case FontVariantNormal:
3522 m_value.valueID = CSSValueNormal; 3592 m_value.valueID = CSSValueNormal;
3523 return; 3593 return;
3524 case FontVariantSmallCaps: 3594 case FontVariantSmallCaps:
3525 m_value.valueID = CSSValueSmallCaps; 3595 m_value.valueID = CSSValueSmallCaps;
(...skipping 1249 matching lines...) Expand 10 before | Expand all | Expand 10 after
4775 default: 4845 default:
4776 break; 4846 break;
4777 } 4847 }
4778 ASSERT_NOT_REACHED(); 4848 ASSERT_NOT_REACHED();
4779 return ScrollBehaviorInstant; 4849 return ScrollBehaviorInstant;
4780 } 4850 }
4781 4851
4782 } 4852 }
4783 4853
4784 #endif 4854 #endif
OLDNEW
« no previous file with comments | « Source/core/css/CSSFontValue.cpp ('k') | Source/core/css/CSSProperties.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698