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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 | 61 |
62 namespace WebCore { | 62 namespace WebCore { |
63 | 63 |
64 static PassRefPtr<AnimatableValue> createFromLength(const Length& length, const
RenderStyle& style) | 64 static PassRefPtr<AnimatableValue> createFromLength(const Length& length, const
RenderStyle& style) |
65 { | 65 { |
66 switch (length.type()) { | 66 switch (length.type()) { |
67 case Fixed: | 67 case Fixed: |
68 return AnimatableLength::create(adjustFloatForAbsoluteZoom(length.value(
), style), AnimatableLength::UnitTypePixels); | 68 return AnimatableLength::create(adjustFloatForAbsoluteZoom(length.value(
), style), AnimatableLength::UnitTypePixels); |
69 case Percent: | 69 case Percent: |
70 return AnimatableLength::create(length.value(), AnimatableLength::UnitTy
pePercentage); | 70 return AnimatableLength::create(length.value(), AnimatableLength::UnitTy
pePercentage); |
71 case ViewportPercentageWidth: | |
72 return AnimatableLength::create(length.value(), AnimatableLength::UnitTy
peViewportWidth); | |
73 case ViewportPercentageHeight: | |
74 return AnimatableLength::create(length.value(), AnimatableLength::UnitTy
peViewportHeight); | |
75 case ViewportPercentageMin: | |
76 return AnimatableLength::create(length.value(), AnimatableLength::UnitTy
peViewportMin); | |
77 case ViewportPercentageMax: | |
78 return AnimatableLength::create(length.value(), AnimatableLength::UnitTy
peViewportMax); | |
79 case Calculated: | 71 case Calculated: |
80 return AnimatableLength::create(CSSCalcValue::createExpressionNode(lengt
h.calculationValue()->expression(), style.effectiveZoom())); | 72 return AnimatableLength::create(CSSCalcValue::createExpressionNode(lengt
h.calculationValue()->expression(), style.effectiveZoom())); |
81 case Auto: | 73 case Auto: |
82 case Intrinsic: | 74 case Intrinsic: |
83 case MinIntrinsic: | 75 case MinIntrinsic: |
84 case MinContent: | 76 case MinContent: |
85 case MaxContent: | 77 case MaxContent: |
86 case FillAvailable: | 78 case FillAvailable: |
87 case FitContent: | 79 case FitContent: |
88 return AnimatableUnknown::create(CSSPrimitiveValue::create(length)); | 80 return AnimatableUnknown::create(CSSPrimitiveValue::create(length)); |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 return createFromDouble(style.zoom()); | 465 return createFromDouble(style.zoom()); |
474 default: | 466 default: |
475 ASSERT_WITH_MESSAGE(!CSSAnimations::isAnimatableProperty(property), "Web
Animations not yet implemented: Create AnimatableValue from render style: %s",
getPropertyNameString(property).utf8().data()); | 467 ASSERT_WITH_MESSAGE(!CSSAnimations::isAnimatableProperty(property), "Web
Animations not yet implemented: Create AnimatableValue from render style: %s",
getPropertyNameString(property).utf8().data()); |
476 ASSERT_NOT_REACHED(); | 468 ASSERT_NOT_REACHED(); |
477 // This return value is to avoid a release crash if possible. | 469 // This return value is to avoid a release crash if possible. |
478 return AnimatableUnknown::create(0); | 470 return AnimatableUnknown::create(0); |
479 } | 471 } |
480 } | 472 } |
481 | 473 |
482 } // namespace WebCore | 474 } // namespace WebCore |
OLD | NEW |