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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 String headerValue = line.substring(colonPosition + 1); | 294 String headerValue = line.substring(colonPosition + 1); |
295 // Steps 12.5.1 - 12.5.11 Region creation: Let region be a new text trac
k region [...] | 295 // Steps 12.5.1 - 12.5.11 Region creation: Let region be a new text trac
k region [...] |
296 createNewRegion(headerValue); | 296 createNewRegion(headerValue); |
297 } | 297 } |
298 } | 298 } |
299 | 299 |
300 VTTParser::ParseState VTTParser::collectCueId(const String& line) | 300 VTTParser::ParseState VTTParser::collectCueId(const String& line) |
301 { | 301 { |
302 if (line.contains("-->")) | 302 if (line.contains("-->")) |
303 return collectTimingsAndSettings(line); | 303 return collectTimingsAndSettings(line); |
304 m_currentId = line; | 304 m_currentId = AtomicString(line); |
305 return TimingsAndSettings; | 305 return TimingsAndSettings; |
306 } | 306 } |
307 | 307 |
308 VTTParser::ParseState VTTParser::collectTimingsAndSettings(const String& line) | 308 VTTParser::ParseState VTTParser::collectTimingsAndSettings(const String& line) |
309 { | 309 { |
310 // Collect WebVTT cue timings and settings. (5.3 WebVTT cue timings and sett
ings parsing.) | 310 // Collect WebVTT cue timings and settings. (5.3 WebVTT cue timings and sett
ings parsing.) |
311 // Steps 1 - 3 - Let input be the string being parsed and position be a poin
ter into input. | 311 // Steps 1 - 3 - Let input be the string being parsed and position be a poin
ter into input. |
312 unsigned position = 0; | 312 unsigned position = 0; |
313 skipWhiteSpace(line, &position); | 313 skipWhiteSpace(line, &position); |
314 | 314 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 cue->setId(m_currentId); | 432 cue->setId(m_currentId); |
433 cue->parseSettings(m_currentSettings); | 433 cue->parseSettings(m_currentSettings); |
434 | 434 |
435 m_cuelist.append(cue); | 435 m_cuelist.append(cue); |
436 if (m_client) | 436 if (m_client) |
437 m_client->newCuesParsed(); | 437 m_client->newCuesParsed(); |
438 } | 438 } |
439 | 439 |
440 void VTTParser::resetCueValues() | 440 void VTTParser::resetCueValues() |
441 { | 441 { |
442 m_currentId = emptyString(); | 442 m_currentId = emptyAtom; |
443 m_currentSettings = emptyString(); | 443 m_currentSettings = emptyString(); |
444 m_currentStartTime = 0; | 444 m_currentStartTime = 0; |
445 m_currentEndTime = 0; | 445 m_currentEndTime = 0; |
446 m_currentContent.clear(); | 446 m_currentContent.clear(); |
447 } | 447 } |
448 | 448 |
449 void VTTParser::createNewRegion(const String& headerValue) | 449 void VTTParser::createNewRegion(const String& headerValue) |
450 { | 450 { |
451 if (headerValue.isEmpty()) | 451 if (headerValue.isEmpty()) |
452 return; | 452 return; |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
618 m_currentNode->parserAppendChild(ProcessingInstruction::create(docum
ent, "timestamp", charactersString)); | 618 m_currentNode->parserAppendChild(ProcessingInstruction::create(docum
ent, "timestamp", charactersString)); |
619 break; | 619 break; |
620 } | 620 } |
621 default: | 621 default: |
622 break; | 622 break; |
623 } | 623 } |
624 } | 624 } |
625 | 625 |
626 } | 626 } |
627 | 627 |
OLD | NEW |