{"action":"created","comment":{"url":"https://api.github.com/repos/web-animations/web-animations-next/pulls/comments/61350112","id":61350112,"diff_hunk":"@@ -13,14 +13,38 @@\n // limitations under the License.\n \n (function(shared) {\n-  // If an animation with the new syntax applies an effect, there's no need\n-  // to load this part of the polyfill.\n+  // If the polyfill is being loaded in a context where Element.animate is\n+  // supported but object-form syntax is not, then creating an animation\n+  // using the new syntax will either have no effect or will throw an exception.\n+  // In either case, we want to proceed to load this part of the polyfill.\n+  //\n+  // The test animation starts from an opacity other than the one the element\n+  // already has. The finish opacity is arbitrary. After the test, the element's\n+  // opacity will be left how we found it:\n+  // - If the animation is not created, the test will leave the element's\n+  //   opacity untouched at originalOpacity.\n+  // - If the animation is created, it will be cancelled, and leave the\n+  //   element's opacity at originalOpacity.\n+  // - If the animation is somehow created and runs without being cancelled,\n+  //   when it finishes after 1ms, it will cease to have any effect (because\n+  //   fill is not specified), and opacity will again be left at originalOpacity.\n   var element = document.documentElement;\n-  var animation = element.animate({'opacity': ['1', '0']},\n-      {duration: 1, fill: 'forwards'});\n-  animation.finish();\n-  var animated = getComputedStyle(element).getPropertyValue('opacity') == '0';\n-  animation.cancel();\n+  var animation = null;\n+  var animated = true;\n+  try {\n+    var originalOpacity = getComputedStyle(element).getPropertyValue('opacity');\n+    var startOpacity = originalOpacity == '0' ? '1' : '0';\n+    var finishOpacity = '1';\n+    animation = element.animate({'opacity': [startOpacity, finishOpacity]},\n+        {duration: 1});\n+    animation.currentTime = 0;\n+    animated = getComputedStyle(element).getPropertyValue('opacity') == startOpacity;\n+  } catch (err) {\n+    animated = false;","path":"src/web-animations-bonus-object-form-keyframes.js","position":null,"original_position":38,"commit_id":"7d9e50a8a71f048ad4b7405f4547372087f5b4c4","original_commit_id":"94ecad7e572ad8304fa2822e42c5061dca5ebe26","user":{"login":"suzyh","id":2652697,"avatar_url":"https://avatars.githubusercontent.com/u/2652697?v=3","gravatar_id":"","url":"https://api.github.com/users/suzyh","html_url":"https://github.com/suzyh","followers_url":"https://api.github.com/users/suzyh/followers","following_url":"https://api.github.com/users/suzyh/following{/other_user}","gists_url":"https://api.github.com/users/suzyh/gists{/gist_id}","starred_url":"https://api.github.com/users/suzyh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suzyh/subscriptions","organizations_url":"https://api.github.com/users/suzyh/orgs","repos_url":"https://api.github.com/users/suzyh/repos","events_url":"https://api.github.com/users/suzyh/events{/privacy}","received_events_url":"https://api.github.com/users/suzyh/received_events","type":"User","site_admin":false},"body":"Done.","created_at":"2016-04-27T22:48:58Z","updated_at":"2016-04-27T22:48:58Z","html_url":"https://github.com/web-animations/web-animations-next/pull/434#discussion_r61350112","pull_request_url":"https://api.github.com/repos/web-animations/web-animations-next/pulls/434","_links":{"self":{"href":"https://api.github.com/repos/web-animations/web-animations-next/pulls/comments/61350112"},"html":{"href":"https://github.com/web-animations/web-animations-next/pull/434#discussion_r61350112"},"pull_request":{"href":"https://api.github.com/repos/web-animations/web-animations-next/pulls/434"}}},"pull_request":{"url":"https://api.github.com/repos/web-animations/web-animations-next/pulls/434","id":68003541,"html_url":"https://github.com/web-animations/web-animations-next/pull/434","diff_url":"https://github.com/web-animations/web-animations-next/pull/434.diff","patch_url":"https://github.com/web-animations/web-animations-next/pull/434.patch","issue_url":"https://api.github.com/repos/web-animations/web-animations-next/issues/434","number":434,"state":"open","locked":false,"title":"Add try-catch guard to object-form loading check","user":{"login":"suzyh","id":2652697,"avatar_url":"https://avatars.githubusercontent.com/u/2652697?v=3","gravatar_id":"","url":"https://api.github.com/users/suzyh","html_url":"https://github.com/suzyh","followers_url":"https://api.github.com/users/suzyh/followers","following_url":"https://api.github.com/users/suzyh/following{/other_user}","gists_url":"https://api.github.com/users/suzyh/gists{/gist_id}","starred_url":"https://api.github.com/users/suzyh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suzyh/subscriptions","organizations_url":"https://api.github.com/users/suzyh/orgs","repos_url":"https://api.github.com/users/suzyh/repos","events_url":"https://api.github.com/users/suzyh/events{/privacy}","received_events_url":"https://api.github.com/users/suzyh/received_events","type":"User","site_admin":false},"body":"The object-form-keyframes source file uses a call to Element.animate\r\nto decide whether to load the polyfill for the object-form syntax.\r\nIf the native browser code supports Element.animate without full\r\nsupport for object-form syntax, this test can throw a TypeError (see\r\nhttps://github.com/web-animations/web-animations-js/issues/72). In\r\nthis case, the polyfill should proceed to load the polyfill. This\r\npatch implements this behaviour with a try-catch guard around the\r\nElement.animate loading check.","created_at":"2016-04-27T06:34:45Z","updated_at":"2016-04-27T22:48:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2876df5b4754076ecf148f929c795276defc1733","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/web-animations/web-animations-next/pulls/434/commits","review_comments_url":"https://api.github.com/repos/web-animations/web-animations-next/pulls/434/comments","review_comment_url":"https://api.github.com/repos/web-animations/web-animations-next/pulls/comments{/number}","comments_url":"https://api.github.com/repos/web-animations/web-animations-next/issues/434/comments","statuses_url":"https://api.github.com/repos/web-animations/web-animations-next/statuses/7d9e50a8a71f048ad4b7405f4547372087f5b4c4","head":{"label":"suzyh:object-form-try-guard","ref":"object-form-try-guard","sha":"7d9e50a8a71f048ad4b7405f4547372087f5b4c4","user":{"login":"suzyh","id":2652697,"avatar_url":"https://avatars.githubusercontent.com/u/2652697?v=3","gravatar_id":"","url":"https://api.github.com/users/suzyh","html_url":"https://github.com/suzyh","followers_url":"https://api.github.com/users/suzyh/followers","following_url":"https://api.github.com/users/suzyh/following{/other_user}","gists_url":"https://api.github.com/users/suzyh/gists{/gist_id}","starred_url":"https://api.github.com/users/suzyh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suzyh/subscriptions","organizations_url":"https://api.github.com/users/suzyh/orgs","repos_url":"https://api.github.com/users/suzyh/repos","events_url":"https://api.github.com/users/suzyh/events{/privacy}","received_events_url":"https://api.github.com/users/suzyh/received_events","type":"User","site_admin":false},"repo":{"id":53285351,"name":"web-animations-next","full_name":"suzyh/web-animations-next","owner":{"login":"suzyh","id":2652697,"avatar_url":"https://avatars.githubusercontent.com/u/2652697?v=3","gravatar_id":"","url":"https://api.github.com/users/suzyh","html_url":"https://github.com/suzyh","followers_url":"https://api.github.com/users/suzyh/followers","following_url":"https://api.github.com/users/suzyh/following{/other_user}","gists_url":"https://api.github.com/users/suzyh/gists{/gist_id}","starred_url":"https://api.github.com/users/suzyh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suzyh/subscriptions","organizations_url":"https://api.github.com/users/suzyh/orgs","repos_url":"https://api.github.com/users/suzyh/repos","events_url":"https://api.github.com/users/suzyh/events{/privacy}","received_events_url":"https://api.github.com/users/suzyh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/suzyh/web-animations-next","description":"Fork of development repository for web-animations-js:","fork":true,"url":"https://api.github.com/repos/suzyh/web-animations-next","forks_url":"https://api.github.com/repos/suzyh/web-animations-next/forks","keys_url":"https://api.github.com/repos/suzyh/web-animations-next/keys{/key_id}","collaborators_url":"https://api.github.com/repos/suzyh/web-animations-next/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/suzyh/web-animations-next/teams","hooks_url":"https://api.github.com/repos/suzyh/web-animations-next/hooks","issue_events_url":"https://api.github.com/repos/suzyh/web-animations-next/issues/events{/number}","events_url":"https://api.github.com/repos/suzyh/web-animations-next/events","assignees_url":"https://api.github.com/repos/suzyh/web-animations-next/assignees{/user}","branches_url":"https://api.github.com/repos/suzyh/web-animations-next/branches{/branch}","tags_url":"https://api.github.com/repos/suzyh/web-animations-next/tags","blobs_url":"https://api.github.com/repos/suzyh/web-animations-next/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/suzyh/web-animations-next/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/suzyh/web-animations-next/git/refs{/sha}","trees_url":"https://api.github.com/repos/suzyh/web-animations-next/git/trees{/sha}","statuses_url":"https://api.github.com/repos/suzyh/web-animations-next/statuses/{sha}","languages_url":"https://api.github.com/repos/suzyh/web-animations-next/languages","stargazers_url":"https://api.github.com/repos/suzyh/web-animations-next/stargazers","contributors_url":"https://api.github.com/repos/suzyh/web-animations-next/contributors","subscribers_url":"https://api.github.com/repos/suzyh/web-animations-next/subscribers","subscription_url":"https://api.github.com/repos/suzyh/web-animations-next/subscription","commits_url":"https://api.github.com/repos/suzyh/web-animations-next/commits{/sha}","git_commits_url":"https://api.github.com/repos/suzyh/web-animations-next/git/commits{/sha}","comments_url":"https://api.github.com/repos/suzyh/web-animations-next/comments{/number}","issue_comment_url":"https://api.github.com/repos/suzyh/web-animations-next/issues/comments{/number}","contents_url":"https://api.github.com/repos/suzyh/web-animations-next/contents/{+path}","compare_url":"https://api.github.com/repos/suzyh/web-animations-next/compare/{base}...{head}","merges_url":"https://api.github.com/repos/suzyh/web-animations-next/merges","archive_url":"https://api.github.com/repos/suzyh/web-animations-next/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/suzyh/web-animations-next/downloads","issues_url":"https://api.github.com/repos/suzyh/web-animations-next/issues{/number}","pulls_url":"https://api.github.com/repos/suzyh/web-animations-next/pulls{/number}","milestones_url":"https://api.github.com/repos/suzyh/web-animations-next/milestones{/number}","notifications_url":"https://api.github.com/repos/suzyh/web-animations-next/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/suzyh/web-animations-next/labels{/name}","releases_url":"https://api.github.com/repos/suzyh/web-animations-next/releases{/id}","deployments_url":"https://api.github.com/repos/suzyh/web-animations-next/deployments","created_at":"2016-03-07T01:05:32Z","updated_at":"2016-03-16T22:42:38Z","pushed_at":"2016-04-27T22:48:45Z","git_url":"git://github.com/suzyh/web-animations-next.git","ssh_url":"git@github.com:suzyh/web-animations-next.git","clone_url":"https://github.com/suzyh/web-animations-next.git","svn_url":"https://github.com/suzyh/web-animations-next","homepage":"https://github.com/web-animations/web-animations-js","size":1324,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"web-animations:master","ref":"master","sha":"28c1277bc643a2884cdf6027dd28abc691f9ebd2","user":{"login":"web-animations","id":2975912,"avatar_url":"https://avatars.githubusercontent.com/u/2975912?v=3","gravatar_id":"","url":"https://api.github.com/users/web-animations","html_url":"https://github.com/web-animations","followers_url":"https://api.github.com/users/web-animations/followers","following_url":"https://api.github.com/users/web-animations/following{/other_user}","gists_url":"https://api.github.com/users/web-animations/gists{/gist_id}","starred_url":"https://api.github.com/users/web-animations/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/web-animations/subscriptions","organizations_url":"https://api.github.com/users/web-animations/orgs","repos_url":"https://api.github.com/users/web-animations/repos","events_url":"https://api.github.com/users/web-animations/events{/privacy}","received_events_url":"https://api.github.com/users/web-animations/received_events","type":"Organization","site_admin":false},"repo":{"id":20545443,"name":"web-animations-next","full_name":"web-animations/web-animations-next","owner":{"login":"web-animations","id":2975912,"avatar_url":"https://avatars.githubusercontent.com/u/2975912?v=3","gravatar_id":"","url":"https://api.github.com/users/web-animations","html_url":"https://github.com/web-animations","followers_url":"https://api.github.com/users/web-animations/followers","following_url":"https://api.github.com/users/web-animations/following{/other_user}","gists_url":"https://api.github.com/users/web-animations/gists{/gist_id}","starred_url":"https://api.github.com/users/web-animations/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/web-animations/subscriptions","organizations_url":"https://api.github.com/users/web-animations/orgs","repos_url":"https://api.github.com/users/web-animations/repos","events_url":"https://api.github.com/users/web-animations/events{/privacy}","received_events_url":"https://api.github.com/users/web-animations/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/web-animations/web-animations-next","description":"Development repository for web-animations-js:","fork":false,"url":"https://api.github.com/repos/web-animations/web-animations-next","forks_url":"https://api.github.com/repos/web-animations/web-animations-next/forks","keys_url":"https://api.github.com/repos/web-animations/web-animations-next/keys{/key_id}","collaborators_url":"https://api.github.com/repos/web-animations/web-animations-next/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/web-animations/web-animations-next/teams","hooks_url":"https://api.github.com/repos/web-animations/web-animations-next/hooks","issue_events_url":"https://api.github.com/repos/web-animations/web-animations-next/issues/events{/number}","events_url":"https://api.github.com/repos/web-animations/web-animations-next/events","assignees_url":"https://api.github.com/repos/web-animations/web-animations-next/assignees{/user}","branches_url":"https://api.github.com/repos/web-animations/web-animations-next/branches{/branch}","tags_url":"https://api.github.com/repos/web-animations/web-animations-next/tags","blobs_url":"https://api.github.com/repos/web-animations/web-animations-next/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/web-animations/web-animations-next/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/web-animations/web-animations-next/git/refs{/sha}","trees_url":"https://api.github.com/repos/web-animations/web-animations-next/git/trees{/sha}","statuses_url":"https://api.github.com/repos/web-animations/web-animations-next/statuses/{sha}","languages_url":"https://api.github.com/repos/web-animations/web-animations-next/languages","stargazers_url":"https://api.github.com/repos/web-animations/web-animations-next/stargazers","contributors_url":"https://api.github.com/repos/web-animations/web-animations-next/contributors","subscribers_url":"https://api.github.com/repos/web-animations/web-animations-next/subscribers","subscription_url":"https://api.github.com/repos/web-animations/web-animations-next/subscription","commits_url":"https://api.github.com/repos/web-animations/web-animations-next/commits{/sha}","git_commits_url":"https://api.github.com/repos/web-animations/web-animations-next/git/commits{/sha}","comments_url":"https://api.github.com/repos/web-animations/web-animations-next/comments{/number}","issue_comment_url":"https://api.github.com/repos/web-animations/web-animations-next/issues/comments{/number}","contents_url":"https://api.github.com/repos/web-animations/web-animations-next/contents/{+path}","compare_url":"https://api.github.com/repos/web-animations/web-animations-next/compare/{base}...{head}","merges_url":"https://api.github.com/repos/web-animations/web-animations-next/merges","archive_url":"https://api.github.com/repos/web-animations/web-animations-next/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/web-animations/web-animations-next/downloads","issues_url":"https://api.github.com/repos/web-animations/web-animations-next/issues{/number}","pulls_url":"https://api.github.com/repos/web-animations/web-animations-next/pulls{/number}","milestones_url":"https://api.github.com/repos/web-animations/web-animations-next/milestones{/number}","notifications_url":"https://api.github.com/repos/web-animations/web-animations-next/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/web-animations/web-animations-next/labels{/name}","releases_url":"https://api.github.com/repos/web-animations/web-animations-next/releases{/id}","deployments_url":"https://api.github.com/repos/web-animations/web-animations-next/deployments","created_at":"2014-06-05T23:47:19Z","updated_at":"2016-04-16T08:23:00Z","pushed_at":"2016-04-27T22:48:45Z","git_url":"git://github.com/web-animations/web-animations-next.git","ssh_url":"git@github.com:web-animations/web-animations-next.git","clone_url":"https://github.com/web-animations/web-animations-next.git","svn_url":"https://github.com/web-animations/web-animations-next","homepage":"https://github.com/web-animations/web-animations-js","size":1518,"stargazers_count":95,"watchers_count":95,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":30,"mirror_url":null,"open_issues_count":66,"forks":30,"open_issues":66,"watchers":95,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/web-animations/web-animations-next/pulls/434"},"html":{"href":"https://github.com/web-animations/web-animations-next/pull/434"},"issue":{"href":"https://api.github.com/repos/web-animations/web-animations-next/issues/434"},"comments":{"href":"https://api.github.com/repos/web-animations/web-animations-next/issues/434/comments"},"review_comments":{"href":"https://api.github.com/repos/web-animations/web-animations-next/pulls/434/comments"},"review_comment":{"href":"https://api.github.com/repos/web-animations/web-animations-next/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/web-animations/web-animations-next/pulls/434/commits"},"statuses":{"href":"https://api.github.com/repos/web-animations/web-animations-next/statuses/7d9e50a8a71f048ad4b7405f4547372087f5b4c4"}}}}