Bug 81496 - [Tests][Forms] We should share code of mouseDownOnSelect
Summary: [Tests][Forms] We should share code of mouseDownOnSelect
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2012-03-18 23:32 PDT by yosin
Modified: 2012-03-18 23:32 PDT (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description yosin 2012-03-18 23:32:58 PDT
JavaScript function mouseDownOnSelect resides in following files:
 1. LayoutTests/fast/forms/listbox-deselect-scroll.html
 2. LayoutTests/fast/forms/resources/select-live-pseudo-selectors.js
 3. LayoutTests/fast/forms/listbox-onchange.html
 4. LayoutTests/fast/forms/listbox-selection.html
 5. LayoutTests/fast/forms/listbox-selection-2.html
 6. LayoutTests/fast/forms/listbox-hit-test-zoomed.html
 7. LayoutTests/fast/forms/select/menulist-popup-crash.html

For ease of maintenance, we should share the code, e.g. move into common place.
Also, the function may do divide by zero in following line:
    var itemHeight = Math.floor(sl.offsetHeight / sl.size);

Test case authors must write non-zero "size" attribute for the "select" element.
I think it is better to throw exception if sl.size is zero.