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 1e285ecff0e6d5a7b84d63be26b508496ce8d28c..21c4595a05f926f129bfe3d78e18fbe9b7a6af28 100644 |
--- a/Source/core/html/track/vtt/VTTRegion.cpp |
+++ b/Source/core/html/track/vtt/VTTRegion.cpp |
@@ -256,22 +256,32 @@ void VTTRegion::parseSettingValue(RegionSetting setting, const String& value) |
break; |
} |
case Height: { |
- unsigned position = 0; |
int number; |
- if (VTTParser::collectDigitsToInt(value, &position, number) && position == value.length()) |
+ VTTScanner valueScanner(value); |
+ if (valueScanner.scanDigits(number) && valueScanner.isAtEnd()) |
m_heightInLines = number; |
else |
WTF_LOG(Media, "VTTRegion::parseSettingValue, invalid Height"); |
break; |
} |
- case RegionAnchor: |
- if (!VTTParser::parseFloatPercentageValuePair(value, ',', m_regionAnchor)) |
+ case RegionAnchor: { |
+ VTTScanner valueScanner(value); |
+ FloatPoint anchor; |
+ if (VTTParser::parseFloatPercentageValuePair(valueScanner, ',', anchor) && valueScanner.isAtEnd()) |
+ m_regionAnchor = anchor; |
+ else |
WTF_LOG(Media, "VTTRegion::parseSettingValue, invalid RegionAnchor"); |
break; |
- case ViewportAnchor: |
- if (!VTTParser::parseFloatPercentageValuePair(value, ',', m_viewportAnchor)) |
+ } |
+ case ViewportAnchor: { |
+ VTTScanner valueScanner(value); |
+ FloatPoint anchor; |
+ if (VTTParser::parseFloatPercentageValuePair(valueScanner, ',', anchor) && valueScanner.isAtEnd()) |
+ m_viewportAnchor = anchor; |
+ else |
WTF_LOG(Media, "VTTRegion::parseSettingValue, invalid ViewportAnchor"); |
break; |
+ } |
case Scroll: |
if (value == scrollUpValueKeyword) |
m_scroll = true; |