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

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

Issue 2246023002: SVG: Use counters for SMIL methods on <svg> root element (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: MeasureAs 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) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Rob Buis <buis@kde.org>
4 * Copyright (C) 2007 Apple Inc. All rights reserved. 4 * Copyright (C) 2007 Apple Inc. All rights reserved.
5 * Copyright (C) 2014 Google, Inc. 5 * Copyright (C) 2014 Google, Inc.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 SVGDocumentExtensions& svgExtensions = document().accessSVGExtensions(); 524 SVGDocumentExtensions& svgExtensions = document().accessSVGExtensions();
525 svgExtensions.removeTimeContainer(this); 525 svgExtensions.removeTimeContainer(this);
526 svgExtensions.removeSVGRootWithRelativeLengthDescendents(this); 526 svgExtensions.removeSVGRootWithRelativeLengthDescendents(this);
527 } 527 }
528 528
529 SVGGraphicsElement::removedFrom(rootParent); 529 SVGGraphicsElement::removedFrom(rootParent);
530 } 530 }
531 531
532 void SVGSVGElement::pauseAnimations() 532 void SVGSVGElement::pauseAnimations()
533 { 533 {
534 ASSERT(RuntimeEnabledFeatures::smilEnabled());
Eric Willigers 2016/08/15 04:58:37 These methods are also called by svg/SVGDocumentEx
535 if (!m_timeContainer->isPaused()) 534 if (!m_timeContainer->isPaused())
536 m_timeContainer->pause(); 535 m_timeContainer->pause();
537 } 536 }
538 537
539 void SVGSVGElement::unpauseAnimations() 538 void SVGSVGElement::unpauseAnimations()
540 { 539 {
541 ASSERT(RuntimeEnabledFeatures::smilEnabled());
542 if (m_timeContainer->isPaused()) 540 if (m_timeContainer->isPaused())
543 m_timeContainer->resume(); 541 m_timeContainer->resume();
544 } 542 }
545 543
546 bool SVGSVGElement::animationsPaused() const 544 bool SVGSVGElement::animationsPaused() const
547 { 545 {
548 ASSERT(RuntimeEnabledFeatures::smilEnabled());
549 return m_timeContainer->isPaused(); 546 return m_timeContainer->isPaused();
550 } 547 }
551 548
552 float SVGSVGElement::getCurrentTime() const 549 float SVGSVGElement::getCurrentTime() const
553 { 550 {
554 ASSERT(RuntimeEnabledFeatures::smilEnabled());
555 return narrowPrecisionToFloat(m_timeContainer->elapsed().value()); 551 return narrowPrecisionToFloat(m_timeContainer->elapsed().value());
556 } 552 }
557 553
558 void SVGSVGElement::setCurrentTime(float seconds) 554 void SVGSVGElement::setCurrentTime(float seconds)
559 { 555 {
560 ASSERT(RuntimeEnabledFeatures::smilEnabled());
561 ASSERT(std::isfinite(seconds)); 556 ASSERT(std::isfinite(seconds));
562 seconds = max(seconds, 0.0f); 557 seconds = max(seconds, 0.0f);
563 m_timeContainer->setElapsed(seconds); 558 m_timeContainer->setElapsed(seconds);
564 } 559 }
565 560
566 bool SVGSVGElement::selfHasRelativeLengths() const 561 bool SVGSVGElement::selfHasRelativeLengths() const
567 { 562 {
568 return m_x->currentValue()->isRelative() 563 return m_x->currentValue()->isRelative()
569 || m_y->currentValue()->isRelative() 564 || m_y->currentValue()->isRelative()
570 || m_width->currentValue()->isRelative() 565 || m_width->currentValue()->isRelative()
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
736 visitor->trace(m_width); 731 visitor->trace(m_width);
737 visitor->trace(m_height); 732 visitor->trace(m_height);
738 visitor->trace(m_translation); 733 visitor->trace(m_translation);
739 visitor->trace(m_timeContainer); 734 visitor->trace(m_timeContainer);
740 visitor->trace(m_viewSpec); 735 visitor->trace(m_viewSpec);
741 SVGGraphicsElement::trace(visitor); 736 SVGGraphicsElement::trace(visitor);
742 SVGFitToViewBox::trace(visitor); 737 SVGFitToViewBox::trace(visitor);
743 } 738 }
744 739
745 } // namespace blink 740 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/UseCounter.h ('k') | third_party/WebKit/Source/core/svg/SVGSVGElement.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698