Bug 154504 - Make HTMLSelectElement.size behave as per the specification
Summary: Make HTMLSelectElement.size behave as per the specification
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL: https://html.spec.whatwg.org/#htmlsel...
Keywords: WebExposed
Depends on:
Blocks:
 
Reported: 2016-02-20 13:31 PST by Chris Dumez
Modified: 2016-02-21 21:52 PST (History)
3 users (show)

See Also:


Attachments
Patch (80.54 KB, patch)
2016-02-20 14:05 PST, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (76.58 KB, patch)
2016-02-21 21:50 PST, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2016-02-20 13:31:12 PST
Make HTMLSelectElement behave as per the specification:
- https://html.spec.whatwg.org/#dom-select-size
- https://html.spec.whatwg.org/#reflecting-content-attributes-in-idl-attributes:idl-unsigned-long

In particular, it should be unsigned and be in the range [0; 2147483647].

Also update several unsigned long attributes in our HTML implementation to use parseHTMLNonNegativeInteger() to parse the unsigned integer as per the HTML specification, instead of calling String::toUint().
Comment 1 Chris Dumez 2016-02-20 14:05:02 PST
Created attachment 271871 [details]
Patch
Comment 2 Darin Adler 2016-02-21 16:46:07 PST
Comment on attachment 271871 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=271871&action=review

> Source/WebCore/html/HTMLSelectElement.idl:35
> +#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
> +    attribute unsigned long size;
> +#else
>      attribute long size;
> +#endif

Since the non-unsigned thing is only there for backward compatibility, I would prefer it if that side was the one that listed languages (Objective-C, GObject bindings).

> LayoutTests/ChangeLog:20
> +        * fast/forms/select-size.html:
> +        * platform/mac/fast/forms/select-size-expected.png:
> +        * platform/mac/fast/forms/select-size-expected.txt:

Can we change this into a reference test? It seems like a natural for that.
Comment 3 Chris Dumez 2016-02-21 21:50:58 PST
Created attachment 271902 [details]
Patch
Comment 4 Chris Dumez 2016-02-21 21:52:06 PST
Comment on attachment 271902 [details]
Patch

Clearing flags on attachment: 271902

Committed r196893: <http://trac.webkit.org/changeset/196893>
Comment 5 Chris Dumez 2016-02-21 21:52:13 PST
All reviewed patches have been landed.  Closing bug.