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

Unified Diff: third_party/WebKit/Source/core/html/track/vtt/VTTCue.cpp

Issue 2342913003: Replace narrowPrecisionToFloat with clampTo<float> (Closed)
Patch Set: Created 4 years, 3 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 | « no previous file | third_party/WebKit/Source/core/layout/LayoutTheme.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/track/vtt/VTTCue.cpp
diff --git a/third_party/WebKit/Source/core/html/track/vtt/VTTCue.cpp b/third_party/WebKit/Source/core/html/track/vtt/VTTCue.cpp
index 38e749e50dfd81c35bf2b41d894ee7583369f0b0..6dc2bd06feab1e7259e6c2b1cec25ee456431d50 100644
--- a/third_party/WebKit/Source/core/html/track/vtt/VTTCue.cpp
+++ b/third_party/WebKit/Source/core/html/track/vtt/VTTCue.cpp
@@ -47,7 +47,6 @@
#include "core/html/track/vtt/VTTRegionList.h"
#include "core/html/track/vtt/VTTScanner.h"
#include "core/layout/LayoutVTTCue.h"
-#include "platform/FloatConversion.h"
#include "platform/RuntimeEnabledFeatures.h"
#include "platform/text/BidiResolver.h"
#include "platform/text/TextRunIterator.h"
@@ -333,7 +332,7 @@ void VTTCue::setLine(const DoubleOrAutoKeyword& position)
floatPosition = std::numeric_limits<float>::quiet_NaN();
} else {
DCHECK(position.isDouble());
- floatPosition = narrowPrecisionToFloat(position.getAsDouble());
+ floatPosition = clampTo<float>(position.getAsDouble());
if (m_linePosition == floatPosition)
return;
}
@@ -372,7 +371,7 @@ void VTTCue::setPosition(const DoubleOrAutoKeyword& position, ExceptionState& ex
DCHECK(position.isDouble());
if (isInvalidPercentage(position.getAsDouble(), exceptionState))
return;
- floatPosition = narrowPrecisionToFloat(position.getAsDouble());
+ floatPosition = clampTo<float>(position.getAsDouble());
if (m_textPosition == floatPosition)
return;
}
@@ -391,7 +390,7 @@ void VTTCue::setSize(double size, ExceptionState& exceptionState)
return;
// Otherwise, set the WebVTT cue size to the new value.
- float floatSize = narrowPrecisionToFloat(size);
+ float floatSize = clampTo<float>(size);
if (m_cueSize == floatSize)
return;
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutTheme.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698