• arv@chromium.org's avatar
    Move Element.contains to Node · 03ce4650
    arv@chromium.org authored
    https://bugs.webkit.org/show_bug.cgi?id=67651
    
    Reviewed by Darin Adler.
    
    This moves the contains method from Element to Node as in the DOM4 working draft:
    http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#dom-node-contains
    
    This also special cases Document contains to make it O(1) instead of O(depth).
    
    Source/WebCore:
    
    Tests: fast/dom/Node/contains-method.html
           perf/document-contains.html
    
    * bindings/objc/PublicDOMInterfaces.h: Move contains from DOMElement to DOMNode.
    * dom/Element.idl:
    * dom/Node.cpp:
    (WebCore::Node::contains): Added document special case.
    * dom/Node.idl:
    * editing/DeleteSelectionCommand.cpp:
    (WebCore::DeleteSelectionCommand::mergeParagraphs): Added a null check.
    
    LayoutTests:
    
    * fast/dom/Element/contains-method-expected.txt: Removed.
    * fast/dom/Element/script-tests/contains-method.js: Removed.
    * fast/dom/Node/contains-method-expected.txt: Added.
    * fast/dom/Node/contains-method.html: Renamed from LayoutTests/fast/dom/Element/contains-method.html.
    * fast/dom/Node/script-tests/contains-method.js: Added. Expanded tests.
    * fast/dom/Window/window-properties-expected.txt:
    * perf/document-contains-expected.txt: Added.
    * perf/document-contains.html: Added.
                                   Perf test to ensure that document.contains is O(1).
    * platform/gtk/fast/dom/Window/window-properties-expected.txt:
    * platform/mac/fast/dom/Window/window-properties-expected.txt:
    * platform/qt-wk2/fast/dom/Window/window-properties-expected.txt:
    * platform/qt/fast/dom/Window/window-properties-expected.txt:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@94898 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    03ce4650