[Webkit-unassigned] [Bug 52436] New: Possible Bug for <select> elements: No default option selected?

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jan 14 01:56:59 PST 2011


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

           Summary: Possible Bug for <select> elements: No default option
                    selected?
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: PC
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: New Bugs
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: christian.lange.81 at googlemail.com


Hi

(I am using Ubuntu 10.04)
I got a <select> element with three <option> inside (my page ist XHTML 1.0 Transitional), looks like this:

<select>
  <option value="0">0</option>
  <option value="1">1</option>
  <option value="2">2</option>
</select>

None of those is selected manually (i.e. has the "selected='selected'" tag) but on first loading the page, the option "0" ist shown by default. When I use jQuery to delete all "selected" tags in all <option>-element (which are not there), suddenly no option is selected anymore. You can check it yourself with following (w3c validated) little code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
<head>
    <title>test</title>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
</head>
<body>
    <select id="s" size="1">
        <option value="0">0</option>
        <option value="1">1</option>
        <option value="2">2</option>
    </select>
    <input id="i" type="button" value="Remove 'selected'"/>
    <script type="text/javascript">
    $(document).ready(function() {
        $("#i").click(function() {
            $("#s").find("option").removeAttr("selected");
        });
    });
    </script>
</body>
</html>

This disappearing of a selected value happens in Google Chrome 8.0.552.237, Chromium 10.0.639.0 (71411) as well as Safari 5.0.3 (7533.19.4). You see, pretty new browsers. According to webkit.org the webkit version of Chromium is 534.16 but the newest webkit version is r75294. So I can't really tell if I got the newest one, it's a confusing name scheme.
This behaviour, however, does not appear in Firefox 3.6.13, Opera 11.00 or Internet Explorer 8.

I think that the way Firefox, Opera and IE handle this is the correct way. Could you please check if this is a bug in WebKit?

Best regards,
Christian

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