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: sky/engine/core/css/CSSPrimitiveValueMappings.h

Issue 1076623002: Remove our impressive amount of CSS Cursor code. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 8 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 | « sky/engine/core/css/CSSCursorImageValue.cpp ('k') | sky/engine/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 705 matching lines...) Expand 10 before | Expand all | Expand 10 after
716 case CSSValueBottom: 716 case CSSValueBottom:
717 return CAPBOTTOM; 717 return CAPBOTTOM;
718 default: 718 default:
719 break; 719 break;
720 } 720 }
721 721
722 ASSERT_NOT_REACHED(); 722 ASSERT_NOT_REACHED();
723 return CAPTOP; 723 return CAPTOP;
724 } 724 }
725 725
726 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ECursor e)
727 : CSSValue(PrimitiveClass)
728 {
729 m_primitiveUnitType = CSS_VALUE_ID;
730 switch (e) {
731 case CURSOR_AUTO:
732 m_value.valueID = CSSValueAuto;
733 break;
734 case CURSOR_CROSS:
735 m_value.valueID = CSSValueCrosshair;
736 break;
737 case CURSOR_DEFAULT:
738 m_value.valueID = CSSValueDefault;
739 break;
740 case CURSOR_POINTER:
741 m_value.valueID = CSSValuePointer;
742 break;
743 case CURSOR_MOVE:
744 m_value.valueID = CSSValueMove;
745 break;
746 case CURSOR_CELL:
747 m_value.valueID = CSSValueCell;
748 break;
749 case CURSOR_VERTICAL_TEXT:
750 m_value.valueID = CSSValueVerticalText;
751 break;
752 case CURSOR_CONTEXT_MENU:
753 m_value.valueID = CSSValueContextMenu;
754 break;
755 case CURSOR_ALIAS:
756 m_value.valueID = CSSValueAlias;
757 break;
758 case CURSOR_COPY:
759 m_value.valueID = CSSValueCopy;
760 break;
761 case CURSOR_NONE:
762 m_value.valueID = CSSValueNone;
763 break;
764 case CURSOR_PROGRESS:
765 m_value.valueID = CSSValueProgress;
766 break;
767 case CURSOR_NO_DROP:
768 m_value.valueID = CSSValueNoDrop;
769 break;
770 case CURSOR_NOT_ALLOWED:
771 m_value.valueID = CSSValueNotAllowed;
772 break;
773 case CURSOR_ZOOM_IN:
774 m_value.valueID = CSSValueZoomIn;
775 break;
776 case CURSOR_ZOOM_OUT:
777 m_value.valueID = CSSValueZoomOut;
778 break;
779 case CURSOR_E_RESIZE:
780 m_value.valueID = CSSValueEResize;
781 break;
782 case CURSOR_NE_RESIZE:
783 m_value.valueID = CSSValueNeResize;
784 break;
785 case CURSOR_NW_RESIZE:
786 m_value.valueID = CSSValueNwResize;
787 break;
788 case CURSOR_N_RESIZE:
789 m_value.valueID = CSSValueNResize;
790 break;
791 case CURSOR_SE_RESIZE:
792 m_value.valueID = CSSValueSeResize;
793 break;
794 case CURSOR_SW_RESIZE:
795 m_value.valueID = CSSValueSwResize;
796 break;
797 case CURSOR_S_RESIZE:
798 m_value.valueID = CSSValueSResize;
799 break;
800 case CURSOR_W_RESIZE:
801 m_value.valueID = CSSValueWResize;
802 break;
803 case CURSOR_EW_RESIZE:
804 m_value.valueID = CSSValueEwResize;
805 break;
806 case CURSOR_NS_RESIZE:
807 m_value.valueID = CSSValueNsResize;
808 break;
809 case CURSOR_NESW_RESIZE:
810 m_value.valueID = CSSValueNeswResize;
811 break;
812 case CURSOR_NWSE_RESIZE:
813 m_value.valueID = CSSValueNwseResize;
814 break;
815 case CURSOR_COL_RESIZE:
816 m_value.valueID = CSSValueColResize;
817 break;
818 case CURSOR_ROW_RESIZE:
819 m_value.valueID = CSSValueRowResize;
820 break;
821 case CURSOR_TEXT:
822 m_value.valueID = CSSValueText;
823 break;
824 case CURSOR_WAIT:
825 m_value.valueID = CSSValueWait;
826 break;
827 case CURSOR_HELP:
828 m_value.valueID = CSSValueHelp;
829 break;
830 case CURSOR_ALL_SCROLL:
831 m_value.valueID = CSSValueAllScroll;
832 break;
833 case CURSOR_WEBKIT_GRAB:
834 m_value.valueID = CSSValueWebkitGrab;
835 break;
836 case CURSOR_WEBKIT_GRABBING:
837 m_value.valueID = CSSValueWebkitGrabbing;
838 break;
839 }
840 }
841
842 template<> inline CSSPrimitiveValue::operator ECursor() const
843 {
844 ASSERT(isValueID());
845 switch (m_value.valueID) {
846 case CSSValueCopy:
847 return CURSOR_COPY;
848 case CSSValueWebkitZoomIn:
849 return CURSOR_ZOOM_IN;
850 case CSSValueWebkitZoomOut:
851 return CURSOR_ZOOM_OUT;
852 case CSSValueNone:
853 return CURSOR_NONE;
854 default:
855 return static_cast<ECursor>(m_value.valueID - CSSValueAuto);
856 }
857 }
858
859 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EDisplay e) 726 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EDisplay e)
860 : CSSValue(PrimitiveClass) 727 : CSSValue(PrimitiveClass)
861 { 728 {
862 m_primitiveUnitType = CSS_VALUE_ID; 729 m_primitiveUnitType = CSS_VALUE_ID;
863 switch (e) { 730 switch (e) {
864 case INLINE: 731 case INLINE:
865 m_value.valueID = CSSValueInline; 732 m_value.valueID = CSSValueInline;
866 break; 733 break;
867 case PARAGRAPH: 734 case PARAGRAPH:
868 m_value.valueID = CSSValueParagraph; 735 m_value.valueID = CSSValueParagraph;
(...skipping 2547 matching lines...) Expand 10 before | Expand all | Expand 10 after
3416 default: 3283 default:
3417 break; 3284 break;
3418 } 3285 }
3419 ASSERT_NOT_REACHED(); 3286 ASSERT_NOT_REACHED();
3420 return OverflowAlignmentTrue; 3287 return OverflowAlignmentTrue;
3421 } 3288 }
3422 3289
3423 } 3290 }
3424 3291
3425 #endif // SKY_ENGINE_CORE_CSS_CSSPRIMITIVEVALUEMAPPINGS_H_ 3292 #endif // SKY_ENGINE_CORE_CSS_CSSPRIMITIVEVALUEMAPPINGS_H_
OLDNEW
« no previous file with comments | « sky/engine/core/css/CSSCursorImageValue.cpp ('k') | sky/engine/core/css/CSSProperties.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698