Allow [id=X] selectors to use the querySelector ID fast path.
This removes 300ms of input latency when clicking the input boxes in the
Mint transaction table on a Reks chromebook and 800ms when clicking
anything on Zillow on a Reks.
On a 2013 MacPro this saves 30-100ms when clicking on those websites.
querySelector(All) supports a fast path which transforms calls with
selectors like "#foo" and ".foo #bar" into a getElementById call
followed by a matches() call against the element and the selector.
This patch allows using that getElementById path when writing selectors
like "[id=foo]" or ".foo [id=foo]". Selectors of this type are used by
the YUI framework and pages like Zillow and Mint often execute a thousand
calls to one of these selectors per click event.
BUG=627242
Review-Url: https://codereview.chromium.org/2139843002
Cr-Commit-Position: refs/heads/master@{#404933}
2 files changed