| 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 case ExtendToZoom: // Does not apply to elements. | 91 case ExtendToZoom: // Does not apply to elements. |
| 92 ASSERT_NOT_REACHED(); | 92 ASSERT_NOT_REACHED(); |
| 93 return 0; | 93 return 0; |
| 94 } | 94 } |
| 95 ASSERT_NOT_REACHED(); | 95 ASSERT_NOT_REACHED(); |
| 96 return 0; | 96 return 0; |
| 97 } | 97 } |
| 98 | 98 |
| 99 static PassRefPtr<AnimatableValue> createFromLineHeight(const Length& length, co
nst RenderStyle& style) | 99 static PassRefPtr<AnimatableValue> createFromLineHeight(const Length& length, co
nst RenderStyle& style) |
| 100 { | 100 { |
| 101 double value = length.value(); | 101 if (length.type() == Percent) { |
| 102 switch (length.type()) { | 102 double value = length.value(); |
| 103 case Fixed: | |
| 104 return AnimatableLength::create(adjustFloatForAbsoluteZoom(value, style)
, AnimatableLength::UnitTypePixels); | |
| 105 case Percent: | |
| 106 // -100% is used to represent "normal" line height. | 103 // -100% is used to represent "normal" line height. |
| 107 if (value == -100) | 104 if (value == -100) |
| 108 return AnimatableUnknown::create(CSSValueNormal); | 105 return AnimatableUnknown::create(CSSValueNormal); |
| 109 return AnimatableDouble::create(value); | 106 return AnimatableDouble::create(value); |
| 110 default: | |
| 111 ASSERT_NOT_REACHED(); | |
| 112 return 0; | |
| 113 } | 107 } |
| 108 return createFromLength(length, style); |
| 114 } | 109 } |
| 115 | 110 |
| 116 inline static PassRefPtr<AnimatableValue> createFromDouble(double value, Animata
bleDouble::Constraint constraint = AnimatableDouble::Unconstrained) | 111 inline static PassRefPtr<AnimatableValue> createFromDouble(double value, Animata
bleDouble::Constraint constraint = AnimatableDouble::Unconstrained) |
| 117 { | 112 { |
| 118 return AnimatableDouble::create(value, constraint); | 113 return AnimatableDouble::create(value, constraint); |
| 119 } | 114 } |
| 120 | 115 |
| 121 inline static PassRefPtr<AnimatableValue> createFromLengthBox(const LengthBox& l
engthBox, const RenderStyle& style) | 116 inline static PassRefPtr<AnimatableValue> createFromLengthBox(const LengthBox& l
engthBox, const RenderStyle& style) |
| 122 { | 117 { |
| 123 return AnimatableLengthBox::create( | 118 return AnimatableLengthBox::create( |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 return createFromDouble(style.zoom()); | 473 return createFromDouble(style.zoom()); |
| 479 default: | 474 default: |
| 480 ASSERT_WITH_MESSAGE(!CSSAnimations::isAnimatableProperty(property), "Web
Animations not yet implemented: Create AnimatableValue from render style: %s",
getPropertyNameString(property).utf8().data()); | 475 ASSERT_WITH_MESSAGE(!CSSAnimations::isAnimatableProperty(property), "Web
Animations not yet implemented: Create AnimatableValue from render style: %s",
getPropertyNameString(property).utf8().data()); |
| 481 ASSERT_NOT_REACHED(); | 476 ASSERT_NOT_REACHED(); |
| 482 // This return value is to avoid a release crash if possible. | 477 // This return value is to avoid a release crash if possible. |
| 483 return AnimatableUnknown::create(0); | 478 return AnimatableUnknown::create(0); |
| 484 } | 479 } |
| 485 } | 480 } |
| 486 | 481 |
| 487 } // namespace WebCore | 482 } // namespace WebCore |
| OLD | NEW |