Bug 610733. Vertically center the text in the combobox display area when a non-default height is set for the combobox. r=dbaron

This commit is contained in:
Boris Zbarsky 2014-03-25 22:48:46 -04:00
parent 05878d4b12
commit bbe206097b
4 changed files with 44 additions and 0 deletions

View File

@ -4,3 +4,4 @@ skip-if(B2G) == multiple.html multiple-ref.html
== dynamic-boguskids.html boguskids-ref.html
== option-children.html option-children-ref.html
fuzzy(1,4) == padding-button-placement.html padding-button-placement-ref.html
HTTP(../..) == vertical-centering.html vertical-centering-ref.html

View File

@ -0,0 +1,23 @@
<!DOCTYPE html>
<style>
@font-face {
font-family: "Ahem";
src: url(../../fonts/Ahem.ttf);
}
select {
-moz-appearance: none;
border: none;
font-family: Ahem;
font-size: 20px;
box-sizing: content-box;
/*
* Why are these top/bottom paddings 7px rather than 10px? 1px each is
* eaten up by padding on the combobox display area, but I have no idea
* where the extra 4px somewhere else are coming from...
*/
padding: 7px 0 7px 0;
}
</style>
<select>
<option>X</option>
</select>

View File

@ -0,0 +1,19 @@
<!DOCTYPE html>
<style>
@font-face {
font-family: "Ahem";
src: url(../../fonts/Ahem.ttf);
}
select {
-moz-appearance: none;
border: none;
font-family: Ahem;
font-size: 20px;
padding: 0;
box-sizing: content-box;
height: 40px;
}
</style>
<select>
<option>X</option>
</select>

View File

@ -282,6 +282,7 @@ select:empty {
/* Make sure to size correctly if the combobox has a non-auto height. */
height: 100% ! important;
box-sizing: border-box ! important;
line-height: -moz-block-height;
}
option {