| 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 DCHECK_NE(property, CSSPropertyInvalid); | 118 DCHECK_NE(property, CSSPropertyInvalid); |
| 119 propertyHistogram.sample(UseCounter::mapCSSPropertyIdToCSSSampleIdForHis
togram(property)); | 119 propertyHistogram.sample(UseCounter::mapCSSPropertyIdToCSSSampleIdForHis
togram(property)); |
| 120 } | 120 } |
| 121 | 121 |
| 122 // Merge duplicate keyframes. | 122 // Merge duplicate keyframes. |
| 123 std::stable_sort(keyframes.begin(), keyframes.end(), Keyframe::compareOffset
s); | 123 std::stable_sort(keyframes.begin(), keyframes.end(), Keyframe::compareOffset
s); |
| 124 size_t targetIndex = 0; | 124 size_t targetIndex = 0; |
| 125 for (size_t i = 1; i < keyframes.size(); i++) { | 125 for (size_t i = 1; i < keyframes.size(); i++) { |
| 126 if (keyframes[i]->offset() == keyframes[targetIndex]->offset()) { | 126 if (keyframes[i]->offset() == keyframes[targetIndex]->offset()) { |
| 127 for (const auto& property : keyframes[i]->properties()) | 127 for (const auto& property : keyframes[i]->properties()) |
| 128 keyframes[targetIndex]->setCSSPropertyValue(property.cssProperty
(), keyframes[i]->cssPropertyValue(property.cssProperty())); | 128 keyframes[targetIndex]->setCSSPropertyValue(property.cssProperty
(), keyframes[i]->cssPropertyValue(property)); |
| 129 } else { | 129 } else { |
| 130 targetIndex++; | 130 targetIndex++; |
| 131 keyframes[targetIndex] = keyframes[i]; | 131 keyframes[targetIndex] = keyframes[i]; |
| 132 } | 132 } |
| 133 } | 133 } |
| 134 if (!keyframes.isEmpty()) | 134 if (!keyframes.isEmpty()) |
| 135 keyframes.shrink(targetIndex + 1); | 135 keyframes.shrink(targetIndex + 1); |
| 136 | 136 |
| 137 // Add 0% and 100% keyframes if absent. | 137 // Add 0% and 100% keyframes if absent. |
| 138 RefPtr<StringKeyframe> startKeyframe = keyframes.isEmpty() ? nullptr : keyfr
ames[0]; | 138 RefPtr<StringKeyframe> startKeyframe = keyframes.isEmpty() ? nullptr : keyfr
ames[0]; |
| (...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 897 } | 897 } |
| 898 | 898 |
| 899 DEFINE_TRACE(CSSAnimations) | 899 DEFINE_TRACE(CSSAnimations) |
| 900 { | 900 { |
| 901 visitor->trace(m_transitions); | 901 visitor->trace(m_transitions); |
| 902 visitor->trace(m_pendingUpdate); | 902 visitor->trace(m_pendingUpdate); |
| 903 visitor->trace(m_runningAnimations); | 903 visitor->trace(m_runningAnimations); |
| 904 } | 904 } |
| 905 | 905 |
| 906 } // namespace blink | 906 } // namespace blink |
| OLD | NEW |