fune/layout/forms/test/test_unstyled_control_height.html
Emilio Cobos Álvarez a1bf2a82af Bug 1560824 - Move combobox select padding to the select rule rather than the combobox frame. r=dholbert
This doesn't change behavior by default but allows authors to remove the
padding if they wish to.

I thought this was going to be problematic because of the windows
arrowbutton, but that doesn't respect select padding so we're good.

Differential Revision: https://phabricator.services.mozilla.com/D103245
2021-01-28 07:09:23 +00:00

33 lines
779 B
HTML

<!doctype html>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<style>
.non-native * {
appearance: none;
}
.no-padding * {
padding: 0;
}
</style>
<div id="container" class="non-native">
<input>
<button>Foo</button>
<select><option>Foo</option></select>
</div>
<script>
function testHeightMatches(desc) {
let commonHeight = null;
for (let element of document.querySelectorAll("#container > *")) {
let height = element.getBoundingClientRect().height;
if (commonHeight === null) {
commonHeight = height;
}
is(height, commonHeight, "Height of the controls should match" + desc);
}
}
testHeightMatches("");
document.getElementById("container").classList.add("no-padding");
testHeightMatches(" without padding");
</script>