Bug 120050 - Don't bother using a Vector for the ouput of querySelector, just return the first element found
Summary: Don't bother using a Vector for the ouput of querySelector, just return the f...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Benjamin Poulain
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-19 20:29 PDT by Benjamin Poulain
Modified: 2013-08-20 15:42 PDT (History)
4 users (show)

See Also:


Attachments
Patch (16.05 KB, patch)
2013-08-19 20:30 PDT, Benjamin Poulain
rniwa: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>