Ignore:
Timestamp:
Sep 15, 2013, 6:31:54 AM (12 years ago)
Author:
[email protected]
Message:

[CTTE] Node subclasses should take a Document by reference in their constructor (Part 6)
https://bugs.webkit.org/show_bug.cgi?id=121387

Reviewed by Andreas Kling.

Converts the following to take a Document reference:

  • Attr
  • CDATASection
  • CharacterData
  • Comment
  • DOMImplementation
  • DocumentFragment
  • DocumentType
  • EntityReference
  • Notation
  • ProcessingInstruction
  • ShadowRoot
  • TemplateContentDocumentFragment
  • Text
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/editing/markup.cpp

    r155777 r155808  
    663663    // We use a fake body element here to trick the HTML parser to using the InBody insertion mode.
    664664    RefPtr<HTMLBodyElement> fakeBody = HTMLBodyElement::create(*document);
    665     RefPtr<DocumentFragment> fragment = DocumentFragment::create(document);
     665    RefPtr<DocumentFragment> fragment = DocumentFragment::create(*document);
    666666
    667667    fragment->parseHTML(markup, fakeBody.get(), parserContentPolicy);
     
    744744    // preserve the structure and appearance of the fragment. For example, if the fragment contains
    745745    // TD, we need to include the enclosing TABLE tag as well.
    746     RefPtr<DocumentFragment> fragment = DocumentFragment::create(document);
     746    RefPtr<DocumentFragment> fragment = DocumentFragment::create(*document);
    747747    if (specialCommonAncestor)
    748748        fragment->appendChild(specialCommonAncestor, ASSERT_NO_EXCEPTION);
     
    973973        document = document->ensureTemplateDocument();
    974974#endif
    975     RefPtr<DocumentFragment> fragment = DocumentFragment::create(document);
     975    RefPtr<DocumentFragment> fragment = DocumentFragment::create(*document);
    976976
    977977    if (document->isHTMLDocument()) {
     
    10001000        fragment->parseHTML(sourceString, fakeBody.get());
    10011001    } else if (sourceMIMEType == "text/plain")
    1002         fragment->parserAppendChild(Text::create(outputDoc, sourceString));
     1002        fragment->parserAppendChild(Text::create(*outputDoc, sourceString));
    10031003    else {
    10041004        bool successfulParse = fragment->parseXML(sourceString, 0);
     
    11041104    }
    11051105
    1106     RefPtr<Text> textNode = Text::create(&containerNode->document(), text);
     1106    RefPtr<Text> textNode = Text::create(containerNode->document(), text);
    11071107
    11081108    if (hasOneChild(containerNode.get())) {
Note: See TracChangeset for help on using the changeset viewer.