New issue
Advanced search Search tips
Starred by 16 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Feature

Blocked on:
issue 842157

Blocking:
issue 747818



Sign in to add a comment

Chrome does not support matches selector

Reported by site.mao...@gmail.com, Dec 10 2015 Back to list

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.33 Safari/537.36

Example URL:
http://jsfiddle.net/u6wtzyvL/2/

Steps to reproduce the problem:
Open this page using safari and chrome

http://jsfiddle.net/u6wtzyvL/2/

What is the expected behavior?
Only hello should show up due to the selector rules

What went wrong?
selector rules are not interpreted properly

Does it occur on multiple sites: N/A

Is it a problem with a plugin? No 

Did this work before? No 

Does this work in other browsers? Yes 

Chrome version: 46.0.2490.33  Channel: stable
OS Version: 12.04
Flash Version: Shockwave Flash 19.0 r0
 
Labels: Cr-Blink-CSS
Labels: -Pri-2 -Type-Compat -OS-Linux Pri-3 Type-Feature OS-All
Status: Available (was: NULL)
Spec: https://drafts.csswg.org/selectors-4/#matches

Labels: Update-Quarterly
Labels: Hotlist-Interop
Supported by WebKit/Safari. This is an interoperability issue.
Blocking: 747818
Labels: Code-Resolver
Labels: ApproachableBug
Labels: -Update-Quarterly
Owner: victoriaytsu@google.com
Status: Assigned (was: Available)
Project Member

Comment 11 by bugdroid1@chromium.org, Jan 8

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9a788e6a15d451b003bffdc9f6c485871a022392

commit 9a788e6a15d451b003bffdc9f6c485871a022392
Author: Victoria Su <victoriaytsu@google.com>
Date: Mon Jan 08 05:59:35 2018

Duplicated :-webkit-any() functionality for :matches()

This is the first stage of implementing :matches().
The pseudo class kPseudoAny was copied under new name kPseudoMatches with its own use-counter.
The selector does not yet allow for complex selector arguments.

Design doc: https://docs.google.com/document/d/1dfbT1mnIuwm9HTyUWDe5PS5FygZgMuQGsyw49oxBcXk/edit?usp=sharing
Intent to Implement: https://groups.google.com/a/chromium.org/d/msg/blink-dev/kqD_G4sxfZE/6CJM01X2BwAJ

Bug: 568705
Change-Id: I288096bd11e8399798bdec16fd13944861a6be59
Reviewed-on: https://chromium-review.googlesource.com/846599
Commit-Queue: Eric Willigers <ericwilligers@chromium.org>
Commit-Queue: Victoria Su <victoriaytsu@google.com>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Eric Willigers <ericwilligers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#527578}
[add] https://crrev.com/9a788e6a15d451b003bffdc9f6c485871a022392/third_party/WebKit/LayoutTests/external/wpt/css/selectors/invalidation/matches.html
[modify] https://crrev.com/9a788e6a15d451b003bffdc9f6c485871a022392/third_party/WebKit/Source/core/css/CSSSelector.cpp
[modify] https://crrev.com/9a788e6a15d451b003bffdc9f6c485871a022392/third_party/WebKit/Source/core/css/CSSSelector.h
[modify] https://crrev.com/9a788e6a15d451b003bffdc9f6c485871a022392/third_party/WebKit/Source/core/css/RuleFeatureSet.cpp
[modify] https://crrev.com/9a788e6a15d451b003bffdc9f6c485871a022392/third_party/WebKit/Source/core/css/SelectorChecker.cpp
[modify] https://crrev.com/9a788e6a15d451b003bffdc9f6c485871a022392/third_party/WebKit/Source/core/css/parser/CSSSelectorParser.cpp
[modify] https://crrev.com/9a788e6a15d451b003bffdc9f6c485871a022392/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp
[modify] https://crrev.com/9a788e6a15d451b003bffdc9f6c485871a022392/third_party/WebKit/Source/platform/runtime_enabled_features.json5
[modify] https://crrev.com/9a788e6a15d451b003bffdc9f6c485871a022392/third_party/WebKit/public/platform/web_feature.mojom
[modify] https://crrev.com/9a788e6a15d451b003bffdc9f6c485871a022392/tools/metrics/histograms/enums.xml

There has been recent activity in the CSSWG around :matches() and whether to rename it to better reflect its relationship with :not(). However, Safari has publicly shipped :matches() for the past several years. See these GitHub issue threads:
https://github.com/w3c/csswg-drafts/issues/2143
https://github.com/w3c/csswg-drafts/issues/1027
Project Member

Comment 13 by bugdroid1@chromium.org, Feb 2

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/85ad70df681127a6f0c5987823f1c42b16fe9dcf

commit 85ad70df681127a6f0c5987823f1c42b16fe9dcf
Author: Victoria Su <victoriaytsu@google.com>
Date: Fri Feb 02 05:58:41 2018

Implemented CSS Selectors 4 :matches()

Design doc: https://docs.google.com/document/d/1dfbT1mnIuwm9HTyUWDe5PS5FygZgMuQGsyw49oxBcXk/edit?usp=sharing

Intent to implement: https://groups.google.com/a/chromium.org/d/msg/blink-dev/kqD_G4sxfZE/6CJM01X2BwAJ

Bug: 568705
Change-Id: I57e619e462f8323496aad477c50c45f9537003c4
Reviewed-on: https://chromium-review.googlesource.com/879982
Reviewed-by: nainar <nainar@chromium.org>
Reviewed-by: Eric Willigers <ericwilligers@chromium.org>
Commit-Queue: Victoria Su <victoriaytsu@google.com>
Cr-Commit-Position: refs/heads/master@{#533969}
[modify] https://crrev.com/85ad70df681127a6f0c5987823f1c42b16fe9dcf/third_party/WebKit/LayoutTests/external/wpt/css/selectors/invalidation/matches.html
[modify] https://crrev.com/85ad70df681127a6f0c5987823f1c42b16fe9dcf/third_party/WebKit/Source/core/css/CSSSelector.cpp
[modify] https://crrev.com/85ad70df681127a6f0c5987823f1c42b16fe9dcf/third_party/WebKit/Source/core/css/CSSSelector.h
[modify] https://crrev.com/85ad70df681127a6f0c5987823f1c42b16fe9dcf/third_party/WebKit/Source/core/css/CSSSelectorList.cpp
[modify] https://crrev.com/85ad70df681127a6f0c5987823f1c42b16fe9dcf/third_party/WebKit/Source/core/css/CSSSelectorList.h
[modify] https://crrev.com/85ad70df681127a6f0c5987823f1c42b16fe9dcf/third_party/WebKit/Source/core/css/CSSSelectorWatch.cpp
[modify] https://crrev.com/85ad70df681127a6f0c5987823f1c42b16fe9dcf/third_party/WebKit/Source/core/css/CSSTestHelper.cpp
[modify] https://crrev.com/85ad70df681127a6f0c5987823f1c42b16fe9dcf/third_party/WebKit/Source/core/css/CSSTestHelper.h
[modify] https://crrev.com/85ad70df681127a6f0c5987823f1c42b16fe9dcf/third_party/WebKit/Source/core/css/RuleFeatureSet.cpp
[modify] https://crrev.com/85ad70df681127a6f0c5987823f1c42b16fe9dcf/third_party/WebKit/Source/core/css/RuleFeatureSetTest.cpp
[modify] https://crrev.com/85ad70df681127a6f0c5987823f1c42b16fe9dcf/third_party/WebKit/Source/core/css/RuleSet.cpp
[modify] https://crrev.com/85ad70df681127a6f0c5987823f1c42b16fe9dcf/third_party/WebKit/Source/core/css/RuleSetTest.cpp
[modify] https://crrev.com/85ad70df681127a6f0c5987823f1c42b16fe9dcf/third_party/WebKit/Source/core/css/SelectorChecker.cpp
[modify] https://crrev.com/85ad70df681127a6f0c5987823f1c42b16fe9dcf/third_party/WebKit/Source/core/css/parser/CSSLazyParsingState.cpp
[modify] https://crrev.com/85ad70df681127a6f0c5987823f1c42b16fe9dcf/third_party/WebKit/Source/core/css/parser/CSSSelectorParser.cpp
[modify] https://crrev.com/85ad70df681127a6f0c5987823f1c42b16fe9dcf/third_party/WebKit/Source/core/css/parser/CSSSelectorParserTest.cpp
[modify] https://crrev.com/85ad70df681127a6f0c5987823f1c42b16fe9dcf/third_party/WebKit/Source/core/exported/WebSelector.cpp
[modify] https://crrev.com/85ad70df681127a6f0c5987823f1c42b16fe9dcf/third_party/WebKit/Source/core/frame/UseCounterTest.cpp

Status: Fixed (was: Assigned)
Blockedon: 842157

Comment 16 by tabatkins@google.com, May 14 (6 days ago)

Status: Assigned (was: Fixed)
As noted in 842157, this is definitely not fixed. Complex selectors are not interpreted at all correctly.

I think Victoria is no longer on Chrome - should we unassign this, then?

Comment 17 by futhark@chromium.org, May 14 (6 days ago)

Owner: ----
Status: Available (was: Assigned)

Sign in to add a comment