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 21 matching lines...) Expand all Loading... |
32 | 32 |
33 #include "core/CSSValueKeywords.h" | 33 #include "core/CSSValueKeywords.h" |
34 #include "core/animation/FontWeightConversion.h" | 34 #include "core/animation/FontWeightConversion.h" |
35 #include "core/animation/LengthPropertyFunctions.h" | 35 #include "core/animation/LengthPropertyFunctions.h" |
36 #include "core/animation/PropertyHandle.h" | 36 #include "core/animation/PropertyHandle.h" |
37 #include "core/animation/animatable/AnimatableClipPathOperation.h" | 37 #include "core/animation/animatable/AnimatableClipPathOperation.h" |
38 #include "core/animation/animatable/AnimatableColor.h" | 38 #include "core/animation/animatable/AnimatableColor.h" |
39 #include "core/animation/animatable/AnimatableDouble.h" | 39 #include "core/animation/animatable/AnimatableDouble.h" |
40 #include "core/animation/animatable/AnimatableDoubleAndBool.h" | 40 #include "core/animation/animatable/AnimatableDoubleAndBool.h" |
41 #include "core/animation/animatable/AnimatableFilterOperations.h" | 41 #include "core/animation/animatable/AnimatableFilterOperations.h" |
| 42 #include "core/animation/animatable/AnimatableFontVariationSettings.h" |
42 #include "core/animation/animatable/AnimatableImage.h" | 43 #include "core/animation/animatable/AnimatableImage.h" |
43 #include "core/animation/animatable/AnimatableLength.h" | 44 #include "core/animation/animatable/AnimatableLength.h" |
44 #include "core/animation/animatable/AnimatableLengthBox.h" | 45 #include "core/animation/animatable/AnimatableLengthBox.h" |
45 #include "core/animation/animatable/AnimatableLengthBoxAndBool.h" | 46 #include "core/animation/animatable/AnimatableLengthBoxAndBool.h" |
46 #include "core/animation/animatable/AnimatableLengthPoint.h" | 47 #include "core/animation/animatable/AnimatableLengthPoint.h" |
47 #include "core/animation/animatable/AnimatableLengthPoint3D.h" | 48 #include "core/animation/animatable/AnimatableLengthPoint3D.h" |
48 #include "core/animation/animatable/AnimatableLengthSize.h" | 49 #include "core/animation/animatable/AnimatableLengthSize.h" |
49 #include "core/animation/animatable/AnimatablePath.h" | 50 #include "core/animation/animatable/AnimatablePath.h" |
50 #include "core/animation/animatable/AnimatableRepeatable.h" | 51 #include "core/animation/animatable/AnimatableRepeatable.h" |
51 #include "core/animation/animatable/AnimatableSVGPaint.h" | 52 #include "core/animation/animatable/AnimatableSVGPaint.h" |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 | 294 |
294 static double FontStretchToDouble(FontStretch font_stretch) { | 295 static double FontStretchToDouble(FontStretch font_stretch) { |
295 return static_cast<unsigned>(font_stretch); | 296 return static_cast<unsigned>(font_stretch); |
296 } | 297 } |
297 | 298 |
298 static PassRefPtr<AnimatableValue> CreateFromFontStretch( | 299 static PassRefPtr<AnimatableValue> CreateFromFontStretch( |
299 FontStretch font_stretch) { | 300 FontStretch font_stretch) { |
300 return CreateFromDouble(FontStretchToDouble(font_stretch)); | 301 return CreateFromDouble(FontStretchToDouble(font_stretch)); |
301 } | 302 } |
302 | 303 |
| 304 static PassRefPtr<AnimatableValue> CreateFromFontVariationSettings( |
| 305 FontVariationSettings* settings) { |
| 306 return AnimatableFontVariationSettings::Create(settings); |
| 307 } |
| 308 |
303 static PassRefPtr<AnimatableValue> CreateFromTransformProperties( | 309 static PassRefPtr<AnimatableValue> CreateFromTransformProperties( |
304 PassRefPtr<TransformOperation> transform, | 310 PassRefPtr<TransformOperation> transform, |
305 double zoom, | 311 double zoom, |
306 PassRefPtr<TransformOperation> initial_transform) { | 312 PassRefPtr<TransformOperation> initial_transform) { |
307 TransformOperations operation; | 313 TransformOperations operation; |
308 bool has_transform = static_cast<bool>(transform); | 314 bool has_transform = static_cast<bool>(transform); |
309 if (has_transform || initial_transform) { | 315 if (has_transform || initial_transform) { |
310 operation.Operations().push_back( | 316 operation.Operations().push_back( |
311 std::move(has_transform ? transform : initial_transform)); | 317 std::move(has_transform ? transform : initial_transform)); |
312 } | 318 } |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 // FIXME: Should we introduce an option to pass the computed font size | 445 // FIXME: Should we introduce an option to pass the computed font size |
440 // here, allowing consumers to enable text zoom rather than Text | 446 // here, allowing consumers to enable text zoom rather than Text |
441 // Autosizing? See http://crbug.com/227545. | 447 // Autosizing? See http://crbug.com/227545. |
442 return CreateFromDouble(style.SpecifiedFontSize()); | 448 return CreateFromDouble(style.SpecifiedFontSize()); |
443 case CSSPropertyFontSizeAdjust: | 449 case CSSPropertyFontSizeAdjust: |
444 return style.HasFontSizeAdjust() | 450 return style.HasFontSizeAdjust() |
445 ? CreateFromDouble(style.FontSizeAdjust()) | 451 ? CreateFromDouble(style.FontSizeAdjust()) |
446 : AnimatableUnknown::Create(CSSValueNone); | 452 : AnimatableUnknown::Create(CSSValueNone); |
447 case CSSPropertyFontStretch: | 453 case CSSPropertyFontStretch: |
448 return CreateFromFontStretch(style.GetFontStretch()); | 454 return CreateFromFontStretch(style.GetFontStretch()); |
| 455 case CSSPropertyFontVariationSettings: |
| 456 return CreateFromFontVariationSettings( |
| 457 style.GetFontDescription().VariationSettings()); |
449 case CSSPropertyFontWeight: | 458 case CSSPropertyFontWeight: |
450 return CreateFromFontWeight(style.GetFontWeight()); | 459 return CreateFromFontWeight(style.GetFontWeight()); |
451 case CSSPropertyHeight: | 460 case CSSPropertyHeight: |
452 return CreateFromLength(style.Height(), style); | 461 return CreateFromLength(style.Height(), style); |
453 case CSSPropertyLightingColor: | 462 case CSSPropertyLightingColor: |
454 return CreateFromColor(property_id, style); | 463 return CreateFromColor(property_id, style); |
455 case CSSPropertyListStyleImage: | 464 case CSSPropertyListStyleImage: |
456 return CreateFromStyleImage(style.ListStyleImage()); | 465 return CreateFromStyleImage(style.ListStyleImage()); |
457 case CSSPropertyLeft: | 466 case CSSPropertyLeft: |
458 return CreateFromLength(style.Left(), style); | 467 return CreateFromLength(style.Left(), style); |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 if (style.HasAutoZIndex()) | 673 if (style.HasAutoZIndex()) |
665 return AnimatableUnknown::Create(CSSValueAuto); | 674 return AnimatableUnknown::Create(CSSValueAuto); |
666 return CreateFromDouble(style.ZIndex()); | 675 return CreateFromDouble(style.ZIndex()); |
667 default: | 676 default: |
668 NOTREACHED(); | 677 NOTREACHED(); |
669 return nullptr; | 678 return nullptr; |
670 } | 679 } |
671 } | 680 } |
672 | 681 |
673 } // namespace blink | 682 } // namespace blink |
OLD | NEW |