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

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

Issue 636993002: [CSS Grid Layout] Upgrade justify-content parsing to CSS3 Box Alignment spec. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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
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 4772 matching lines...) Expand 10 before | Expand all | Expand 10 after
4783 return ItemPositionLeft; 4783 return ItemPositionLeft;
4784 case CSSValueRight: 4784 case CSSValueRight:
4785 return ItemPositionRight; 4785 return ItemPositionRight;
4786 default: 4786 default:
4787 break; 4787 break;
4788 } 4788 }
4789 ASSERT_NOT_REACHED(); 4789 ASSERT_NOT_REACHED();
4790 return ItemPositionAuto; 4790 return ItemPositionAuto;
4791 } 4791 }
4792 4792
4793 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ContentPosition contentPo sition)
4794 : CSSValue(PrimitiveClass)
4795 {
4796 m_primitiveUnitType = CSS_VALUE_ID;
4797 switch (contentPosition) {
4798 case ContentPositionAuto:
4799 m_value.valueID = CSSValueAuto;
4800 break;
4801 case ContentPositionBaseline:
4802 m_value.valueID = CSSValueBaseline;
4803 break;
4804 case ContentPositionLastBaseline:
4805 m_value.valueID = CSSValueLastBaseline;
4806 break;
4807 case ContentPositionCenter:
4808 m_value.valueID = CSSValueCenter;
4809 break;
4810 case ContentPositionStart:
4811 m_value.valueID = CSSValueStart;
4812 break;
4813 case ContentPositionEnd:
4814 m_value.valueID = CSSValueEnd;
4815 break;
4816 case ContentPositionFlexStart:
4817 m_value.valueID = CSSValueFlexStart;
4818 break;
4819 case ContentPositionFlexEnd:
4820 m_value.valueID = CSSValueFlexEnd;
4821 break;
4822 case ContentPositionLeft:
4823 m_value.valueID = CSSValueLeft;
4824 break;
4825 case ContentPositionRight:
4826 m_value.valueID = CSSValueRight;
4827 break;
4828 }
4829 }
4830
4831 template<> inline CSSPrimitiveValue::operator ContentPosition() const
4832 {
4833 switch (m_value.valueID) {
4834 case CSSValueAuto:
4835 return ContentPositionAuto;
4836 case CSSValueBaseline:
4837 return ContentPositionBaseline;
4838 case CSSValueLastBaseline:
4839 return ContentPositionLastBaseline;
4840 case CSSValueCenter:
4841 return ContentPositionCenter;
4842 case CSSValueStart:
4843 return ContentPositionStart;
4844 case CSSValueEnd:
4845 return ContentPositionEnd;
4846 case CSSValueFlexStart:
4847 return ContentPositionFlexStart;
4848 case CSSValueFlexEnd:
4849 return ContentPositionFlexEnd;
4850 case CSSValueLeft:
4851 return ContentPositionLeft;
4852 case CSSValueRight:
4853 return ContentPositionRight;
4854 default:
4855 break;
4856 }
4857 ASSERT_NOT_REACHED();
4858 return ContentPositionAuto;
4859 }
4860
4861 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ContentDistributionType c ontentDistribution)
4862 : CSSValue(PrimitiveClass)
4863 {
4864 m_primitiveUnitType = CSS_VALUE_ID;
4865 switch (contentDistribution) {
4866 case ContentDistributionDefault:
4867 m_value.valueID = CSSValueDefault;
4868 break;
4869 case ContentDistributionSpaceBetween:
4870 m_value.valueID = CSSValueSpaceBetween;
4871 break;
4872 case ContentDistributionSpaceAround:
4873 m_value.valueID = CSSValueSpaceAround;
4874 break;
4875 case ContentDistributionSpaceEvenly:
4876 m_value.valueID = CSSValueSpaceEvenly;
4877 break;
4878 case ContentDistributionStretch:
4879 m_value.valueID = CSSValueStretch;
4880 break;
4881 }
4882 }
4883
4884 template<> inline CSSPrimitiveValue::operator ContentDistributionType() const
4885 {
4886 switch (m_value.valueID) {
4887 case CSSValueSpaceBetween:
4888 return ContentDistributionSpaceBetween;
4889 case CSSValueSpaceAround:
4890 return ContentDistributionSpaceAround;
4891 case CSSValueSpaceEvenly:
4892 return ContentDistributionSpaceEvenly;
4893 case CSSValueStretch:
4894 return ContentDistributionStretch;
4895 default:
4896 break;
4897 }
4898 ASSERT_NOT_REACHED();
4899 return ContentDistributionStretch;
4900 }
4901
4793 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(OverflowAlignment overflo wAlignment) 4902 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(OverflowAlignment overflo wAlignment)
4794 : CSSValue(PrimitiveClass) 4903 : CSSValue(PrimitiveClass)
4795 { 4904 {
4796 m_primitiveUnitType = CSS_VALUE_ID; 4905 m_primitiveUnitType = CSS_VALUE_ID;
4797 switch (overflowAlignment) { 4906 switch (overflowAlignment) {
4798 case OverflowAlignmentDefault: 4907 case OverflowAlignmentDefault:
4799 m_value.valueID = CSSValueDefault; 4908 m_value.valueID = CSSValueDefault;
4800 break; 4909 break;
4801 case OverflowAlignmentTrue: 4910 case OverflowAlignmentTrue:
4802 m_value.valueID = CSSValueTrue; 4911 m_value.valueID = CSSValueTrue;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
4849 default: 4958 default:
4850 break; 4959 break;
4851 } 4960 }
4852 ASSERT_NOT_REACHED(); 4961 ASSERT_NOT_REACHED();
4853 return ScrollBehaviorInstant; 4962 return ScrollBehaviorInstant;
4854 } 4963 }
4855 4964
4856 } 4965 }
4857 4966
4858 #endif 4967 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698