Ignore:
Timestamp:
Sep 14, 2013, 12:16:04 PM (12 years ago)
Author:
[email protected]
Message:

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

Reviewed by Andreas Kling.

  • dom/make_names.pl:

(defaultTagPropertyHash):
(printConstructorInterior):
Add a new property, 'constructorTakesDocumentReference', to indicate that the class
has been converted to take a Document by reference. Once all classes are converted, this
will go away.

  • html/HTMLTagNames.in:

Add the 'constructorTakesDocumentReference' property to the <body> tag as an initial
step.

  • html/HTMLBodyElement.cpp:

(WebCore::HTMLBodyElement::HTMLBodyElement):
(WebCore::HTMLBodyElement::create):

  • html/HTMLBodyElement.h:

Modify the constructor and create functions of HTMLBodyElement to take a Document reference.

  • editing/markup.cpp:

(WebCore::createFragmentFromMarkup):
(WebCore::createFragmentForTransformToFragment):

  • html/HTMLViewSourceDocument.cpp:

(WebCore::HTMLViewSourceDocument::createContainingTable):
Update callers of HTMLBodyElement::create() to pass a Document reference.

File:
1 edited

Legend:

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

    r155374 r155777  
    662662{
    663663    // We use a fake body element here to trick the HTML parser to using the InBody insertion mode.
    664     RefPtr<HTMLBodyElement> fakeBody = HTMLBodyElement::create(document);
     664    RefPtr<HTMLBodyElement> fakeBody = HTMLBodyElement::create(*document);
    665665    RefPtr<DocumentFragment> fragment = DocumentFragment::create(document);
    666666
     
    997997        // Unfortunately, that's an implementation detail of the parser.
    998998        // We achieve that effect here by passing in a fake body element as context for the fragment.
    999         RefPtr<HTMLBodyElement> fakeBody = HTMLBodyElement::create(outputDoc);
     999        RefPtr<HTMLBodyElement> fakeBody = HTMLBodyElement::create(*outputDoc);
    10001000        fragment->parseHTML(sourceString, fakeBody.get());
    10011001    } else if (sourceMIMEType == "text/plain")
Note: See TracChangeset for help on using the changeset viewer.