Ignore:
Timestamp:
Sep 22, 2013, 8:40:47 PM (12 years ago)
Author:
[email protected]
Message:

CTTE: Use references more in ContainerNode, ContainerNodeAlgorithms and related classes
https://bugs.webkit.org/show_bug.cgi?id=121772

Reviewed by Andreas Kling.

../WebCore:

Use references for never null Nodes in ContainerNode and related classes.

../WebKit/qt:

  • Api/qwebelement.cpp:

(QWebElementCollection::append):
Update to work with the new StaticNodeList adopt function.

File:
1 edited

Legend:

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

    r156253 r156256  
    10661066}
    10671067
    1068 void replaceChildrenWithFragment(ContainerNode* container, PassRefPtr<DocumentFragment> fragment, ExceptionCode& ec)
    1069 {
    1070     RefPtr<ContainerNode> containerNode(container);
    1071 
     1068void replaceChildrenWithFragment(ContainerNode& container, PassRefPtr<DocumentFragment> fragment, ExceptionCode& ec)
     1069{
     1070    Ref<ContainerNode> containerNode(container);
    10721071    ChildListMutationScope mutation(containerNode.get());
    10731072
     
    10771076    }
    10781077
    1079     if (hasOneTextChild(containerNode.get()) && hasOneTextChild(fragment.get())) {
     1078    if (hasOneTextChild(&containerNode.get()) && hasOneTextChild(fragment.get())) {
    10801079        toText(containerNode->firstChild())->setData(toText(fragment->firstChild())->data(), ec);
    10811080        return;
    10821081    }
    10831082
    1084     if (hasOneChild(containerNode.get())) {
     1083    if (hasOneChild(&containerNode.get())) {
    10851084        containerNode->replaceChild(fragment, containerNode->firstChild(), ec);
    10861085        return;
     
    10911090}
    10921091
    1093 void replaceChildrenWithText(ContainerNode* container, const String& text, ExceptionCode& ec)
    1094 {
    1095     RefPtr<ContainerNode> containerNode(container);
    1096 
     1092void replaceChildrenWithText(ContainerNode& container, const String& text, ExceptionCode& ec)
     1093{
     1094    Ref<ContainerNode> containerNode(container);
    10971095    ChildListMutationScope mutation(containerNode.get());
    10981096
    1099     if (hasOneTextChild(containerNode.get())) {
     1097    if (hasOneTextChild(&containerNode.get())) {
    11001098        toText(containerNode->firstChild())->setData(text, ec);
    11011099        return;
     
    11041102    RefPtr<Text> textNode = Text::create(containerNode->document(), text);
    11051103
    1106     if (hasOneChild(containerNode.get())) {
     1104    if (hasOneChild(&containerNode.get())) {
    11071105        containerNode->replaceChild(textNode.release(), containerNode->firstChild(), ec);
    11081106        return;
Note: See TracChangeset for help on using the changeset viewer.