Index: django/newforms/widgets.py
===================================================================
--- django/newforms/widgets.py	(Revision 7351)
+++ django/newforms/widgets.py	(Arbeitskopie)
@@ -375,14 +375,22 @@
     def render(self, name, value, attrs=None, choices=()):
         if value is None: value = []
         final_attrs = self.build_attrs(attrs, name=name)
-        output = [u'<select multiple="multiple"%s>' % flatatt(final_attrs)]
+        output = []
+        choice_count = 0
         str_values = set([force_unicode(v) for v in value]) # Normalize to strings.
         for option_value, option_label in chain(self.choices, choices):
+            choice_count += 1
             option_value = force_unicode(option_value)
             selected_html = (option_value in str_values) and ' selected="selected"' or ''
             output.append(u'<option value="%s"%s>%s</option>' % (
                     escape(option_value), selected_html,
                     conditional_escape(force_unicode(option_label))))
+        # default size attribute for cross-browser consistent rendering
+        if 'size' not in final_attrs:
+            # emulate the behaviour of firefox: adjust the size to the number of choices, with an upper boundary
+            final_attrs['size'] = min(10, max(1, choice_count))
+        # we have to prepend because choices can be any iterable and we cannot call len() so we have to count them first
+        output = [u'<select multiple="multiple"%s>' % flatatt(final_attrs)] + output
         output.append(u'</select>')
         return mark_safe(u'\n'.join(output))
 
Index: tests/modeltests/model_forms/models.py
===================================================================
--- tests/modeltests/model_forms/models.py	(Revision 7351)
+++ tests/modeltests/model_forms/models.py	(Arbeitskopie)
@@ -330,7 +330,7 @@
 <option value="2">Pending</option>
 <option value="3">Live</option>
 </select></td></tr>
-<tr><th>Categories:</th><td><select multiple="multiple" name="categories">
+<tr><th>Categories:</th><td><select multiple="multiple" name="categories" size="3">
 <option value="1">Entertainment</option>
 <option value="2">It&#39;s a test</option>
 <option value="3">Third test</option>
@@ -386,7 +386,7 @@
 <option value="2">Pending</option>
 <option value="3">Live</option>
 </select></li>
-<li>Categories: <select multiple="multiple" name="categories">
+<li>Categories: <select multiple="multiple" name="categories" size="3">
 <option value="1">Entertainment</option>
 <option value="2">It&#39;s a test</option>
 <option value="3">Third test</option>
@@ -447,7 +447,7 @@
 <option value="2">Pending</option>
 <option value="3">Live</option>
 </select></li>
-<li>Categories: <select multiple="multiple" name="categories">
+<li>Categories: <select multiple="multiple" name="categories" size="3">
 <option value="1" selected="selected">Entertainment</option>
 <option value="2">It&#39;s a test</option>
 <option value="3">Third test</option>
@@ -563,7 +563,7 @@
 <option value="2">Pending</option>
 <option value="3">Live</option>
 </select></li>
-<li>Categories: <select multiple="multiple" name="categories">
+<li>Categories: <select multiple="multiple" name="categories" size="3">
 <option value="1">Entertainment</option>
 <option value="2">It&#39;s a test</option>
 <option value="3">Third</option>
@@ -589,7 +589,7 @@
 <option value="2">Pending</option>
 <option value="3">Live</option>
 </select></li>
-<li>Categories: <select multiple="multiple" name="categories">
+<li>Categories: <select multiple="multiple" name="categories" size="4">
 <option value="1">Entertainment</option>
 <option value="2">It&#39;s a test</option>
 <option value="3">Third</option>
Index: tests/regressiontests/admin_widgets/models.py
===================================================================
--- tests/regressiontests/admin_widgets/models.py	(Revision 7351)
+++ tests/regressiontests/admin_widgets/models.py	(Arbeitskopie)
@@ -38,7 +38,7 @@
 
 >>> w = FilteredSelectMultiple('test', False)
 >>> print conditional_escape(w.render('test', 'test'))
-<select multiple="multiple" name="test">
+<select multiple="multiple" name="test" size="1">
 </select><script type="text/javascript">addEvent(window, "load", function(e) {SelectFilter.init("id_test", "test", 0, "%(ADMIN_MEDIA_PREFIX)s"); });</script>
 <BLANKLINE>
 
Index: tests/regressiontests/forms/extra.py
===================================================================
--- tests/regressiontests/forms/extra.py	(Revision 7351)
+++ tests/regressiontests/forms/extra.py	(Arbeitskopie)
@@ -259,7 +259,7 @@
 >>> w = ComplexMultiWidget()
 >>> print w.render('name', 'some text,JP,2007-04-25 06:24:00')
 <input type="text" name="name_0" value="some text" />
-<select multiple="multiple" name="name_1">
+<select multiple="multiple" name="name_1" size="4">
 <option value="J" selected="selected">John</option>
 <option value="P" selected="selected">Paul</option>
 <option value="G">George</option>
@@ -300,7 +300,7 @@
 >>> f = ComplexFieldForm()
 >>> print f
 <tr><th><label for="id_field1_0">Field1:</label></th><td><input type="text" name="field1_0" id="id_field1_0" />
-<select multiple="multiple" name="field1_1" id="id_field1_1">
+<select multiple="multiple" size="4" name="field1_1" id="id_field1_1">
 <option value="J">John</option>
 <option value="P">Paul</option>
 <option value="G">George</option>
@@ -311,7 +311,7 @@
 >>> f = ComplexFieldForm({'field1_0':'some text','field1_1':['J','P'], 'field1_2_0':'2007-04-25', 'field1_2_1':'06:24:00'})
 >>> print f
 <tr><th><label for="id_field1_0">Field1:</label></th><td><input type="text" name="field1_0" value="some text" id="id_field1_0" />
-<select multiple="multiple" name="field1_1" id="id_field1_1">
+<select multiple="multiple" size="4" name="field1_1" id="id_field1_1">
 <option value="J" selected="selected">John</option>
 <option value="P" selected="selected">Paul</option>
 <option value="G">George</option>
Index: tests/regressiontests/forms/forms.py
===================================================================
--- tests/regressiontests/forms/forms.py	(Revision 7351)
+++ tests/regressiontests/forms/forms.py	(Arbeitskopie)
@@ -475,14 +475,14 @@
 ...     composers = MultipleChoiceField()
 >>> f = SongForm(auto_id=False)
 >>> print f['composers']
-<select multiple="multiple" name="composers">
+<select multiple="multiple" name="composers" size="1">
 </select>
 >>> class SongForm(Form):
 ...     name = CharField()
 ...     composers = MultipleChoiceField(choices=[('J', 'John Lennon'), ('P', 'Paul McCartney')])
 >>> f = SongForm(auto_id=False)
 >>> print f['composers']
-<select multiple="multiple" name="composers">
+<select multiple="multiple" name="composers" size="2">
 <option value="J">John Lennon</option>
 <option value="P">Paul McCartney</option>
 </select>
@@ -490,7 +490,7 @@
 >>> print f['name']
 <input type="text" name="name" value="Yesterday" />
 >>> print f['composers']
-<select multiple="multiple" name="composers">
+<select multiple="multiple" name="composers" size="2">
 <option value="J">John Lennon</option>
 <option value="P" selected="selected">Paul McCartney</option>
 </select>
