1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
|
<!DOCTYPE html>
<html>
<title>HTMLselectElement Test: many options</title>
<link rel="author" title="Ionel Popescu" href="mailto:iopopesc@microsoft.com">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-actions.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<style>
#select0 {
position: absolute;
top: 0px;
left: 0px;
}
::picker(select) {
border: 1px solid rgba(0, 0, 0, 0.15);
border-radius: 4px;
box-shadow: 0px 12.8px 28.8px rgba(0, 0, 0, 0.13), 0px 0px 9.2px rgba(0, 0, 0, 0.11);
box-sizing: border-box;
overflow: auto;
padding: 4px;
}
select, ::picker(select) {
appearance: base-select;
}
</style>
<select id="select0">
<div id="select0-popover">
<option>bottom left</option>
<option>two</option>
<option>three</option>
<option>two</option>
<option>three</option>
<option>two</option>
<option>three</option>
<option>two</option>
<option>three</option>
<option>two</option>
<option>three</option>
<option>two</option>
<option>three</option>
<option>two</option>
<option>three</option>
<option>two</option>
<option>three</option>
<option>two</option>
<option>three</option>
<option>two</option>
<option>three</option>
<option>two</option>
<option>three</option>
<option>two</option>
<option>three</option>
<option>two</option>
<option>three</option>
<option>two</option>
<option>three</option>
<option>two</option>
<option>three</option>
<option>two</option>
<option>three</option>
<option>two</option>
<option>three</option>
<option>two</option>
<option>three</option>
<option>two</option>
<option>three</option>
<option>two</option>
<option>three</option>
<option>two</option>
<option>three</option>
<option>two</option>
<option>three</option>
<option>two</option>
<option>three</option>
<option>two</option>
<option>three</option>
<option>two</option>
<option>three</option>
<option>two</option>
<option>three</option>
<option>two</option>
<option>three</option>
<option>two</option>
<option>three</option>
<option>two</option>
<option>three</option>
<option>two</option>
<option>three</option>
<option>two</option>
<option>three</option>
<option>two</option>
<option>three</option>
<option>two</option>
<option>three</option>
<option>two</option>
<option>three</option>
<option>two</option>
<option>three</option>
<option>two</option>
<option>three</option>
<option>two</option>
<option>three</option>
<option>two</option>
<option>three</option>
<option>two</option>
<option>three</option>
<option>two</option>
<option>three</option>
<option>two</option>
<option>three</option>
<option>two</option>
<option>three</option>
<option>two</option>
<option>three</option>
</div>
</select>
<br>
<script>
function clickOn(element) {
const actions = new test_driver.Actions();
return actions.pointerMove(0, 0, {origin: element})
.pointerDown({button: actions.ButtonType.LEFT})
.pointerUp({button: actions.ButtonType.LEFT})
.send();
}
promise_test(async () => {
const select0 = document.getElementById("select0");
const select0Popover = document.getElementById("select0-popover");
await clickOn(select0);
assert_equals(Math.round(select0.getBoundingClientRect().bottom), Math.round(select0Popover.getBoundingClientRect().top));
assert_equals(Math.round(select0.getBoundingClientRect().left), Math.round(select0Popover.getBoundingClientRect().left));
assert_equals(window.innerHeight, Math.round(select0Popover.getBoundingClientRect().bottom));
}, "The popover should be bottom left positioned");
</script>
|