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

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

Issue 137033002: Use VTTScanner for VTT region settings parsing (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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
« no previous file with comments | « no previous file | Source/core/html/track/vtt/VTTParser.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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 // WebVTT space characters are U+0020 SPACE, U+0009 CHARACTER TABULATION (tab), U+000A LINE FEED (LF), U+000C FORM FEED (FF), and U+000D CARRIAGE RETURN (CR). 87 // WebVTT space characters are U+0020 SPACE, U+0009 CHARACTER TABULATION (tab), U+000A LINE FEED (LF), U+000C FORM FEED (FF), and U+000D CARRIAGE RETURN (CR).
88 return c == ' ' || c == '\t' || c == '\n' || c == '\f' || c == '\r'; 88 return c == ' ' || c == '\t' || c == '\n' || c == '\f' || c == '\r';
89 } 89 }
90 static inline bool isValidSettingDelimiter(UChar c) 90 static inline bool isValidSettingDelimiter(UChar c)
91 { 91 {
92 // ... a WebVTT cue consists of zero or more of the following components , in any order, separated from each other by one or more 92 // ... a WebVTT cue consists of zero or more of the following components , in any order, separated from each other by one or more
93 // U+0020 SPACE characters or U+0009 CHARACTER TABULATION (tab) characte rs. 93 // U+0020 SPACE characters or U+0009 CHARACTER TABULATION (tab) characte rs.
94 return c == ' ' || c == '\t'; 94 return c == ' ' || c == '\t';
95 } 95 }
96 static unsigned collectDigitsToInt(const String& input, unsigned* position, int& number); 96 static unsigned collectDigitsToInt(const String& input, unsigned* position, int& number);
97 static String collectWord(const String&, unsigned*);
98 static bool collectTimeStamp(const String&, double& timeStamp); 97 static bool collectTimeStamp(const String&, double& timeStamp);
99 98
100 // Useful functions for parsing percentage settings. 99 // Useful functions for parsing percentage settings.
101 static bool parseFloatPercentageValue(const String&, float&); 100 static bool parseFloatPercentageValue(const String&, float&);
102 static bool parseFloatPercentageValuePair(const String&, char, FloatPoint&); 101 static bool parseFloatPercentageValuePair(const String&, char, FloatPoint&);
103 102
104 // Create the DocumentFragment representation of the WebVTT cue text. 103 // Create the DocumentFragment representation of the WebVTT cue text.
105 static PassRefPtr<DocumentFragment> createDocumentFragmentFromCueText(Docume nt&, const String&); 104 static PassRefPtr<DocumentFragment> createDocumentFragmentFromCueText(Docume nt&, const String&);
106 105
107 // Input data to the parser to parse. 106 // Input data to the parser to parse.
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 VTTParserClient* m_client; 145 VTTParserClient* m_client;
147 146
148 Vector<RefPtr<VTTCue> > m_cuelist; 147 Vector<RefPtr<VTTCue> > m_cuelist;
149 148
150 Vector<RefPtr<VTTRegion> > m_regionList; 149 Vector<RefPtr<VTTRegion> > m_regionList;
151 }; 150 };
152 151
153 } // namespace WebCore 152 } // namespace WebCore
154 153
155 #endif 154 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/core/html/track/vtt/VTTParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698