[Webkit-unassigned] [Bug 22784] [Chromium] Home and End buttons do not do anything in drop down lists

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jul 10 14:11:36 PDT 2009


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


Mark Rowe (bdash) <mrowe at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #32577|review?                     |review-
               Flag|                            |




--- Comment #6 from Mark Rowe (bdash) <mrowe at apple.com>  2009-07-10 14:11:35 PDT ---
(From update of attachment 32577)
> -#if PLATFORM(MAC)
> +// On Mac (Safari or Chrome), pop up the menu if the user presses the arrow keys
> +// while a Select element has focus. On other platforms, just change the selection.
> +#if PLATFORM(DARWIN) && !PLATFORM(IPHONE)
>  #define ARROW_KEYS_POP_MENU 1
>  #else
>  #define ARROW_KEYS_POP_MENU 0

Another minor comment: Mac WebKit is more than just Safari, so it doesn't makes
too much sense to mention Safari here.

> +#if !ARROW_KEYS_POP_MENU
> +// Returns the index of the next valid list item in direction |dir| past |listIndex|.
> +static int nextValidIndex(int listIndex, int dir, const Vector<Element*>& listItems) {
> +    ASSERT(dir!=0);
> +    int size = listItems.size();
> +    for (listIndex += dir; listIndex >= 0 && listIndex < size; listIndex += dir) {
> +        if (!listItems[listIndex]->disabled() && isOptionElement(listItems[listIndex]))
> +            return listIndex;
> +    }
> +    return -1;
> +}
> +#endif

There are some minor style issues here (brace on same line as function
definition, lack of whitespace around operators).  We also prefer not to
unnecessarily abbreviate variable names such as "dir".  It may be clearer to
use an enum rather than magic values such as -1 and 1 to represent up and down
as the directions.

-- 
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