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

Side by Side Diff: Source/core/css/CSSValue.cpp

Issue 1311843003: Remove default case from CSSValue::equals (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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 | no next file » | 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) 2011 Andreas Kling (kling@webkit.org) 2 * Copyright (C) 2011 Andreas Kling (kling@webkit.org)
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 85
86 template<class ChildClassType> 86 template<class ChildClassType>
87 inline static bool compareCSSValues(const CSSValue& first, const CSSValue& secon d) 87 inline static bool compareCSSValues(const CSSValue& first, const CSSValue& secon d)
88 { 88 {
89 return static_cast<const ChildClassType&>(first).equals(static_cast<const Ch ildClassType&>(second)); 89 return static_cast<const ChildClassType&>(first).equals(static_cast<const Ch ildClassType&>(second));
90 } 90 }
91 91
92 bool CSSValue::equals(const CSSValue& other) const 92 bool CSSValue::equals(const CSSValue& other) const
93 { 93 {
94 if (m_classType == other.m_classType) { 94 if (m_classType == other.m_classType) {
95 switch (m_classType) { 95 switch (classType()) {
96 case BorderImageSliceClass: 96 case BorderImageSliceClass:
97 return compareCSSValues<CSSBorderImageSliceValue>(*this, other); 97 return compareCSSValues<CSSBorderImageSliceValue>(*this, other);
98 case CanvasClass: 98 case CanvasClass:
99 return compareCSSValues<CSSCanvasValue>(*this, other); 99 return compareCSSValues<CSSCanvasValue>(*this, other);
100 case CounterClass: 100 case CounterClass:
101 return compareCSSValues<CSSCounterValue>(*this, other); 101 return compareCSSValues<CSSCounterValue>(*this, other);
102 case CursorImageClass: 102 case CursorImageClass:
103 return compareCSSValues<CSSCursorImageValue>(*this, other); 103 return compareCSSValues<CSSCursorImageValue>(*this, other);
104 case FontFaceSrcClass: 104 case FontFaceSrcClass:
105 return compareCSSValues<CSSFontFaceSrcValue>(*this, other); 105 return compareCSSValues<CSSFontFaceSrcValue>(*this, other);
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 case ValueListClass: 142 case ValueListClass:
143 return compareCSSValues<CSSValueList>(*this, other); 143 return compareCSSValues<CSSValueList>(*this, other);
144 case LineBoxContainClass: 144 case LineBoxContainClass:
145 return compareCSSValues<CSSLineBoxContainValue>(*this, other); 145 return compareCSSValues<CSSLineBoxContainValue>(*this, other);
146 case ImageSetClass: 146 case ImageSetClass:
147 return compareCSSValues<CSSImageSetValue>(*this, other); 147 return compareCSSValues<CSSImageSetValue>(*this, other);
148 case CSSSVGDocumentClass: 148 case CSSSVGDocumentClass:
149 return compareCSSValues<CSSSVGDocumentValue>(*this, other); 149 return compareCSSValues<CSSSVGDocumentValue>(*this, other);
150 case CSSContentDistributionClass: 150 case CSSContentDistributionClass:
151 return compareCSSValues<CSSContentDistributionValue>(*this, other); 151 return compareCSSValues<CSSContentDistributionValue>(*this, other);
152 default:
153 ASSERT_NOT_REACHED();
154 return false;
155 } 152 }
153 ASSERT_NOT_REACHED();
154 return false;
156 } 155 }
157 return false; 156 return false;
158 } 157 }
159 158
160 String CSSValue::cssText() const 159 String CSSValue::cssText() const
161 { 160 {
162 switch (classType()) { 161 switch (classType()) {
163 case BorderImageSliceClass: 162 case BorderImageSliceClass:
164 return toCSSBorderImageSliceValue(this)->customCSSText(); 163 return toCSSBorderImageSliceValue(this)->customCSSText();
165 case CanvasClass: 164 case CanvasClass:
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 toCSSSVGDocumentValue(this)->traceAfterDispatch(visitor); 487 toCSSSVGDocumentValue(this)->traceAfterDispatch(visitor);
489 return; 488 return;
490 case CSSContentDistributionClass: 489 case CSSContentDistributionClass:
491 toCSSContentDistributionValue(this)->traceAfterDispatch(visitor); 490 toCSSContentDistributionValue(this)->traceAfterDispatch(visitor);
492 return; 491 return;
493 } 492 }
494 ASSERT_NOT_REACHED(); 493 ASSERT_NOT_REACHED();
495 } 494 }
496 495
497 } 496 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698