[Webkit-unassigned] [Bug 70765] Default <select multiple> expands up to 10 items instead of showing 4

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Nov 3 09:50:57 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=70765





--- Comment #12 from Darin Adler <darin at apple.com>  2011-11-03 09:50:57 PST ---
(In reply to comment #10)
> I have added the pixel tests, since the change affects visually i.e earlier it used to display 10 option, now it will display options according to the prsence of multiple attar.

Yes, but you don’t have to make a pixel test just to check if the height of the element changed.

> Also are you talking of test case which will look like:-
> 1. With multiple attr and number of options are greater then the default (4)
> <select multiple id="sel" >
>     <option value="1">One</option>
>     ------- ------ ----- ------
> </select>
> <script>
>     var sel = document.getElementById('sel');
>     shouldBeTrue('sel.scrollHeight > sel.clientHeight');
> </script>
> 2. With multiple attr and number of options are less then the default (4)
> <select multiple id="sel">
>     <option value="1">One</option>
>     <option value="2">Two</option>
>     <option value="3">Three</option>
> </select>
> <script>
>     var sel = document.getElementById('sel');
>     shouldBeTrue('sel.scrollHeight == sel.clientHeight');
> </script>
> 
> I am using clientHeight since it excluded border width.
> 
> On some test cases, I have seen usage of value 17 (I think thats the default font size). So can I use it for checking the space when we have less elements than the default.

Yes, something like that. I wasn't thinking of comparing scrollHeight to clientHeight. More comparing clientHeight of differently sized select elements. A single test could really easily cover all sorts of different combinations and expected heights and test them by checking the relationships between the heights.

You could even calibrate by checking the height of a single item one, and then make a function that does the math and returns the size in rows, and "error" if the size isn’t an even multiple of rows.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list