{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/pdf.js/pulls/comments/45552130","id":45552130,"diff_hunk":"@@ -139,6 +141,70 @@ var Annotation = (function AnnotationClosure() {\n \n   Annotation.prototype = {\n     /**\n+     * Set the flags.\n+     *\n+     * @public\n+     * @memberof Annotation\n+     * @param {number} flags - unsigned 32-bit integer specifying annotation\n+     *                         characteristics\n+     * @see {@link shared/util.js}\n+     */\n+    setFlags: function Annotation_setFlags(flags) {\n+      if (flags === (flags | 0)) {","path":"src/core/annotation.js","position":null,"original_position":33,"commit_id":"2ef2af300159683d34cda557778cfea77007c78f","original_commit_id":"8f953b29a2f81c526f1973036752b9a421055868","user":{"login":"timvandermeij","id":1993262,"avatar_url":"https://avatars.githubusercontent.com/u/1993262?v=3","gravatar_id":"","url":"https://api.github.com/users/timvandermeij","html_url":"https://github.com/timvandermeij","followers_url":"https://api.github.com/users/timvandermeij/followers","following_url":"https://api.github.com/users/timvandermeij/following{/other_user}","gists_url":"https://api.github.com/users/timvandermeij/gists{/gist_id}","starred_url":"https://api.github.com/users/timvandermeij/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timvandermeij/subscriptions","organizations_url":"https://api.github.com/users/timvandermeij/orgs","repos_url":"https://api.github.com/users/timvandermeij/repos","events_url":"https://api.github.com/users/timvandermeij/events{/privacy}","received_events_url":"https://api.github.com/users/timvandermeij/received_events","type":"User","site_admin":false},"body":"Done in the new commit.","created_at":"2015-11-21T22:59:44Z","updated_at":"2015-11-21T22:59:44Z","html_url":"https://github.com/mozilla/pdf.js/pull/6672#discussion_r45552130","pull_request_url":"https://api.github.com/repos/mozilla/pdf.js/pulls/6672","_links":{"self":{"href":"https://api.github.com/repos/mozilla/pdf.js/pulls/comments/45552130"},"html":{"href":"https://github.com/mozilla/pdf.js/pull/6672#discussion_r45552130"},"pull_request":{"href":"https://api.github.com/repos/mozilla/pdf.js/pulls/6672"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/pdf.js/pulls/6672","id":51452103,"html_url":"https://github.com/mozilla/pdf.js/pull/6672","diff_url":"https://github.com/mozilla/pdf.js/pull/6672.diff","patch_url":"https://github.com/mozilla/pdf.js/pull/6672.patch","issue_url":"https://api.github.com/repos/mozilla/pdf.js/issues/6672","number":6672,"state":"open","locked":false,"title":"Refactor annotation flags code","user":{"login":"timvandermeij","id":1993262,"avatar_url":"https://avatars.githubusercontent.com/u/1993262?v=3","gravatar_id":"","url":"https://api.github.com/users/timvandermeij","html_url":"https://github.com/timvandermeij","followers_url":"https://api.github.com/users/timvandermeij/followers","following_url":"https://api.github.com/users/timvandermeij/following{/other_user}","gists_url":"https://api.github.com/users/timvandermeij/gists{/gist_id}","starred_url":"https://api.github.com/users/timvandermeij/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timvandermeij/subscriptions","organizations_url":"https://api.github.com/users/timvandermeij/orgs","repos_url":"https://api.github.com/users/timvandermeij/repos","events_url":"https://api.github.com/users/timvandermeij/events{/privacy}","received_events_url":"https://api.github.com/users/timvandermeij/received_events","type":"User","site_admin":false},"body":"This patch makes it possible to set and get all possible flags that the PDF specification defines. Even though we do not support all possible annotation types and not all possible annotation flags yet, this general framework makes it easy to access all flags for each annotation such that annotation type implementations can use with this information.\r\n\r\nWe add constants for all possible annotation flags such that we do not need to hardcode the flags in the code anymore. The `isViewable()` and `isPrintable()` methods are now much easier to read. Additionally, unit tests have been added to ensure correct behavior.\r\n\r\nThis is another part of #5218.\r\n\r\nI have tested this patch, both with displaying and with printing, with a corpus of 22 PDF files with different annotation types and annotation flags in them and observed no difference with the current master.\r\n\r\n@Snuffleupagus Do you have time to review this patch? I have tentatively assigned you as you reviewed most of my previous annotation layer patches, but if you don't have time feel free to unassign yourself!","created_at":"2015-11-21T22:37:42Z","updated_at":"2015-11-21T22:59:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"54288a4f59045419102e0bd3a0240afa64f5a59e","assignee":{"login":"Snuffleupagus","id":2692120,"avatar_url":"https://avatars.githubusercontent.com/u/2692120?v=3","gravatar_id":"","url":"https://api.github.com/users/Snuffleupagus","html_url":"https://github.com/Snuffleupagus","followers_url":"https://api.github.com/users/Snuffleupagus/followers","following_url":"https://api.github.com/users/Snuffleupagus/following{/other_user}","gists_url":"https://api.github.com/users/Snuffleupagus/gists{/gist_id}","starred_url":"https://api.github.com/users/Snuffleupagus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Snuffleupagus/subscriptions","organizations_url":"https://api.github.com/users/Snuffleupagus/orgs","repos_url":"https://api.github.com/users/Snuffleupagus/repos","events_url":"https://api.github.com/users/Snuffleupagus/events{/privacy}","received_events_url":"https://api.github.com/users/Snuffleupagus/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/pdf.js/pulls/6672/commits","review_comments_url":"https://api.github.com/repos/mozilla/pdf.js/pulls/6672/comments","review_comment_url":"https://api.github.com/repos/mozilla/pdf.js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/pdf.js/issues/6672/comments","statuses_url":"https://api.github.com/repos/mozilla/pdf.js/statuses/2ef2af300159683d34cda557778cfea77007c78f","head":{"label":"timvandermeij:annotation-flags","ref":"annotation-flags","sha":"2ef2af300159683d34cda557778cfea77007c78f","user":{"login":"timvandermeij","id":1993262,"avatar_url":"https://avatars.githubusercontent.com/u/1993262?v=3","gravatar_id":"","url":"https://api.github.com/users/timvandermeij","html_url":"https://github.com/timvandermeij","followers_url":"https://api.github.com/users/timvandermeij/followers","following_url":"https://api.github.com/users/timvandermeij/following{/other_user}","gists_url":"https://api.github.com/users/timvandermeij/gists{/gist_id}","starred_url":"https://api.github.com/users/timvandermeij/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timvandermeij/subscriptions","organizations_url":"https://api.github.com/users/timvandermeij/orgs","repos_url":"https://api.github.com/users/timvandermeij/repos","events_url":"https://api.github.com/users/timvandermeij/events{/privacy}","received_events_url":"https://api.github.com/users/timvandermeij/received_events","type":"User","site_admin":false},"repo":{"id":6161909,"name":"pdf.js","full_name":"timvandermeij/pdf.js","owner":{"login":"timvandermeij","id":1993262,"avatar_url":"https://avatars.githubusercontent.com/u/1993262?v=3","gravatar_id":"","url":"https://api.github.com/users/timvandermeij","html_url":"https://github.com/timvandermeij","followers_url":"https://api.github.com/users/timvandermeij/followers","following_url":"https://api.github.com/users/timvandermeij/following{/other_user}","gists_url":"https://api.github.com/users/timvandermeij/gists{/gist_id}","starred_url":"https://api.github.com/users/timvandermeij/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timvandermeij/subscriptions","organizations_url":"https://api.github.com/users/timvandermeij/orgs","repos_url":"https://api.github.com/users/timvandermeij/repos","events_url":"https://api.github.com/users/timvandermeij/events{/privacy}","received_events_url":"https://api.github.com/users/timvandermeij/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/timvandermeij/pdf.js","description":"PDF Reader in JavaScript","fork":true,"url":"https://api.github.com/repos/timvandermeij/pdf.js","forks_url":"https://api.github.com/repos/timvandermeij/pdf.js/forks","keys_url":"https://api.github.com/repos/timvandermeij/pdf.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/timvandermeij/pdf.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/timvandermeij/pdf.js/teams","hooks_url":"https://api.github.com/repos/timvandermeij/pdf.js/hooks","issue_events_url":"https://api.github.com/repos/timvandermeij/pdf.js/issues/events{/number}","events_url":"https://api.github.com/repos/timvandermeij/pdf.js/events","assignees_url":"https://api.github.com/repos/timvandermeij/pdf.js/assignees{/user}","branches_url":"https://api.github.com/repos/timvandermeij/pdf.js/branches{/branch}","tags_url":"https://api.github.com/repos/timvandermeij/pdf.js/tags","blobs_url":"https://api.github.com/repos/timvandermeij/pdf.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/timvandermeij/pdf.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/timvandermeij/pdf.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/timvandermeij/pdf.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/timvandermeij/pdf.js/statuses/{sha}","languages_url":"https://api.github.com/repos/timvandermeij/pdf.js/languages","stargazers_url":"https://api.github.com/repos/timvandermeij/pdf.js/stargazers","contributors_url":"https://api.github.com/repos/timvandermeij/pdf.js/contributors","subscribers_url":"https://api.github.com/repos/timvandermeij/pdf.js/subscribers","subscription_url":"https://api.github.com/repos/timvandermeij/pdf.js/subscription","commits_url":"https://api.github.com/repos/timvandermeij/pdf.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/timvandermeij/pdf.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/timvandermeij/pdf.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/timvandermeij/pdf.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/timvandermeij/pdf.js/contents/{+path}","compare_url":"https://api.github.com/repos/timvandermeij/pdf.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/timvandermeij/pdf.js/merges","archive_url":"https://api.github.com/repos/timvandermeij/pdf.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/timvandermeij/pdf.js/downloads","issues_url":"https://api.github.com/repos/timvandermeij/pdf.js/issues{/number}","pulls_url":"https://api.github.com/repos/timvandermeij/pdf.js/pulls{/number}","milestones_url":"https://api.github.com/repos/timvandermeij/pdf.js/milestones{/number}","notifications_url":"https://api.github.com/repos/timvandermeij/pdf.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/timvandermeij/pdf.js/labels{/name}","releases_url":"https://api.github.com/repos/timvandermeij/pdf.js/releases{/id}","created_at":"2012-10-10T18:16:22Z","updated_at":"2015-04-30T20:36:01Z","pushed_at":"2015-11-21T22:59:21Z","git_url":"git://github.com/timvandermeij/pdf.js.git","ssh_url":"git@github.com:timvandermeij/pdf.js.git","clone_url":"https://github.com/timvandermeij/pdf.js.git","svn_url":"https://github.com/timvandermeij/pdf.js","homepage":"","size":48784,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":0,"forks":2,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mozilla:master","ref":"master","sha":"df46b64045d0e341ae3aae13a42eb9bf138a6d58","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":1663468,"name":"pdf.js","full_name":"mozilla/pdf.js","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/pdf.js","description":"PDF Reader in JavaScript","fork":false,"url":"https://api.github.com/repos/mozilla/pdf.js","forks_url":"https://api.github.com/repos/mozilla/pdf.js/forks","keys_url":"https://api.github.com/repos/mozilla/pdf.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/pdf.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/pdf.js/teams","hooks_url":"https://api.github.com/repos/mozilla/pdf.js/hooks","issue_events_url":"https://api.github.com/repos/mozilla/pdf.js/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/pdf.js/events","assignees_url":"https://api.github.com/repos/mozilla/pdf.js/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/pdf.js/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/pdf.js/tags","blobs_url":"https://api.github.com/repos/mozilla/pdf.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/pdf.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/pdf.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/pdf.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/pdf.js/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/pdf.js/languages","stargazers_url":"https://api.github.com/repos/mozilla/pdf.js/stargazers","contributors_url":"https://api.github.com/repos/mozilla/pdf.js/contributors","subscribers_url":"https://api.github.com/repos/mozilla/pdf.js/subscribers","subscription_url":"https://api.github.com/repos/mozilla/pdf.js/subscription","commits_url":"https://api.github.com/repos/mozilla/pdf.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/pdf.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/pdf.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/pdf.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/pdf.js/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/pdf.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/pdf.js/merges","archive_url":"https://api.github.com/repos/mozilla/pdf.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/pdf.js/downloads","issues_url":"https://api.github.com/repos/mozilla/pdf.js/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/pdf.js/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/pdf.js/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/pdf.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/pdf.js/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/pdf.js/releases{/id}","created_at":"2011-04-26T06:32:03Z","updated_at":"2015-11-21T20:50:14Z","pushed_at":"2015-11-21T22:59:22Z","git_url":"git://github.com/mozilla/pdf.js.git","ssh_url":"git@github.com:mozilla/pdf.js.git","clone_url":"https://github.com/mozilla/pdf.js.git","svn_url":"https://github.com/mozilla/pdf.js","homepage":"","size":100019,"stargazers_count":12956,"watchers_count":12956,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3026,"mirror_url":null,"open_issues_count":580,"forks":3026,"open_issues":580,"watchers":12956,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/pdf.js/pulls/6672"},"html":{"href":"https://github.com/mozilla/pdf.js/pull/6672"},"issue":{"href":"https://api.github.com/repos/mozilla/pdf.js/issues/6672"},"comments":{"href":"https://api.github.com/repos/mozilla/pdf.js/issues/6672/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/pdf.js/pulls/6672/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/pdf.js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/pdf.js/pulls/6672/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/pdf.js/statuses/2ef2af300159683d34cda557778cfea77007c78f"}}}}