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

Side by Side Diff: Source/core/animation/css/CSSAnimatableValueFactory.cpp

Issue 55813002: Convert animation and renderer code to know about BorderImageLength (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@length-relative-die-step-1-4
Patch Set: Rebased to latest master Created 7 years, 1 month 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 | Source/core/css/resolver/AnimatedStyleBuilder.cpp » ('j') | 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) 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 121
122 inline static PassRefPtr<AnimatableValue> createFromLengthBox(const LengthBox& l engthBox, const RenderStyle& style) 122 inline static PassRefPtr<AnimatableValue> createFromLengthBox(const LengthBox& l engthBox, const RenderStyle& style)
123 { 123 {
124 return AnimatableLengthBox::create( 124 return AnimatableLengthBox::create(
125 createFromLength(lengthBox.left(), style), 125 createFromLength(lengthBox.left(), style),
126 createFromLength(lengthBox.right(), style), 126 createFromLength(lengthBox.right(), style),
127 createFromLength(lengthBox.top(), style), 127 createFromLength(lengthBox.top(), style),
128 createFromLength(lengthBox.bottom(), style)); 128 createFromLength(lengthBox.bottom(), style));
129 } 129 }
130 130
131 static PassRefPtr<AnimatableValue> createFromBorderImageLength(const BorderImage Length& borderImageLength, const RenderStyle& style)
132 {
133 if (borderImageLength.isNumber())
134 return createFromDouble(borderImageLength.number());
135 return createFromLength(borderImageLength.length(), style);
136 }
137
138 inline static PassRefPtr<AnimatableValue> createFromBorderImageLengthBox(const B orderImageLengthBox& borderImageLengthBox, const RenderStyle& style)
139 {
140 return AnimatableLengthBox::create(
141 createFromBorderImageLength(borderImageLengthBox.left(), style),
142 createFromBorderImageLength(borderImageLengthBox.right(), style),
143 createFromBorderImageLength(borderImageLengthBox.top(), style),
144 createFromBorderImageLength(borderImageLengthBox.bottom(), style));
145 }
146
131 inline static PassRefPtr<AnimatableValue> createFromLengthBoxAndBool(const Lengt hBox lengthBox, const bool flag, const RenderStyle& style) 147 inline static PassRefPtr<AnimatableValue> createFromLengthBoxAndBool(const Lengt hBox lengthBox, const bool flag, const RenderStyle& style)
132 { 148 {
133 return AnimatableLengthBoxAndBool::create( 149 return AnimatableLengthBoxAndBool::create(
134 createFromLengthBox(lengthBox, style), 150 createFromLengthBox(lengthBox, style),
135 flag); 151 flag);
136 } 152 }
137 153
138 inline static PassRefPtr<AnimatableValue> createFromLengthPoint(const LengthPoin t& lengthPoint, const RenderStyle& style) 154 inline static PassRefPtr<AnimatableValue> createFromLengthPoint(const LengthPoin t& lengthPoint, const RenderStyle& style)
139 { 155 {
140 return AnimatableLengthPoint::create( 156 return AnimatableLengthPoint::create(
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 return AnimatableSVGLength::create(style.baselineShiftValue()); 255 return AnimatableSVGLength::create(style.baselineShiftValue());
240 case CSSPropertyBorderBottomColor: 256 case CSSPropertyBorderBottomColor:
241 return createFromColor(property, style); 257 return createFromColor(property, style);
242 case CSSPropertyBorderBottomLeftRadius: 258 case CSSPropertyBorderBottomLeftRadius:
243 return createFromLengthSize(style.borderBottomLeftRadius(), style); 259 return createFromLengthSize(style.borderBottomLeftRadius(), style);
244 case CSSPropertyBorderBottomRightRadius: 260 case CSSPropertyBorderBottomRightRadius:
245 return createFromLengthSize(style.borderBottomRightRadius(), style); 261 return createFromLengthSize(style.borderBottomRightRadius(), style);
246 case CSSPropertyBorderBottomWidth: 262 case CSSPropertyBorderBottomWidth:
247 return createFromDouble(style.borderBottomWidth()); 263 return createFromDouble(style.borderBottomWidth());
248 case CSSPropertyBorderImageOutset: 264 case CSSPropertyBorderImageOutset:
249 return createFromLengthBox(style.borderImageOutset(), style); 265 return createFromBorderImageLengthBox(style.borderImageOutset(), style);
250 case CSSPropertyBorderImageSlice: 266 case CSSPropertyBorderImageSlice:
251 return createFromLengthBox(style.borderImageSlices(), style); 267 return createFromLengthBox(style.borderImageSlices(), style);
252 case CSSPropertyBorderImageSource: 268 case CSSPropertyBorderImageSource:
253 return createFromStyleImage(style.borderImageSource()); 269 return createFromStyleImage(style.borderImageSource());
254 case CSSPropertyBorderImageWidth: 270 case CSSPropertyBorderImageWidth:
255 return createFromLengthBox(style.borderImageWidth(), style); 271 return createFromBorderImageLengthBox(style.borderImageWidth(), style);
256 case CSSPropertyBorderLeftColor: 272 case CSSPropertyBorderLeftColor:
257 return createFromColor(property, style); 273 return createFromColor(property, style);
258 case CSSPropertyBorderLeftWidth: 274 case CSSPropertyBorderLeftWidth:
259 return createFromDouble(style.borderLeftWidth()); 275 return createFromDouble(style.borderLeftWidth());
260 case CSSPropertyBorderRightColor: 276 case CSSPropertyBorderRightColor:
261 return createFromColor(property, style); 277 return createFromColor(property, style);
262 case CSSPropertyBorderRightWidth: 278 case CSSPropertyBorderRightWidth:
263 return createFromDouble(style.borderRightWidth()); 279 return createFromDouble(style.borderRightWidth());
264 case CSSPropertyBorderTopColor: 280 case CSSPropertyBorderTopColor:
265 return createFromColor(property, style); 281 return createFromColor(property, style);
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 return createFromDouble(style.columnGap()); 404 return createFromDouble(style.columnGap());
389 case CSSPropertyWebkitColumnRuleColor: 405 case CSSPropertyWebkitColumnRuleColor:
390 return createFromColor(property, style); 406 return createFromColor(property, style);
391 case CSSPropertyWebkitColumnRuleWidth: 407 case CSSPropertyWebkitColumnRuleWidth:
392 return createFromDouble(style.columnRuleWidth()); 408 return createFromDouble(style.columnRuleWidth());
393 case CSSPropertyWebkitColumnWidth: 409 case CSSPropertyWebkitColumnWidth:
394 return createFromDouble(style.columnWidth()); 410 return createFromDouble(style.columnWidth());
395 case CSSPropertyWebkitFilter: 411 case CSSPropertyWebkitFilter:
396 return AnimatableFilterOperations::create(style.filter()); 412 return AnimatableFilterOperations::create(style.filter());
397 case CSSPropertyWebkitMaskBoxImageOutset: 413 case CSSPropertyWebkitMaskBoxImageOutset:
398 return createFromLengthBox(style.maskBoxImageOutset(), style); 414 return createFromBorderImageLengthBox(style.maskBoxImageOutset(), style) ;
399 case CSSPropertyWebkitMaskBoxImageSlice: 415 case CSSPropertyWebkitMaskBoxImageSlice:
400 return createFromLengthBoxAndBool(style.maskBoxImageSlices(), style.mask BoxImageSlicesFill(), style); 416 return createFromLengthBoxAndBool(style.maskBoxImageSlices(), style.mask BoxImageSlicesFill(), style);
401 case CSSPropertyWebkitMaskBoxImageSource: 417 case CSSPropertyWebkitMaskBoxImageSource:
402 return createFromStyleImage(style.maskBoxImageSource()); 418 return createFromStyleImage(style.maskBoxImageSource());
403 case CSSPropertyWebkitMaskBoxImageWidth: 419 case CSSPropertyWebkitMaskBoxImageWidth:
404 return createFromLengthBox(style.maskBoxImageWidth(), style); 420 return createFromBorderImageLengthBox(style.maskBoxImageWidth(), style);
405 case CSSPropertyWebkitMaskImage: 421 case CSSPropertyWebkitMaskImage:
406 return createFromFillLayers<CSSPropertyWebkitMaskImage>(style.maskLayers (), style); 422 return createFromFillLayers<CSSPropertyWebkitMaskImage>(style.maskLayers (), style);
407 case CSSPropertyWebkitMaskPositionX: 423 case CSSPropertyWebkitMaskPositionX:
408 return createFromFillLayers<CSSPropertyWebkitMaskPositionX>(style.maskLa yers(), style); 424 return createFromFillLayers<CSSPropertyWebkitMaskPositionX>(style.maskLa yers(), style);
409 case CSSPropertyWebkitMaskPositionY: 425 case CSSPropertyWebkitMaskPositionY:
410 return createFromFillLayers<CSSPropertyWebkitMaskPositionY>(style.maskLa yers(), style); 426 return createFromFillLayers<CSSPropertyWebkitMaskPositionY>(style.maskLa yers(), style);
411 case CSSPropertyWebkitMaskSize: 427 case CSSPropertyWebkitMaskSize:
412 return createFromFillLayers<CSSPropertyWebkitMaskSize>(style.maskLayers( ), style); 428 return createFromFillLayers<CSSPropertyWebkitMaskSize>(style.maskLayers( ), style);
413 case CSSPropertyWebkitPerspective: 429 case CSSPropertyWebkitPerspective:
414 return createFromDouble(style.perspective()); 430 return createFromDouble(style.perspective());
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 return createFromDouble(style.zoom()); 462 return createFromDouble(style.zoom());
447 default: 463 default:
448 ASSERT_WITH_MESSAGE(!CSSAnimations::isAnimatableProperty(property), "Web Animations not yet implemented: Create AnimatableValue from render style: %s", getPropertyNameString(property).utf8().data()); 464 ASSERT_WITH_MESSAGE(!CSSAnimations::isAnimatableProperty(property), "Web Animations not yet implemented: Create AnimatableValue from render style: %s", getPropertyNameString(property).utf8().data());
449 ASSERT_NOT_REACHED(); 465 ASSERT_NOT_REACHED();
450 // This return value is to avoid a release crash if possible. 466 // This return value is to avoid a release crash if possible.
451 return AnimatableUnknown::create(0); 467 return AnimatableUnknown::create(0);
452 } 468 }
453 } 469 }
454 470
455 } // namespace WebCore 471 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/core/css/resolver/AnimatedStyleBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698