[Webkit-unassigned] [Bug 9179] Implement select.options.add() method

bugzilla-daemon at opendarwin.org bugzilla-daemon at opendarwin.org
Tue Jul 4 05:49:03 PDT 2006


http://bugzilla.opendarwin.org/show_bug.cgi?id=9179





------- Comment #18 from ddkilzer at kilzer.net  2006-07-04 05:49 PDT -------
(In reply to comment #17)
> (From update of attachment 9174 [edit])
> The reason getNumber returns a boolean is so that you don't have to make a
> separate call to isNumber. And we don't use the function call syntax for type
> casts -- instead we use C++ cast syntax. So this:
> 
> +    if (value->isNumber()) {
> +        double lengthValue;
> +        value->getNumber(lengthValue);
> +        if (lengthValue < 0.0)
> +            return;
> +        if (lengthValue > double(UINT_MAX))
> +            newLength = UINT_MAX;
> +        else
> +            newLength = unsigned(lengthValue);
> +    }
> 
> should be:
> 
>     double lengthValue;
>     if (value->getNumber(lengthValue)) {
>         if (lengthValue < 0.0)
>             return;
>         if (lengthValue > static_cast<double>(UINT_MAX))
>             newLength = UINT_MAX;
>         else
>             newLength = static_cast<unsigned>(lengthValue);
>     }

This change causes a regression in
fast/dom/select-selectedIndex-multiple.html.  I will investigate why.

> I'd like to see tests that cover a few more of the branches, for example
> setting length to infinity and NaN. The code makes infinite try to set it to
> UINT_MAX, NaN sets it to 0, although -1 doesn't change the existing length. Is
> that really the behavior we want? If so, then lets make sure tests exercise
> those cases and perhaps try them in other browsers.

I'll write some more tests before this patch lands.


-- 
Configure bugmail: http://bugzilla.opendarwin.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list