forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1686486 [wpt PR 27161] - [css-scroll-snap] Add more tests for ini…
…tial position in mandatory and proximity snap modes, a=testonly Automatic update from web-platform-tests [css-scroll-snap] Add more tests for initial position in mandatory and proximity snap modes -- wpt-commits: 00d6a95bb4bcafd3b7ad68d1162722d959db255a wpt-pr: 27161
- Loading branch information
1 parent
174fc86
commit e98b4a6
Showing
2 changed files
with
194 additions
and
0 deletions.
There are no files selected for viewing
81 changes: 81 additions & 0 deletions
81
...sts/css/css-scroll-snap/snap-after-initial-layout/scroll-snap-initial-layout-000-ref.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<!DOCTYPE html> | ||
<title> | ||
CSS Scroll Snap Reference | ||
</title> | ||
<style> | ||
|
||
.scroller { | ||
width: 100px; | ||
height: 100px; | ||
border: solid blue; | ||
margin: 10px; | ||
display: inline-block; | ||
} | ||
|
||
.scroller > div { | ||
width: 30px; | ||
height: 30px; | ||
background: orange; | ||
} | ||
|
||
.proxfar { | ||
border-color: orange; | ||
} | ||
|
||
</style> | ||
|
||
<p>Test passes if there is an orange square precisely at the top left corner of each blue box (no gap), | ||
and each orange box is empty. | ||
|
||
|
||
<div class="mandatory"> | ||
<div class="scroller"> | ||
<div></div> | ||
</div> | ||
|
||
<div class="scroller"> | ||
<div></div> | ||
</div> | ||
|
||
<div class="scroller"> | ||
<div></div> | ||
</div> | ||
|
||
<!-- on-screen --> | ||
<div class="scroller"> | ||
<div></div> | ||
</div> | ||
|
||
<div class="scroller"> | ||
<div></div> | ||
</div> | ||
|
||
<div class="scroller"> | ||
<div></div> | ||
</div> | ||
</div> | ||
|
||
<div class="proximity"> | ||
<!-- off-screen --> | ||
<div class="scroller proxfar"> | ||
</div> | ||
|
||
<div class="scroller proxfar"> | ||
</div> | ||
|
||
<div class="scroller proxfar"> | ||
</div> | ||
|
||
<!-- on-screen --> | ||
<div class="scroller"> | ||
<div></div> | ||
</div> | ||
|
||
<div class="scroller"> | ||
<div></div> | ||
</div> | ||
|
||
<div class="scroller"> | ||
<div></div> | ||
</div> | ||
</div> |
113 changes: 113 additions & 0 deletions
113
...m/tests/css/css-scroll-snap/snap-after-initial-layout/scroll-snap-initial-layout-000.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
<!DOCTYPE html> | ||
<title> | ||
On-screen vs. Off-screen Snapped Initial Scroll Position (Mandatory and Proximity) | ||
</title> | ||
<link rel="help" href="https://drafts.csswg.org/css-scroll-snap-1/#scroll-snap-align"> | ||
<link rel="help" href="https://drafts.csswg.org/css-scroll-snap/#re-snap"> | ||
<link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"> | ||
<!-- Test assumes 2px proximity is enough to snap. | ||
If your implementation has a cogent argument as to why this is too much, | ||
please request a change to this test. ~fantasai --> | ||
<link rel="match" href="scroll-snap-initial-layout-000-ref.html"> | ||
|
||
<style> | ||
|
||
.scroller { | ||
scroll-snap-type: both mandatory; | ||
overflow: hidden; | ||
scroll-padding: 0; | ||
width: 100px; | ||
height: 100px; | ||
border: solid blue; | ||
margin: 10px; | ||
display: inline-block; | ||
} | ||
|
||
.mandatory > .scroller { | ||
scroll-snap-type: both mandatory; | ||
} | ||
|
||
.proximity > .scroller { | ||
scroll-snap-type: both proximity; | ||
} | ||
|
||
.scroller > div { | ||
/* padding wrapper */ | ||
width: 30px; | ||
} | ||
|
||
.scroller > div > div { | ||
/* target box */ | ||
height: 30px; | ||
background: orange; | ||
scroll-snap-align: start; | ||
} | ||
|
||
.proxfar { | ||
border-color: orange; | ||
} | ||
.proxfar > div > div { | ||
background: red; | ||
} | ||
|
||
</style> | ||
|
||
<p>Test passes if there is an orange square precisely at the top left corner of each blue box (no gap), | ||
and each orange box is empty. | ||
|
||
|
||
<div class="mandatory"> | ||
<!-- off-screen --> | ||
<div class="scroller"> | ||
<div style="padding: 110px;"><div class="small-target"></div></div> | ||
</div> | ||
|
||
<div class="scroller"> | ||
<div style="padding-block: 110px;"><div class="small-target"></div></div> | ||
</div> | ||
|
||
<div class="scroller"> | ||
<div style="padding-inline: 110px;"><div class="small-target"></div></div> | ||
</div> | ||
|
||
<!-- on-screen --> | ||
<div class="scroller"> | ||
<div style="padding: 90px;"><div class="small-target"></div></div> | ||
</div> | ||
|
||
<div class="scroller"> | ||
<div style="padding-block: 90px;"><div class="small-target"></div></div> | ||
</div> | ||
|
||
<div class="scroller"> | ||
<div style="padding-inline: 90px;"><div class="small-target"></div></div> | ||
</div> | ||
</div> | ||
|
||
<div class="proximity"> | ||
<!-- off-screen --> | ||
<div class="scroller proxfar"> | ||
<div style="padding: 110px;"><div class="small-target"></div></div> | ||
</div> | ||
|
||
<div class="scroller proxfar"> | ||
<div style="padding-block: 110px;"><div class="small-target"></div></div> | ||
</div> | ||
|
||
<div class="scroller proxfar"> | ||
<div style="padding-inline: 110px;"><div class="small-target"></div></div> | ||
</div> | ||
|
||
<!-- on-screen --> | ||
<div class="scroller"> | ||
<div style="padding: 2px 110px 110px 2px;"><div class="small-target"></div></div> | ||
</div> | ||
|
||
<div class="scroller"> | ||
<div style="padding: 2px 110px 110px 2px;"><div class="small-target"></div></div> | ||
</div> | ||
|
||
<div class="scroller"> | ||
<div style="padding: 2px 110px 110px 2px;"><div class="small-target"></div></div> | ||
</div> | ||
</div> |