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

Side by Side Diff: sky/engine/core/animation/css/CSSPropertyEquality.cpp

Issue 667003003: Remove most of visited link support. (Closed) Base URL: git@github.com:domokit/mojo.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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "core/animation/css/CSSPropertyEquality.h" 6 #include "core/animation/css/CSSPropertyEquality.h"
7 7
8 #include "core/animation/css/CSSAnimations.h" 8 #include "core/animation/css/CSSAnimations.h"
9 #include "core/rendering/style/DataEquivalency.h" 9 #include "core/rendering/style/DataEquivalency.h"
10 #include "core/rendering/style/RenderStyle.h" 10 #include "core/rendering/style/RenderStyle.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 // FIXME: Shouldn't this be return !aLayer && !bLayer; ? 53 // FIXME: Shouldn't this be return !aLayer && !bLayer; ?
54 return true; 54 return true;
55 } 55 }
56 56
57 } 57 }
58 58
59 bool CSSPropertyEquality::propertiesEqual(CSSPropertyID prop, const RenderStyle& a, const RenderStyle& b) 59 bool CSSPropertyEquality::propertiesEqual(CSSPropertyID prop, const RenderStyle& a, const RenderStyle& b)
60 { 60 {
61 switch (prop) { 61 switch (prop) {
62 case CSSPropertyBackgroundColor: 62 case CSSPropertyBackgroundColor:
63 return a.backgroundColor().resolve(a.color()) == b.backgroundColor().res olve(b.color()) 63 return a.backgroundColor().resolve(a.color()) == b.backgroundColor().res olve(b.color());
64 && a.visitedLinkBackgroundColor().resolve(a.color()) == b.visitedLin kBackgroundColor().resolve(b.color());
65 case CSSPropertyBackgroundImage: 64 case CSSPropertyBackgroundImage:
66 return fillLayersEqual<CSSPropertyBackgroundImage>(a.backgroundLayers(), b.backgroundLayers()); 65 return fillLayersEqual<CSSPropertyBackgroundImage>(a.backgroundLayers(), b.backgroundLayers());
67 case CSSPropertyBackgroundPositionX: 66 case CSSPropertyBackgroundPositionX:
68 return fillLayersEqual<CSSPropertyBackgroundPositionX>(a.backgroundLayer s(), b.backgroundLayers()); 67 return fillLayersEqual<CSSPropertyBackgroundPositionX>(a.backgroundLayer s(), b.backgroundLayers());
69 case CSSPropertyBackgroundPositionY: 68 case CSSPropertyBackgroundPositionY:
70 return fillLayersEqual<CSSPropertyBackgroundPositionY>(a.backgroundLayer s(), b.backgroundLayers()); 69 return fillLayersEqual<CSSPropertyBackgroundPositionY>(a.backgroundLayer s(), b.backgroundLayers());
71 case CSSPropertyBackgroundSize: 70 case CSSPropertyBackgroundSize:
72 return fillLayersEqual<CSSPropertyBackgroundSize>(a.backgroundLayers(), b.backgroundLayers()); 71 return fillLayersEqual<CSSPropertyBackgroundSize>(a.backgroundLayers(), b.backgroundLayers());
73 case CSSPropertyBorderBottomColor: 72 case CSSPropertyBorderBottomColor:
74 return a.borderBottomColor().resolve(a.color()) == b.borderBottomColor() .resolve(b.color()) 73 return a.borderBottomColor().resolve(a.color()) == b.borderBottomColor() .resolve(b.color());
75 && a.visitedLinkBorderBottomColor().resolve(a.color()) == b.visitedL inkBorderBottomColor().resolve(b.color());
76 case CSSPropertyBorderBottomLeftRadius: 74 case CSSPropertyBorderBottomLeftRadius:
77 return a.borderBottomLeftRadius() == b.borderBottomLeftRadius(); 75 return a.borderBottomLeftRadius() == b.borderBottomLeftRadius();
78 case CSSPropertyBorderBottomRightRadius: 76 case CSSPropertyBorderBottomRightRadius:
79 return a.borderBottomRightRadius() == b.borderBottomRightRadius(); 77 return a.borderBottomRightRadius() == b.borderBottomRightRadius();
80 case CSSPropertyBorderBottomWidth: 78 case CSSPropertyBorderBottomWidth:
81 return a.borderBottomWidth() == b.borderBottomWidth(); 79 return a.borderBottomWidth() == b.borderBottomWidth();
82 case CSSPropertyBorderImageOutset: 80 case CSSPropertyBorderImageOutset:
83 return a.borderImageOutset() == b.borderImageOutset(); 81 return a.borderImageOutset() == b.borderImageOutset();
84 case CSSPropertyBorderImageSlice: 82 case CSSPropertyBorderImageSlice:
85 return a.borderImageSlices() == b.borderImageSlices(); 83 return a.borderImageSlices() == b.borderImageSlices();
86 case CSSPropertyBorderImageSource: 84 case CSSPropertyBorderImageSource:
87 return dataEquivalent(a.borderImageSource(), b.borderImageSource()); 85 return dataEquivalent(a.borderImageSource(), b.borderImageSource());
88 case CSSPropertyBorderImageWidth: 86 case CSSPropertyBorderImageWidth:
89 return a.borderImageWidth() == b.borderImageWidth(); 87 return a.borderImageWidth() == b.borderImageWidth();
90 case CSSPropertyBorderLeftColor: 88 case CSSPropertyBorderLeftColor:
91 return a.borderLeftColor().resolve(a.color()) == b.borderLeftColor().res olve(b.color()) 89 return a.borderLeftColor().resolve(a.color()) == b.borderLeftColor().res olve(b.color());
92 && a.visitedLinkBorderLeftColor().resolve(a.color()) == b.visitedLin kBorderLeftColor().resolve(b.color());
93 case CSSPropertyBorderLeftWidth: 90 case CSSPropertyBorderLeftWidth:
94 return a.borderLeftWidth() == b.borderLeftWidth(); 91 return a.borderLeftWidth() == b.borderLeftWidth();
95 case CSSPropertyBorderRightColor: 92 case CSSPropertyBorderRightColor:
96 return a.borderRightColor().resolve(a.color()) == b.borderRightColor().r esolve(b.color()) 93 return a.borderRightColor().resolve(a.color()) == b.borderRightColor().r esolve(b.color());
97 && a.visitedLinkBorderRightColor().resolve(a.color()) == b.visitedLi nkBorderRightColor().resolve(b.color());
98 case CSSPropertyBorderRightWidth: 94 case CSSPropertyBorderRightWidth:
99 return a.borderRightWidth() == b.borderRightWidth(); 95 return a.borderRightWidth() == b.borderRightWidth();
100 case CSSPropertyBorderTopColor: 96 case CSSPropertyBorderTopColor:
101 return a.borderTopColor().resolve(a.color()) == b.borderTopColor().resol ve(b.color()) 97 return a.borderTopColor().resolve(a.color()) == b.borderTopColor().resol ve(b.color());
102 && a.visitedLinkBorderTopColor().resolve(a.color()) == b.visitedLink BorderTopColor().resolve(b.color());
103 case CSSPropertyBorderTopLeftRadius: 98 case CSSPropertyBorderTopLeftRadius:
104 return a.borderTopLeftRadius() == b.borderTopLeftRadius(); 99 return a.borderTopLeftRadius() == b.borderTopLeftRadius();
105 case CSSPropertyBorderTopRightRadius: 100 case CSSPropertyBorderTopRightRadius:
106 return a.borderTopRightRadius() == b.borderTopRightRadius(); 101 return a.borderTopRightRadius() == b.borderTopRightRadius();
107 case CSSPropertyBorderTopWidth: 102 case CSSPropertyBorderTopWidth:
108 return a.borderTopWidth() == b.borderTopWidth(); 103 return a.borderTopWidth() == b.borderTopWidth();
109 case CSSPropertyBottom: 104 case CSSPropertyBottom:
110 return a.bottom() == b.bottom(); 105 return a.bottom() == b.bottom();
111 case CSSPropertyBoxShadow: 106 case CSSPropertyBoxShadow:
112 return dataEquivalent(a.boxShadow(), b.boxShadow()); 107 return dataEquivalent(a.boxShadow(), b.boxShadow());
113 case CSSPropertyClip: 108 case CSSPropertyClip:
114 return a.clip() == b.clip(); 109 return a.clip() == b.clip();
115 case CSSPropertyColor: 110 case CSSPropertyColor:
116 return a.color() == b.color() && a.visitedLinkColor() == b.visitedLinkCo lor(); 111 return a.color() == b.color();
117 case CSSPropertyFlexBasis: 112 case CSSPropertyFlexBasis:
118 return a.flexBasis() == b.flexBasis(); 113 return a.flexBasis() == b.flexBasis();
119 case CSSPropertyFlexGrow: 114 case CSSPropertyFlexGrow:
120 return a.flexGrow() == b.flexGrow(); 115 return a.flexGrow() == b.flexGrow();
121 case CSSPropertyFlexShrink: 116 case CSSPropertyFlexShrink:
122 return a.flexShrink() == b.flexShrink(); 117 return a.flexShrink() == b.flexShrink();
123 case CSSPropertyFontSize: 118 case CSSPropertyFontSize:
124 // CSSPropertyFontSize: Must pass a specified size to setFontSize if Tex t Autosizing is enabled, but a computed size 119 // CSSPropertyFontSize: Must pass a specified size to setFontSize if Tex t Autosizing is enabled, but a computed size
125 // if text zoom is enabled (if neither is enabled it's irrelevant as the y're probably the same). 120 // if text zoom is enabled (if neither is enabled it's irrelevant as the y're probably the same).
126 // FIXME: Should we introduce an option to pass the computed font size h ere, allowing consumers to 121 // FIXME: Should we introduce an option to pass the computed font size h ere, allowing consumers to
(...skipping 29 matching lines...) Expand all
156 return a.minHeight() == b.minHeight(); 151 return a.minHeight() == b.minHeight();
157 case CSSPropertyMinWidth: 152 case CSSPropertyMinWidth:
158 return a.minWidth() == b.minWidth(); 153 return a.minWidth() == b.minWidth();
159 case CSSPropertyObjectPosition: 154 case CSSPropertyObjectPosition:
160 return a.objectPosition() == b.objectPosition(); 155 return a.objectPosition() == b.objectPosition();
161 case CSSPropertyOpacity: 156 case CSSPropertyOpacity:
162 return a.opacity() == b.opacity(); 157 return a.opacity() == b.opacity();
163 case CSSPropertyOrphans: 158 case CSSPropertyOrphans:
164 return a.orphans() == b.orphans(); 159 return a.orphans() == b.orphans();
165 case CSSPropertyOutlineColor: 160 case CSSPropertyOutlineColor:
166 return a.outlineColor().resolve(a.color()) == b.outlineColor().resolve(b .color()) 161 return a.outlineColor().resolve(a.color()) == b.outlineColor().resolve(b .color());
167 && a.visitedLinkOutlineColor().resolve(a.color()) == b.visitedLinkOu tlineColor().resolve(b.color());
168 case CSSPropertyOutlineOffset: 162 case CSSPropertyOutlineOffset:
169 return a.outlineOffset() == b.outlineOffset(); 163 return a.outlineOffset() == b.outlineOffset();
170 case CSSPropertyOutlineWidth: 164 case CSSPropertyOutlineWidth:
171 return a.outlineWidth() == b.outlineWidth(); 165 return a.outlineWidth() == b.outlineWidth();
172 case CSSPropertyPaddingBottom: 166 case CSSPropertyPaddingBottom:
173 return a.paddingBottom() == b.paddingBottom(); 167 return a.paddingBottom() == b.paddingBottom();
174 case CSSPropertyPaddingLeft: 168 case CSSPropertyPaddingLeft:
175 return a.paddingLeft() == b.paddingLeft(); 169 return a.paddingLeft() == b.paddingLeft();
176 case CSSPropertyPaddingRight: 170 case CSSPropertyPaddingRight:
177 return a.paddingRight() == b.paddingRight(); 171 return a.paddingRight() == b.paddingRight();
178 case CSSPropertyPaddingTop: 172 case CSSPropertyPaddingTop:
179 return a.paddingTop() == b.paddingTop(); 173 return a.paddingTop() == b.paddingTop();
180 case CSSPropertyRight: 174 case CSSPropertyRight:
181 return a.right() == b.right(); 175 return a.right() == b.right();
182 case CSSPropertyShapeImageThreshold: 176 case CSSPropertyShapeImageThreshold:
183 return a.shapeImageThreshold() == b.shapeImageThreshold(); 177 return a.shapeImageThreshold() == b.shapeImageThreshold();
184 case CSSPropertyShapeMargin: 178 case CSSPropertyShapeMargin:
185 return a.shapeMargin() == b.shapeMargin(); 179 return a.shapeMargin() == b.shapeMargin();
186 case CSSPropertyShapeOutside: 180 case CSSPropertyShapeOutside:
187 return dataEquivalent(a.shapeOutside(), b.shapeOutside()); 181 return dataEquivalent(a.shapeOutside(), b.shapeOutside());
188 case CSSPropertyTextDecorationColor: 182 case CSSPropertyTextDecorationColor:
189 return a.textDecorationColor().resolve(a.color()) == b.textDecorationCol or().resolve(b.color()) 183 return a.textDecorationColor().resolve(a.color()) == b.textDecorationCol or().resolve(b.color());
190 && a.visitedLinkTextDecorationColor().resolve(a.color()) == b.visite dLinkTextDecorationColor().resolve(b.color());
191 case CSSPropertyTextIndent: 184 case CSSPropertyTextIndent:
192 return a.textIndent() == b.textIndent(); 185 return a.textIndent() == b.textIndent();
193 case CSSPropertyTextShadow: 186 case CSSPropertyTextShadow:
194 return dataEquivalent(a.textShadow(), b.textShadow()); 187 return dataEquivalent(a.textShadow(), b.textShadow());
195 case CSSPropertyTop: 188 case CSSPropertyTop:
196 return a.top() == b.top(); 189 return a.top() == b.top();
197 case CSSPropertyVerticalAlign: 190 case CSSPropertyVerticalAlign:
198 return a.verticalAlign() == b.verticalAlign() 191 return a.verticalAlign() == b.verticalAlign()
199 && (a.verticalAlign() != LENGTH || a.verticalAlignLength() == b.vert icalAlignLength()); 192 && (a.verticalAlign() != LENGTH || a.verticalAlignLength() == b.vert icalAlignLength());
200 case CSSPropertyWebkitBackgroundSize: 193 case CSSPropertyWebkitBackgroundSize:
(...skipping 22 matching lines...) Expand all
223 return fillLayersEqual<CSSPropertyWebkitMaskPositionX>(a.maskLayers(), b .maskLayers()); 216 return fillLayersEqual<CSSPropertyWebkitMaskPositionX>(a.maskLayers(), b .maskLayers());
224 case CSSPropertyWebkitMaskPositionY: 217 case CSSPropertyWebkitMaskPositionY:
225 return fillLayersEqual<CSSPropertyWebkitMaskPositionY>(a.maskLayers(), b .maskLayers()); 218 return fillLayersEqual<CSSPropertyWebkitMaskPositionY>(a.maskLayers(), b .maskLayers());
226 case CSSPropertyWebkitMaskSize: 219 case CSSPropertyWebkitMaskSize:
227 return fillLayersEqual<CSSPropertyWebkitMaskSize>(a.maskLayers(), b.mask Layers()); 220 return fillLayersEqual<CSSPropertyWebkitMaskSize>(a.maskLayers(), b.mask Layers());
228 case CSSPropertyPerspective: 221 case CSSPropertyPerspective:
229 return a.perspective() == b.perspective(); 222 return a.perspective() == b.perspective();
230 case CSSPropertyPerspectiveOrigin: 223 case CSSPropertyPerspectiveOrigin:
231 return a.perspectiveOriginX() == b.perspectiveOriginX() && a.perspective OriginY() == b.perspectiveOriginY(); 224 return a.perspectiveOriginX() == b.perspectiveOriginX() && a.perspective OriginY() == b.perspectiveOriginY();
232 case CSSPropertyWebkitTextStrokeColor: 225 case CSSPropertyWebkitTextStrokeColor:
233 return a.textStrokeColor().resolve(a.color()) == b.textStrokeColor().res olve(b.color()) 226 return a.textStrokeColor().resolve(a.color()) == b.textStrokeColor().res olve(b.color());
234 && a.visitedLinkTextStrokeColor().resolve(a.color()) == b.visitedLin kTextStrokeColor().resolve(b.color());
235 case CSSPropertyTransform: 227 case CSSPropertyTransform:
236 return a.transform() == b.transform(); 228 return a.transform() == b.transform();
237 case CSSPropertyTransformOrigin: 229 case CSSPropertyTransformOrigin:
238 return a.transformOriginX() == b.transformOriginX() && a.transformOrigin Y() == b.transformOriginY() && a.transformOriginZ() == b.transformOriginZ(); 230 return a.transformOriginX() == b.transformOriginX() && a.transformOrigin Y() == b.transformOriginY() && a.transformOriginZ() == b.transformOriginZ();
239 case CSSPropertyWidows: 231 case CSSPropertyWidows:
240 return a.widows() == b.widows(); 232 return a.widows() == b.widows();
241 case CSSPropertyWidth: 233 case CSSPropertyWidth:
242 return a.width() == b.width(); 234 return a.width() == b.width();
243 case CSSPropertyWordSpacing: 235 case CSSPropertyWordSpacing:
244 return a.wordSpacing() == b.wordSpacing(); 236 return a.wordSpacing() == b.wordSpacing();
245 case CSSPropertyZIndex: 237 case CSSPropertyZIndex:
246 return a.zIndex() == b.zIndex(); 238 return a.zIndex() == b.zIndex();
247 case CSSPropertyZoom: 239 case CSSPropertyZoom:
248 return a.zoom() == b.zoom(); 240 return a.zoom() == b.zoom();
249 default: 241 default:
250 ASSERT_NOT_REACHED(); 242 ASSERT_NOT_REACHED();
251 return true; 243 return true;
252 } 244 }
253 } 245 }
254 246
255 } 247 }
OLDNEW
« no previous file with comments | « sky/engine/core/animation/css/CSSAnimatableValueFactory.cpp ('k') | sky/engine/core/css/CSSComputedStyleDeclaration.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698