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 24 matching lines...) Expand all Loading... |
35 | 35 |
36 namespace blink { | 36 namespace blink { |
37 | 37 |
38 static bool sidesHaveSameUnits(const AnimatableValue* sideA, | 38 static bool sidesHaveSameUnits(const AnimatableValue* sideA, |
39 const AnimatableValue* sideB) { | 39 const AnimatableValue* sideB) { |
40 if (!sideA->isLength() || !sideB->isLength()) | 40 if (!sideA->isLength() || !sideB->isLength()) |
41 return false; | 41 return false; |
42 return toAnimatableLength(sideA)->hasSameUnits(toAnimatableLength(sideB)); | 42 return toAnimatableLength(sideA)->hasSameUnits(toAnimatableLength(sideB)); |
43 } | 43 } |
44 | 44 |
45 // This is only used by *-image-slice properties which cannot interpolate betwee
n numbers and percentages. | 45 // This is only used by *-image-slice properties which cannot interpolate |
46 // Numbers are internally represented by pixels on the ComputedStyle so we must
manually type check both sides. | 46 // between numbers and percentages. Numbers are internally represented by pixels |
| 47 // on the ComputedStyle so we must manually type check both sides. |
47 bool AnimatableLengthBoxAndBool::usesDefaultInterpolationWith( | 48 bool AnimatableLengthBoxAndBool::usesDefaultInterpolationWith( |
48 const AnimatableValue* value) const { | 49 const AnimatableValue* value) const { |
49 const AnimatableLengthBoxAndBool* lengthBoxAndBool = | 50 const AnimatableLengthBoxAndBool* lengthBoxAndBool = |
50 toAnimatableLengthBoxAndBool(value); | 51 toAnimatableLengthBoxAndBool(value); |
51 if (lengthBoxAndBool->flag() != flag()) | 52 if (lengthBoxAndBool->flag() != flag()) |
52 return true; | 53 return true; |
53 if (!box()->isLengthBox() || !lengthBoxAndBool->box()->isLengthBox()) | 54 if (!box()->isLengthBox() || !lengthBoxAndBool->box()->isLengthBox()) |
54 return AnimatableValue::usesDefaultInterpolation(box(), | 55 return AnimatableValue::usesDefaultInterpolation(box(), |
55 lengthBoxAndBool->box()); | 56 lengthBoxAndBool->box()); |
56 const AnimatableLengthBox* boxA = toAnimatableLengthBox(box()); | 57 const AnimatableLengthBox* boxA = toAnimatableLengthBox(box()); |
(...skipping 17 matching lines...) Expand all Loading... |
74 flag()); | 75 flag()); |
75 } | 76 } |
76 | 77 |
77 bool AnimatableLengthBoxAndBool::equalTo(const AnimatableValue* value) const { | 78 bool AnimatableLengthBoxAndBool::equalTo(const AnimatableValue* value) const { |
78 const AnimatableLengthBoxAndBool* lengthBox = | 79 const AnimatableLengthBoxAndBool* lengthBox = |
79 toAnimatableLengthBoxAndBool(value); | 80 toAnimatableLengthBoxAndBool(value); |
80 return box()->equals(lengthBox->box()) && flag() == lengthBox->flag(); | 81 return box()->equals(lengthBox->box()) && flag() == lengthBox->flag(); |
81 } | 82 } |
82 | 83 |
83 } // namespace blink | 84 } // namespace blink |
OLD | NEW |