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

Side by Side Diff: Source/core/html/track/WebVTTParser.cpp

Issue 55853002: Handle empty lines in the 'TimingsAndSettings' state in the WebVTTParser (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month 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 | « LayoutTests/media/track/track-webvtt-tc030-interspersed-non-cue-expected.txt ('k') | no next file » | 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 // 19-29 - Allow any number of line terminators, then initialize new cue values. 173 // 19-29 - Allow any number of line terminators, then initialize new cue values.
174 if (line.isEmpty()) 174 if (line.isEmpty())
175 break; 175 break;
176 resetCueValues(); 176 resetCueValues();
177 177
178 // 30-39 - Check if this line contains an optional identifier or tim ing data. 178 // 30-39 - Check if this line contains an optional identifier or tim ing data.
179 m_state = collectCueId(line); 179 m_state = collectCueId(line);
180 break; 180 break;
181 181
182 case TimingsAndSettings: 182 case TimingsAndSettings:
183 if (line.isEmpty()) {
184 m_state = Id;
185 break;
186 }
187
183 // 40 - Collect cue timings and settings. 188 // 40 - Collect cue timings and settings.
184 m_state = collectTimingsAndSettings(line); 189 m_state = collectTimingsAndSettings(line);
185 break; 190 break;
186 191
187 case CueText: 192 case CueText:
188 // 41-53 - Collect the cue text, create a cue, and add it to the out put. 193 // 41-53 - Collect the cue text, create a cue, and add it to the out put.
189 m_state = collectCueText(line, position >= textData.length()); 194 m_state = collectCueText(line, position >= textData.length());
190 break; 195 break;
191 196
192 case BadCue: 197 case BadCue:
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 unsigned oldPosition = *position; 566 unsigned oldPosition = *position;
562 while (*position < data.length() && data[*position] != '\r' && data[*positio n] != '\n') 567 while (*position < data.length() && data[*position] != '\r' && data[*positio n] != '\n')
563 (*position)++; 568 (*position)++;
564 String line = data.substring(oldPosition, *position - oldPosition); 569 String line = data.substring(oldPosition, *position - oldPosition);
565 skipLineTerminator(data, position); 570 skipLineTerminator(data, position);
566 return line; 571 return line;
567 } 572 }
568 573
569 } 574 }
570 575
OLDNEW
« no previous file with comments | « LayoutTests/media/track/track-webvtt-tc030-interspersed-non-cue-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698