summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/svg
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/svg')
-rw-r--r--Source/WebCore/svg/SVGLengthContext.cpp2
-rw-r--r--Source/WebCore/svg/SVGSVGElement.cpp2
-rw-r--r--Source/WebCore/svg/animation/SMILTime.h2
-rw-r--r--Source/WebCore/svg/animation/SMILTimeContainer.cpp14
-rw-r--r--Source/WebCore/svg/animation/SMILTimeContainer.h2
-rw-r--r--Source/WebCore/svg/animation/SVGSMILElement.cpp2
6 files changed, 12 insertions, 12 deletions
diff --git a/Source/WebCore/svg/SVGLengthContext.cpp b/Source/WebCore/svg/SVGLengthContext.cpp
index fe4b66994..1bd857b9d 100644
--- a/Source/WebCore/svg/SVGLengthContext.cpp
+++ b/Source/WebCore/svg/SVGLengthContext.cpp
@@ -91,7 +91,7 @@ float SVGLengthContext::valueForLength(const Length& length, SVGLengthMode mode)
{
if (length.isPercent())
return convertValueFromPercentageToUserUnits(length.value() / 100, mode, IGNORE_EXCEPTION);
- if (length.isAuto())
+ if (length.isAuto() || !length.isSpecified())
return 0;
FloatSize viewportSize;
diff --git a/Source/WebCore/svg/SVGSVGElement.cpp b/Source/WebCore/svg/SVGSVGElement.cpp
index e5fbd7465..7990139b3 100644
--- a/Source/WebCore/svg/SVGSVGElement.cpp
+++ b/Source/WebCore/svg/SVGSVGElement.cpp
@@ -64,7 +64,7 @@ inline SVGSVGElement::SVGSVGElement(const QualifiedName& tagName, Document& docu
, m_y(LengthModeHeight)
, m_width(LengthModeWidth, ASCIILiteral("100%"))
, m_height(LengthModeHeight, ASCIILiteral("100%"))
- , m_timeContainer(RefPtr<SMILTimeContainer>(SMILTimeContainer::create(this)).releaseNonNull())
+ , m_timeContainer(SMILTimeContainer::create(this))
{
ASSERT(hasTagName(SVGNames::svgTag));
registerAnimatedPropertiesForSVGSVGElement();
diff --git a/Source/WebCore/svg/animation/SMILTime.h b/Source/WebCore/svg/animation/SMILTime.h
index 60d1301a0..3047d97af 100644
--- a/Source/WebCore/svg/animation/SMILTime.h
+++ b/Source/WebCore/svg/animation/SMILTime.h
@@ -31,6 +31,8 @@
namespace WebCore {
+const double SMILAnimationFrameDelay = 1.0 / 60;
+
class SMILTime {
public:
SMILTime() : m_time(0) { }
diff --git a/Source/WebCore/svg/animation/SMILTimeContainer.cpp b/Source/WebCore/svg/animation/SMILTimeContainer.cpp
index 57d9c7f7f..cbf3b7ba5 100644
--- a/Source/WebCore/svg/animation/SMILTimeContainer.cpp
+++ b/Source/WebCore/svg/animation/SMILTimeContainer.cpp
@@ -35,8 +35,6 @@
namespace WebCore {
-static const double animationFrameDelay = 0.025;
-
SMILTimeContainer::SMILTimeContainer(SVGSVGElement* owner)
: m_beginTime(0)
, m_pauseTime(0)
@@ -100,7 +98,7 @@ void SMILTimeContainer::notifyIntervalsChanged()
{
// Schedule updateAnimations() to be called asynchronously so multiple intervals
// can change with updateAnimations() only called once at the end.
- startTimer(0);
+ startTimer(elapsed(), 0);
}
SMILTime SMILTimeContainer::elapsed() const
@@ -161,7 +159,7 @@ void SMILTimeContainer::resume()
m_resumeTime = monotonicallyIncreasingTime();
m_pauseTime = 0;
- startTimer(0);
+ startTimer(elapsed(), 0);
}
void SMILTimeContainer::setElapsed(SMILTime time)
@@ -198,7 +196,7 @@ void SMILTimeContainer::setElapsed(SMILTime time)
updateAnimations(time, true);
}
-void SMILTimeContainer::startTimer(SMILTime fireTime, SMILTime minimumDelay)
+void SMILTimeContainer::startTimer(SMILTime elapsed, SMILTime fireTime, SMILTime minimumDelay)
{
if (!m_beginTime || isPaused())
return;
@@ -206,7 +204,7 @@ void SMILTimeContainer::startTimer(SMILTime fireTime, SMILTime minimumDelay)
if (!fireTime.isFinite())
return;
- SMILTime delay = std::max(fireTime - elapsed(), minimumDelay);
+ SMILTime delay = std::max(fireTime - elapsed, minimumDelay);
m_timer.startOneShot(delay.value());
}
@@ -309,7 +307,7 @@ void SMILTimeContainer::updateAnimations(SMILTime elapsed, bool seekToTime)
#ifndef NDEBUG
m_preventScheduledAnimationsChanges = false;
#endif
- startTimer(earliestFireTime, animationFrameDelay);
+ startTimer(elapsed, earliestFireTime, SMILAnimationFrameDelay);
return;
}
@@ -321,7 +319,7 @@ void SMILTimeContainer::updateAnimations(SMILTime elapsed, bool seekToTime)
m_preventScheduledAnimationsChanges = false;
#endif
- startTimer(earliestFireTime, animationFrameDelay);
+ startTimer(elapsed, earliestFireTime, SMILAnimationFrameDelay);
}
}
diff --git a/Source/WebCore/svg/animation/SMILTimeContainer.h b/Source/WebCore/svg/animation/SMILTimeContainer.h
index d2856027a..ae4cba4d9 100644
--- a/Source/WebCore/svg/animation/SMILTimeContainer.h
+++ b/Source/WebCore/svg/animation/SMILTimeContainer.h
@@ -67,7 +67,7 @@ private:
SMILTimeContainer(SVGSVGElement* owner);
void timerFired();
- void startTimer(SMILTime fireTime, SMILTime minimumDelay = 0);
+ void startTimer(SMILTime elapsed, SMILTime fireTime, SMILTime minimumDelay = 0);
void updateAnimations(SMILTime elapsed, bool seekToTime = false);
void updateDocumentOrderIndexes();
diff --git a/Source/WebCore/svg/animation/SVGSMILElement.cpp b/Source/WebCore/svg/animation/SVGSMILElement.cpp
index 4410b5bd3..f75f945a5 100644
--- a/Source/WebCore/svg/animation/SVGSMILElement.cpp
+++ b/Source/WebCore/svg/animation/SVGSMILElement.cpp
@@ -1042,7 +1042,7 @@ SMILTime SVGSMILElement::calculateNextProgressTime(SMILTime elapsed) const
return repeatingDurationEnd;
return m_intervalEnd;
}
- return elapsed + 0.025;
+ return elapsed + SMILAnimationFrameDelay;
}
return m_intervalBegin >= elapsed ? m_intervalBegin : SMILTime::unresolved();
}