| OLD | NEW |
| 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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(char c) | 90 static inline bool isValidSettingDelimiter(char 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*); | 97 static String collectWord(const String&, unsigned*); |
| 98 static double collectTimeStamp(const String&, unsigned*); | 98 static bool collectTimeStamp(const String&, unsigned*, double& timeStamp); |
| 99 | 99 |
| 100 // Useful functions for parsing percentage settings. | 100 // Useful functions for parsing percentage settings. |
| 101 static float parseFloatPercentageValue(const String&, bool&); | 101 static bool parseFloatPercentageValue(const String&, float&); |
| 102 static FloatPoint parseFloatPercentageValuePair(const String&, char, bool&); | 102 static bool parseFloatPercentageValuePair(const String&, char, FloatPoint&); |
| 103 | 103 |
| 104 // Create the DocumentFragment representation of the WebVTT cue text. | 104 // Create the DocumentFragment representation of the WebVTT cue text. |
| 105 static PassRefPtr<DocumentFragment> createDocumentFragmentFromCueText(Docume
nt&, const String&); | 105 static PassRefPtr<DocumentFragment> createDocumentFragmentFromCueText(Docume
nt&, const String&); |
| 106 | 106 |
| 107 // Input data to the parser to parse. | 107 // Input data to the parser to parse. |
| 108 void parseBytes(const char* data, unsigned length); | 108 void parseBytes(const char* data, unsigned length); |
| 109 void flush(); | 109 void flush(); |
| 110 | 110 |
| 111 // Transfers ownership of last parsed cues to caller. | 111 // Transfers ownership of last parsed cues to caller. |
| 112 void getNewCues(Vector<RefPtr<VTTCue> >&); | 112 void getNewCues(Vector<RefPtr<VTTCue> >&); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 VTTParserClient* m_client; | 146 VTTParserClient* m_client; |
| 147 | 147 |
| 148 Vector<RefPtr<VTTCue> > m_cuelist; | 148 Vector<RefPtr<VTTCue> > m_cuelist; |
| 149 | 149 |
| 150 Vector<RefPtr<VTTRegion> > m_regionList; | 150 Vector<RefPtr<VTTRegion> > m_regionList; |
| 151 }; | 151 }; |
| 152 | 152 |
| 153 } // namespace WebCore | 153 } // namespace WebCore |
| 154 | 154 |
| 155 #endif | 155 #endif |
| OLD | NEW |