File tree 5 files changed +231
-0
lines changed
5 files changed +231
-0
lines changed Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < meta charset ="utf-8 ">
3
+ < title > CSS Overflow Test: scroll-marker-contain property invalidation - reparenting nested anchors</ title >
4
+ < link rel ="help " href ="https://github.com/w3c/csswg-drafts/issues/10916 ">
5
+ < link rel ="match " href ="scroll-marker-contain-001-ref.tentative.html ">
6
+ < style >
7
+ .wrapper {
8
+ scroll-marker-contain : auto;
9
+ }
10
+
11
+ # scroller {
12
+ overflow : auto;
13
+ height : 130px ;
14
+ width : 100px ;
15
+ }
16
+
17
+ # scroller div {
18
+ width : 100px ;
19
+ height : 100px ;
20
+ background-color : blue;
21
+ margin : 5px ;
22
+ }
23
+
24
+ a {
25
+ color : red;
26
+ }
27
+
28
+ a : target-current {
29
+ color : green;
30
+ }
31
+ </ style >
32
+ < div class ="wrapper ">
33
+ < div id ="target " class ="wrapper ">
34
+ < a href ="#target1 "> t1</ a >
35
+ < a href ="#target2 "> t2</ a >
36
+ < a href ="#target3 "> t3</ a >
37
+ < a href ="#target4 "> t4</ a >
38
+ </ div >
39
+ </ div >
40
+ < div id ="scroller ">
41
+ < div id ="target1 "> </ div >
42
+ < div id ="target2 "> </ div >
43
+ < div id ="target3 "> </ div >
44
+ < div id ="target4 "> </ div >
45
+ </ div >
46
+ < script >
47
+ scroller . scrollTop = 400 ;
48
+ document . documentElement . offsetTop ;
49
+ target . classList . remove ( 'wrapper' ) ;
50
+ document . documentElement . offsetTop ;
51
+ scroller . scrollTop = 0 ;
52
+ </ script >
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < meta charset ="utf-8 ">
3
+ < title > CSS Overflow Test: scroll-marker-contain property invalidation - anchor and target removal and addition</ title >
4
+ < link rel ="help " href ="https://github.com/w3c/csswg-drafts/issues/10916 ">
5
+ < link rel ="match " href ="scroll-marker-contain-001-ref.tentative.html ">
6
+ < style >
7
+ .wrapper {
8
+ scroll-marker-contain : auto;
9
+ }
10
+
11
+ # scroller {
12
+ overflow : auto;
13
+ height : 130px ;
14
+ width : 100px ;
15
+ }
16
+
17
+ # scroller div {
18
+ width : 100px ;
19
+ height : 100px ;
20
+ background-color : blue;
21
+ margin : 5px ;
22
+ }
23
+
24
+ a {
25
+ color : red;
26
+ }
27
+
28
+ a : target-current {
29
+ color : green;
30
+ }
31
+ </ style >
32
+ < div id ="target " class ="wrapper ">
33
+ < a id ="link1 " href ="#target1 "> t1</ a >
34
+ < a href ="#target2 "> t2</ a >
35
+ < a href ="#target3 "> t3</ a >
36
+ < a href ="#target4 "> t4</ a >
37
+ </ div >
38
+ < div id ="scroller ">
39
+ < div id ="target1 "> </ div >
40
+ < div id ="target2 "> </ div >
41
+ < div id ="target3 "> </ div >
42
+ < div id ="target4 "> </ div >
43
+ </ div >
44
+ < script >
45
+ const newLink1 = link1 . cloneNode ( true ) ;
46
+ const newTarget1 = target1 . cloneNode ( ) ;
47
+ target . removeChild ( link1 ) ;
48
+ scroller . removeChild ( target1 ) ;
49
+ document . documentElement . offsetTop ;
50
+ target . prepend ( newLink1 ) ;
51
+ scroller . prepend ( newTarget1 ) ;
52
+ </ script >
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < meta charset ="utf-8 ">
3
+ < title > CSS Overflow Test: scroll-marker-contain property invalidation - dynamic creation</ title >
4
+ < link rel ="help " href ="https://github.com/w3c/csswg-drafts/issues/10916 ">
5
+ < link rel ="match " href ="scroll-marker-contain-001-ref.tentative.html ">
6
+ < style >
7
+ .wrapper {
8
+ scroll-marker-contain : auto;
9
+ }
10
+
11
+ # scroller {
12
+ overflow : auto;
13
+ height : 130px ;
14
+ width : 100px ;
15
+ }
16
+
17
+ # scroller div {
18
+ width : 100px ;
19
+ height : 100px ;
20
+ background-color : blue;
21
+ margin : 5px ;
22
+ }
23
+
24
+ a {
25
+ color : red;
26
+ }
27
+
28
+ a : target-current {
29
+ color : green;
30
+ }
31
+ </ style >
32
+ < div id ="target ">
33
+ < a href ="#target1 "> t1</ a >
34
+ < a href ="#target2 "> t2</ a >
35
+ < a href ="#target3 "> t3</ a >
36
+ < a href ="#target4 "> t4</ a >
37
+ </ div >
38
+ < div id ="scroller ">
39
+ < div id ="target1 "> </ div >
40
+ < div id ="target2 "> </ div >
41
+ < div id ="target3 "> </ div >
42
+ < div id ="target4 "> </ div >
43
+ </ div >
44
+ < script >
45
+ document . documentElement . offsetTop ;
46
+ target . classList . add ( "wrapper" ) ;
47
+ </ script >
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < meta charset ="utf-8 ">
3
+ < title > CSS Overflow Test Reference: scroll-marker-contain property makes anchor elements scroll markers - </ title >
4
+ < style >
5
+ # scroller {
6
+ overflow : auto;
7
+ height : 130px ;
8
+ width : 100px ;
9
+ }
10
+
11
+ # scroller div {
12
+ width : 100px ;
13
+ height : 100px ;
14
+ background-color : blue;
15
+ margin : 5px ;
16
+ }
17
+
18
+ a {
19
+ color : red;
20
+ }
21
+ </ style >
22
+ < div >
23
+ < a href ="#target1 "> t1</ a >
24
+ < a href ="#target2 "> t2</ a >
25
+ < a href ="#target3 "> t3</ a >
26
+ < a href ="#target4 "> t4</ a >
27
+ </ div >
28
+ < div id ="scroller ">
29
+ < div id ="target1 "> </ div >
30
+ < div id ="target2 "> </ div >
31
+ < div id ="target3 "> </ div >
32
+ < div id ="target4 "> </ div >
33
+ </ div >
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < meta charset ="utf-8 ">
3
+ < title > CSS Overflow Test: scroll-marker-contain property invalidation - dynamic removal</ title >
4
+ < link rel ="help " href ="https://github.com/w3c/csswg-drafts/issues/10916 ">
5
+ < link rel ="match " href ="scroll-marker-contain-008-ref.tentative.html ">
6
+ < style >
7
+ .wrapper {
8
+ scroll-marker-contain : auto;
9
+ }
10
+
11
+ # scroller {
12
+ overflow : auto;
13
+ height : 130px ;
14
+ width : 100px ;
15
+ }
16
+
17
+ # scroller div {
18
+ width : 100px ;
19
+ height : 100px ;
20
+ background-color : blue;
21
+ margin : 5px ;
22
+ }
23
+
24
+ a {
25
+ color : red;
26
+ }
27
+
28
+ a : target-current {
29
+ color : green;
30
+ }
31
+ </ style >
32
+ < div id ="target " class ="wrapper ">
33
+ < a href ="#target1 "> t1</ a >
34
+ < a href ="#target2 "> t2</ a >
35
+ < a href ="#target3 "> t3</ a >
36
+ < a href ="#target4 "> t4</ a >
37
+ </ div >
38
+ < div id ="scroller ">
39
+ < div id ="target1 "> </ div >
40
+ < div id ="target2 "> </ div >
41
+ < div id ="target3 "> </ div >
42
+ < div id ="target4 "> </ div >
43
+ </ div >
44
+ < script >
45
+ document . documentElement . offsetTop ;
46
+ target . classList . remove ( "wrapper" ) ;
47
+ </ script >
You can’t perform that action at this time.
0 commit comments