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

Unified Diff: Source/core/svg/SVGSVGElement.cpp

Issue 910713002: Restrict floats over SVGSVGElement to finite values. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update svg/animations/animate-setcurrenttime.html Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/svg/dom/SVGSVGElement-currentTime-expected.txt ('k') | Source/core/svg/SVGSVGElement.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGSVGElement.cpp
diff --git a/Source/core/svg/SVGSVGElement.cpp b/Source/core/svg/SVGSVGElement.cpp
index 11d7dc0736544a95bd4ba88f7d6ac7a38052438a..9671e4e281a70dac3c44ee36fa77f9a435585e0f 100644
--- a/Source/core/svg/SVGSVGElement.cpp
+++ b/Source/core/svg/SVGSVGElement.cpp
@@ -153,6 +153,7 @@ float SVGSVGElement::currentScale() const
void SVGSVGElement::setCurrentScale(float scale)
{
+ ASSERT(std::isfinite(scale));
if (!inDocument() || !isOutermostSVGSVGElement())
return;
@@ -578,8 +579,7 @@ float SVGSVGElement::getCurrentTime() const
void SVGSVGElement::setCurrentTime(float seconds)
{
- if (std::isnan(seconds))
- return;
+ ASSERT(std::isfinite(seconds));
seconds = max(seconds, 0.0f);
m_timeContainer->setElapsed(seconds);
}
« no previous file with comments | « LayoutTests/svg/dom/SVGSVGElement-currentTime-expected.txt ('k') | Source/core/svg/SVGSVGElement.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698