Bug 120050

Summary: Don't bother using a Vector for the ouput of querySelector, just return the first element found
Product: WebKit Reporter: Benjamin Poulain <benjamin>
Component: New BugsAssignee: Benjamin Poulain <benjamin>
Status: RESOLVED FIXED    
Severity: Normal CC: allan.jensen, commit-queue, esprehn+autocc, kangil.han
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch rniwa: review+

Description Benjamin Poulain 2013-08-19 20:29:27 PDT
Don't bother using a Vector for the ouput of querySelector, just return the first element found
Comment 1 Benjamin Poulain 2013-08-19 20:30:38 PDT
Created attachment 209152 [details]
Patch
Comment 2 Ryosuke Niwa 2013-08-19 20:37:10 PDT
Comment on attachment 209152 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=209152&action=review

> Source/WebCore/dom/SelectorQuery.cpp:149
> +                SelectorQueryTrait::appendOutputForElement(output, element);
> +                if (SelectorQueryTrait::shouldOnlyMatchFirstElement)

It'll be nice to assert that we never call appendOutputForElement for the first match case.
Comment 3 Benjamin Poulain 2013-08-20 15:42:57 PDT
Committed r154370: <http://trac.webkit.org/changeset/154370>