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