OLD | NEW |
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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 flag); | 138 flag); |
139 } | 139 } |
140 | 140 |
141 inline static PassRefPtrWillBeRawPtr<AnimatableValue> createFromLengthPoint(cons
t LengthPoint& lengthPoint, const RenderStyle& style) | 141 inline static PassRefPtrWillBeRawPtr<AnimatableValue> createFromLengthPoint(cons
t LengthPoint& lengthPoint, const RenderStyle& style) |
142 { | 142 { |
143 return AnimatableLengthPoint::create( | 143 return AnimatableLengthPoint::create( |
144 createFromLength(lengthPoint.x(), style), | 144 createFromLength(lengthPoint.x(), style), |
145 createFromLength(lengthPoint.y(), style)); | 145 createFromLength(lengthPoint.y(), style)); |
146 } | 146 } |
147 | 147 |
| 148 inline static PassRefPtrWillBeRawPtr<AnimatableValue> createFromTransformOrigin(
const TransformOrigin& transformOrigin, const RenderStyle& style) |
| 149 { |
| 150 return AnimatableLengthPoint3D::create( |
| 151 createFromLength(transformOrigin.x(), style), |
| 152 createFromLength(transformOrigin.y(), style), |
| 153 createFromDouble(transformOrigin.z())); |
| 154 } |
| 155 |
148 inline static PassRefPtrWillBeRawPtr<AnimatableValue> createFromLengthSize(const
LengthSize& lengthSize, const RenderStyle& style) | 156 inline static PassRefPtrWillBeRawPtr<AnimatableValue> createFromLengthSize(const
LengthSize& lengthSize, const RenderStyle& style) |
149 { | 157 { |
150 return AnimatableLengthSize::create( | 158 return AnimatableLengthSize::create( |
151 createFromLength(lengthSize.width(), style), | 159 createFromLength(lengthSize.width(), style), |
152 createFromLength(lengthSize.height(), style)); | 160 createFromLength(lengthSize.height(), style)); |
153 } | 161 } |
154 | 162 |
155 inline static PassRefPtrWillBeRawPtr<AnimatableValue> createFromStyleImage(Style
Image* image) | 163 inline static PassRefPtrWillBeRawPtr<AnimatableValue> createFromStyleImage(Style
Image* image) |
156 { | 164 { |
157 if (image) { | 165 if (image) { |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 return createFromShapeValue(style.shapeOutside()); | 484 return createFromShapeValue(style.shapeOutside()); |
477 case CSSPropertyShapeMargin: | 485 case CSSPropertyShapeMargin: |
478 return createFromLength(style.shapeMargin(), style); | 486 return createFromLength(style.shapeMargin(), style); |
479 case CSSPropertyShapeImageThreshold: | 487 case CSSPropertyShapeImageThreshold: |
480 return createFromDouble(style.shapeImageThreshold()); | 488 return createFromDouble(style.shapeImageThreshold()); |
481 case CSSPropertyWebkitTextStrokeColor: | 489 case CSSPropertyWebkitTextStrokeColor: |
482 return createFromColor(property, style); | 490 return createFromColor(property, style); |
483 case CSSPropertyTransform: | 491 case CSSPropertyTransform: |
484 return AnimatableTransform::create(style.transform()); | 492 return AnimatableTransform::create(style.transform()); |
485 case CSSPropertyTransformOrigin: | 493 case CSSPropertyTransformOrigin: |
486 return AnimatableLengthPoint3D::create( | 494 return createFromTransformOrigin(style.transformOrigin(), style); |
487 createFromLength(style.transformOriginX(), style), | |
488 createFromLength(style.transformOriginY(), style), | |
489 createFromDouble(style.transformOriginZ())); | |
490 case CSSPropertyWidows: | 495 case CSSPropertyWidows: |
491 return createFromDouble(style.widows()); | 496 return createFromDouble(style.widows()); |
492 case CSSPropertyWidth: | 497 case CSSPropertyWidth: |
493 return createFromLength(style.width(), style); | 498 return createFromLength(style.width(), style); |
494 case CSSPropertyWordSpacing: | 499 case CSSPropertyWordSpacing: |
495 return createFromDouble(style.wordSpacing()); | 500 return createFromDouble(style.wordSpacing()); |
496 case CSSPropertyVerticalAlign: | 501 case CSSPropertyVerticalAlign: |
497 if (style.verticalAlign() == LENGTH) | 502 if (style.verticalAlign() == LENGTH) |
498 return createFromLength(style.verticalAlignLength(), style); | 503 return createFromLength(style.verticalAlignLength(), style); |
499 return AnimatableUnknown::create(CSSPrimitiveValue::create(style.vertica
lAlign())); | 504 return AnimatableUnknown::create(CSSPrimitiveValue::create(style.vertica
lAlign())); |
500 case CSSPropertyVisibility: | 505 case CSSPropertyVisibility: |
501 return AnimatableVisibility::create(style.visibility()); | 506 return AnimatableVisibility::create(style.visibility()); |
502 case CSSPropertyZIndex: | 507 case CSSPropertyZIndex: |
503 return createFromDouble(style.zIndex()); | 508 return createFromDouble(style.zIndex()); |
504 case CSSPropertyZoom: | 509 case CSSPropertyZoom: |
505 return createFromDouble(style.zoom()); | 510 return createFromDouble(style.zoom()); |
506 default: | 511 default: |
507 ASSERT_NOT_REACHED(); | 512 ASSERT_NOT_REACHED(); |
508 // This return value is to avoid a release crash if possible. | 513 // This return value is to avoid a release crash if possible. |
509 return AnimatableUnknown::create(nullptr); | 514 return AnimatableUnknown::create(nullptr); |
510 } | 515 } |
511 } | 516 } |
512 | 517 |
513 } // namespace blink | 518 } // namespace blink |
OLD | NEW |