Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 4f0da8d

Browse files
Divyansh Mangalmoz-wptsync-bot
authored andcommitted
Bug 1949162 [wpt PR 50797] - [CSS][SVG] Fix inheritance for all :visited styles, a=testonly
Automatic update from web-platform-tests [CSS][SVG] Fix inheritance for all :visited styles This CL fixes the failure in the WPT color-inherit-link-visited.svg [1] The WebKit commit [2] introduces logic and tests to ensure that elements inside a link inherit a computed color from another element. This change was intended to cover both CSS and SVG elements. However, in Chromium, the WPT for SVG started failing. The issue occurred because we only expand visited properties when inside a visited link. Consequently, the visited properties did not inherit values from their unvisited counterparts. The WPT failure is related to the `internal-visited-fill` property, but similar issues can arise with other CSS properties like `internal-visited-text-emphasis-color`. This CL resolves the WPT failure and the broader problem of visited properties not inheriting unvisited values. In this CL we apply the unvisited values to the visited properties during the initial style calculation of the visited link element. This CL also includes new WPTs for all the inherited visited properties for which we are applying unvisited values before `ExpandCascade`. [1] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/web_tests/external/wpt/svg/styling/color-inherit-link-visited.svg?q=color-inherit-link-visited&ss=chromium%2Fchromium%2Fsrc [2] WebKit/WebKit@f93d710 Note: Even with this change there will be a bug corresponding to explicit inheritance (of non-inherited visited properties). Bug: 388400236, 40356084 Change-Id: I36dd328e6b9435e3baf1baab71867f8de7efd263 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6137310 Reviewed-by: Anders Hartvoll Ruud <[email protected]> Commit-Queue: Divyansh Mangal <[email protected]> Cr-Commit-Position: refs/heads/main@{#1421874} -- wpt-commits: 5b541e93134dffb74649d01ccfc17377db79e0e1 wpt-pr: 50797
1 parent e3e08be commit 4f0da8d

10 files changed

+147
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!DOCTYPE html>
2+
<meta charset="utf-8">
3+
<link rel="author" title="Divyansh Mangal" href="mailto:[email protected]">
4+
<link rel="help" href="https://developer.mozilla.org/en-US/docs/Web/CSS/Privacy_and_the_:visited_selector">
5+
<style>
6+
:root {
7+
font-size: 50px;
8+
caret-color: orange;
9+
}
10+
[contenteditable] {
11+
outline: none;
12+
}
13+
</style>
14+
<main>
15+
<a id="link" style="caret-color:orange;" contenteditable href="">link</a>
16+
</main>
17+
<script>
18+
window.onload = function() {
19+
document.getElementById("link").focus();
20+
}
21+
</script>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!DOCTYPE html>
2+
<meta charset="utf-8">
3+
<link rel="author" title="Divyansh Mangal" href="mailto:[email protected]">
4+
<link rel="match" href="caret-color-visited-inheritance-ref.html">
5+
<link rel="help" href="https://developer.mozilla.org/en-US/docs/Web/CSS/Privacy_and_the_:visited_selector">
6+
<style>
7+
:root {
8+
font-size: 50px;
9+
caret-color: orange;
10+
}
11+
[contenteditable] {
12+
outline: none;
13+
}
14+
</style>
15+
<main>
16+
<a id="link" contenteditable href="">link</a>
17+
</main>
18+
<script>
19+
window.onload = function() {
20+
document.getElementById("link").focus();
21+
}
22+
</script>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html>
2+
<meta charset="utf-8">
3+
<link rel="author" title="Divyansh Mangal" href="mailto:[email protected]">
4+
<link rel="help" href="https://developer.mozilla.org/en-US/docs/Web/CSS/Privacy_and_the_:visited_selector">
5+
<style>
6+
:root {
7+
font-size: 50px;
8+
}
9+
</style>
10+
<main>
11+
<a href="">
12+
Simply <em style="text-emphasis-style: '!'; text-emphasis-color: green;">UNACCEPTABLE</em>.
13+
</a>
14+
</main>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!DOCTYPE html>
2+
<meta charset="utf-8">
3+
<link rel="author" title="Divyansh Mangal" href="mailto:[email protected]">
4+
<link rel="match" href="text-emphasis-visited-inheritance-ref.html">
5+
<link rel="help" href="https://developer.mozilla.org/en-US/docs/Web/CSS/Privacy_and_the_:visited_selector">
6+
<style>
7+
:root {
8+
font-size: 50px;
9+
text-emphasis-color: green;
10+
}
11+
em {
12+
text-emphasis-style: "!"; /* (Should appear green). */
13+
}
14+
</style>
15+
<main>
16+
<a href="">
17+
Simply <em>UNACCEPTABLE</em>.
18+
</a>
19+
</main>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html>
2+
<meta charset="utf-8">
3+
<link rel="author" title="Divyansh Mangal" href="mailto:[email protected]">
4+
<link rel="help" href="https://developer.mozilla.org/en-US/docs/Web/CSS/Privacy_and_the_:visited_selector">
5+
<style>
6+
:root {
7+
font-size: 50px;
8+
}
9+
</style>
10+
<main>
11+
<a href="" style="-webkit-text-fill-color: green;">
12+
Sample Paragraph.
13+
</a>
14+
</main>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!DOCTYPE html>
2+
<meta charset="utf-8">
3+
<link rel="author" title="Divyansh Mangal" href="mailto:[email protected]">
4+
<link rel="match" href="text-fill-color-visited-inheritance-ref.html">
5+
<link rel="help" href="https://developer.mozilla.org/en-US/docs/Web/CSS/Privacy_and_the_:visited_selector">
6+
<style>
7+
:root {
8+
font-size: 50px;
9+
-webkit-text-fill-color: green;
10+
}
11+
</style>
12+
<main>
13+
<a href="">
14+
Sample Paragraph.
15+
</a>
16+
</main>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html>
2+
<meta charset="utf-8">
3+
<link rel="author" title="Divyansh Mangal" href="mailto:[email protected]">
4+
<link rel="help" href="https://developer.mozilla.org/en-US/docs/Web/CSS/Privacy_and_the_:visited_selector">
5+
<style>
6+
:root {
7+
font-size: 50px;
8+
}
9+
</style>
10+
<main>
11+
<a href="" style="-webkit-text-stroke-color:2px green;">
12+
The stroke colour in this sentence should be green.
13+
</a>
14+
</main>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!DOCTYPE html>
2+
<meta charset="utf-8">
3+
<link rel="author" title="Divyansh Mangal" href="mailto:[email protected]">
4+
<link rel="match" href="text-stroke-color-visited-inheritance-ref.html">
5+
<link rel="help" href="https://developer.mozilla.org/en-US/docs/Web/CSS/Privacy_and_the_:visited_selector">
6+
<style>
7+
:root {
8+
font-size: 50px;
9+
-webkit-text-stroke-color:2px green;
10+
}
11+
</style>
12+
<main>
13+
<a href="">
14+
The stroke colour in this sentence should be green.
15+
</a>
16+
</main>
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 8 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)