-
https://bugs.webkit.org/show_bug.cgi?id=29703weinig@apple.com authored
Add a function to element to check whether it matches a CSS selector Reviewed by Dan Bernstein. Implement Element.webkitMatchesSelector. * css/CSSSelectorList.cpp: (WebCore::forEachTagSelector): (WebCore::forEachSelector): (WebCore::SelectorNeedsNamespaceResolutionFunctor::operator()): (WebCore::CSSSelectorList::selectorsNeedNamespaceResolution): * css/CSSSelectorList.h: Moved code to iterate the CSSSelectorList and determine if any selectors need namespace resolution from a static function in Node.cpp to CSSSelectorList so that it can be used by webkitMatchesSelector as well as querySelector/querySelectorAll. * dom/Element.cpp: (WebCore::Element::webkitMatchesSelector): * dom/Element.h: * dom/Element.idl: Implement the new function. Handles exceptional cases identically to querySelector/querySelectorAll. * dom/Node.cpp: (WebCore::Node::querySelector): (WebCore::Node::querySelectorAll): Moved selectorsNeedNamespaceResolution to CSSSelectorList from here. LayoutTests: Update tests for https://bugs.webkit.org/show_bug.cgi?id=29703 Add a function to element to check whether it matches a CSS selector Reviewed by Dan Bernstein. Add webkitMatchesSelector to SelectorAPI tests. * fast/dom/SelectorAPI/caseID-almost-strict-expected.txt: * fast/dom/SelectorAPI/caseID-almost-strict.html: * fast/dom/SelectorAPI/caseID-expected.txt: * fast/dom/SelectorAPI/caseID-strict-expected.txt: * fast/dom/SelectorAPI/caseID-strict.html: * fast/dom/SelectorAPI/caseID.html: * fast/dom/SelectorAPI/caseTag-expected.txt: * fast/dom/SelectorAPI/caseTag.html: * fast/dom/SelectorAPI/caseTagX-expected.txt: * fast/dom/SelectorAPI/caseTagX.xhtml: * fast/dom/SelectorAPI/detached-element-expected.txt: * fast/dom/SelectorAPI/not-supported-namespace-in-selector-expected.txt: * fast/dom/SelectorAPI/not-supported-namespace-in-selector.html: * fast/dom/SelectorAPI/script-tests/detached-element.js: * fast/dom/SelectorAPI/script-tests/undefined-null-stringify.js: * fast/dom/SelectorAPI/script-tests/viewless-document.js: * fast/dom/SelectorAPI/undefined-null-stringify-expected.txt: * fast/dom/SelectorAPI/viewless-document-expected.txt: * fast/dom/Window/window-properties-expected.txt: * fast/dom/domListEnumeration-expected.txt: * fast/dom/script-tests/domListEnumeration.js: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48723 268f45cc-cd09-0410-ab3c-d52691b4dbfc
ee5bc0a2