Skip to content
  • benjamin@webkit.org's avatar
    <https://webkit.org/b/120050> Don't bother using a Vector for the ouput of... · 7c754a75
    benjamin@webkit.org authored
    <https://webkit.org/b/120050> Don't bother using a Vector for the ouput of querySelector, just return the first element found
    
    Reviewed by Ryosuke Niwa.
    
    Simplify the case of querySelector. Instead of using the same output type as querySelectorAll,
    simply use a trait to define what to do in the loop.
    
    * dom/SelectorQuery.cpp:
    (WebCore::AllElementExtractorSelectorQueryTrait::appendOutputForElement):
    (WebCore::SelectorDataList::queryAll):
    (WebCore::SingleElementExtractorSelectorQueryTrait::appendOutputForElement):
    (WebCore::SelectorDataList::queryFirst):
    (WebCore::SelectorDataList::executeFastPathForIdSelector):
    (WebCore::elementsForLocalName):
    (WebCore::anyElement):
    (WebCore::SelectorDataList::executeSingleTagNameSelectorData):
    (WebCore::SelectorDataList::executeSingleClassNameSelectorData):
    (WebCore::SelectorDataList::executeSingleSelectorData):
    (WebCore::SelectorDataList::executeSingleMultiSelectorData):
    (WebCore::SelectorDataList::execute):
    * dom/SelectorQuery.h:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154370 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    7c754a75