{"action":"created","comment":{"url":"https://api.github.com/repos/servo/servo/pulls/comments/61614106","id":61614106,"diff_hunk":"@@ -97,19 +129,40 @@ pub struct ArcHelpers<GeckoType, ServoType> {\n     phantom2: PhantomData<ServoType>,\n }\n \n+\n impl<GeckoType, ServoType> ArcHelpers<GeckoType, ServoType> {\n     pub fn with<F, Output>(raw: *mut GeckoType, cb: F) -> Output\n                            where F: FnOnce(&Arc<ServoType>) -> Output {\n+        debug_assert!(!raw.is_null());\n+\n         let owned = unsafe { Self::into(raw) };\n         let result = cb(&owned);\n         forget(owned);\n         result\n     }\n \n+    pub fn maybe_with<F, Output>(maybe_raw: *mut GeckoType, cb: F) -> Output\n+                                 where F: FnOnce(Option<&Arc<ServoType>>) -> Output {\n+        let owned = if maybe_raw.is_null() {\n+            None\n+        } else {\n+            Some(unsafe { Self::into(maybe_raw) })\n+        };\n+\n+        let result = cb(owned.as_ref());\n+        forget(owned);\n+\n+        result\n+    }\n+\n     pub unsafe fn into(ptr: *mut GeckoType) -> Arc<ServoType> {\n         transmute(ptr)\n     }\n \n+    pub unsafe fn from(owned: Arc<ServoType>) -> *mut GeckoType {","path":"ports/geckolib/glue.rs","position":126,"original_position":126,"commit_id":"c84541e5a604a4ee706de533c6598d362fa4f29c","original_commit_id":"c84541e5a604a4ee706de533c6598d362fa4f29c","user":{"login":"bholley","id":377435,"avatar_url":"https://avatars.githubusercontent.com/u/377435?v=3","gravatar_id":"","url":"https://api.github.com/users/bholley","html_url":"https://github.com/bholley","followers_url":"https://api.github.com/users/bholley/followers","following_url":"https://api.github.com/users/bholley/following{/other_user}","gists_url":"https://api.github.com/users/bholley/gists{/gist_id}","starred_url":"https://api.github.com/users/bholley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bholley/subscriptions","organizations_url":"https://api.github.com/users/bholley/orgs","repos_url":"https://api.github.com/users/bholley/repos","events_url":"https://api.github.com/users/bholley/events{/privacy}","received_events_url":"https://api.github.com/users/bholley/received_events","type":"User","site_admin":false},"body":"Nit: I don't see any reason why this needs to be unsafe.","created_at":"2016-04-29T17:18:29Z","updated_at":"2016-04-29T17:18:29Z","html_url":"https://github.com/servo/servo/pull/10815#discussion_r61614106","pull_request_url":"https://api.github.com/repos/servo/servo/pulls/10815","_links":{"self":{"href":"https://api.github.com/repos/servo/servo/pulls/comments/61614106"},"html":{"href":"https://github.com/servo/servo/pull/10815#discussion_r61614106"},"pull_request":{"href":"https://api.github.com/repos/servo/servo/pulls/10815"}}},"pull_request":{"url":"https://api.github.com/repos/servo/servo/pulls/10815","id":67588909,"html_url":"https://github.com/servo/servo/pull/10815","diff_url":"https://github.com/servo/servo/pull/10815.diff","patch_url":"https://github.com/servo/servo/pull/10815.patch","issue_url":"https://api.github.com/repos/servo/servo/issues/10815","number":10815,"state":"open","locked":false,"title":"style: Support anonymous box pseudo-elements","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":"This is a work-in-progress that:\r\n\r\n * Adds support for some pseudo-elements to skip the cascade entirely, in an analogous way to Gecko's anonymous box pseudo-elements.\r\n * Takes rid of `StylistWrapper`, and uses `Arc::get_mut` instead.\r\n * Uses the first bullet to precompute the `-servo-details-content` pseudo's style.\r\n\r\nI'd like @bholley to take a look before following, do you think that the aproach is the correct?\r\nAlso, @SimonSapin could want to put some eyes on it.\r\n\r\nDepends on https://github.com/servo/rust-selectors/pull/81\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/10815)\n<!-- Reviewable:end -->\n","created_at":"2016-04-23T00:14:19Z","updated_at":"2016-04-29T17:18:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5f78d182e7d4466ded0ab1c92cfb720d5b051131","assignee":{"login":"bholley","id":377435,"avatar_url":"https://avatars.githubusercontent.com/u/377435?v=3","gravatar_id":"","url":"https://api.github.com/users/bholley","html_url":"https://github.com/bholley","followers_url":"https://api.github.com/users/bholley/followers","following_url":"https://api.github.com/users/bholley/following{/other_user}","gists_url":"https://api.github.com/users/bholley/gists{/gist_id}","starred_url":"https://api.github.com/users/bholley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bholley/subscriptions","organizations_url":"https://api.github.com/users/bholley/orgs","repos_url":"https://api.github.com/users/bholley/repos","events_url":"https://api.github.com/users/bholley/events{/privacy}","received_events_url":"https://api.github.com/users/bholley/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/servo/servo/pulls/10815/commits","review_comments_url":"https://api.github.com/repos/servo/servo/pulls/10815/comments","review_comment_url":"https://api.github.com/repos/servo/servo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/servo/servo/issues/10815/comments","statuses_url":"https://api.github.com/repos/servo/servo/statuses/c84541e5a604a4ee706de533c6598d362fa4f29c","head":{"label":"emilio:anonbox-gcs","ref":"anonbox-gcs","sha":"c84541e5a604a4ee706de533c6598d362fa4f29c","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},"repo":{"id":34808649,"name":"servo","full_name":"emilio/servo","owner":{"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},"private":false,"html_url":"https://github.com/emilio/servo","description":"The Servo Browser Engine","fork":true,"url":"https://api.github.com/repos/emilio/servo","forks_url":"https://api.github.com/repos/emilio/servo/forks","keys_url":"https://api.github.com/repos/emilio/servo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/emilio/servo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/emilio/servo/teams","hooks_url":"https://api.github.com/repos/emilio/servo/hooks","issue_events_url":"https://api.github.com/repos/emilio/servo/issues/events{/number}","events_url":"https://api.github.com/repos/emilio/servo/events","assignees_url":"https://api.github.com/repos/emilio/servo/assignees{/user}","branches_url":"https://api.github.com/repos/emilio/servo/branches{/branch}","tags_url":"https://api.github.com/repos/emilio/servo/tags","blobs_url":"https://api.github.com/repos/emilio/servo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/emilio/servo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/emilio/servo/git/refs{/sha}","trees_url":"https://api.github.com/repos/emilio/servo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/emilio/servo/statuses/{sha}","languages_url":"https://api.github.com/repos/emilio/servo/languages","stargazers_url":"https://api.github.com/repos/emilio/servo/stargazers","contributors_url":"https://api.github.com/repos/emilio/servo/contributors","subscribers_url":"https://api.github.com/repos/emilio/servo/subscribers","subscription_url":"https://api.github.com/repos/emilio/servo/subscription","commits_url":"https://api.github.com/repos/emilio/servo/commits{/sha}","git_commits_url":"https://api.github.com/repos/emilio/servo/git/commits{/sha}","comments_url":"https://api.github.com/repos/emilio/servo/comments{/number}","issue_comment_url":"https://api.github.com/repos/emilio/servo/issues/comments{/number}","contents_url":"https://api.github.com/repos/emilio/servo/contents/{+path}","compare_url":"https://api.github.com/repos/emilio/servo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/emilio/servo/merges","archive_url":"https://api.github.com/repos/emilio/servo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/emilio/servo/downloads","issues_url":"https://api.github.com/repos/emilio/servo/issues{/number}","pulls_url":"https://api.github.com/repos/emilio/servo/pulls{/number}","milestones_url":"https://api.github.com/repos/emilio/servo/milestones{/number}","notifications_url":"https://api.github.com/repos/emilio/servo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/emilio/servo/labels{/name}","releases_url":"https://api.github.com/repos/emilio/servo/releases{/id}","deployments_url":"https://api.github.com/repos/emilio/servo/deployments","created_at":"2015-04-29T17:44:08Z","updated_at":"2016-01-12T15:00:17Z","pushed_at":"2016-04-28T01:20:08Z","git_url":"git://github.com/emilio/servo.git","ssh_url":"git@github.com:emilio/servo.git","clone_url":"https://github.com/emilio/servo.git","svn_url":"https://github.com/emilio/servo","homepage":"","size":189434,"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":"311dd0f930b9e8e90d08151f1956e2da25737d8a","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-04-29T12:46:35Z","pushed_at":"2016-04-29T17:15:19Z","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":239587,"stargazers_count":6610,"watchers_count":6610,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1083,"mirror_url":null,"open_issues_count":1450,"forks":1083,"open_issues":1450,"watchers":6610,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/servo/servo/pulls/10815"},"html":{"href":"https://github.com/servo/servo/pull/10815"},"issue":{"href":"https://api.github.com/repos/servo/servo/issues/10815"},"comments":{"href":"https://api.github.com/repos/servo/servo/issues/10815/comments"},"review_comments":{"href":"https://api.github.com/repos/servo/servo/pulls/10815/comments"},"review_comment":{"href":"https://api.github.com/repos/servo/servo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/servo/servo/pulls/10815/commits"},"statuses":{"href":"https://api.github.com/repos/servo/servo/statuses/c84541e5a604a4ee706de533c6598d362fa4f29c"}}}}