Chromium Code Reviews| 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 1933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1944 return EOverflow::kWebkitPagedY; | 1944 return EOverflow::kWebkitPagedY; |
| 1945 default: | 1945 default: |
| 1946 break; | 1946 break; |
| 1947 } | 1947 } |
| 1948 | 1948 |
| 1949 ASSERT_NOT_REACHED(); | 1949 ASSERT_NOT_REACHED(); |
| 1950 return EOverflow::kVisible; | 1950 return EOverflow::kVisible; |
| 1951 } | 1951 } |
| 1952 | 1952 |
| 1953 template <> | 1953 template <> |
| 1954 inline CSSIdentifierValue::CSSIdentifierValue(EBreak e) | 1954 inline CSSIdentifierValue::CSSIdentifierValue(EBreakBetween e) |
|
amoylan
2017/02/07 04:35:02
Sorted this switch to match enum ordering. Same be
| |
| 1955 : CSSValue(IdentifierClass) { | 1955 : CSSValue(IdentifierClass) { |
| 1956 switch (e) { | 1956 switch (e) { |
| 1957 default: | 1957 default: |
| 1958 ASSERT_NOT_REACHED(); | 1958 ASSERT_NOT_REACHED(); |
| 1959 case BreakAuto: | 1959 case EBreakBetween::kAuto: |
| 1960 m_valueID = CSSValueAuto; | 1960 m_valueID = CSSValueAuto; |
| 1961 break; | 1961 break; |
| 1962 case BreakAvoid: | 1962 case EBreakBetween::kAvoid: |
| 1963 m_valueID = CSSValueAvoid; | 1963 m_valueID = CSSValueAvoid; |
| 1964 break; | 1964 break; |
| 1965 case BreakAvoidPage: | 1965 case EBreakBetween::kAvoidColumn: |
| 1966 m_valueID = CSSValueAvoidColumn; | |
| 1967 break; | |
| 1968 case EBreakBetween::kAvoidPage: | |
| 1966 m_valueID = CSSValueAvoidPage; | 1969 m_valueID = CSSValueAvoidPage; |
| 1967 break; | 1970 break; |
| 1968 case BreakPage: | 1971 case EBreakBetween::kColumn: |
| 1972 m_valueID = CSSValueColumn; | |
| 1973 break; | |
| 1974 case EBreakBetween::kLeft: | |
| 1975 m_valueID = CSSValueLeft; | |
| 1976 break; | |
| 1977 case EBreakBetween::kPage: | |
| 1969 m_valueID = CSSValuePage; | 1978 m_valueID = CSSValuePage; |
| 1970 break; | 1979 break; |
| 1971 case BreakLeft: | 1980 case EBreakBetween::kRecto: |
| 1972 m_valueID = CSSValueLeft; | 1981 m_valueID = CSSValueRecto; |
| 1973 break; | 1982 break; |
| 1974 case BreakRight: | 1983 case EBreakBetween::kRight: |
| 1975 m_valueID = CSSValueRight; | 1984 m_valueID = CSSValueRight; |
| 1976 break; | 1985 break; |
| 1977 case BreakRecto: | 1986 case EBreakBetween::kVerso: |
| 1978 m_valueID = CSSValueRecto; | |
| 1979 break; | |
| 1980 case BreakVerso: | |
| 1981 m_valueID = CSSValueVerso; | 1987 m_valueID = CSSValueVerso; |
| 1982 break; | 1988 break; |
| 1983 case BreakAvoidColumn: | |
| 1984 m_valueID = CSSValueAvoidColumn; | |
| 1985 break; | |
| 1986 case BreakColumn: | |
| 1987 m_valueID = CSSValueColumn; | |
| 1988 break; | |
| 1989 } | 1989 } |
| 1990 } | 1990 } |
| 1991 | 1991 |
| 1992 template <> | 1992 template <> |
| 1993 inline EBreak CSSIdentifierValue::convertTo() const { | 1993 inline EBreakBetween CSSIdentifierValue::convertTo() const { |
| 1994 switch (m_valueID) { | 1994 switch (m_valueID) { |
| 1995 default: | 1995 default: |
| 1996 ASSERT_NOT_REACHED(); | 1996 ASSERT_NOT_REACHED(); |
| 1997 case CSSValueAuto: | 1997 case CSSValueAuto: |
| 1998 return BreakAuto; | 1998 return EBreakBetween::kAuto; |
| 1999 case CSSValueAvoid: | 1999 case CSSValueAvoid: |
| 2000 return BreakAvoid; | 2000 return EBreakBetween::kAvoid; |
| 2001 case CSSValueAvoidColumn: | |
| 2002 return EBreakBetween::kAvoidColumn; | |
| 2001 case CSSValueAvoidPage: | 2003 case CSSValueAvoidPage: |
| 2002 return BreakAvoidPage; | 2004 return EBreakBetween::kAvoidPage; |
| 2005 case CSSValueColumn: | |
| 2006 return EBreakBetween::kColumn; | |
| 2007 case CSSValueLeft: | |
| 2008 return EBreakBetween::kLeft; | |
| 2003 case CSSValuePage: | 2009 case CSSValuePage: |
| 2004 return BreakPage; | 2010 return EBreakBetween::kPage; |
| 2005 case CSSValueLeft: | 2011 case CSSValueRecto: |
| 2006 return BreakLeft; | 2012 return EBreakBetween::kRecto; |
| 2007 case CSSValueRight: | 2013 case CSSValueRight: |
| 2008 return BreakRight; | 2014 return EBreakBetween::kRight; |
| 2009 case CSSValueRecto: | |
| 2010 return BreakRecto; | |
| 2011 case CSSValueVerso: | 2015 case CSSValueVerso: |
| 2012 return BreakVerso; | 2016 return EBreakBetween::kVerso; |
| 2013 case CSSValueAvoidColumn: | |
| 2014 return BreakAvoidColumn; | |
| 2015 case CSSValueColumn: | |
| 2016 return BreakColumn; | |
| 2017 } | 2017 } |
| 2018 } | 2018 } |
| 2019 | 2019 |
| 2020 template <> | |
| 2021 inline CSSIdentifierValue::CSSIdentifierValue(EBreakInside e) | |
| 2022 : CSSValue(IdentifierClass) { | |
| 2023 switch (e) { | |
| 2024 default: | |
| 2025 NOTREACHED(); | |
| 2026 case EBreakInside::kAuto: | |
| 2027 m_valueID = CSSValueAuto; | |
| 2028 break; | |
| 2029 case EBreakInside::kAvoid: | |
| 2030 m_valueID = CSSValueAvoid; | |
| 2031 break; | |
| 2032 case EBreakInside::kAvoidColumn: | |
| 2033 m_valueID = CSSValueAvoidColumn; | |
| 2034 break; | |
| 2035 case EBreakInside::kAvoidPage: | |
| 2036 m_valueID = CSSValueAvoidPage; | |
| 2037 break; | |
| 2038 } | |
| 2039 } | |
| 2040 | |
| 2041 template <> | |
| 2042 inline EBreakInside CSSIdentifierValue::convertTo() const { | |
| 2043 switch (m_valueID) { | |
| 2044 default: | |
| 2045 NOTREACHED(); | |
| 2046 case CSSValueAuto: | |
| 2047 return EBreakInside::kAuto; | |
| 2048 case CSSValueAvoid: | |
| 2049 return EBreakInside::kAvoid; | |
| 2050 case CSSValueAvoidColumn: | |
| 2051 return EBreakInside::kAvoidColumn; | |
| 2052 case CSSValueAvoidPage: | |
| 2053 return EBreakInside::kAvoidPage; | |
| 2054 } | |
| 2055 } | |
| 2056 | |
| 2020 template <> | 2057 template <> |
| 2021 inline CSSIdentifierValue::CSSIdentifierValue(EPosition e) | 2058 inline CSSIdentifierValue::CSSIdentifierValue(EPosition e) |
| 2022 : CSSValue(IdentifierClass) { | 2059 : CSSValue(IdentifierClass) { |
| 2023 switch (e) { | 2060 switch (e) { |
| 2024 case StaticPosition: | 2061 case StaticPosition: |
| 2025 m_valueID = CSSValueStatic; | 2062 m_valueID = CSSValueStatic; |
| 2026 break; | 2063 break; |
| 2027 case RelativePosition: | 2064 case RelativePosition: |
| 2028 m_valueID = CSSValueRelative; | 2065 m_valueID = CSSValueRelative; |
| 2029 break; | 2066 break; |
| (...skipping 2755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4785 default: | 4822 default: |
| 4786 break; | 4823 break; |
| 4787 } | 4824 } |
| 4788 ASSERT_NOT_REACHED(); | 4825 ASSERT_NOT_REACHED(); |
| 4789 return ContainsNone; | 4826 return ContainsNone; |
| 4790 } | 4827 } |
| 4791 | 4828 |
| 4792 } // namespace blink | 4829 } // namespace blink |
| 4793 | 4830 |
| 4794 #endif | 4831 #endif |
| OLD | NEW |