Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(372)

Side by Side Diff: third_party/WebKit/Source/core/animation/CompositorAnimations.cpp

Issue 2225743002: Use same layout logic in animations for deciding whether an element can transform (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: isTransformApplicable Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 PropertyHandleSet properties = keyframeEffect.properties(); 234 PropertyHandleSet properties = keyframeEffect.properties();
235 if (properties.isEmpty()) 235 if (properties.isEmpty())
236 return false; 236 return false;
237 237
238 unsigned transformPropertyCount = 0; 238 unsigned transformPropertyCount = 0;
239 for (const auto& property : properties) { 239 for (const auto& property : properties) {
240 if (!property.isCSSProperty()) 240 if (!property.isCSSProperty())
241 return false; 241 return false;
242 242
243 if (isTransformRelatedCSSProperty(property)) { 243 if (isTransformRelatedCSSProperty(property)) {
244 if (targetElement.layoutObject() && targetElement.layoutObject()->is Inline() && !targetElement.layoutObject()->isInlineBlockOrInlineTable()) { 244 if (targetElement.layoutObject() && !targetElement.layoutObject()->i sTransformApplicable()) {
245 return false; 245 return false;
246 } 246 }
247 transformPropertyCount++; 247 transformPropertyCount++;
248 } 248 }
249 249
250 const PropertySpecificKeyframeVector& keyframes = keyframeEffect.getProp ertySpecificKeyframes(property); 250 const PropertySpecificKeyframeVector& keyframes = keyframeEffect.getProp ertySpecificKeyframes(property);
251 ASSERT(keyframes.size() >= 2); 251 ASSERT(keyframes.size() >= 2);
252 for (const auto& keyframe : keyframes) { 252 for (const auto& keyframe : keyframes) {
253 // FIXME: Determine candidacy based on the CSSValue instead of a sna pshot AnimatableValue. 253 // FIXME: Determine candidacy based on the CSSValue instead of a sna pshot AnimatableValue.
254 bool isNeutralKeyframe = keyframe->isCSSPropertySpecificKeyframe() & & !toCSSPropertySpecificKeyframe(keyframe.get())->value() && keyframe->composite () == EffectModel::CompositeAdd; 254 bool isNeutralKeyframe = keyframe->isCSSPropertySpecificKeyframe() & & !toCSSPropertySpecificKeyframe(keyframe.get())->value() && keyframe->composite () == EffectModel::CompositeAdd;
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 break; 643 break;
644 default: 644 default:
645 NOTREACHED(); 645 NOTREACHED();
646 } 646 }
647 animations.append(std::move(animation)); 647 animations.append(std::move(animation));
648 } 648 }
649 ASSERT(!animations.isEmpty()); 649 ASSERT(!animations.isEmpty());
650 } 650 }
651 651
652 } // namespace blink 652 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698