{"action":"created","comment":{"url":"https://api.github.com/repos/servo/servo/pulls/comments/68430952","id":68430952,"diff_hunk":"@@ -33,6 +33,81 @@\n     </%call>\n </%def>\n \n+<%doc>\n+    To be used in cases where we have a grammar like\n+    \"<thing> [ , <thing> ]*\", but only support a single value\n+    in servo\n+</%doc>\n+<%def name=\"gecko_autoarray_longhand(name, **kwargs)\">\n+    <%call expr=\"longhand(name, **kwargs)\">\n+        % if product == \"gecko\":\n+            use cssparser::ToCss;\n+            use std::fmt;\n+\n+            pub mod single_value {\n+                use cssparser::Parser;\n+                use parser::{ParserContext, ParserContextExtraData};\n+                use properties::{CSSWideKeyword, DeclaredValue, Shorthand};\n+                use values::computed::{TContext, ToComputedValue};\n+                use values::{computed, specified};\n+                ${caller.body()}\n+            }\n+            pub mod computed_value {\n+                use super::single_value;\n+                #[derive(Debug, Clone, PartialEq, HeapSizeOf)]\n+                pub struct T(pub Vec<single_value::computed_value::T>);\n+            }\n+\n+            impl ToCss for computed_value::T {\n+                fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {\n+                    if self.0.len() >= 1 {\n+                        try!(self.0[0].to_css(dest));\n+                    }\n+                    for i in self.0.iter().skip(1) {\n+                        try!(dest.write_str(\", \"));\n+                        try!(i.to_css(dest));\n+                    }\n+                    Ok(())\n+                }\n+            }\n+\n+            #[derive(Debug, Clone, PartialEq, HeapSizeOf)]\n+            pub struct SpecifiedValue(pub Vec<single_value::SpecifiedValue>);\n+\n+            impl ToCss for SpecifiedValue {\n+                fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {\n+                    if self.0.len() >= 1 {\n+                        try!(self.0[0].to_css(dest))\n+                    }\n+                    for i in self.0.iter().skip(1) {\n+                        try!(dest.write_str(\", \"));\n+                        try!(i.to_css(dest));\n+                    }\n+                    Ok(())\n+                }\n+            }\n+            pub fn get_initial_value() -> computed_value::T {\n+                computed_value::T(vec![single_value::get_initial_value()])\n+            }\n+            pub fn parse(context: &ParserContext, input: &mut Parser) -> Result<SpecifiedValue, ()> {\n+                input.parse_comma_separated(|parser| {\n+                    single_value::parse(context, parser)\n+                }).map(|ok| SpecifiedValue(ok))\n+            }\n+            impl ToComputedValue for SpecifiedValue {","path":"components/style/properties/helpers.mako.rs","position":65,"original_position":65,"commit_id":"871bb57c2aab9289611762ccfe148e9a1afc05f0","original_commit_id":"871bb57c2aab9289611762ccfe148e9a1afc05f0","user":{"login":"emilio","id":1323194,"avatar_url":"https://avatars.githubusercontent.com/u/1323194?v=3","gravatar_id":"","url":"https://api.github.com/users/emilio","html_url":"https://github.com/emilio","followers_url":"https://api.github.com/users/emilio/followers","following_url":"https://api.github.com/users/emilio/following{/other_user}","gists_url":"https://api.github.com/users/emilio/gists{/gist_id}","starred_url":"https://api.github.com/users/emilio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emilio/subscriptions","organizations_url":"https://api.github.com/users/emilio/orgs","repos_url":"https://api.github.com/users/emilio/repos","events_url":"https://api.github.com/users/emilio/events{/privacy}","received_events_url":"https://api.github.com/users/emilio/received_events","type":"User","site_admin":false},"body":"Some (most?) of these properties are computed-value as specified, which would just involve a generic clone which would be cheaper.\r\n\r\nI'm not opposed to land this as is, but I'd want a note about that here.","created_at":"2016-06-24T17:23:33Z","updated_at":"2016-06-24T17:23:33Z","html_url":"https://github.com/servo/servo/pull/11851#discussion_r68430952","pull_request_url":"https://api.github.com/repos/servo/servo/pulls/11851","_links":{"self":{"href":"https://api.github.com/repos/servo/servo/pulls/comments/68430952"},"html":{"href":"https://github.com/servo/servo/pull/11851#discussion_r68430952"},"pull_request":{"href":"https://api.github.com/repos/servo/servo/pulls/11851"}}},"pull_request":{"url":"https://api.github.com/repos/servo/servo/pulls/11851","id":75098547,"html_url":"https://github.com/servo/servo/pull/11851","diff_url":"https://github.com/servo/servo/pull/11851.diff","patch_url":"https://github.com/servo/servo/pull/11851.patch","issue_url":"https://api.github.com/repos/servo/servo/issues/11851","number":11851,"state":"open","locked":false,"title":"WIP: Add support for gecko-only array values; use for stylo","user":{"login":"Manishearth","id":1617736,"avatar_url":"https://avatars.githubusercontent.com/u/1617736?v=3","gravatar_id":"","url":"https://api.github.com/users/Manishearth","html_url":"https://github.com/Manishearth","followers_url":"https://api.github.com/users/Manishearth/followers","following_url":"https://api.github.com/users/Manishearth/following{/other_user}","gists_url":"https://api.github.com/users/Manishearth/gists{/gist_id}","starred_url":"https://api.github.com/users/Manishearth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Manishearth/subscriptions","organizations_url":"https://api.github.com/users/Manishearth/orgs","repos_url":"https://api.github.com/users/Manishearth/repos","events_url":"https://api.github.com/users/Manishearth/events{/privacy}","received_events_url":"https://api.github.com/users/Manishearth/received_events","type":"User","site_admin":false},"body":"Doesn't yet work, because I can't grow nsTArrays from Rust. If anyone knows how to add bindings for that, let me know!\n\n\nThoughts on the design so far? Once this PR lands, all of the array-accepting background- properties can just use gecko_autoarray_longhand and some iterators in the geckolib implementation without changing much other code to work with arrays.\n\n\ncc @emilio @bholley\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"35\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/servo/servo/11851)\n<!-- Reviewable:end -->\n","created_at":"2016-06-24T11:06:11Z","updated_at":"2016-06-24T17:23:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c4a39127ba8b747bfb5ac83fe82eda9d2bc97930","assignee":{"login":"emilio","id":1323194,"avatar_url":"https://avatars.githubusercontent.com/u/1323194?v=3","gravatar_id":"","url":"https://api.github.com/users/emilio","html_url":"https://github.com/emilio","followers_url":"https://api.github.com/users/emilio/followers","following_url":"https://api.github.com/users/emilio/following{/other_user}","gists_url":"https://api.github.com/users/emilio/gists{/gist_id}","starred_url":"https://api.github.com/users/emilio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emilio/subscriptions","organizations_url":"https://api.github.com/users/emilio/orgs","repos_url":"https://api.github.com/users/emilio/repos","events_url":"https://api.github.com/users/emilio/events{/privacy}","received_events_url":"https://api.github.com/users/emilio/received_events","type":"User","site_admin":false},"assignees":[{"login":"emilio","id":1323194,"avatar_url":"https://avatars.githubusercontent.com/u/1323194?v=3","gravatar_id":"","url":"https://api.github.com/users/emilio","html_url":"https://github.com/emilio","followers_url":"https://api.github.com/users/emilio/followers","following_url":"https://api.github.com/users/emilio/following{/other_user}","gists_url":"https://api.github.com/users/emilio/gists{/gist_id}","starred_url":"https://api.github.com/users/emilio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emilio/subscriptions","organizations_url":"https://api.github.com/users/emilio/orgs","repos_url":"https://api.github.com/users/emilio/repos","events_url":"https://api.github.com/users/emilio/events{/privacy}","received_events_url":"https://api.github.com/users/emilio/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/servo/servo/pulls/11851/commits","review_comments_url":"https://api.github.com/repos/servo/servo/pulls/11851/comments","review_comment_url":"https://api.github.com/repos/servo/servo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/servo/servo/issues/11851/comments","statuses_url":"https://api.github.com/repos/servo/servo/statuses/871bb57c2aab9289611762ccfe148e9a1afc05f0","head":{"label":"Manishearth:stylo-autoarray","ref":"stylo-autoarray","sha":"871bb57c2aab9289611762ccfe148e9a1afc05f0","user":{"login":"Manishearth","id":1617736,"avatar_url":"https://avatars.githubusercontent.com/u/1617736?v=3","gravatar_id":"","url":"https://api.github.com/users/Manishearth","html_url":"https://github.com/Manishearth","followers_url":"https://api.github.com/users/Manishearth/followers","following_url":"https://api.github.com/users/Manishearth/following{/other_user}","gists_url":"https://api.github.com/users/Manishearth/gists{/gist_id}","starred_url":"https://api.github.com/users/Manishearth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Manishearth/subscriptions","organizations_url":"https://api.github.com/users/Manishearth/orgs","repos_url":"https://api.github.com/users/Manishearth/repos","events_url":"https://api.github.com/users/Manishearth/events{/privacy}","received_events_url":"https://api.github.com/users/Manishearth/received_events","type":"User","site_admin":false},"repo":{"id":17138296,"name":"servo","full_name":"Manishearth/servo","owner":{"login":"Manishearth","id":1617736,"avatar_url":"https://avatars.githubusercontent.com/u/1617736?v=3","gravatar_id":"","url":"https://api.github.com/users/Manishearth","html_url":"https://github.com/Manishearth","followers_url":"https://api.github.com/users/Manishearth/followers","following_url":"https://api.github.com/users/Manishearth/following{/other_user}","gists_url":"https://api.github.com/users/Manishearth/gists{/gist_id}","starred_url":"https://api.github.com/users/Manishearth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Manishearth/subscriptions","organizations_url":"https://api.github.com/users/Manishearth/orgs","repos_url":"https://api.github.com/users/Manishearth/repos","events_url":"https://api.github.com/users/Manishearth/events{/privacy}","received_events_url":"https://api.github.com/users/Manishearth/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Manishearth/servo","description":"The Servo Browser Engine","fork":true,"url":"https://api.github.com/repos/Manishearth/servo","forks_url":"https://api.github.com/repos/Manishearth/servo/forks","keys_url":"https://api.github.com/repos/Manishearth/servo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Manishearth/servo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Manishearth/servo/teams","hooks_url":"https://api.github.com/repos/Manishearth/servo/hooks","issue_events_url":"https://api.github.com/repos/Manishearth/servo/issues/events{/number}","events_url":"https://api.github.com/repos/Manishearth/servo/events","assignees_url":"https://api.github.com/repos/Manishearth/servo/assignees{/user}","branches_url":"https://api.github.com/repos/Manishearth/servo/branches{/branch}","tags_url":"https://api.github.com/repos/Manishearth/servo/tags","blobs_url":"https://api.github.com/repos/Manishearth/servo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Manishearth/servo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Manishearth/servo/git/refs{/sha}","trees_url":"https://api.github.com/repos/Manishearth/servo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Manishearth/servo/statuses/{sha}","languages_url":"https://api.github.com/repos/Manishearth/servo/languages","stargazers_url":"https://api.github.com/repos/Manishearth/servo/stargazers","contributors_url":"https://api.github.com/repos/Manishearth/servo/contributors","subscribers_url":"https://api.github.com/repos/Manishearth/servo/subscribers","subscription_url":"https://api.github.com/repos/Manishearth/servo/subscription","commits_url":"https://api.github.com/repos/Manishearth/servo/commits{/sha}","git_commits_url":"https://api.github.com/repos/Manishearth/servo/git/commits{/sha}","comments_url":"https://api.github.com/repos/Manishearth/servo/comments{/number}","issue_comment_url":"https://api.github.com/repos/Manishearth/servo/issues/comments{/number}","contents_url":"https://api.github.com/repos/Manishearth/servo/contents/{+path}","compare_url":"https://api.github.com/repos/Manishearth/servo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Manishearth/servo/merges","archive_url":"https://api.github.com/repos/Manishearth/servo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Manishearth/servo/downloads","issues_url":"https://api.github.com/repos/Manishearth/servo/issues{/number}","pulls_url":"https://api.github.com/repos/Manishearth/servo/pulls{/number}","milestones_url":"https://api.github.com/repos/Manishearth/servo/milestones{/number}","notifications_url":"https://api.github.com/repos/Manishearth/servo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Manishearth/servo/labels{/name}","releases_url":"https://api.github.com/repos/Manishearth/servo/releases{/id}","deployments_url":"https://api.github.com/repos/Manishearth/servo/deployments","created_at":"2014-02-24T14:18:00Z","updated_at":"2015-10-18T11:13:31Z","pushed_at":"2016-06-24T11:08:59Z","git_url":"git://github.com/Manishearth/servo.git","ssh_url":"git@github.com:Manishearth/servo.git","clone_url":"https://github.com/Manishearth/servo.git","svn_url":"https://github.com/Manishearth/servo","homepage":"","size":188158,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"servo:master","ref":"master","sha":"235a6a6380f50985dcbce9fa3901551cc111c954","user":{"login":"servo","id":2566135,"avatar_url":"https://avatars.githubusercontent.com/u/2566135?v=3","gravatar_id":"","url":"https://api.github.com/users/servo","html_url":"https://github.com/servo","followers_url":"https://api.github.com/users/servo/followers","following_url":"https://api.github.com/users/servo/following{/other_user}","gists_url":"https://api.github.com/users/servo/gists{/gist_id}","starred_url":"https://api.github.com/users/servo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/servo/subscriptions","organizations_url":"https://api.github.com/users/servo/orgs","repos_url":"https://api.github.com/users/servo/repos","events_url":"https://api.github.com/users/servo/events{/privacy}","received_events_url":"https://api.github.com/users/servo/received_events","type":"Organization","site_admin":false},"repo":{"id":3390243,"name":"servo","full_name":"servo/servo","owner":{"login":"servo","id":2566135,"avatar_url":"https://avatars.githubusercontent.com/u/2566135?v=3","gravatar_id":"","url":"https://api.github.com/users/servo","html_url":"https://github.com/servo","followers_url":"https://api.github.com/users/servo/followers","following_url":"https://api.github.com/users/servo/following{/other_user}","gists_url":"https://api.github.com/users/servo/gists{/gist_id}","starred_url":"https://api.github.com/users/servo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/servo/subscriptions","organizations_url":"https://api.github.com/users/servo/orgs","repos_url":"https://api.github.com/users/servo/repos","events_url":"https://api.github.com/users/servo/events{/privacy}","received_events_url":"https://api.github.com/users/servo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/servo/servo","description":"The Servo Browser Engine","fork":false,"url":"https://api.github.com/repos/servo/servo","forks_url":"https://api.github.com/repos/servo/servo/forks","keys_url":"https://api.github.com/repos/servo/servo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/servo/servo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/servo/servo/teams","hooks_url":"https://api.github.com/repos/servo/servo/hooks","issue_events_url":"https://api.github.com/repos/servo/servo/issues/events{/number}","events_url":"https://api.github.com/repos/servo/servo/events","assignees_url":"https://api.github.com/repos/servo/servo/assignees{/user}","branches_url":"https://api.github.com/repos/servo/servo/branches{/branch}","tags_url":"https://api.github.com/repos/servo/servo/tags","blobs_url":"https://api.github.com/repos/servo/servo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/servo/servo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/servo/servo/git/refs{/sha}","trees_url":"https://api.github.com/repos/servo/servo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/servo/servo/statuses/{sha}","languages_url":"https://api.github.com/repos/servo/servo/languages","stargazers_url":"https://api.github.com/repos/servo/servo/stargazers","contributors_url":"https://api.github.com/repos/servo/servo/contributors","subscribers_url":"https://api.github.com/repos/servo/servo/subscribers","subscription_url":"https://api.github.com/repos/servo/servo/subscription","commits_url":"https://api.github.com/repos/servo/servo/commits{/sha}","git_commits_url":"https://api.github.com/repos/servo/servo/git/commits{/sha}","comments_url":"https://api.github.com/repos/servo/servo/comments{/number}","issue_comment_url":"https://api.github.com/repos/servo/servo/issues/comments{/number}","contents_url":"https://api.github.com/repos/servo/servo/contents/{+path}","compare_url":"https://api.github.com/repos/servo/servo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/servo/servo/merges","archive_url":"https://api.github.com/repos/servo/servo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/servo/servo/downloads","issues_url":"https://api.github.com/repos/servo/servo/issues{/number}","pulls_url":"https://api.github.com/repos/servo/servo/pulls{/number}","milestones_url":"https://api.github.com/repos/servo/servo/milestones{/number}","notifications_url":"https://api.github.com/repos/servo/servo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/servo/servo/labels{/name}","releases_url":"https://api.github.com/repos/servo/servo/releases{/id}","deployments_url":"https://api.github.com/repos/servo/servo/deployments","created_at":"2012-02-08T19:07:25Z","updated_at":"2016-06-24T13:27:50Z","pushed_at":"2016-06-24T16:45:23Z","git_url":"git://github.com/servo/servo.git","ssh_url":"git@github.com:servo/servo.git","clone_url":"https://github.com/servo/servo.git","svn_url":"https://github.com/servo/servo","homepage":"https://servo.org/","size":258170,"stargazers_count":6897,"watchers_count":6897,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1138,"mirror_url":null,"open_issues_count":1463,"forks":1138,"open_issues":1463,"watchers":6897,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/servo/servo/pulls/11851"},"html":{"href":"https://github.com/servo/servo/pull/11851"},"issue":{"href":"https://api.github.com/repos/servo/servo/issues/11851"},"comments":{"href":"https://api.github.com/repos/servo/servo/issues/11851/comments"},"review_comments":{"href":"https://api.github.com/repos/servo/servo/pulls/11851/comments"},"review_comment":{"href":"https://api.github.com/repos/servo/servo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/servo/servo/pulls/11851/commits"},"statuses":{"href":"https://api.github.com/repos/servo/servo/statuses/871bb57c2aab9289611762ccfe148e9a1afc05f0"}}}}
{"actor":{"display_login":"emilio"}}