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

Side by Side Diff: Source/core/html/track/vtt/VTTScanner.h

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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/html/track/vtt/VTTCue.cpp ('k') | Source/core/html/track/vtt/VTTScanner.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013, Opera Software ASA. All rights reserved. 2 * Copyright (c) 2013, Opera Software ASA. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 122
123 // Scan a set of ASCII digits from the input. Return the number of digits 123 // Scan a set of ASCII digits from the input. Return the number of digits
124 // scanned, and set |number| to the computed value. If the digits make up a 124 // scanned, and set |number| to the computed value. If the digits make up a
125 // number that does not fit the 'int' type, |number| is set to INT_MAX. 125 // number that does not fit the 'int' type, |number| is set to INT_MAX.
126 // Note: Does not handle sign. 126 // Note: Does not handle sign.
127 unsigned scanDigits(int& number); 127 unsigned scanDigits(int& number);
128 128
129 // Scan a floating point value on one of the forms: \d+\.? \d+\.\d+ \.\d+ 129 // Scan a floating point value on one of the forms: \d+\.? \d+\.\d+ \.\d+
130 bool scanFloat(float& number); 130 bool scanFloat(float& number);
131 131
132 // Scan a floating point value (per scanFloat) followed by a '%'.
133 bool scanPercentage(float& percentage);
134
132 protected: 135 protected:
133 Position position() const { return m_data.characters8; } 136 Position position() const { return m_data.characters8; }
134 Position end() const { return m_end.characters8; } 137 Position end() const { return m_end.characters8; }
135 void seekTo(Position); 138 void seekTo(Position);
136 UChar currentChar() const; 139 UChar currentChar() const;
137 void advance(unsigned amount = 1); 140 void advance(unsigned amount = 1);
138 // Adapt a UChar-predicate to an LChar-predicate. 141 // Adapt a UChar-predicate to an LChar-predicate.
139 // (For use with skipWhile/Until from ParsingUtilities.h). 142 // (For use with skipWhile/Until from ParsingUtilities.h).
140 template<bool characterPredicate(UChar)> 143 template<bool characterPredicate(UChar)>
141 static inline bool LCharPredicateAdapter(LChar c) { return characterPredicat e(c); } 144 static inline bool LCharPredicateAdapter(LChar c) { return characterPredicat e(c); }
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 ASSERT(position() < end()); 227 ASSERT(position() < end());
225 if (m_is8Bit) 228 if (m_is8Bit)
226 m_data.characters8 += amount; 229 m_data.characters8 += amount;
227 else 230 else
228 m_data.characters16 += amount; 231 m_data.characters16 += amount;
229 } 232 }
230 233
231 } 234 }
232 235
233 #endif 236 #endif
OLDNEW
« no previous file with comments | « Source/core/html/track/vtt/VTTCue.cpp ('k') | Source/core/html/track/vtt/VTTScanner.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698