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

Unified Diff: Source/core/html/track/vtt/VTTRegion.cpp

Issue 262753004: Replace all remaining IDL finitude type checks with [TypeChecking=Unrestricted] (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 6 years, 8 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 | « Source/core/html/track/vtt/VTTCue.cpp ('k') | Source/core/html/track/vtt/VTTRegion.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/track/vtt/VTTRegion.cpp
diff --git a/Source/core/html/track/vtt/VTTRegion.cpp b/Source/core/html/track/vtt/VTTRegion.cpp
index c67428a0c25a9af10d2c7fb9df3d20f10659425c..7a549ff29862e36673b1d6763d8fcea7b2215867 100644
--- a/Source/core/html/track/vtt/VTTRegion.cpp
+++ b/Source/core/html/track/vtt/VTTRegion.cpp
@@ -68,12 +68,8 @@ static const float lineHeight = 5.33;
// Default scrolling animation time period (s).
static const float scrollTime = 0.433;
-static bool isInfiniteOrNonNumberOrNonPercentage(double value, const char* method, ExceptionState& exceptionState)
+static bool isNonPercentage(double value, const char* method, ExceptionState& exceptionState)
{
- if (!std::isfinite(value)) {
- exceptionState.throwTypeError(ExceptionMessages::notAFiniteNumber(value));
- return true;
- }
if (value < 0 || value > 100) {
exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::indexOutsideRange("value", value, 0.0, ExceptionMessages::InclusiveBound, 100.0, ExceptionMessages::InclusiveBound));
return true;
@@ -110,7 +106,7 @@ void VTTRegion::setId(const String& id)
void VTTRegion::setWidth(double value, ExceptionState& exceptionState)
{
- if (isInfiniteOrNonNumberOrNonPercentage(value, "width", exceptionState))
+ if (isNonPercentage(value, "width", exceptionState))
return;
m_width = value;
@@ -128,7 +124,7 @@ void VTTRegion::setHeight(long value, ExceptionState& exceptionState)
void VTTRegion::setRegionAnchorX(double value, ExceptionState& exceptionState)
{
- if (isInfiniteOrNonNumberOrNonPercentage(value, "regionAnchorX", exceptionState))
+ if (isNonPercentage(value, "regionAnchorX", exceptionState))
return;
m_regionAnchor.setX(value);
@@ -136,7 +132,7 @@ void VTTRegion::setRegionAnchorX(double value, ExceptionState& exceptionState)
void VTTRegion::setRegionAnchorY(double value, ExceptionState& exceptionState)
{
- if (isInfiniteOrNonNumberOrNonPercentage(value, "regionAnchorY", exceptionState))
+ if (isNonPercentage(value, "regionAnchorY", exceptionState))
return;
m_regionAnchor.setY(value);
@@ -144,7 +140,7 @@ void VTTRegion::setRegionAnchorY(double value, ExceptionState& exceptionState)
void VTTRegion::setViewportAnchorX(double value, ExceptionState& exceptionState)
{
- if (isInfiniteOrNonNumberOrNonPercentage(value, "viewportAnchorX", exceptionState))
+ if (isNonPercentage(value, "viewportAnchorX", exceptionState))
return;
m_viewportAnchor.setX(value);
@@ -152,7 +148,7 @@ void VTTRegion::setViewportAnchorX(double value, ExceptionState& exceptionState)
void VTTRegion::setViewportAnchorY(double value, ExceptionState& exceptionState)
{
- if (isInfiniteOrNonNumberOrNonPercentage(value, "viewportAnchorY", exceptionState))
+ if (isNonPercentage(value, "viewportAnchorY", exceptionState))
return;
m_viewportAnchor.setY(value);
« no previous file with comments | « Source/core/html/track/vtt/VTTCue.cpp ('k') | Source/core/html/track/vtt/VTTRegion.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698