Bug 136838

Summary: Return early in SelectorChecker::checkOne() if selector.isAttributeSelector() is true
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: CSSAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, commit-queue
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

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.