Source code

Revision control

Copy as Markdown

Other Tools

Test Info: Warnings

<!DOCTYPE html>
<link rel=author href="mailto:jarhar@chromium.org">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<style>
select, select::picker(select) {
appearance: base-select;
}
select::picker(select) {
transition-behavior: allow-discrete;
transition-duration: 100s;
transition-property: display, overlay, opacity, color;
transition-timing-function: steps(1, jump-both);
opacity: 0;
color: black;
}
select::picker(select):popover-open {
opacity: 1;
color: rgb(200, 0, 0);
}
@starting-style {
select::picker(select):popover-open {
opacity: 0;
color: black;
}
}
</style>
<select>
<option>one</option>
<option>two</option>
</select>
<script>
const select = document.querySelector('select');
const firstOption = document.querySelector('option');
promise_test(async () => {
assert_equals(document.styleSheets[0].cssRules.length, 4,
'All 4 of the CSS rules should have been parsed.');
assert_equals(getComputedStyle(firstOption).color, 'rgb(0, 0, 0)',
'option color should be black before animation starts.');
await test_driver.bless();
select.showPicker();
await new Promise(requestAnimationFrame);
await new Promise(requestAnimationFrame);
assert_equals(getComputedStyle(firstOption).color, 'rgb(100, 0, 0)',
'option color should start animating when opening the picker.');
}, 'select::picker(select) should support author provided top layer animations.');
</script>