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. | 4 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. |
5 * (http://www.torchmobile.com/) | 5 * (http://www.torchmobile.com/) |
6 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com> | 6 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com> |
7 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 7 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
8 * | 8 * |
9 * Redistribution and use in source and binary forms, with or without | 9 * Redistribution and use in source and binary forms, with or without |
10 * modification, are permitted provided that the following conditions | 10 * modification, are permitted provided that the following conditions |
(...skipping 1461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1472 return TextEmphasisMark::kSesame; | 1472 return TextEmphasisMark::kSesame; |
1473 default: | 1473 default: |
1474 break; | 1474 break; |
1475 } | 1475 } |
1476 | 1476 |
1477 NOTREACHED(); | 1477 NOTREACHED(); |
1478 return TextEmphasisMark::kNone; | 1478 return TextEmphasisMark::kNone; |
1479 } | 1479 } |
1480 | 1480 |
1481 template <> | 1481 template <> |
1482 inline CSSIdentifierValue::CSSIdentifierValue(TextOrientation e) | |
1483 : CSSValue(kIdentifierClass) { | |
1484 switch (e) { | |
1485 case TextOrientation::kSideways: | |
1486 value_id_ = CSSValueSideways; | |
1487 break; | |
1488 case TextOrientation::kMixed: | |
1489 value_id_ = CSSValueMixed; | |
1490 break; | |
1491 case TextOrientation::kUpright: | |
1492 value_id_ = CSSValueUpright; | |
1493 break; | |
1494 } | |
1495 } | |
1496 | |
1497 template <> | |
1498 inline TextOrientation CSSIdentifierValue::ConvertTo() const { | |
1499 switch (value_id_) { | |
1500 case CSSValueSideways: | |
1501 case CSSValueSidewaysRight: | |
1502 return TextOrientation::kSideways; | |
1503 case CSSValueMixed: | |
1504 case CSSValueVerticalRight: // -webkit-text-orientation | |
1505 return TextOrientation::kMixed; | |
1506 case CSSValueUpright: | |
1507 return TextOrientation::kUpright; | |
1508 default: | |
1509 break; | |
1510 } | |
1511 | |
1512 NOTREACHED(); | |
1513 return TextOrientation::kMixed; | |
1514 } | |
1515 | |
1516 template <> | |
1517 inline CSSIdentifierValue::CSSIdentifierValue(FontDescription::Kerning kerning) | 1482 inline CSSIdentifierValue::CSSIdentifierValue(FontDescription::Kerning kerning) |
1518 : CSSValue(kIdentifierClass) { | 1483 : CSSValue(kIdentifierClass) { |
1519 switch (kerning) { | 1484 switch (kerning) { |
1520 case FontDescription::kAutoKerning: | 1485 case FontDescription::kAutoKerning: |
1521 value_id_ = CSSValueAuto; | 1486 value_id_ = CSSValueAuto; |
1522 return; | 1487 return; |
1523 case FontDescription::kNormalKerning: | 1488 case FontDescription::kNormalKerning: |
1524 value_id_ = CSSValueNormal; | 1489 value_id_ = CSSValueNormal; |
1525 return; | 1490 return; |
1526 case FontDescription::kNoneKerning: | 1491 case FontDescription::kNoneKerning: |
(...skipping 1484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3011 default: | 2976 default: |
3012 break; | 2977 break; |
3013 } | 2978 } |
3014 NOTREACHED(); | 2979 NOTREACHED(); |
3015 return kContainsNone; | 2980 return kContainsNone; |
3016 } | 2981 } |
3017 | 2982 |
3018 } // namespace blink | 2983 } // namespace blink |
3019 | 2984 |
3020 #endif | 2985 #endif |
OLD | NEW |