{"action":"created","comment":{"url":"https://api.github.com/repos/servo/servo/pulls/comments/81794757","pull_request_review_id":2748687,"id":81794757,"diff_hunk":"@@ -313,6 +313,42 @@ impl PropertyDeclarationBlock {\n     }\n }\n \n+impl PropertyDeclarationBlock {\n+    // Take a declaration block known to contain a single property,\n+    // and serialize it\n+    pub fn to_css_single_value<W>(&self, dest: &mut W, name: &str)\n+        -> fmt::Result where W: fmt::Write {\n+        match self.declarations.len() {\n+            0 => Err(fmt::Error),\n+            1 if self.declarations[0].0.name().eq_str_ignore_ascii_case(name) => {","path":"components/style/properties/properties.mako.rs","position":11,"original_position":11,"commit_id":"c9efa6e2a281442578d3a2e3c3e238a746e702c9","original_commit_id":"c9efa6e2a281442578d3a2e3c3e238a746e702c9","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":"I was about to r+ this, but don't you want something like:\r\n\r\n```rust\r\n1 => {\r\n    if !self.declarations[0].0.name().eq_str_ignore_ascii_case(name) {\r\n        return Err(fmt::Error);\r\n    }\r\n    self.declarations[0].0.to_css(dest)\r\n}\r\n```\r\n\r\nI think it's not going to matter because it will get rejected in the `all` condition below, but maybe it's cleaner? In any case, r=me","created_at":"2016-10-04T16:15:08Z","updated_at":"2016-10-04T16:15:22Z","html_url":"https://github.com/servo/servo/pull/13556#discussion_r81794757","pull_request_url":"https://api.github.com/repos/servo/servo/pulls/13556","_links":{"self":{"href":"https://api.github.com/repos/servo/servo/pulls/comments/81794757"},"html":{"href":"https://github.com/servo/servo/pull/13556#discussion_r81794757"},"pull_request":{"href":"https://api.github.com/repos/servo/servo/pulls/13556"}}},"pull_request":{"url":"https://api.github.com/repos/servo/servo/pulls/13556","id":87701126,"html_url":"https://github.com/servo/servo/pull/13556","diff_url":"https://github.com/servo/servo/pull/13556.diff","patch_url":"https://github.com/servo/servo/pull/13556.patch","issue_url":"https://api.github.com/repos/servo/servo/issues/13556","number":13556,"state":"open","locked":false,"title":"Add to_css_single_value for serializing a single PropertyDeclarationBlock ","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":"(fixes #13423)\r\n\r\nr? @birtles\r\n\r\nThis needs to take the name of the property in question as input so that it can figure out which shorthand to serialize to (if any), since some props are part of multiple shorthands (and you need a way to distinguish between the lone value and the shorthand). I can tweak this to accept an `Option<Shorthand>` in case you only want to pass in the property name for shorthands.\r\n\r\nIn case you don't want to handle shorthands at all, we probably don't need this method at all, since you can just assert that there's a single field and serialize that.\r\n\r\nAlso, is `!important` involved here?\r\n\r\n<!-- Reviewable:start -->\r\n---\r\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/servo/servo/13556)\r\n<!-- Reviewable:end -->\r\n","created_at":"2016-10-03T11:32:29Z","updated_at":"2016-10-04T16:15:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"83ff0c4c9725792698d1e2a328a9c1ed08a6d505","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/13556/commits","review_comments_url":"https://api.github.com/repos/servo/servo/pulls/13556/comments","review_comment_url":"https://api.github.com/repos/servo/servo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/servo/servo/issues/13556/comments","statuses_url":"https://api.github.com/repos/servo/servo/statuses/c9efa6e2a281442578d3a2e3c3e238a746e702c9","head":{"label":"Manishearth:serialize-one","ref":"serialize-one","sha":"c9efa6e2a281442578d3a2e3c3e238a746e702c9","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-10-04T14:28:18Z","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":210545,"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":"b80769dbf5e8f0c59db353b8e0ee7e4d77813294","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-10-04T15:53:34Z","pushed_at":"2016-10-04T16:11:54Z","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":299152,"stargazers_count":8007,"watchers_count":8007,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1297,"mirror_url":null,"open_issues_count":1766,"forks":1297,"open_issues":1766,"watchers":8007,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/servo/servo/pulls/13556"},"html":{"href":"https://github.com/servo/servo/pull/13556"},"issue":{"href":"https://api.github.com/repos/servo/servo/issues/13556"},"comments":{"href":"https://api.github.com/repos/servo/servo/issues/13556/comments"},"review_comments":{"href":"https://api.github.com/repos/servo/servo/pulls/13556/comments"},"review_comment":{"href":"https://api.github.com/repos/servo/servo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/servo/servo/pulls/13556/commits"},"statuses":{"href":"https://api.github.com/repos/servo/servo/statuses/c9efa6e2a281442578d3a2e3c3e238a746e702c9"}}}}
{"actor":{"display_login":"emilio"}}