Bug 137393

Summary: CSS Selectors Level 4: Implement :matches in SelectorChecker
Product: WebKit Reporter: Yusuke Suzuki <ysuzuki>
Component: New BugsAssignee: Yusuke Suzuki <ysuzuki>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch benjamin: review+

Description Yusuke Suzuki 2014-10-03 06:39:08 PDT
CSS Selectors Level 4: Implement :matches in SelectorChecker
Comment 1 Yusuke Suzuki 2014-10-14 19:20:13 PDT
Created attachment 239839 [details]
Patch
Comment 2 Yusuke Suzuki 2014-10-14 19:20:54 PDT
Added WIP patch, not enough tests are added, I'll add them later and update the patch.
Comment 3 Benjamin Poulain 2014-10-14 20:45:59 PDT
Woot! I can't wait :)
Comment 4 Yusuke Suzuki 2014-10-15 23:31:02 PDT
Created attachment 239931 [details]
Patch
Comment 5 Yusuke Suzuki 2014-10-15 23:33:29 PDT
(In reply to comment #3)
> Woot! I can't wait :)

Yay! Added initial implementation with test cases based on the not-selector-list test :)
In this implementation, pseudo element is not considered.
I'll create the issue for supporting that.
Comment 6 Benjamin Poulain 2014-10-16 21:36:46 PDT
Comment on attachment 239931 [details]
Patch

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

Looks like a good start for the baseline, the patch looks correct to me.

I did not check the actual test results but the test themselves seem to cover the important use cases.

> Source/WebCore/ChangeLog:9
> +        In this current implementation, we don't consider about pseudo elements.

You can drop the "about".

> LayoutTests/fast/selectors/querySelector-matches.html:68
> +// When using querySelector, the pseudo element produces the unmatch.

"produces the unmatch" -> "cannot match"?
Comment 7 Yusuke Suzuki 2014-10-16 22:34:07 PDT
Comment on attachment 239931 [details]
Patch

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

Thank you for your review! After landing this patch, I'll extend the SelectorChecker to annotate multiple pseudo elements at once.

>> Source/WebCore/ChangeLog:9
>> +        In this current implementation, we don't consider about pseudo elements.
> 
> You can drop the "about".

Thanks! Done.

>> LayoutTests/fast/selectors/querySelector-matches.html:68
>> +// When using querySelector, the pseudo element produces the unmatch.
> 
> "produces the unmatch" -> "cannot match"?

Right. I'll fix this to "the selectors containing the pseudo elements cannot match".
Comment 8 Yusuke Suzuki 2014-10-16 22:34:50 PDT
Committed r174811: <http://trac.webkit.org/changeset/174811>