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 23453033: Have DOMPatchSupport and DocumentFragment deal with Document references (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
« no previous file with comments | « Source/core/html/track/TextTrackCue.cpp ('k') | Source/core/inspector/DOMEditor.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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 } 323 }
324 324
325 PassRefPtr<DocumentFragment> WebVTTParser::createDocumentFragmentFromCueText(co nst String& text) 325 PassRefPtr<DocumentFragment> WebVTTParser::createDocumentFragmentFromCueText(co nst String& text)
326 { 326 {
327 // Cue text processing based on 327 // Cue text processing based on
328 // 4.8.10.13.4 WebVTT cue text parsing rules and 328 // 4.8.10.13.4 WebVTT cue text parsing rules and
329 // 4.8.10.13.5 WebVTT cue text DOM construction rules. 329 // 4.8.10.13.5 WebVTT cue text DOM construction rules.
330 330
331 ASSERT(m_scriptExecutionContext->isDocument()); 331 ASSERT(m_scriptExecutionContext->isDocument());
332 Document* document = toDocument(m_scriptExecutionContext); 332 Document* document = toDocument(m_scriptExecutionContext);
333 ASSERT(document);
333 334
334 RefPtr<DocumentFragment> fragment = DocumentFragment::create(document); 335 RefPtr<DocumentFragment> fragment = DocumentFragment::create(*document);
335 336
336 if (!text.length()) { 337 if (!text.length()) {
337 fragment->parserAppendChild(Text::create(document, "")); 338 fragment->parserAppendChild(Text::create(document, ""));
338 return fragment; 339 return fragment;
339 } 340 }
340 341
341 m_currentNode = fragment; 342 m_currentNode = fragment;
342 m_tokenizer->reset(); 343 m_tokenizer->reset();
343 m_token.clear(); 344 m_token.clear();
344 345
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 unsigned oldPosition = *position; 566 unsigned oldPosition = *position;
566 while (*position < length && data[*position] != '\r' && data[*position] != ' \n') 567 while (*position < length && data[*position] != '\r' && data[*position] != ' \n')
567 (*position)++; 568 (*position)++;
568 String line = String::fromUTF8(data + oldPosition, *position - oldPosition); 569 String line = String::fromUTF8(data + oldPosition, *position - oldPosition);
569 skipLineTerminator(data, length, position); 570 skipLineTerminator(data, length, position);
570 return line; 571 return line;
571 } 572 }
572 573
573 } 574 }
574 575
OLDNEW
« no previous file with comments | « Source/core/html/track/TextTrackCue.cpp ('k') | Source/core/inspector/DOMEditor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698