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

Side by Side Diff: Source/core/html/track/TextTrackCue.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/HTMLTemplateElement.cpp ('k') | Source/core/html/track/WebVTTParser.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 * Copyright (C) 2011, 2012, 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2011, 2012, 2013 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 clonedNode = node->cloneNode(false); 509 clonedNode = node->cloneNode(false);
510 parent->appendChild(clonedNode); 510 parent->appendChild(clonedNode);
511 if (node->isContainerNode()) 511 if (node->isContainerNode())
512 copyWebVTTNodeToDOMTree(toContainerNode(node), toContainerNode(clone dNode.get())); 512 copyWebVTTNodeToDOMTree(toContainerNode(node), toContainerNode(clone dNode.get()));
513 } 513 }
514 } 514 }
515 515
516 PassRefPtr<DocumentFragment> TextTrackCue::getCueAsHTML() 516 PassRefPtr<DocumentFragment> TextTrackCue::getCueAsHTML()
517 { 517 {
518 createWebVTTNodeTree(); 518 createWebVTTNodeTree();
519 RefPtr<DocumentFragment> clonedFragment = DocumentFragment::create(ownerDocu ment()); 519 RefPtr<DocumentFragment> clonedFragment = DocumentFragment::create(*ownerDoc ument());
520 copyWebVTTNodeToDOMTree(m_webVTTNodeTree.get(), clonedFragment.get()); 520 copyWebVTTNodeToDOMTree(m_webVTTNodeTree.get(), clonedFragment.get());
521 return clonedFragment.release(); 521 return clonedFragment.release();
522 } 522 }
523 523
524 PassRefPtr<DocumentFragment> TextTrackCue::createCueRenderingTree() 524 PassRefPtr<DocumentFragment> TextTrackCue::createCueRenderingTree()
525 { 525 {
526 RefPtr<DocumentFragment> clonedFragment; 526 RefPtr<DocumentFragment> clonedFragment;
527 createWebVTTNodeTree(); 527 createWebVTTNodeTree();
528 clonedFragment = DocumentFragment::create(ownerDocument()); 528 clonedFragment = DocumentFragment::create(*ownerDocument());
529 m_webVTTNodeTree->cloneChildNodes(clonedFragment.get()); 529 m_webVTTNodeTree->cloneChildNodes(clonedFragment.get());
530 return clonedFragment.release(); 530 return clonedFragment.release();
531 } 531 }
532 532
533 bool TextTrackCue::dispatchEvent(PassRefPtr<Event> event) 533 bool TextTrackCue::dispatchEvent(PassRefPtr<Event> event)
534 { 534 {
535 // When a TextTrack's mode is disabled: no cues are active, no events fired. 535 // When a TextTrack's mode is disabled: no cues are active, no events fired.
536 if (!track() || track()->mode() == TextTrack::disabledKeyword()) 536 if (!track() || track()->mode() == TextTrack::disabledKeyword())
537 return false; 537 return false;
538 538
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after
1184 return false; 1184 return false;
1185 if (m_cueSize != cue.size()) 1185 if (m_cueSize != cue.size())
1186 return false; 1186 return false;
1187 if (align() != cue.align()) 1187 if (align() != cue.align())
1188 return false; 1188 return false;
1189 1189
1190 return true; 1190 return true;
1191 } 1191 }
1192 1192
1193 } // namespace WebCore 1193 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/html/HTMLTemplateElement.cpp ('k') | Source/core/html/track/WebVTTParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698