Lines Matching defs:fragment
285 RefPtr<DocumentFragment> fragment = DocumentFragment::create(document());
288 parseHTMLDocumentFragment(html, fragment.get(), scriptingPermission);
290 if (!parseXMLDocumentFragment(html, fragment.get(), this, scriptingPermission))
303 for (RefPtr<Node> node = fragment->firstChild(); node; node = nextNode) {
314 fragment->insertBefore(child, node.get(), ignoredExceptionCode);
317 fragment->removeChild(node.get(), ignoredExceptionCode);
320 fragment->removeChild(node.get(), ignoredExceptionCode);
325 return fragment.release();
339 static void replaceChildrenWithFragment(HTMLElement* element, PassRefPtr<DocumentFragment> fragment, ExceptionCode& ec)
341 if (!fragment->firstChild()) {
346 if (hasOneTextChild(element) && hasOneTextChild(fragment.get())) {
347 static_cast<Text*>(element->firstChild())->setData(static_cast<Text*>(fragment->firstChild())->data(), ec);
352 element->replaceChild(fragment, element->firstChild(), ec);
357 element->appendChild(fragment, ec);
387 RefPtr<DocumentFragment> fragment = createContextualFragment(html);
388 if (!fragment) {
393 replaceChildrenWithFragment(this, fragment.release(), ec);
405 RefPtr<DocumentFragment> fragment = parent->createContextualFragment(html);
406 if (!fragment) {
413 parent->replaceChild(fragment.release(), this, ec);
460 RefPtr<DocumentFragment> fragment = DocumentFragment::create(document());
468 fragment->appendChild(Text::create(document(), text.substring(lineStart, i - lineStart)), ec);
473 fragment->appendChild(new HTMLBRElement(brTag, document()), ec);
482 fragment->appendChild(Text::create(document(), text.substring(lineStart, length - lineStart)), ec);
483 replaceChildrenWithFragment(this, fragment.release(), ec);
545 // a document fragment is created and the elements appended in the correct order. This document
546 // fragment isn't returned anywhere.
589 RefPtr<DocumentFragment> fragment = document()->createDocumentFragment();
591 parseHTMLDocumentFragment(html, fragment.get());
593 if (!parseXMLDocumentFragment(html, fragment.get(), this))
598 insertAdjacent(where, fragment.get(), ec);