diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /testing/web-platform/tests/css/css-position | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-upstream/125.0.1.tar.xz firefox-upstream/125.0.1.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/css/css-position')
6 files changed, 249 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-position/animations/position-interpolation.html b/testing/web-platform/tests/css/css-position/animations/position-interpolation.html index a4ad50240a..1a9e7f055b 100644 --- a/testing/web-platform/tests/css/css-position/animations/position-interpolation.html +++ b/testing/web-platform/tests/css/css-position/animations/position-interpolation.html @@ -36,12 +36,41 @@ </body> <script> +// Use default transition-behavior: normal. test_no_interpolation({ property: 'position', from: 'absolute', to: 'static', }); +test_interpolation({ + property: 'position', + behavior: 'allow-discrete', + from: 'relative', + to: 'static', +}, [ + {at: -1, expect: 'relative'}, + {at: 0, expect: 'relative'}, + {at: 0.4, expect: 'relative'}, + {at: 0.5, expect: 'static'}, + {at: 1, expect: 'static'}, + {at: 1.5, expect: 'static'}, +]); + +test_interpolation({ + property: 'position', + behavior: 'allow-discrete', + from: 'sticky', + to: 'fixed', +}, [ + {at: -1, expect: 'sticky'}, + {at: 0, expect: 'sticky'}, + {at: 0.4, expect: 'sticky'}, + {at: 0.5, expect: 'fixed'}, + {at: 1, expect: 'fixed'}, + {at: 1.5, expect: 'fixed'}, +]); + // This is still discrete interpolation; this test ensures that the neutral // keyframe is defined correctly for position. test_interpolation({ diff --git a/testing/web-platform/tests/css/css-position/sticky/position-sticky-in-fixed-container.html b/testing/web-platform/tests/css/css-position/sticky/position-sticky-in-fixed-container.html index 359ec2fd33..75c2d67259 100644 --- a/testing/web-platform/tests/css/css-position/sticky/position-sticky-in-fixed-container.html +++ b/testing/web-platform/tests/css/css-position/sticky/position-sticky-in-fixed-container.html @@ -1,6 +1,7 @@ <!DOCTYPE html> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width,initial-scale=1"> +<meta name="fuzzy" content="1;0-50"> <link rel="match" href="position-sticky-in-fixed-container-ref.html"> <link rel="help" href="https://drafts.csswg.org/css-position-3/#sticky-pos"> <link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1854010"> diff --git a/testing/web-platform/tests/css/css-position/sticky/position-sticky-padding-001-ref.html b/testing/web-platform/tests/css/css-position/sticky/position-sticky-padding-001-ref.html new file mode 100644 index 0000000000..efe584bc88 --- /dev/null +++ b/testing/web-platform/tests/css/css-position/sticky/position-sticky-padding-001-ref.html @@ -0,0 +1,37 @@ +<!DOCTYPE html> +<meta charset="UTF-8"> +<meta name="viewport" content="width=device-width, initial-scale=1.0"> +<style> + .block { + position: relative; + width: 300px; + height: 210px; + padding: 10px; + padding-top: 0; + margin: 10px; + float: left; + background-color: #ddd; + } + + .col { + width: 100px; + background-color: blue; + height: 210px; + } + + .abspos { + position: absolute; + width: 10px; + height: 10px; + background-color: cyan; + top: 210px; + } +</style> +<div class="block"> + <div class="col"></div> + <div class="abspos"></div> +</div> +<div class="block"> + <div class="col"></div> + <div class="abspos"></div> +</div> diff --git a/testing/web-platform/tests/css/css-position/sticky/position-sticky-padding-001.html b/testing/web-platform/tests/css/css-position/sticky/position-sticky-padding-001.html new file mode 100644 index 0000000000..6bd4952c28 --- /dev/null +++ b/testing/web-platform/tests/css/css-position/sticky/position-sticky-padding-001.html @@ -0,0 +1,73 @@ +<!DOCTYPE html> +<meta charset="UTF-8"> +<meta name="viewport" content="width=device-width, initial-scale=1.0"> +<link rel="help" href="https://drafts.csswg.org/css-position/#sticky-pos"> +<link rel="help" href="https://bugzil.la/1882091"> +<link rel="match" href="position-sticky-padding-001-ref.html"> +<link rel="author" href="mailto:emilio@crisal.io" title="Emilio Cobos Álvarez"> +<link rel="author" href="https://mozilla.org" title="Mozilla"> +<style> + .flex, + .block { + position: relative; + width: 300px; + height: 200px; + padding: 10px; + margin: 10px; + float: left; + overflow: auto; + scrollbar-width: none; + background-color: #ddd; + } + + .flex { + display: flex; + flex-direction: row; + align-items: start; + justify-content: space-between; + } + + .col { + width: 100px; + background-color: blue; + } + + .col-1 { + position: sticky; + min-height: 300px; + top: 0; + } + + .col-2 { + height: 20px; + align-self: start; + background-color: purple; + } + .block .col-2 { + float: right; /* Just make it visible */ + } + .abspos { + position: absolute; + width: 10px; + height: 10px; + background-color: cyan; + top: 600px; + } +</style> +<div class="flex"> + <div class="col col-1"></div> + <div class="col col-2"></div> + <div class="abspos"></div> +</div> +<div class="block"> + <div class="col col-2"></div> + <div class="col col-1"></div> + <div class="abspos"></div> +</div> +<script> +onload = function() { + for (let e of document.querySelectorAll('.flex,.block')) { + e.scrollTop = 100000; + } +}; +</script> diff --git a/testing/web-platform/tests/css/css-position/sticky/position-sticky-padding-002-ref.html b/testing/web-platform/tests/css/css-position/sticky/position-sticky-padding-002-ref.html new file mode 100644 index 0000000000..cc9d447d1c --- /dev/null +++ b/testing/web-platform/tests/css/css-position/sticky/position-sticky-padding-002-ref.html @@ -0,0 +1,38 @@ +<!DOCTYPE html> +<meta charset="UTF-8"> +<meta name="viewport" content="width=device-width, initial-scale=1.0"> +<style> + .block { + position: relative; + width: 210px; + height: 300px; + padding: 10px; + padding-left: 0; + margin: 10px; + float: left; + background-color: #ddd; + } + + .row { + height: 100px; + width: 210px; + background-color: blue; + } + + .abspos { + position: absolute; + width: 10px; + height: 10px; + background-color: cyan; + top: 0; + left: 210px; + } +</style> +<div class="block"> + <div class="row"></div> + <div class="abspos"></div> +</div> +<div class="block"> + <div class="row"></div> + <div class="abspos"></div> +</div> diff --git a/testing/web-platform/tests/css/css-position/sticky/position-sticky-padding-002.html b/testing/web-platform/tests/css/css-position/sticky/position-sticky-padding-002.html new file mode 100644 index 0000000000..972288fd3a --- /dev/null +++ b/testing/web-platform/tests/css/css-position/sticky/position-sticky-padding-002.html @@ -0,0 +1,71 @@ +<!DOCTYPE html> +<meta charset="UTF-8"> +<meta name="viewport" content="width=device-width, initial-scale=1.0"> +<link rel="help" href="https://drafts.csswg.org/css-position/#sticky-pos"> +<link rel="help" href="https://bugzil.la/1882091"> +<link rel="match" href="position-sticky-padding-002-ref.html"> +<link rel="author" href="mailto:emilio@crisal.io" title="Emilio Cobos Álvarez"> +<link rel="author" href="https://mozilla.org" title="Mozilla"> +<style> + .flex, + .block { + position: relative; + width: 200px; + height: 300px; + padding: 10px; + margin: 10px; + float: left; + overflow: auto; + scrollbar-width: none; + background-color: #ddd; + } + + .flex { + display: flex; + flex-direction: column; + align-items: start; + justify-content: space-between; + } + + .row { + height: 100px; + background-color: blue; + } + + .row-1 { + position: sticky; + min-width: 300px; + left: 0; + } + + .row-2 { + width: 20px; + align-self: start; + background-color: purple; + } + .abspos { + position: absolute; + width: 10px; + height: 10px; + background-color: cyan; + left: 600px; + top: 0; + } +</style> +<div class="flex"> + <div class="row row-1"></div> + <div class="row row-2"></div> + <div class="abspos"></div> +</div> +<div class="block"> + <div class="row row-1"></div> + <div class="row row-2"></div> + <div class="abspos"></div> +</div> +<script> +onload = function() { + for (let e of document.querySelectorAll('.flex,.block')) { + e.scrollLeft = 100000; + } +}; +</script> |