New issue
Advanced search Search tips

Issue 808392 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

:visited selector always matches when used inside ::slotted

Reported by tomalec...@gmail.com, Feb 2 2018

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36

Example URL:
http://jsbin.com/wizodax/2/edit?html,output

Steps to reproduce the problem:
1. Create a shadow host, and `<a>` element inside, make `<a>` point to location never visited before
2. Attach Shadow Root to host element,
3. Add style to shadow root, with a rule `::slotted(a:visited){color: red;}`

http://jsbin.com/wizodax/2/edit?html,output

What is the expected behavior?
link should be in default color.

What went wrong?
link is red, as `:visited` matches even though page was never visited before.

Does it occur on multiple sites: Yes

Is it a problem with a plugin? No 

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: 63.0.3239.132  Channel: stable
OS Version: 10.0
Flash Version:
 
Labels: Needs-Triage-M63
Firefox (Nightly, 60.0a1 (2018-02-04), with Shadow DOM flag enabled) supports this case as expected - http://jsbin.com/wizodax/4/edit?html,output
Components: -Blink Blink>CSS Blink>DOM>ShadowDOM

Comment 4 by e...@chromium.org, Feb 5 2018

Cc: futhark@chromium.org
Status: Available (was: Unconfirmed)
Labels: Hotlist-Interop
Cc: -futhark@chromium.org
Owner: futhark@chromium.org
Status: Started (was: Available)
Project Member

Comment 8 by bugdroid1@chromium.org, Feb 13 2018

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

commit 6046b2ee9ada67bd73ec1dd619a2f5a134c4c6af
Author: Rune Lillesveen <futhark@chromium.org>
Date: Tue Feb 13 10:48:37 2018

Handle ::slotted in ComputeLinkMatchType.

We skipped the selector list for ::slotted looking for :visited and
:link pseudo classes and ended up applying such rules with both :visited
and :link style.

Bug:  808392 
Change-Id: I85956902f3ca9cea01c96ef5c56ccf7f0ee23671
Reviewed-on: https://chromium-review.googlesource.com/904903
Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#536328}
[add] https://crrev.com/6046b2ee9ada67bd73ec1dd619a2f5a134c4c6af/third_party/WebKit/LayoutTests/external/wpt/css/css-scoping/slotted-link.html
[modify] https://crrev.com/6046b2ee9ada67bd73ec1dd619a2f5a134c4c6af/third_party/WebKit/Source/core/css/CSSSelector.cpp
[modify] https://crrev.com/6046b2ee9ada67bd73ec1dd619a2f5a134c4c6af/third_party/WebKit/Source/core/css/CSSSelector.h
[modify] https://crrev.com/6046b2ee9ada67bd73ec1dd619a2f5a134c4c6af/third_party/WebKit/Source/core/css/RuleSet.cpp

Status: Fixed (was: Started)

Sign in to add a comment