[webkit-reviews] review granted: [Bug 29796] .maxLength should return -1 if maxlength attribute is not specified : [Attachment 40283] Proposed patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Sep 29 11:29:35 PDT 2009


Darin Adler <darin at apple.com> has granted TAMURA, Kent <tkent at chromium.org>'s
request for review:
Bug 29796: .maxLength should return -1 if maxlength attribute is not specified
https://bugs.webkit.org/show_bug.cgi?id=29796

Attachment 40283: Proposed patch
https://bugs.webkit.org/attachment.cgi?id=40283&action=review

------- Additional Comments from Darin Adler <darin at apple.com>
> -void HTMLInputElement::setMaxLength(int _maxLength)
> +void HTMLInputElement::setMaxLength(int _maxLength, ExceptionCode&
exceptionCode)
>  {
> -    setAttribute(maxlengthAttr, String::number(_maxLength));
> +    if (_maxLength < 0)
> +	   exceptionCode = INDEX_SIZE_ERR;
> +    else
> +	   setAttribute(maxlengthAttr, String::number(_maxLength));
>  }

Underscore in the argument name is usually something we'd want to avoid. One of
the few abbreviations we use consistently in WebCore code is "ec" for the
exception code. I think using exceptionCode instead is nicer, but I'd prefer to
stay consistent.

I was under the impression that INDEX_SIZE_ERR was usually generated by having
an attribute of type unsigned long in IDL and handled automatically by the
bindings. Could you find another example and make sure you are doing this
consistently?

r=me as-is, but please consider the comments above too.


More information about the webkit-reviews mailing list