Bug 136838 - Return early in SelectorChecker::checkOne() if selector.isAttributeSelector() is true
Summary: Return early in SelectorChecker::checkOne() if selector.isAttributeSelector()...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-15 14:26 PDT by Chris Dumez
Modified: 2014-09-15 19:30 PDT (History)
2 users (show)

See Also:


Attachments
Patch (1.99 KB, patch)
2014-09-15 14:28 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2014-09-15 14:26:06 PDT
Return early in SelectorChecker::checkOne() if selector.isAttributeSelector() is true and the selector matched. Previously, we were only returning early if the selector did not match and we were falling through if it did. This means that we ended up doing the 2 if() checks below in the method unnecessarily:
- selector.m_match == CSSSelector::PseudoClass
- selector.m_match == CSSSelector::PseudoElement
Comment 1 Chris Dumez 2014-09-15 14:28:16 PDT
Created attachment 238142 [details]
Patch
Comment 2 Benjamin Poulain 2014-09-15 17:01:55 PDT
Comment on attachment 238142 [details]
Patch

Please do not optimize SelectorChecker, it is *completely* untested.

The rule for SelectorChecker is now to make it correct no matter how slow "correct" is.
Comment 3 WebKit Commit Bot 2014-09-15 19:30:25 PDT
Comment on attachment 238142 [details]
Patch

Clearing flags on attachment: 238142

Committed r173646: <http://trac.webkit.org/changeset/173646>
Comment 4 WebKit Commit Bot 2014-09-15 19:30:29 PDT
All reviewed patches have been landed.  Closing bug.