Bug 14362 - Opening a select list always highlights first element in list
Summary: Opening a select list always highlights first element in list
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 523.x (Safari 3)
Hardware: All Windows XP
: P1 Normal
Assignee: Nobody
URL:
Keywords: HasReduction, PlatformOnly
Depends on:
Blocks:
 
Reported: 2007-06-24 01:42 PDT by Tore B. Krudtaa
Modified: 2008-03-25 08:02 PDT (History)
5 users (show)

See Also:


Attachments
example showing select error (see Bug 14879) (890 bytes, text/html)
2007-08-01 13:22 PDT, Neal Rutta
no flags Details
Select bug in safar beta for win - - nothing to do with javascript (2.96 KB, text/html)
2007-08-03 09:32 PDT, Tore B. Krudtaa
no flags Details
Track the mouse only inside the popup (1.78 KB, patch)
2007-08-04 02:51 PDT, mitz
aroben: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tore B. Krudtaa 2007-06-24 01:42:40 PDT
If I click a select list to open it then safari allways highlights the first element in list.

If another element in list than the first one is the selected one, then it is not highlighted when you open the list.
Comment 1 David Kilzer (:ddkilzer) 2007-06-24 07:27:43 PDT
Is this a platform-only bug?

Comment 2 Neal Rutta 2007-08-01 13:22:05 PDT
Created attachment 15792 [details]
example showing select error (see Bug 14879)



This reproduces the bug, where a select element doesn't correctly show the "selected" option initially.
Comment 3 Neal Rutta 2007-08-01 13:22:49 PDT
I just added an attachment for this bug. This is not a platform-only bug. This test has the problem when I ran safari on both Mac and Windows platforms.
Comment 4 David Kilzer (:ddkilzer) 2007-08-02 06:36:57 PDT
Thanks for the test case, Neal!

Comment 5 David Kilzer (:ddkilzer) 2007-08-02 06:38:57 PDT
This is a regression from shipping Safari 2.0.4 (419.3) with original WebKit on Mac OS X 10.4.10 (8R218).

Tested with a local debug build of WebKit r24803 with Safari 3 Public Beta v. 3.0.3 (522.12.1) on 10.4.10.

Comment 6 David Kilzer (:ddkilzer) 2007-08-02 06:39:23 PDT
<rdar://problem/5380342>
Comment 7 John Sullivan 2007-08-02 13:38:32 PDT
I can't reproduce this with tip of tree WebKit on either Tiger or Leopard.
Comment 8 mitz 2007-08-02 15:45:49 PDT
(In reply to comment #7)
> I can't reproduce this with tip of tree WebKit on either Tiger or Leopard.
> 

When I open attachment 15792 [details] the popup button reads "one", which is wrong because in the DOM, the "three" option is selected. "three" is also selected in the popup when I click the button (and even appears on the button if I do not make a selection). What's bothering me is that I am sure a bug identical or very similar to this has already been fixed once...
Comment 9 John Sullivan 2007-08-02 17:01:09 PDT
I see. I didn't read all the comments carefully enough. The bug title implies that the wrong thing happens when opening the list, which I interpreted as clicking on the list. In fact what I see is that the wrong item is displayed *before* the list is clicked on, but clicking on the list corrects the problem and causes the right item to be displayed.

Changed title to reflect the actual problem as I now understand it.
Comment 10 Tore B. Krudtaa 2007-08-03 00:29:07 PDT
Well, I belive the title now is totally wrong.

Title now is:
REGRESSION: First item in select (pop-up menu) is displayed even if another item was selected via JavaScript

What I originally reported was this:
If I click a select list to open it then safari allways highlights the first
element in list.

This is still how it works, and has nothing to do with javascript at all.

When I select a new item in a select in my form then the form is submitted to server and a new form is populated... AND then another item in the select are selected, and that is the item you now see in the select.

And when the form opens, no javascript has ever touched the select.
Then when I click the select to eventually select another item then the topmost item in the select is ALLWAYS selected, and not the one that is actually selected.

In other words..... the item that is selected in the list, if it is not the topmost item, is never highlighted.

So for me it looks like the "engine code" or whatever that handle operations on the select are unable to see which option in the list are marked as selected, and by some reason chooses to allways mark the first one.

So, as the title are now.... it is wrong and misleading.

Regards
Comment 11 David Kilzer (:ddkilzer) 2007-08-03 05:50:31 PDT
(In reply to comment #10)
> Well, I belive the title now is totally wrong.

Please provide a test case that demonstrates the issue you're seeing.

Comment 12 Tore B. Krudtaa 2007-08-03 09:32:34 PDT
Created attachment 15820 [details]
Select bug in safar beta for win - - nothing to do with javascript

Here is an example file with instructions on how to reproduce the select bug in safari beta for windows.

Should be easy to reproduce.

As you can see, no javascript needed to reproduce it.
Comment 13 David Kilzer (:ddkilzer) 2007-08-03 09:57:51 PDT
(In reply to comment #12)
> Created an attachment (id=15820) [edit]
> Select bug in safar beta for win - - nothing to do with javascript

It appears that the reduction in Attachment #15792 [details] is a different bug than the one originally filed by Tore.

I will open a new Bugzilla bug for Attachment #15792 [details] later today (unless someone beats me to it), and change this bug back to its original intent.
Comment 14 mitz 2007-08-03 14:29:19 PDT
(In reply to comment #13)
> I will open a new Bugzilla bug for Attachment #15792 [details] [edit] later today (unless
> someone beats me to it), and change this bug back to its original intent.

Bug 14879.
Comment 15 David Kilzer (:ddkilzer) 2007-08-03 14:47:39 PDT
No longer in Radar.  See Bug 14879.

Comment 16 David Kilzer (:ddkilzer) 2007-08-03 14:51:15 PDT
Comment on attachment 15792 [details]
example showing select error (see Bug 14879)



*Jedi hand wave*  This is not the reduction you're looking for.
Comment 17 mitz 2007-08-04 02:51:06 PDT
Created attachment 15837 [details]
Track the mouse only inside the popup
Comment 18 Adam Roben (:aroben) 2007-08-04 09:15:17 PDT
Comment on attachment 15837 [details]
Track the mouse only inside the popup

r=me
Comment 19 Mark Rowe (bdash) 2007-08-09 20:54:21 PDT
Landed in r24972.
Comment 20 Tore B. Krudtaa 2008-03-25 05:59:27 PDT
I belive there still is a bug with select lists in Safari.

I have now installed and tested select lists using Safari Version 3.1 (525.13)
and have found the following weird behaviour.... tested on XP PRO SP2

*** BUG 1 ***
If you click on the select list to open it then it will now
highlight the selected item in the select (which is good).
BUT, if you then click on the select (the very top of it) while it is open then it sometimes highlight the first option in the list, even if it is not the selected one.

*** BUG 2 ***
It is not very consistent regarding to clicks on the top of the select (the part of the select that is visible by default in the page).
Example:
1. Select list is not open.
2. You click on the select to open the list.
3. You then click on the top of select again to close it...
   Most of the time the select does not close the list by doing this, which
   I belive it should do.
   More often you will see the top option in list get highlighted as of BUG 1.

I belive the select list should close when clicking the very top part of the select (the one that is visible by default in the page), if the select list is open. At least this is the way it works in other working browsers (IE, Firefox).

****************************************************
One last thing that is not related to this issue....
****************************************************
Who is responsible for how Safari renders the fonts.
The fonts in Safari (at least on windows) really look ugly when compared to
how the fonts are rendered in IE, Firefox or Opera.
(this is not a joke)
Text that look crisp and good reading looks very smudget and are rendered
more "fat" than it "should".

Example: font-weight:normal; in Safari are rendered more "boldish" than e.g.
IE or Firefox.

Where can I file a complaint on how font rendering are done in Safari?

Comment 21 Alexey Proskuryakov 2008-03-25 07:08:18 PDT
Could you please file new bugs for these issues? This bug has been resolved, and trying to track all related issues here would only cause confusion.
Comment 22 Tore B. Krudtaa 2008-03-25 08:02:52 PDT
Done. See:
http://bugs.webkit.org/show_bug.cgi?id=18068