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

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

Issue 23754005: Have CharacterData constructor take a Document reference in argument (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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
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 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 if (m_currentNode->parentNode()) 527 if (m_currentNode->parentNode())
528 m_currentNode = m_currentNode->parentNode(); 528 m_currentNode = m_currentNode->parentNode();
529 } 529 }
530 break; 530 break;
531 } 531 }
532 case WebVTTTokenTypes::TimestampTag: { 532 case WebVTTTokenTypes::TimestampTag: {
533 unsigned position = 0; 533 unsigned position = 0;
534 String charactersString(StringImpl::create8BitIfPossible(m_token.charact ers())); 534 String charactersString(StringImpl::create8BitIfPossible(m_token.charact ers()));
535 double time = collectTimeStamp(charactersString, &position); 535 double time = collectTimeStamp(charactersString, &position);
536 if (time != malformedTime) 536 if (time != malformedTime)
537 m_currentNode->parserAppendChild(ProcessingInstruction::create(&docu ment, "timestamp", charactersString)); 537 m_currentNode->parserAppendChild(ProcessingInstruction::create(docum ent, "timestamp", charactersString));
538 break; 538 break;
539 } 539 }
540 default: 540 default:
541 break; 541 break;
542 } 542 }
543 m_token.clear(); 543 m_token.clear();
544 } 544 }
545 545
546 void WebVTTParser::skipWhiteSpace(const String& line, unsigned* position) 546 void WebVTTParser::skipWhiteSpace(const String& line, unsigned* position)
547 { 547 {
(...skipping 18 matching lines...) Expand all
566 unsigned oldPosition = *position; 566 unsigned oldPosition = *position;
567 while (*position < length && data[*position] != '\r' && data[*position] != ' \n') 567 while (*position < length && data[*position] != '\r' && data[*position] != ' \n')
568 (*position)++; 568 (*position)++;
569 String line = String::fromUTF8(data + oldPosition, *position - oldPosition); 569 String line = String::fromUTF8(data + oldPosition, *position - oldPosition);
570 skipLineTerminator(data, length, position); 570 skipLineTerminator(data, length, position);
571 return line; 571 return line;
572 } 572 }
573 573
574 } 574 }
575 575
OLDNEW
« no previous file with comments | « Source/core/html/parser/HTMLConstructionSite.cpp ('k') | Source/core/xml/parser/XMLDocumentParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698