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

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGAnimateMotionElement.cpp

Issue 1418663004: SVG animateMotion paths that only cause offsets are no longer ignored (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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) 2007 Eric Seidel <eric@webkit.org> 2 * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
3 * Copyright (C) 2007 Rob Buis <buis@kde.org> 3 * Copyright (C) 2007 Rob Buis <buis@kde.org>
4 * Copyright (C) 2008 Apple Inc. All rights reserved. 4 * Copyright (C) 2008 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 246
247 transform->translate(animatedX, animatedY); 247 transform->translate(animatedX, animatedY);
248 return; 248 return;
249 } 249 }
250 250
251 ASSERT(!m_animationPath.isEmpty()); 251 ASSERT(!m_animationPath.isEmpty());
252 252
253 float positionOnPath = m_animationPath.length() * percentage; 253 float positionOnPath = m_animationPath.length() * percentage;
254 FloatPoint position; 254 FloatPoint position;
255 float angle; 255 float angle;
256 bool ok = m_animationPath.pointAndNormalAtLength(positionOnPath, position, a ngle); 256 m_animationPath.pointAndNormalAtLength(positionOnPath, position, angle);
257 if (!ok)
258 return;
259 257
260 // Handle accumulate="sum". 258 // Handle accumulate="sum".
261 if (isAccumulated() && repeatCount) { 259 if (isAccumulated() && repeatCount) {
260 bool ok;
262 FloatPoint positionAtEndOfDuration = m_animationPath.pointAtLength(m_ani mationPath.length(), ok); 261 FloatPoint positionAtEndOfDuration = m_animationPath.pointAtLength(m_ani mationPath.length(), ok);
pdr. 2015/10/30 00:52:05 pointAtLength just calls pointAndNormalAtLength in
Eric Willigers 2015/11/20 07:49:53 Updated. animateMotion-still.html now tests this
263 if (ok) 262 if (ok)
264 position.move(positionAtEndOfDuration.x() * repeatCount, positionAtE ndOfDuration.y() * repeatCount); 263 position.move(positionAtEndOfDuration.x() * repeatCount, positionAtE ndOfDuration.y() * repeatCount);
265 } 264 }
266 265
267 transform->translate(position.x(), position.y()); 266 transform->translate(position.x(), position.y());
268 RotateMode rotateMode = this->rotateMode(); 267 RotateMode rotateMode = this->rotateMode();
269 if (rotateMode != RotateAuto && rotateMode != RotateAutoReverse) 268 if (rotateMode != RotateAuto && rotateMode != RotateAutoReverse)
270 return; 269 return;
271 if (rotateMode == RotateAutoReverse) 270 if (rotateMode == RotateAutoReverse)
272 angle += 180; 271 angle += 180;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 315
317 void SVGAnimateMotionElement::updateAnimationMode() 316 void SVGAnimateMotionElement::updateAnimationMode()
318 { 317 {
319 if (!m_animationPath.isEmpty()) 318 if (!m_animationPath.isEmpty())
320 setAnimationMode(PathAnimation); 319 setAnimationMode(PathAnimation);
321 else 320 else
322 SVGAnimationElement::updateAnimationMode(); 321 SVGAnimationElement::updateAnimationMode();
323 } 322 }
324 323
325 } 324 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698