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

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

Issue 2942393002: Generate enum/getters/setters/mappings for flex-direction (Closed)
Patch Set: Retry Created 3 years, 6 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/CSSProperties.json5 » ('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. 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 613 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 return kLeftEdge; 624 return kLeftEdge;
625 default: 625 default:
626 break; 626 break;
627 } 627 }
628 628
629 NOTREACHED(); 629 NOTREACHED();
630 return kTopEdge; 630 return kTopEdge;
631 } 631 }
632 632
633 template <> 633 template <>
634 inline CSSIdentifierValue::CSSIdentifierValue(EFlexDirection e)
635 : CSSValue(kIdentifierClass) {
636 switch (e) {
637 case EFlexDirection::kRow:
638 value_id_ = CSSValueRow;
639 break;
640 case EFlexDirection::kRowReverse:
641 value_id_ = CSSValueRowReverse;
642 break;
643 case EFlexDirection::kColumn:
644 value_id_ = CSSValueColumn;
645 break;
646 case EFlexDirection::kColumnReverse:
647 value_id_ = CSSValueColumnReverse;
648 break;
649 }
650 }
651
652 template <>
653 inline EFlexDirection CSSIdentifierValue::ConvertTo() const {
654 switch (value_id_) {
655 case CSSValueRow:
656 return EFlexDirection::kRow;
657 case CSSValueRowReverse:
658 return EFlexDirection::kRowReverse;
659 case CSSValueColumn:
660 return EFlexDirection::kColumn;
661 case CSSValueColumnReverse:
662 return EFlexDirection::kColumnReverse;
663 default:
664 break;
665 }
666
667 NOTREACHED();
668 return EFlexDirection::kRow;
669 }
670
671 template <>
672 inline CSSIdentifierValue::CSSIdentifierValue(EFlexWrap e) 634 inline CSSIdentifierValue::CSSIdentifierValue(EFlexWrap e)
673 : CSSValue(kIdentifierClass) { 635 : CSSValue(kIdentifierClass) {
674 switch (e) { 636 switch (e) {
675 case EFlexWrap::kNowrap: 637 case EFlexWrap::kNowrap:
676 value_id_ = CSSValueNowrap; 638 value_id_ = CSSValueNowrap;
677 break; 639 break;
678 case EFlexWrap::kWrap: 640 case EFlexWrap::kWrap:
679 value_id_ = CSSValueWrap; 641 value_id_ = CSSValueWrap;
680 break; 642 break;
681 case EFlexWrap::kWrapReverse: 643 case EFlexWrap::kWrapReverse:
(...skipping 1663 matching lines...) Expand 10 before | Expand all | Expand 10 after
2345 default: 2307 default:
2346 break; 2308 break;
2347 } 2309 }
2348 NOTREACHED(); 2310 NOTREACHED();
2349 return kContainsNone; 2311 return kContainsNone;
2350 } 2312 }
2351 2313
2352 } // namespace blink 2314 } // namespace blink
2353 2315
2354 #endif 2316 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/CSSProperties.json5 » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698