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

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

Issue 864043002: WebVTT: Support fractional percentage values for position/line/size (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Moar tests. Created 5 years, 11 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/VTTScanner.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/track/vtt/VTTScanner.cpp
diff --git a/Source/core/html/track/vtt/VTTScanner.cpp b/Source/core/html/track/vtt/VTTScanner.cpp
index 4def706a6313b35f4839838e4d1c4141afa9dada..7604794f79d8e6b5ab65c70beaad03f221a7e50e 100644
--- a/Source/core/html/track/vtt/VTTScanner.cpp
+++ b/Source/core/html/track/vtt/VTTScanner.cpp
@@ -168,4 +168,16 @@ bool VTTScanner::scanFloat(float& number)
return true;
}
+bool VTTScanner::scanPercentage(float& percentage)
+{
+ Position savedPosition = position();
+ if (!scanFloat(percentage))
+ return false;
+ if (scan('%'))
+ return true;
+ // Restore scanner position.
+ seekTo(savedPosition);
+ return false;
+}
+
}
« no previous file with comments | « Source/core/html/track/vtt/VTTScanner.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698