Skip to content

Commit a2ad688

Browse files
committed
Bug 1574282 [wpt PR 18469] - Create Web Platform Tests for Scroll to text, a=testonly
Automatic update from web-platform-tests Create Web Platform Tests for Scroll to text Add a web platform test that performs navigations to a test page with various targetText parameters and checks if the target page successfully scrolled as expected. Using a BroadcastChannel is the only way to communicate whether the target page scrolled, since scroll to text is specifically restricted from iframes or pages with an opener, so there's no other way for the test page to track the status of the child target page. Bug: 994299 Change-Id: I69243e739c3a7469ac48647508e379f204ccfbf6 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1756707 Commit-Queue: Nick Burris <nburrischromium.org> Reviewed-by: Robert Ma <robertmachromium.org> Cr-Commit-Position: refs/heads/master{#689453} -- wpt-commits: 3c56e312080b972189b3dcfe57107b60527bb436 wpt-pr: 18469 UltraBlame original commit: 33a19ec20cf62c07d8337f2772a79808a974290b
1 parent 7d09d48 commit a2ad688

File tree

2 files changed

+605
-0
lines changed

2 files changed

+605
-0
lines changed
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
<
2+
!
3+
doctype
4+
html
5+
>
6+
<
7+
title
8+
>
9+
Navigating
10+
to
11+
a
12+
text
13+
fragment
14+
anchor
15+
<
16+
/
17+
title
18+
>
19+
<
20+
script
21+
>
22+
function
23+
checkScroll
24+
(
25+
)
26+
{
27+
let
28+
bc
29+
=
30+
new
31+
BroadcastChannel
32+
(
33+
'
34+
scroll
35+
-
36+
to
37+
-
38+
text
39+
-
40+
fragment
41+
'
42+
)
43+
;
44+
bc
45+
.
46+
postMessage
47+
(
48+
{
49+
didScrollToTarget
50+
:
51+
window
52+
.
53+
scrollY
54+
>
55+
0
56+
}
57+
)
58+
;
59+
bc
60+
.
61+
close
62+
(
63+
)
64+
;
65+
window
66+
.
67+
close
68+
(
69+
)
70+
;
71+
}
72+
<
73+
/
74+
script
75+
>
76+
<
77+
style
78+
>
79+
body
80+
{
81+
height
82+
:
83+
3200px
84+
;
85+
}
86+
p
87+
{
88+
position
89+
:
90+
absolute
91+
;
92+
top
93+
:
94+
3000px
95+
;
96+
}
97+
<
98+
/
99+
style
100+
>
101+
<
102+
body
103+
onload
104+
=
105+
"
106+
checkScroll
107+
(
108+
)
109+
"
110+
>
111+
<
112+
p
113+
id
114+
=
115+
"
116+
text
117+
"
118+
>
119+
This
120+
is
121+
a
122+
test
123+
page
124+
<
125+
/
126+
p
127+
>
128+
<
129+
/
130+
body
131+
>

0 commit comments

Comments
 (0)