OLD | NEW |
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 3464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3475 case CSSValue100: | 3475 case CSSValue100: |
3476 return FontWeight100; | 3476 return FontWeight100; |
3477 default: | 3477 default: |
3478 break; | 3478 break; |
3479 } | 3479 } |
3480 | 3480 |
3481 ASSERT_NOT_REACHED(); | 3481 ASSERT_NOT_REACHED(); |
3482 return FontWeightNormal; | 3482 return FontWeightNormal; |
3483 } | 3483 } |
3484 | 3484 |
| 3485 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(FontStretch stretch) |
| 3486 : CSSValue(PrimitiveClass) |
| 3487 { |
| 3488 fprintf(stderr, "CSSPrimitiveValue::CSSPrimitiveValue(FontStretch stretch)\n
"); |
| 3489 m_primitiveUnitType = CSS_VALUE_ID; |
| 3490 switch (stretch) { |
| 3491 case FontStretchUltraCondensed: |
| 3492 m_value.valueID = CSSValueUltraCondensed; |
| 3493 return; |
| 3494 case FontStretchExtraCondensed: |
| 3495 m_value.valueID = CSSValueExtraCondensed; |
| 3496 return; |
| 3497 case FontStretchCondensed: |
| 3498 m_value.valueID = CSSValueCondensed; |
| 3499 return; |
| 3500 case FontStretchSemiCondensed: |
| 3501 m_value.valueID = CSSValueSemiCondensed; |
| 3502 return; |
| 3503 case FontStretchNormal: |
| 3504 m_value.valueID = CSSValueNormal; |
| 3505 return; |
| 3506 case FontStretchSemiExpanded: |
| 3507 m_value.valueID = CSSValueSemiExpanded; |
| 3508 return; |
| 3509 case FontStretchExpanded: |
| 3510 m_value.valueID = CSSValueExpanded; |
| 3511 return; |
| 3512 case FontStretchExtraExpanded: |
| 3513 m_value.valueID = CSSValueExtraExpanded; |
| 3514 return; |
| 3515 case FontStretchUltraExpanded: |
| 3516 m_value.valueID = CSSValueUltraExpanded; |
| 3517 return; |
| 3518 } |
| 3519 |
| 3520 ASSERT_NOT_REACHED(); |
| 3521 m_value.valueID = CSSValueNormal; |
| 3522 } |
| 3523 |
| 3524 template<> inline CSSPrimitiveValue::operator FontStretch() const |
| 3525 { |
| 3526 fprintf(stderr, "CSSPrimitiveValue::operator FontStretch\n"); |
| 3527 ASSERT(isValueID()); |
| 3528 switch (m_value.valueID) { |
| 3529 case CSSValueUltraCondensed: |
| 3530 return FontStretchUltraCondensed; |
| 3531 case CSSValueExtraCondensed: |
| 3532 return FontStretchExtraCondensed; |
| 3533 case CSSValueCondensed: |
| 3534 return FontStretchCondensed; |
| 3535 case CSSValueSemiCondensed: |
| 3536 return FontStretchSemiCondensed; |
| 3537 case CSSValueNormal: |
| 3538 return FontStretchNormal; |
| 3539 case CSSValueSemiExpanded: |
| 3540 return FontStretchSemiExpanded; |
| 3541 case CSSValueExpanded: |
| 3542 return FontStretchExpanded; |
| 3543 case CSSValueExtraExpanded: |
| 3544 return FontStretchExtraExpanded; |
| 3545 case CSSValueUltraExpanded: |
| 3546 return FontStretchUltraExpanded; |
| 3547 default: |
| 3548 break; |
| 3549 } |
| 3550 |
| 3551 ASSERT_NOT_REACHED(); |
| 3552 return FontStretchNormal; |
| 3553 } |
| 3554 |
3485 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(FontItalic italic) | 3555 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(FontItalic italic) |
3486 : CSSValue(PrimitiveClass) | 3556 : CSSValue(PrimitiveClass) |
3487 { | 3557 { |
3488 m_primitiveUnitType = CSS_VALUE_ID; | 3558 m_primitiveUnitType = CSS_VALUE_ID; |
3489 switch (italic) { | 3559 switch (italic) { |
3490 case FontItalicOff: | 3560 case FontItalicOff: |
3491 m_value.valueID = CSSValueNormal; | 3561 m_value.valueID = CSSValueNormal; |
3492 return; | 3562 return; |
3493 case FontItalicOn: | 3563 case FontItalicOn: |
3494 m_value.valueID = CSSValueItalic; | 3564 m_value.valueID = CSSValueItalic; |
(...skipping 1454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4949 default: | 5019 default: |
4950 break; | 5020 break; |
4951 } | 5021 } |
4952 ASSERT_NOT_REACHED(); | 5022 ASSERT_NOT_REACHED(); |
4953 return ScrollBehaviorInstant; | 5023 return ScrollBehaviorInstant; |
4954 } | 5024 } |
4955 | 5025 |
4956 } | 5026 } |
4957 | 5027 |
4958 #endif | 5028 #endif |
OLD | NEW |