Skip to content
  • arv@chromium.org's avatar
    DOM4 remove method · 8b0430f0
    arv@chromium.org authored
    https://bugs.webkit.org/show_bug.cgi?id=73885
    
    Reviewed by Ojan Vafai.
    
    This adds the DOM 4 remove method.
    
    http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#dom-childnode-remove
    
    The remove method removes the node from its parent if it has a parent.
    
    Source/WebCore:
    
    Tests: fast/dom/Comment/remove.html
           fast/dom/DocumentType/remove.html
           fast/dom/Element/remove.html
           fast/dom/Text/remove.html
    
    * dom/CharacterData.idl:
    * dom/DocumentType.idl:
    * dom/Element.idl:
    * dom/Node.cpp:
    (WebCore::Node::remove): The spec says to do nothing if the node has no parent.
    * html/parser/HTMLTreeBuilder.cpp:
    (WebCore::HTMLTreeBuilder::processStartTagForInBody): Cleanup.
    * html/track/TextTrackCue.cpp:
    (WebCore::TextTrackCue::removeDisplayTree): No need to check parenNode twice.
    
    LayoutTests:
    
    * fast/dom/Comment/remove-expected.txt: Added.
    * fast/dom/Comment/remove.html: Added.
    * fast/dom/DocumentType/remove-expected.txt: Added.
    * fast/dom/DocumentType/remove.html: Added.
    * fast/dom/Element/remove-expected.txt: Added.
    * fast/dom/Element/remove.html: Added.
    * fast/dom/Text/remove-expected.txt: Added.
    * fast/dom/Text/remove.html: Added.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129400 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    8b0430f0