diff options
Diffstat (limited to 'testing/web-platform/tests/css/css-position/overlay')
5 files changed, 144 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-position/overlay/animation/overlay-interpolation.html b/testing/web-platform/tests/css/css-position/overlay/animation/overlay-interpolation.html new file mode 100644 index 0000000000..a3034b88c1 --- /dev/null +++ b/testing/web-platform/tests/css/css-position/overlay/animation/overlay-interpolation.html @@ -0,0 +1,80 @@ +<!DOCTYPE html> +<link rel=author href="mailto:jarhar@chromium.org"> +<link rel=help href="https://drafts.csswg.org/css-position-4/#overlay"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/interpolation-testcommon.js"></script> + +<body> +<script> +const alwaysAuto = [ + {at: -1, expect: 'auto'}, + {at: 0, expect: 'auto'}, + {at: 0.1, expect: 'auto'}, + {at: 0.9, expect: 'auto'}, + {at: 1, expect: 'auto'}, + {at: 1.5, expect: 'auto'}, +]; +const alwaysNone = [ + {at: -1, expect: 'none'}, + {at: 0, expect: 'none'}, + {at: 0.1, expect: 'none'}, + {at: 0.9, expect: 'none'}, + {at: 1, expect: 'none'}, + {at: 1.5, expect: 'none'}, +]; + +test_interpolation({ + property: 'overlay', + from: 'auto', + to: 'none', + // transition:all is not supposed to allow overlay to be transitioned. + 'CSS Transitions with transition: all': alwaysNone, +}, [ + {at: -1, expect: 'auto'}, + {at: 0, expect: 'auto'}, + {at: 0.1, expect: 'auto'}, + {at: 0.9, expect: 'auto'}, + {at: 1, expect: 'none'}, + {at: 1.5, expect: 'none'}, +]); + +test_interpolation({ + property: 'overlay', + from: 'none', + to: 'auto', + // transition:all is not supposed to allow overlay to be transitioned. + 'CSS Transitions with transition: all': alwaysAuto, +}, [ + {at: -1, expect: 'none'}, + {at: 0, expect: 'none'}, + {at: 0.1, expect: 'auto'}, + {at: 0.9, expect: 'auto'}, + {at: 1, expect: 'auto'}, + {at: 1.5, expect: 'auto'}, +]); + +test_interpolation({ + property: 'overlay', + from: 'auto', + to: 'auto' +}, [ + {at: -1, expect: 'auto'}, + {at: 0, expect: 'auto'}, + {at: 0.5, expect: 'auto'}, + {at: 1, expect: 'auto'}, + {at: 1.5, expect: 'auto'}, +]); + +test_interpolation({ + property: 'overlay', + from: 'none', + to: 'none' +}, [ + {at: -1, expect: 'none'}, + {at: 0, expect: 'none'}, + {at: 0.5, expect: 'none'}, + {at: 1, expect: 'none'}, + {at: 1.5, expect: 'none'}, +]); +</script> diff --git a/testing/web-platform/tests/css/css-position/overlay/overlay-computed.html b/testing/web-platform/tests/css/css-position/overlay/overlay-computed.html new file mode 100644 index 0000000000..f1a0a315de --- /dev/null +++ b/testing/web-platform/tests/css/css-position/overlay/overlay-computed.html @@ -0,0 +1,19 @@ +<!DOCTYPE html> +<title>CSS Positioned Layout Module Test: getComputedStyle().overlay</title> +<link rel="help" href="https://drafts.csswg.org/css-position-4/#overlay"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/computed-testcommon.js"></script> +<div id="target"></div> +<script> + test_computed_value("overlay", "none", "none"); + // 'auto' also computes to 'none' due to this UA style while the element is + // not in the top layer: + // + // * { overlay: none !important } + test_computed_value("overlay", "auto", "none"); + test_computed_value("overlay", "inherit", "none"); + test_computed_value("overlay", "initial", "none"); + test_computed_value("overlay", "revert", "none"); + test_computed_value("overlay", "unset", "none"); +</script> diff --git a/testing/web-platform/tests/css/css-position/overlay/overlay-invalid.html b/testing/web-platform/tests/css/css-position/overlay/overlay-invalid.html new file mode 100644 index 0000000000..e84d0c8a6b --- /dev/null +++ b/testing/web-platform/tests/css/css-position/overlay/overlay-invalid.html @@ -0,0 +1,15 @@ +<!DOCTYPE html> +<title>CSS Positioned Layout Module Test: parsing overlay with invalid values</title> +<link rel="help" href="https://drafts.csswg.org/css-position-4/#overlay"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/parsing-testcommon.js"></script> +<script> + // overlay: none | auto + test_invalid_value("overlay", "browser"); + test_invalid_value("overlay", "normal"); + test_invalid_value("overlay", "none auto"); + test_invalid_value("overlay", "none, auto"); + test_invalid_value("overlay", "\'auto\'"); + test_invalid_value("overlay", "\'none\'"); +</script> diff --git a/testing/web-platform/tests/css/css-position/overlay/overlay-transition-property.html b/testing/web-platform/tests/css/css-position/overlay/overlay-transition-property.html new file mode 100644 index 0000000000..a667f26ea6 --- /dev/null +++ b/testing/web-platform/tests/css/css-position/overlay/overlay-transition-property.html @@ -0,0 +1,15 @@ +<!DOCTYPE html> +<title>CSS Positioned Layout Module Test: 'overlay' is a valid transition-property value</title> +<link rel="help" href="https://drafts.csswg.org/css-position-4/#overlay"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/parsing-testcommon.js"></script> +<script src="/css/support/computed-testcommon.js"></script> +<div id="target"></div> +<script> + test_valid_value("transition-property", "overlay"); + test_valid_value("transition", "overlay 2s", "overlay 2s ease 0s"); + + test_computed_value("transition-property", "overlay"); + test_computed_value("transition", "overlay 1s", "overlay 1s ease 0s"); +</script> diff --git a/testing/web-platform/tests/css/css-position/overlay/overlay-valid.html b/testing/web-platform/tests/css/css-position/overlay/overlay-valid.html new file mode 100644 index 0000000000..8d808ac6dc --- /dev/null +++ b/testing/web-platform/tests/css/css-position/overlay/overlay-valid.html @@ -0,0 +1,15 @@ +<!DOCTYPE html> +<title>CSS Positioned Layout Module Test: parsing overlay with valid values</title> +<link rel="help" href="https://drafts.csswg.org/css-position-4/#overlay"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/parsing-testcommon.js"></script> +<script> + // overlay: none | auto + test_valid_value("overlay", "none"); + test_valid_value("overlay", "auto"); + test_valid_value("overlay", "inherit"); + test_valid_value("overlay", "initial"); + test_valid_value("overlay", "revert"); + test_valid_value("overlay", "unset"); +</script> |