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

Side by Side Diff: sky/engine/core/css/resolver/AnimatedStyleBuilder.cpp

Issue 892903002: Remove -webkit-mask-*. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: fix goofups Created 5 years, 10 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 const Vector<RefPtr<AnimatableValue> >& values = toAnimatableRepeatable(valu e)->values(); 136 const Vector<RefPtr<AnimatableValue> >& values = toAnimatableRepeatable(valu e)->values();
137 ASSERT(!values.isEmpty()); 137 ASSERT(!values.isEmpty());
138 FillLayer* fillLayer = &fillLayers; 138 FillLayer* fillLayer = &fillLayers;
139 FillLayer* prev = 0; 139 FillLayer* prev = 0;
140 for (size_t i = 0; i < values.size(); ++i) { 140 for (size_t i = 0; i < values.size(); ++i) {
141 if (!fillLayer) 141 if (!fillLayer)
142 fillLayer = prev->ensureNext(); 142 fillLayer = prev->ensureNext();
143 const AnimatableValue* layerValue = values[i].get(); 143 const AnimatableValue* layerValue = values[i].get();
144 switch (property) { 144 switch (property) {
145 case CSSPropertyBackgroundImage: 145 case CSSPropertyBackgroundImage:
146 case CSSPropertyWebkitMaskImage:
147 if (layerValue->isImage()) { 146 if (layerValue->isImage()) {
148 fillLayer->setImage(state.styleImage(property, toAnimatableImage (layerValue)->toCSSValue())); 147 fillLayer->setImage(state.styleImage(property, toAnimatableImage (layerValue)->toCSSValue()));
149 } else { 148 } else {
150 ASSERT(toAnimatableUnknown(layerValue)->toCSSValueID() == CSSVal ueNone); 149 ASSERT(toAnimatableUnknown(layerValue)->toCSSValueID() == CSSVal ueNone);
151 fillLayer->setImage(nullptr); 150 fillLayer->setImage(nullptr);
152 } 151 }
153 break; 152 break;
154 case CSSPropertyBackgroundPositionX: 153 case CSSPropertyBackgroundPositionX:
155 case CSSPropertyWebkitMaskPositionX:
156 fillLayer->setXPosition(animatableValueToLength(layerValue, state)); 154 fillLayer->setXPosition(animatableValueToLength(layerValue, state));
157 break; 155 break;
158 case CSSPropertyBackgroundPositionY: 156 case CSSPropertyBackgroundPositionY:
159 case CSSPropertyWebkitMaskPositionY:
160 fillLayer->setYPosition(animatableValueToLength(layerValue, state)); 157 fillLayer->setYPosition(animatableValueToLength(layerValue, state));
161 break; 158 break;
162 case CSSPropertyBackgroundSize: 159 case CSSPropertyBackgroundSize:
163 case CSSPropertyWebkitBackgroundSize: 160 case CSSPropertyWebkitBackgroundSize:
164 case CSSPropertyWebkitMaskSize:
165 setFillSize(fillLayer, layerValue, state); 161 setFillSize(fillLayer, layerValue, state);
166 break; 162 break;
167 default: 163 default:
168 ASSERT_NOT_REACHED(); 164 ASSERT_NOT_REACHED();
169 } 165 }
170 prev = fillLayer; 166 prev = fillLayer;
171 fillLayer = fillLayer->next(); 167 fillLayer = fillLayer->next();
172 } 168 }
173 while (fillLayer) { 169 while (fillLayer) {
174 switch (property) { 170 switch (property) {
175 case CSSPropertyBackgroundImage: 171 case CSSPropertyBackgroundImage:
176 case CSSPropertyWebkitMaskImage:
177 fillLayer->clearImage(); 172 fillLayer->clearImage();
178 break; 173 break;
179 case CSSPropertyBackgroundPositionX: 174 case CSSPropertyBackgroundPositionX:
180 case CSSPropertyWebkitMaskPositionX:
181 fillLayer->clearXPosition(); 175 fillLayer->clearXPosition();
182 break; 176 break;
183 case CSSPropertyBackgroundPositionY: 177 case CSSPropertyBackgroundPositionY:
184 case CSSPropertyWebkitMaskPositionY:
185 fillLayer->clearYPosition(); 178 fillLayer->clearYPosition();
186 break; 179 break;
187 case CSSPropertyBackgroundSize: 180 case CSSPropertyBackgroundSize:
188 case CSSPropertyWebkitBackgroundSize: 181 case CSSPropertyWebkitBackgroundSize:
189 case CSSPropertyWebkitMaskSize:
190 fillLayer->clearSize(); 182 fillLayer->clearSize();
191 break; 183 break;
192 default: 184 default:
193 ASSERT_NOT_REACHED(); 185 ASSERT_NOT_REACHED();
194 } 186 }
195 fillLayer = fillLayer->next(); 187 fillLayer = fillLayer->next();
196 } 188 }
197 } 189 }
198 190
199 FontStretch animatableValueToFontStretch(const AnimatableValue* value) 191 FontStretch animatableValueToFontStretch(const AnimatableValue* value)
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 return; 431 return;
440 case CSSPropertyWebkitBorderVerticalSpacing: 432 case CSSPropertyWebkitBorderVerticalSpacing:
441 style->setVerticalBorderSpacing(animatableValueRoundClampTo<unsigned sho rt>(value)); 433 style->setVerticalBorderSpacing(animatableValueRoundClampTo<unsigned sho rt>(value));
442 return; 434 return;
443 case CSSPropertyWebkitClipPath: 435 case CSSPropertyWebkitClipPath:
444 style->setClipPath(toAnimatableClipPathOperation(value)->clipPathOperati on()); 436 style->setClipPath(toAnimatableClipPathOperation(value)->clipPathOperati on());
445 return; 437 return;
446 case CSSPropertyFilter: 438 case CSSPropertyFilter:
447 style->setFilter(toAnimatableFilterOperations(value)->operations()); 439 style->setFilter(toAnimatableFilterOperations(value)->operations());
448 return; 440 return;
449 case CSSPropertyWebkitMaskBoxImageOutset:
450 style->setMaskBoxImageOutset(animatableValueToBorderImageLengthBox(value , state));
451 return;
452 case CSSPropertyWebkitMaskBoxImageSlice:
453 style->setMaskBoxImageSlices(animatableValueToLengthBox(toAnimatableLeng thBoxAndBool(value)->box(), state, ValueRangeNonNegative));
454 style->setMaskBoxImageSlicesFill(toAnimatableLengthBoxAndBool(value)->fl ag());
455 return;
456 case CSSPropertyWebkitMaskBoxImageSource:
457 style->setMaskBoxImageSource(state.styleImage(property, toAnimatableImag e(value)->toCSSValue()));
458 return;
459 case CSSPropertyWebkitMaskBoxImageWidth:
460 style->setMaskBoxImageWidth(animatableValueToBorderImageLengthBox(value, state));
461 return;
462 case CSSPropertyWebkitMaskImage:
463 setOnFillLayers<CSSPropertyWebkitMaskImage>(style->accessMaskLayers(), v alue, state);
464 return;
465 case CSSPropertyWebkitMaskPositionX:
466 setOnFillLayers<CSSPropertyWebkitMaskPositionX>(style->accessMaskLayers( ), value, state);
467 return;
468 case CSSPropertyWebkitMaskPositionY:
469 setOnFillLayers<CSSPropertyWebkitMaskPositionY>(style->accessMaskLayers( ), value, state);
470 return;
471 case CSSPropertyWebkitMaskSize:
472 setOnFillLayers<CSSPropertyWebkitMaskSize>(style->accessMaskLayers(), va lue, state);
473 return;
474 case CSSPropertyPerspective: 441 case CSSPropertyPerspective:
475 style->setPerspective(clampTo<float>(toAnimatableDouble(value)->toDouble ())); 442 style->setPerspective(clampTo<float>(toAnimatableDouble(value)->toDouble ()));
476 return; 443 return;
477 case CSSPropertyPerspectiveOrigin: { 444 case CSSPropertyPerspectiveOrigin: {
478 const AnimatableLengthPoint* animatableLengthPoint = toAnimatableLengthP oint(value); 445 const AnimatableLengthPoint* animatableLengthPoint = toAnimatableLengthP oint(value);
479 style->setPerspectiveOriginX(animatableValueToLength(animatableLengthPoi nt->x(), state)); 446 style->setPerspectiveOriginX(animatableValueToLength(animatableLengthPoi nt->x(), state));
480 style->setPerspectiveOriginY(animatableValueToLength(animatableLengthPoi nt->y(), state)); 447 style->setPerspectiveOriginY(animatableValueToLength(animatableLengthPoi nt->y(), state));
481 return; 448 return;
482 } 449 }
483 case CSSPropertyWebkitTextStrokeColor: 450 case CSSPropertyWebkitTextStrokeColor:
(...skipping 26 matching lines...) Expand all
510 return; 477 return;
511 case CSSPropertyZIndex: 478 case CSSPropertyZIndex:
512 style->setZIndex(animatableValueRoundClampTo<unsigned>(value)); 479 style->setZIndex(animatableValueRoundClampTo<unsigned>(value));
513 return; 480 return;
514 default: 481 default:
515 ASSERT_NOT_REACHED(); 482 ASSERT_NOT_REACHED();
516 } 483 }
517 } 484 }
518 485
519 } // namespace blink 486 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/css/parser/CSSPropertyParser.cpp ('k') | sky/engine/core/css/resolver/CSSToStyleMap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698