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

Side by Side Diff: sky/engine/core/animation/css/CSSAnimatableValueFactory.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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 119
120 inline static PassRefPtr<AnimatableValue> createFromBorderImageLengthBox(const B orderImageLengthBox& borderImageLengthBox, const RenderStyle& style) 120 inline static PassRefPtr<AnimatableValue> createFromBorderImageLengthBox(const B orderImageLengthBox& borderImageLengthBox, const RenderStyle& style)
121 { 121 {
122 return AnimatableLengthBox::create( 122 return AnimatableLengthBox::create(
123 createFromBorderImageLength(borderImageLengthBox.left(), style), 123 createFromBorderImageLength(borderImageLengthBox.left(), style),
124 createFromBorderImageLength(borderImageLengthBox.right(), style), 124 createFromBorderImageLength(borderImageLengthBox.right(), style),
125 createFromBorderImageLength(borderImageLengthBox.top(), style), 125 createFromBorderImageLength(borderImageLengthBox.top(), style),
126 createFromBorderImageLength(borderImageLengthBox.bottom(), style)); 126 createFromBorderImageLength(borderImageLengthBox.bottom(), style));
127 } 127 }
128 128
129 inline static PassRefPtr<AnimatableValue> createFromLengthBoxAndBool(const Lengt hBox lengthBox, const bool flag, const RenderStyle& style)
130 {
131 return AnimatableLengthBoxAndBool::create(
132 createFromLengthBox(lengthBox, style),
133 flag);
134 }
135
136 inline static PassRefPtr<AnimatableValue> createFromLengthPoint(const LengthPoin t& lengthPoint, const RenderStyle& style) 129 inline static PassRefPtr<AnimatableValue> createFromLengthPoint(const LengthPoin t& lengthPoint, const RenderStyle& style)
137 { 130 {
138 return AnimatableLengthPoint::create( 131 return AnimatableLengthPoint::create(
139 createFromLength(lengthPoint.x(), style), 132 createFromLength(lengthPoint.x(), style),
140 createFromLength(lengthPoint.y(), style)); 133 createFromLength(lengthPoint.y(), style));
141 } 134 }
142 135
143 inline static PassRefPtr<AnimatableValue> createFromLengthSize(const LengthSize& lengthSize, const RenderStyle& style) 136 inline static PassRefPtr<AnimatableValue> createFromLengthSize(const LengthSize& lengthSize, const RenderStyle& style)
144 { 137 {
145 return AnimatableLengthSize::create( 138 return AnimatableLengthSize::create(
(...skipping 30 matching lines...) Expand all
176 if (!originIsSet || origin == LeftEdge || origin == TopEdge) 169 if (!originIsSet || origin == LeftEdge || origin == TopEdge)
177 return createFromLength(length, style); 170 return createFromLength(length, style);
178 return createFromLength(length.subtractFromOneHundredPercent(), style); 171 return createFromLength(length.subtractFromOneHundredPercent(), style);
179 } 172 }
180 173
181 template<CSSPropertyID property> 174 template<CSSPropertyID property>
182 inline static PassRefPtr<AnimatableValue> createFromFillLayers(const FillLayer& fillLayers, const RenderStyle& style) 175 inline static PassRefPtr<AnimatableValue> createFromFillLayers(const FillLayer& fillLayers, const RenderStyle& style)
183 { 176 {
184 Vector<RefPtr<AnimatableValue> > values; 177 Vector<RefPtr<AnimatableValue> > values;
185 for (const FillLayer* fillLayer = &fillLayers; fillLayer; fillLayer = fillLa yer->next()) { 178 for (const FillLayer* fillLayer = &fillLayers; fillLayer; fillLayer = fillLa yer->next()) {
186 if (property == CSSPropertyBackgroundImage || property == CSSPropertyWeb kitMaskImage) { 179 if (property == CSSPropertyBackgroundImage) {
187 if (!fillLayer->isImageSet()) 180 if (!fillLayer->isImageSet())
188 break; 181 break;
189 values.append(createFromStyleImage(fillLayer->image())); 182 values.append(createFromStyleImage(fillLayer->image()));
190 } else if (property == CSSPropertyBackgroundPositionX || property == CSS PropertyWebkitMaskPositionX) { 183 } else if (property == CSSPropertyBackgroundPositionX) {
191 if (!fillLayer->isXPositionSet()) 184 if (!fillLayer->isXPositionSet())
192 break; 185 break;
193 values.append(createFromBackgroundPosition(fillLayer->xPosition(), f illLayer->isBackgroundXOriginSet(), fillLayer->backgroundXOrigin(), style)); 186 values.append(createFromBackgroundPosition(fillLayer->xPosition(), f illLayer->isBackgroundXOriginSet(), fillLayer->backgroundXOrigin(), style));
194 } else if (property == CSSPropertyBackgroundPositionY || property == CSS PropertyWebkitMaskPositionY) { 187 } else if (property == CSSPropertyBackgroundPositionY) {
195 if (!fillLayer->isYPositionSet()) 188 if (!fillLayer->isYPositionSet())
196 break; 189 break;
197 values.append(createFromBackgroundPosition(fillLayer->yPosition(), f illLayer->isBackgroundYOriginSet(), fillLayer->backgroundYOrigin(), style)); 190 values.append(createFromBackgroundPosition(fillLayer->yPosition(), f illLayer->isBackgroundYOriginSet(), fillLayer->backgroundYOrigin(), style));
198 } else if (property == CSSPropertyBackgroundSize || property == CSSPrope rtyWebkitMaskSize) { 191 } else if (property == CSSPropertyBackgroundSize) {
199 if (!fillLayer->isSizeSet()) 192 if (!fillLayer->isSizeSet())
200 break; 193 break;
201 values.append(createFromFillSize(fillLayer->size(), style)); 194 values.append(createFromFillSize(fillLayer->size(), style));
202 } else { 195 } else {
203 ASSERT_NOT_REACHED(); 196 ASSERT_NOT_REACHED();
204 } 197 }
205 } 198 }
206 return AnimatableRepeatable::create(values); 199 return AnimatableRepeatable::create(values);
207 } 200 }
208 201
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 case CSSPropertyTop: 381 case CSSPropertyTop:
389 return createFromLength(style.top(), style); 382 return createFromLength(style.top(), style);
390 case CSSPropertyWebkitBorderHorizontalSpacing: 383 case CSSPropertyWebkitBorderHorizontalSpacing:
391 return createFromDouble(style.horizontalBorderSpacing()); 384 return createFromDouble(style.horizontalBorderSpacing());
392 case CSSPropertyWebkitBorderVerticalSpacing: 385 case CSSPropertyWebkitBorderVerticalSpacing:
393 return createFromDouble(style.verticalBorderSpacing()); 386 return createFromDouble(style.verticalBorderSpacing());
394 case CSSPropertyWebkitClipPath: 387 case CSSPropertyWebkitClipPath:
395 if (ClipPathOperation* operation = style.clipPath()) 388 if (ClipPathOperation* operation = style.clipPath())
396 return AnimatableClipPathOperation::create(operation); 389 return AnimatableClipPathOperation::create(operation);
397 return AnimatableUnknown::create(CSSValueNone); 390 return AnimatableUnknown::create(CSSValueNone);
398 case CSSPropertyWebkitMaskBoxImageOutset:
399 return createFromBorderImageLengthBox(style.maskBoxImageOutset(), style) ;
400 case CSSPropertyWebkitMaskBoxImageSlice:
401 return createFromLengthBoxAndBool(style.maskBoxImageSlices(), style.mask BoxImageSlicesFill(), style);
402 case CSSPropertyWebkitMaskBoxImageSource:
403 return createFromStyleImage(style.maskBoxImageSource());
404 case CSSPropertyWebkitMaskBoxImageWidth:
405 return createFromBorderImageLengthBox(style.maskBoxImageWidth(), style);
406 case CSSPropertyWebkitMaskImage:
407 return createFromFillLayers<CSSPropertyWebkitMaskImage>(style.maskLayers (), style);
408 case CSSPropertyWebkitMaskPositionX:
409 return createFromFillLayers<CSSPropertyWebkitMaskPositionX>(style.maskLa yers(), style);
410 case CSSPropertyWebkitMaskPositionY:
411 return createFromFillLayers<CSSPropertyWebkitMaskPositionY>(style.maskLa yers(), style);
412 case CSSPropertyWebkitMaskSize:
413 return createFromFillLayers<CSSPropertyWebkitMaskSize>(style.maskLayers( ), style);
414 case CSSPropertyPerspective: 391 case CSSPropertyPerspective:
415 return createFromDouble(style.perspective()); 392 return createFromDouble(style.perspective());
416 case CSSPropertyPerspectiveOrigin: 393 case CSSPropertyPerspectiveOrigin:
417 return AnimatableLengthPoint::create( 394 return AnimatableLengthPoint::create(
418 createFromLength(style.perspectiveOriginX(), style), 395 createFromLength(style.perspectiveOriginX(), style),
419 createFromLength(style.perspectiveOriginY(), style)); 396 createFromLength(style.perspectiveOriginY(), style));
420 case CSSPropertyWebkitTextStrokeColor: 397 case CSSPropertyWebkitTextStrokeColor:
421 return createFromColor(property, style); 398 return createFromColor(property, style);
422 case CSSPropertyTransform: 399 case CSSPropertyTransform:
423 return AnimatableTransform::create(style.transform()); 400 return AnimatableTransform::create(style.transform());
(...skipping 15 matching lines...) Expand all
439 case CSSPropertyZIndex: 416 case CSSPropertyZIndex:
440 return createFromDouble(style.zIndex()); 417 return createFromDouble(style.zIndex());
441 default: 418 default:
442 ASSERT_NOT_REACHED(); 419 ASSERT_NOT_REACHED();
443 // This return value is to avoid a release crash if possible. 420 // This return value is to avoid a release crash if possible.
444 return AnimatableUnknown::create(nullptr); 421 return AnimatableUnknown::create(nullptr);
445 } 422 }
446 } 423 }
447 424
448 } // namespace blink 425 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698