{"action":"created","issue":{"url":"https://api.github.com/repos/servo/servo/issues/7323","labels_url":"https://api.github.com/repos/servo/servo/issues/7323/labels{/name}","comments_url":"https://api.github.com/repos/servo/servo/issues/7323/comments","events_url":"https://api.github.com/repos/servo/servo/issues/7323/events","html_url":"https://github.com/servo/servo/pull/7323","id":102589119,"number":7323,"title":"Adds support for input element's maxlength attr","user":{"login":"samfoo","id":26163,"avatar_url":"https://avatars.githubusercontent.com/u/26163?v=3","gravatar_id":"","url":"https://api.github.com/users/samfoo","html_url":"https://github.com/samfoo","followers_url":"https://api.github.com/users/samfoo/followers","following_url":"https://api.github.com/users/samfoo/following{/other_user}","gists_url":"https://api.github.com/users/samfoo/gists{/gist_id}","starred_url":"https://api.github.com/users/samfoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samfoo/subscriptions","organizations_url":"https://api.github.com/users/samfoo/orgs","repos_url":"https://api.github.com/users/samfoo/repos","events_url":"https://api.github.com/users/samfoo/events{/privacy}","received_events_url":"https://api.github.com/users/samfoo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/servo/servo/labels/S-needs-code-changes","name":"S-needs-code-changes","color":"d4c5f9"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-08-23T05:24:26Z","updated_at":"2015-09-01T02:10:24Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/servo/servo/pulls/7323","html_url":"https://github.com/servo/servo/pull/7323","diff_url":"https://github.com/servo/servo/pull/7323.diff","patch_url":"https://github.com/servo/servo/pull/7323.patch"},"body":"This implements maxlength [as described by whatwg](https://html.spec.whatwg.org/multipage/forms.html#dom-input-maxlength) for input elements.\r\n\r\nRemaining work:\r\n* WPT test - I have no idea how to write a WPT for simulating user input. Webdriver? Open to suggestions here.\r\n* Support for textarea (should be trivial, probably worth filing another issue)\r\n\r\nservo/servo#7320\r\nservo/servo#7004\r\n\r\n<!-- Reviewable:start -->\r\n[<img src=\"https://reviewable.io/review_button.png\" height=40 alt=\"Review on Reviewable\"/>](https://reviewable.io/reviews/servo/servo/7323)\r\n<!-- Reviewable:end -->\r\n"},"comment":{"url":"https://api.github.com/repos/servo/servo/issues/comments/136552247","html_url":"https://github.com/servo/servo/pull/7323#issuecomment-136552247","issue_url":"https://api.github.com/repos/servo/servo/issues/7323","id":136552247,"user":{"login":"jdm","id":27658,"avatar_url":"https://avatars.githubusercontent.com/u/27658?v=3","gravatar_id":"","url":"https://api.github.com/users/jdm","html_url":"https://github.com/jdm","followers_url":"https://api.github.com/users/jdm/followers","following_url":"https://api.github.com/users/jdm/following{/other_user}","gists_url":"https://api.github.com/users/jdm/gists{/gist_id}","starred_url":"https://api.github.com/users/jdm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdm/subscriptions","organizations_url":"https://api.github.com/users/jdm/orgs","repos_url":"https://api.github.com/users/jdm/repos","events_url":"https://api.github.com/users/jdm/events{/privacy}","received_events_url":"https://api.github.com/users/jdm/received_events","type":"User","site_admin":false},"created_at":"2015-09-01T02:10:24Z","updated_at":"2015-09-01T02:10:24Z","body":"-S-needs-rebase -S-awaiting-review +S-needs-code-changes \n\n---\n\nReviewed 7 of 7 files at r2, 1 of 1 files at r3.\nReview status: all files reviewed at latest revision, 4 unresolved discussions, some commit checks failed.\n\n---\n\n<sup>**[components/script/dom/htmlinputelement.rs, line 69 \\[r2\\]](https://reviewable.io:443/reviews/servo/servo/7323#-Jy5ec4QGPwG440IZZZh)** ([raw file](https://github.com/servo/servo/blob/c5b07197b850b6d63b6cfddf5be9d912f87cf959/components/script/dom/htmlinputelement.rs#L69)):</sup>\nI don't think this field is necessary?\n\n---\n\n<sup>**[components/script/dom/htmlinputelement.rs, line 334 \\[r1\\]](https://reviewable.io:443/reviews/servo/servo/7323#-Jy-4MUJJl3IOc6XwBl5)** ([raw file](https://github.com/servo/servo/blob/b39fac418147f0acb59d731ce9893a82f4e3dfb4/components/script/dom/htmlinputelement.rs#L334)):</sup>\nRight, I did mean setter. However, the macro allows us to both store the attribute value as well as act on the new value since HTMLInputElement::after_set_attr will be called, which is where we can propagate it to TextInput.\n\n---\n\n<sup>**[components/script/dom/htmlinputelement.rs, line 606 \\[r1\\]](https://reviewable.io:443/reviews/servo/servo/7323#-Jxzxed1-x1fA4bskK-t)** ([raw file](https://github.com/servo/servo/blob/b39fac418147f0acb59d731ce9893a82f4e3dfb4/components/script/dom/htmlinputelement.rs#L606)):</sup>\nI propose `from_limited_i32` return `Result<AttrValue::Uint, Error>`, and that we implement my plan described in #7461. That will enable us to throw an exception when appropriate, and avoid storing values that do not make sense. The `make_limited_int_getter` described earlier can take a `default` argument to return when no such attribute is present. Does that make sense?\n\n---\n\n<sup>**[components/script/textinput.rs, line 0 \\[r1\\]](https://reviewable.io:443/reviews/servo/servo/7323#-Jy-9WWWycIoaD_Upd2O)** ([raw file](https://github.com/servo/servo/blob/b39fac418147f0acb59d731ce9893a82f4e3dfb4/components/script/textinput.rs#L0)):</sup>\nAh, my mistake! Perhaps a comment calling this out would be useful, in that case :)\n\n---\n\n\nComments from the [review on Reviewable.io](https://reviewable.io:443/reviews/servo/servo/7323)\n<!-- Sent from Reviewable.io -->\n"}}