<!DOCTYPE html><linkrel=authorhref="mailto:jarhar@chromium.org"><linkrel=helphref="https://github.com/openui/open-ui/issues/547"><linkrel=helphref="https://drafts.csswg.org/selectors/#open-state"><scriptsrc="/resources/testharness.js"></script><scriptsrc="/resources/testharnessreport.js"></script><scriptsrc="/resources/testdriver.js"></script><scriptsrc="/resources/testdriver-actions.js"></script><scriptsrc="/resources/testdriver-vendor.js"></script><selectid=myselect><option>one</option><option>two</option></select><style>select,::picker(select){appearance:base-select;}</style><script>promise_test(async()=>{assert_true(CSS.supports('appearance','base-select'),'This test requires appearance:base-select in order to run.');assert_false(myselect.matches(':open'),'select should not match :open while it is closed.');awaittest_driver.click(myselect);assert_true(myselect.matches(':open'),'select should match :open while it is open.');},'select should support :open pseudo selector.');</script><selectid=selectinvalidation><option>one</option><option>two</option></select><style>select:not(:open){background-color:red;}select:open{background-color:green;}</style><script>promise_test(async()=>{assert_true(CSS.supports('appearance','base-select'),'This test requires appearance:base-select in order to run.');constselect=document.getElementById('selectinvalidation');constoption=select.querySelector('option');assert_equals(getComputedStyle(select).backgroundColor,'rgb(255, 0, 0)','The style rules from :not(:open) should apply when the select is closed.');awaittest_driver.click(select);assert_equals(getComputedStyle(select).backgroundColor,'rgb(0, 128, 0)','The style rules from :open should apply when the select is open.');awaittest_driver.click(select);assert_equals(getComputedStyle(select).backgroundColor,'rgb(255, 0, 0)','The style rules from :not(:open) should apply when the select is opened and closed again.');},'select :open and :not(:open) should invalidate correctly.');</script>