diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
commit | 6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch) | |
tree | a68f146d7fa01f0134297619fbe7e33db084e0aa /layout/forms/test/test_select_reframe.html | |
parent | Initial commit. (diff) | |
download | thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.tar.xz thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.zip |
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | layout/forms/test/test_select_reframe.html | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/layout/forms/test/test_select_reframe.html b/layout/forms/test/test_select_reframe.html new file mode 100644 index 0000000000..666d8074b8 --- /dev/null +++ b/layout/forms/test/test_select_reframe.html @@ -0,0 +1,52 @@ +<!doctype html> +<meta charset="utf-8"> +<title>Test for page up/down in collapsed select (bug 1488828)</title> +<script src="/tests/SimpleTest/SimpleTest.js"></script> +<script src="/tests/SimpleTest/EventUtils.js"></script> +<link rel="stylesheet" href="/tests/SimpleTest/test.css"/> +<style> +.reframe { + display: flex; +} +</style> +<div id="container"> + <select> + <option>ABC</option> + <option>DEF</option> + </select> +</div> +<script> +(async function() { + SimpleTest.waitForExplicitFinish(); + + const utils = SpecialPowers.DOMWindowUtils; + const select = document.querySelector("select"); + await SimpleTest.promiseFocus(window); + + ok(!select.openInParentProcess, "Should not be open") + + select.focus(); + synthesizeKey("VK_SPACE"); + + ok(SpecialPowers.wrap(select).openInParentProcess, "Should open"); + + const container = document.getElementById("container"); + container.getBoundingClientRect(); // flush layout + + const frameCountBeforeReframe = utils.framesConstructed; + + container.classList.add("reframe"); + + container.getBoundingClientRect(); // flush layout + + ok(utils.framesConstructed > frameCountBeforeReframe, "Should have reframed"); + ok(SpecialPowers.wrap(select).openInParentProcess, "Should remain open"); + + select.remove(); + + container.getBoundingClientRect(); // flush layout + ok(!SpecialPowers.wrap(select).openInParentProcess, "Should close after removal"); + + SimpleTest.finish(); +}()); +</script> |