Commit e2c21044 authored by Mason Freed's avatar Mason Freed Committed by Commit Bot

Respect zero font size on <select> option and optgroup

Prior to this change, font-size:0 was ignored for <select>
options and option groups.

Fixed: 1102414
Change-Id: I93389cbe5258095896f6846077c9df2c18410947
Cq-Do-Not-Cancel-Tryjobs: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2283051
Auto-Submit: Mason Freed <masonfreed@chromium.org>
Reviewed-by: default avatarYu Han <yuzhehan@chromium.org>
Commit-Queue: Mason Freed <masonfreed@chromium.org>
Cr-Commit-Position: refs/heads/master@{#785885}
parent b879cc60
...@@ -444,7 +444,8 @@ ListPicker.prototype._applyItemStyle = function(element, styleConfig) { ...@@ -444,7 +444,8 @@ ListPicker.prototype._applyItemStyle = function(element, styleConfig) {
style.color = styleConfig.color ? styleConfig.color : ''; style.color = styleConfig.color ? styleConfig.color : '';
style.backgroundColor = style.backgroundColor =
styleConfig.backgroundColor ? styleConfig.backgroundColor : ''; styleConfig.backgroundColor ? styleConfig.backgroundColor : '';
style.fontSize = styleConfig.fontSize ? styleConfig.fontSize + 'px' : ''; style.fontSize =
styleConfig.fontSize !== undefined ? styleConfig.fontSize + 'px' : '';
style.fontWeight = styleConfig.fontWeight ? styleConfig.fontWeight : ''; style.fontWeight = styleConfig.fontWeight ? styleConfig.fontWeight : '';
style.fontFamily = styleConfig.fontFamily ? style.fontFamily = styleConfig.fontFamily ?
styleConfig.fontFamily.map(s => '"' + s + '"').join(',') : styleConfig.fontFamily.map(s => '"' + s + '"').join(',') :
......
<!DOCTYPE html>
<script>
testRunner.waitUntilDone();
</script>
<script src="../resources/picker-common.js"></script>
<select id="menu">
<optgroup label="Theropods">
<option>Tyrannosaurus</option>
<option>Velociraptor</option>
<option>Deinonychus</option>
</optgroup>
<optgroup label="Sauropods">
<option>Diplodocus</option>
<option>Saltasaurus</option>
<option>Apatosaurus</option>
</optgroup>
</select>
<style>
option, optgroup {
font-size:0;
}
</style>
<script>
openPicker(document.getElementById('menu'), () => testRunner.notifyDone(), () => testRunner.notifyDone());
</script>
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment