forked from mirrors/gecko-dev
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
33 lines
779 B
HTML
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>
|