Bug 133326 - [test case] form reset button doesn't reset the select list
Summary: [test case] form reset button doesn't reset the select list
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml forms (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR minor
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-31 12:01 UTC by José JORGE
Modified: 2006-09-01 13:28 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
test case (136 bytes, text/html)
2006-09-01 09:39 UTC, Tommi Tervo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description José JORGE 2006-08-31 12:01:52 UTC
Version:           3.5.4 (using KDE 3.5.4, Debian Package 4:3.5.4-3 (testing/unstable))
Compiler:          Target: i486-linux-gnu
OS:                Linux (i686) release 2.6.17-2-686

This is as the old bug 30094, but as I couldn't re-open it...

Please look at this bug to description.
Comment 1 Andreas Kling 2006-08-31 12:56:28 UTC
The testcase on 30094 works for me on 3.5.4. Can you give us an example of a form where it fails?
Comment 2 José JORGE 2006-09-01 08:28:29 UTC
My test case is a form with no selected item, so the first one is selected.
Then select anything. Reset should come back to the first one.
Comment 3 Tommi Tervo 2006-09-01 09:39:31 UTC
Created attachment 17596 [details]
test case

Yeah, reset selects first one, FF & opera doesn't
Comment 4 Andreas Kling 2006-09-01 13:28:35 UTC
SVN commit 579594 by kling:

Resetting a SELECT with no default selection should only jump to the first option if it's a single-row list.

BUG: 133326


 M  +2 -2      html_formimpl.cpp  


--- branches/KDE/3.5/kdelibs/khtml/html/html_formimpl.cpp #579593:579594
@@ -2428,8 +2428,8 @@
                 anySelected = true;
         }
     }
-    // If there is no default selection, jump to first option.
-    if ( !anySelected ) {
+    // If this is a single-row SELECT and there is no default selection, jump to first option.
+    if ( !anySelected && m_size <= 1 ) {
         for (i = 0; i < itemsSize; ++i) {
             if (items[i]->id() == ID_OPTION) {
                 static_cast<HTMLOptionElementImpl*>(items[i])->setSelected(true);