PassRefPtrWillBeRawPtr<DocumentFragment> VTTCue::getCueAsHTML() { createVTTNodeTree(); RefPtrWillBeRawPtr<DocumentFragment> clonedFragment = DocumentFragment::create(document()); copyVTTNodeToDOMTree(m_vttNodeTree.get(), clonedFragment.get()); return clonedFragment.release(); }
DocumentFragment* VTTCue::getCueAsHTML() { createVTTNodeTree(); DocumentFragment* clonedFragment = DocumentFragment::create(document()); copyVTTNodeToDOMTree(m_vttNodeTree.get(), clonedFragment); return clonedFragment; }
void VTTCue::copyVTTNodeToDOMTree(ContainerNode* vttNode, ContainerNode* parent) { for (Node* node = vttNode->firstChild(); node; node = node->nextSibling()) { RefPtrWillBeRawPtr<Node> clonedNode; if (node->isVTTElement()) clonedNode = toVTTElement(node)->createEquivalentHTMLElement(document()); else clonedNode = node->cloneNode(false); parent->appendChild(clonedNode); if (node->isContainerNode()) copyVTTNodeToDOMTree(toContainerNode(node), toContainerNode(clonedNode)); } }