Changeset 140659 in webkit


Ignore:
Timestamp:
Jan 24, 2013 12:23:16 AM (11 years ago)
Author:
morrita@google.com
Message:

There are a few of wrong removeAllChildren() call
https://bugs.webkit.org/show_bug.cgi?id=107790

Reviewed by Ryosuke Niwa.

Source/WebCore:

removeAllChildren() is designed for trashing deleting children out.
It doesn't detach() children and could have possible leak.
This change replaces such removeAllChildren() usage with safer removeChildren().

No new tests. Covered by existing tests.

  • html/HTMLInputElement.cpp:

(WebCore::HTMLInputElement::parseAttribute):

  • html/InputType.cpp:

(WebCore::InputType::destroyShadowSubtree):

  • html/ValidationMessage.cpp:

(WebCore::ValidationMessage::setMessageDOMAndStartTimer):

  • html/parser/HTMLTreeBuilder.cpp:

(WebCore::HTMLTreeBuilder::processEndTag):

Source/WebKit/qt:

  • Api/qwebelement.cpp: Repalced removeAllChildren() with safer removeChildren()

(QWebElement::removeAllChildren):

Location:
trunk/Source
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r140658 r140659  
     12013-01-24  Hajime Morrita  <morrita@google.com>
     2
     3        There are a few of wrong removeAllChildren() call
     4        https://bugs.webkit.org/show_bug.cgi?id=107790
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        removeAllChildren() is designed for trashing deleting children out.
     9        It doesn't detach() children and could have possible leak.
     10        This change replaces such removeAllChildren() usage with safer removeChildren().
     11
     12        No new tests. Covered by existing tests.
     13
     14        * html/HTMLInputElement.cpp:
     15        (WebCore::HTMLInputElement::parseAttribute):
     16        * html/InputType.cpp:
     17        (WebCore::InputType::destroyShadowSubtree):
     18        * html/ValidationMessage.cpp:
     19        (WebCore::ValidationMessage::setMessageDOMAndStartTimer):
     20        * html/parser/HTMLTreeBuilder.cpp:
     21        (WebCore::HTMLTreeBuilder::processEndTag):
     22
    1232013-01-24  Dominic Mazzoni  <dmazzoni@google.com>
    224
  • trunk/Source/WebCore/html/HTMLInputElement.cpp

    r140655 r140659  
    753753            m_inputType->destroyShadowSubtree();
    754754            m_inputType->createShadowSubtree();
    755             attach();
     755            if (!attached())
     756                attach();
    756757        } else {
    757758            m_inputType->destroyShadowSubtree();
  • trunk/Source/WebCore/html/InputType.cpp

    r140655 r140659  
    490490        return;
    491491
    492     root->removeAllChildren();
     492    root->removeChildren();
    493493
    494494    // It's ok to clear contents of all other ShadowRoots because they must have
     
    497497    while ((root = root->youngerShadowRoot())) {
    498498#if ENABLE(SHADOW_DOM)
    499         root->removeAllChildren();
     499        root->removeChildren();
    500500        root->appendChild(HTMLShadowElement::create(shadowTag, element()->document()));
    501501#else
  • trunk/Source/WebCore/html/ValidationMessage.cpp

    r134828 r140659  
    126126    ASSERT(m_messageHeading);
    127127    ASSERT(m_messageBody);
    128     m_messageHeading->removeAllChildren();
    129     m_messageBody->removeAllChildren();
     128    m_messageHeading->removeChildren();
     129    m_messageBody->removeChildren();
    130130    Vector<String> lines;
    131131    m_message.split('\n', lines);
  • trunk/Source/WebCore/html/parser/HTMLTreeBuilder.cpp

    r140341 r140659  
    21532153            m_tree.openElements()->pop();
    21542154            if (isParsingFragment() && !scriptingContentIsAllowed(m_fragmentContext.scriptingPermission()))
    2155                 m_scriptToProcess->removeAllChildren();
     2155                m_scriptToProcess->removeChildren();
    21562156            setInsertionMode(m_originalInsertionMode);
    21572157
  • trunk/Source/WebKit/qt/Api/qwebelement.cpp

    r135567 r140659  
    11991199        return;
    12001200
    1201     m_element->removeAllChildren();
     1201    m_element->removeChildren();
    12021202}
    12031203
  • trunk/Source/WebKit/qt/ChangeLog

    r140541 r140659  
     12013-01-24  Hajime Morrita  <morrita@google.com>
     2
     3        There are a few of wrong removeAllChildren() call
     4        https://bugs.webkit.org/show_bug.cgi?id=107790
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        * Api/qwebelement.cpp: Repalced removeAllChildren() with safer removeChildren()
     9        (QWebElement::removeAllChildren):
     10
    1112013-01-23  Shinya Kawanaka  <shinyak@chromium.org>
    212
Note: See TracChangeset for help on using the changeset viewer.