Skip to content

Commit 9ca71d4

Browse files
Kyra Seeverschromium-wpt-export-bot
authored andcommitted
Add manual WPT for triple-key partitioning of :visited links
This manual web-platform test ensures that :visited-ness is partitioned by <link URL, top-level site, frame origin>. It does so by displaying three links, two of which have the same key despite one being in a (same-origin) iframe. When the user clicks on the link in the same-origin iframe, only those two links will be purple, while the cross-origin iframe link will remain blue. Change-Id: If6020038b7edd6ab9482097b7949cbbbccc1aa6a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6262650 Reviewed-by: Steven Bingler <[email protected]> Commit-Queue: Kyra Seevers <[email protected]> Cr-Commit-Position: refs/heads/main@{#1420547}
1 parent 7ff6512 commit 9ca71d4

File tree

3 files changed

+77
-0
lines changed

3 files changed

+77
-0
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<!DOCTYPE html>
2+
<meta charset="utf-8">
3+
<title>:visited links are partitioned by top-level site and frame origin</title>
4+
<link rel="author" title="Kyra Seevers" href="mailto:[email protected]">
5+
<link rel="help" href="https://drafts.csswg.org/selectors-4/#visited-privacy">
6+
7+
<!-- Import scripts to build same- and cross-origin URLs -->
8+
<script src="/common/get-host-info.sub.js"></script>
9+
10+
<body>
11+
<h2>Description</h2>
12+
<p>The goal of this manual test is to ensure that :visited links are
13+
partitioned by link URL, top-level site, and frame origin. </p>
14+
<br/>
15+
<p>(1) Clear any browsing data, including history.</p>
16+
<br/>
17+
<p>(2) Click on the link in the first iframe. The link in this
18+
top-level frame should turn purple. The link in the second iframe
19+
should remain blue.</p>
20+
<br/>
21+
<!-- This link's triple key is:
22+
Link URL: https://drafts.csswg.org/selectors-4,
23+
Top-Level Site: http://localhost,
24+
Frame Origin: http://localhost:8000 -->
25+
<a href = "https://drafts.csswg.org/selectors-4">I should turn purple!</a>
26+
<br/>
27+
<p>(3) Finally, click on the browser's back arrow.
28+
</p>
29+
<br/>
30+
<p>Test PASSES if: the top-level link (I should turn purple!) is purple,
31+
the first iframe link (Click me! (Then I should turn purple)) is purple,
32+
and the second iframe link (I should stay blue) is blue. All other
33+
conditions: the test FAILS.
34+
</p>
35+
<br/> <br/>
36+
<script>
37+
// Associate our local HTML resources with an origin that is
38+
// same- or cross-origin to the top-level page. This is
39+
// important so that we can accurately compare our
40+
// triple-partition keys.
41+
const { HTTP_ORIGIN, HTTP_REMOTE_ORIGIN } = get_host_info();
42+
let same_origin_url = HTTP_ORIGIN + '/css/selectors/resources/partitioned-visited-same-site-iframe.html';
43+
let cross_origin_url = HTTP_REMOTE_ORIGIN + '/css/selectors/resources/partitioned-visited-cross-site-iframe.html';
44+
// Construct the same-origin iframe. This link's triple key is:
45+
// Link URL: https://drafts.csswg.org/selectors-4,
46+
// Top-Level Site: http://localhost,
47+
// Frame Origin: http://localhost:800
48+
let same_origin_iframe = document.createElement("iframe");
49+
same_origin_iframe.setAttribute("src", same_origin_url);
50+
document.body.appendChild(same_origin_iframe);
51+
// Construct the cross-origin iframe. This link's triple key is:
52+
// Link URL: https://drafts.csswg.org/selectors-4,
53+
// Top-Level Site: http://localhost,
54+
// Frame Origin: http://www1.localhost:800
55+
let cross_origin_iframe = document.createElement("iframe");
56+
cross_origin_iframe.setAttribute("src", cross_origin_url);
57+
document.body.appendChild(cross_origin_iframe);
58+
</script>
59+
</body>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
</head>
6+
<body>
7+
<a href = "https://drafts.csswg.org/selectors-4">I should stay blue</a>
8+
</body>
9+
</html>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
</head>
6+
<body>
7+
<a href = "https://drafts.csswg.org/selectors-4">Click me! (Then I should turn purple)</a>
8+
</body>
9+
</html>

0 commit comments

Comments
 (0)