{"action":"created","comment":{"url":"https://api.github.com/repos/Polymer/vulcanize/pulls/comments/76705523","id":76705523,"diff_hunk":"@@ -16,46 +16,73 @@\n 'use strict';\n \n import constants from './constants';\n-import {predicates as p} from 'dom5';\n+import {predicates} from 'dom5';\n import * as parse5 from 'parse5';\n \n export interface Matcher { (node: parse5.ASTNode): boolean; }\n ;\n \n export const urlAttrMatchers: (Matcher)[] =\n-    constants.URL_ATTR.map(attr => p.hasAttr(attr));\n+    constants.URL_ATTR.map(attr => predicates.hasAttr(attr));\n \n-export const urlAttrs: Matcher = p.OR.apply(null, urlAttrMatchers);\n+export const urlAttrs: Matcher = predicates.OR.apply(null, urlAttrMatchers);\n \n-export const jsMatcher: Matcher = p.AND(\n-    p.hasTagName('script'),\n-    p.OR(\n-        p.NOT(p.hasAttr('type')), p.hasAttrValue('type', 'text/javascript'),\n-        p.hasAttrValue('type', 'application/javascript')));\n+export const jsMatcher: Matcher = predicates.AND(\n+    predicates.hasTagName('script'),\n+    predicates.OR(\n+        predicates.NOT(predicates.hasAttr('type')),\n+        predicates.hasAttrValue('type', 'text/javascript'),\n+        predicates.hasAttrValue('type', 'application/javascript')));\n \n-export const externalStyle: Matcher =\n-    p.AND(p.hasTagName('link'), p.hasAttrValue('rel', 'stylesheet'));\n+export const externalStyle: Matcher = predicates.AND(\n+    predicates.hasTagName('link'),\n+    predicates.hasAttrValue('rel', 'stylesheet'));\n // polymer specific external stylesheet\n-export const polymerExternalStyle: Matcher = p.AND(\n-    p.hasTagName('link'), p.hasAttrValue('rel', 'import'),\n-    p.hasAttrValue('type', 'css'));\n-\n-export const styleMatcher: Matcher = p.AND(\n-    p.hasTagName('style'),\n-    p.OR(p.NOT(p.hasAttr('type')), p.hasAttrValue('type', 'text/css')));\n-\n-export const targetMatcher: Matcher = p.AND(\n-    p.OR(p.hasTagName('a'), p.hasTagName('form')), p.NOT(p.hasAttr('target')));\n-\n-export const head: Matcher = p.hasTagName('head');\n-export const body: Matcher = p.hasTagName('body');\n-export const base: Matcher = p.hasTagName('base');\n-export const domModule: Matcher = p.AND(\n-    p.hasTagName('dom-module'), p.hasAttr('id'), p.NOT(p.hasAttr('assetpath')));\n-export const meta: Matcher = p.AND(p.hasTagName('meta'), p.hasAttr('charset'));\n-export const polymerElement: Matcher = p.hasTagName('polymer-element');\n-export const externalJavascript: Matcher = p.AND(p.hasAttr('src'), jsMatcher);\n+export const polymerExternalStyle: Matcher = predicates.AND(\n+    predicates.hasTagName('link'), predicates.hasAttrValue('rel', 'import'),\n+    predicates.hasAttrValue('type', 'css'));\n+\n+export const styleMatcher: Matcher = predicates.AND(\n+    predicates.hasTagName('style'),\n+    predicates.OR(\n+        predicates.NOT(predicates.hasAttr('type')),\n+        predicates.hasAttrValue('type', 'text/css')));\n+\n+export const targetMatcher: Matcher = predicates.AND(\n+    predicates.OR(predicates.hasTagName('a'), predicates.hasTagName('form')),\n+    predicates.NOT(predicates.hasAttr('target')));\n+\n+export const head: Matcher = predicates.hasTagName('head');\n+export const body: Matcher = predicates.hasTagName('body');\n+export const base: Matcher = predicates.hasTagName('base');\n+export const domModule: Matcher = predicates.AND(\n+    predicates.hasTagName('dom-module'), predicates.hasAttr('id'),\n+    predicates.NOT(predicates.hasAttr('assetpath')));\n+export const meta: Matcher = predicates.AND(\n+    predicates.hasTagName('meta'), predicates.hasAttr('charset'));\n+export const polymerElement: Matcher = predicates.hasTagName('polymer-element');\n+export const externalJavascript: Matcher =\n+    predicates.AND(predicates.hasAttr('src'), jsMatcher);\n export const inlineJavascript: Matcher =\n-    p.AND(p.NOT(p.hasAttr('src')), jsMatcher);\n-export const htmlImport: Matcher = p.AND(\n-    p.hasTagName('link'), p.hasAttrValue('rel', 'import'), p.hasAttr('href'));\n+    predicates.AND(predicates.NOT(predicates.hasAttr('src')), jsMatcher);\n+export const htmlImport: Matcher = predicates.AND(\n+    predicates.hasTagName('link'), predicates.hasAttrValue('rel', 'import'),\n+    predicates.hasAttr('href'));\n+\n+export const hiddenDiv = predicates.AND(\n+    predicates.hasTagName('div'), predicates.hasAttr('hidden'),\n+    predicates.hasAttr('by-vulcanize'));\n+\n+export const inHiddenDiv = predicates.parentMatches(hiddenDiv);\n+const nextToHiddenDiv = (offset) => {\n+  return (node) => {\n+    const siblings = node.parentNode.childNodes;\n+    const hiddenDivIndex = siblings.indexOf(node) + offset;","path":"src/matchers.ts","position":97,"original_position":97,"commit_id":"85fbc7916f499aa43d5180ca63c3df36d9dd9b15","original_commit_id":"85fbc7916f499aa43d5180ca63c3df36d9dd9b15","user":{"login":"usergenic","id":578,"avatar_url":"https://avatars.githubusercontent.com/u/578?v=3","gravatar_id":"","url":"https://api.github.com/users/usergenic","html_url":"https://github.com/usergenic","followers_url":"https://api.github.com/users/usergenic/followers","following_url":"https://api.github.com/users/usergenic/following{/other_user}","gists_url":"https://api.github.com/users/usergenic/gists{/gist_id}","starred_url":"https://api.github.com/users/usergenic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/usergenic/subscriptions","organizations_url":"https://api.github.com/users/usergenic/orgs","repos_url":"https://api.github.com/users/usergenic/repos","events_url":"https://api.github.com/users/usergenic/events{/privacy}","received_events_url":"https://api.github.com/users/usergenic/received_events","type":"User","site_admin":false},"body":"I'm working off the assumption that tests exist for edge cases you mentioned.  Adding TODO to ensure we have have them.","created_at":"2016-08-29T23:15:30Z","updated_at":"2016-08-29T23:15:30Z","html_url":"https://github.com/Polymer/vulcanize/pull/365#discussion_r76705523","pull_request_url":"https://api.github.com/repos/Polymer/vulcanize/pulls/365","_links":{"self":{"href":"https://api.github.com/repos/Polymer/vulcanize/pulls/comments/76705523"},"html":{"href":"https://github.com/Polymer/vulcanize/pull/365#discussion_r76705523"},"pull_request":{"href":"https://api.github.com/repos/Polymer/vulcanize/pulls/365"}}},"pull_request":{"url":"https://api.github.com/repos/Polymer/vulcanize/pulls/365","id":83145037,"html_url":"https://github.com/Polymer/vulcanize/pull/365","diff_url":"https://github.com/Polymer/vulcanize/pull/365.diff","patch_url":"https://github.com/Polymer/vulcanize/pull/365.patch","issue_url":"https://api.github.com/repos/Polymer/vulcanize/issues/365","number":365,"state":"open","locked":false,"title":"v3 checkpoint PR","user":{"login":"usergenic","id":578,"avatar_url":"https://avatars.githubusercontent.com/u/578?v=3","gravatar_id":"","url":"https://api.github.com/users/usergenic","html_url":"https://github.com/usergenic","followers_url":"https://api.github.com/users/usergenic/followers","following_url":"https://api.github.com/users/usergenic/following{/other_user}","gists_url":"https://api.github.com/users/usergenic/gists{/gist_id}","starred_url":"https://api.github.com/users/usergenic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/usergenic/subscriptions","organizations_url":"https://api.github.com/users/usergenic/orgs","repos_url":"https://api.github.com/users/usergenic/repos","events_url":"https://api.github.com/users/usergenic/events{/privacy}","received_events_url":"https://api.github.com/users/usergenic/received_events","type":"User","site_admin":false},"body":"A checkpoint for v3 work.  Inlining HTML support, converted all tests to the promise style, added source maps support for tests, and other minor fixes.  (27 tests passing, 21 failing, 7 pending)","created_at":"2016-08-29T18:33:20Z","updated_at":"2016-08-29T23:15:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ba88222c8668b560e4adf47267e7725c36e76376","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Polymer/vulcanize/pulls/365/commits","review_comments_url":"https://api.github.com/repos/Polymer/vulcanize/pulls/365/comments","review_comment_url":"https://api.github.com/repos/Polymer/vulcanize/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Polymer/vulcanize/issues/365/comments","statuses_url":"https://api.github.com/repos/Polymer/vulcanize/statuses/85fbc7916f499aa43d5180ca63c3df36d9dd9b15","head":{"label":"Polymer:inlining","ref":"inlining","sha":"85fbc7916f499aa43d5180ca63c3df36d9dd9b15","user":{"login":"Polymer","id":2159051,"avatar_url":"https://avatars.githubusercontent.com/u/2159051?v=3","gravatar_id":"","url":"https://api.github.com/users/Polymer","html_url":"https://github.com/Polymer","followers_url":"https://api.github.com/users/Polymer/followers","following_url":"https://api.github.com/users/Polymer/following{/other_user}","gists_url":"https://api.github.com/users/Polymer/gists{/gist_id}","starred_url":"https://api.github.com/users/Polymer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Polymer/subscriptions","organizations_url":"https://api.github.com/users/Polymer/orgs","repos_url":"https://api.github.com/users/Polymer/repos","events_url":"https://api.github.com/users/Polymer/events{/privacy}","received_events_url":"https://api.github.com/users/Polymer/received_events","type":"Organization","site_admin":false},"repo":{"id":13599100,"name":"vulcanize","full_name":"Polymer/vulcanize","owner":{"login":"Polymer","id":2159051,"avatar_url":"https://avatars.githubusercontent.com/u/2159051?v=3","gravatar_id":"","url":"https://api.github.com/users/Polymer","html_url":"https://github.com/Polymer","followers_url":"https://api.github.com/users/Polymer/followers","following_url":"https://api.github.com/users/Polymer/following{/other_user}","gists_url":"https://api.github.com/users/Polymer/gists{/gist_id}","starred_url":"https://api.github.com/users/Polymer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Polymer/subscriptions","organizations_url":"https://api.github.com/users/Polymer/orgs","repos_url":"https://api.github.com/users/Polymer/repos","events_url":"https://api.github.com/users/Polymer/events{/privacy}","received_events_url":"https://api.github.com/users/Polymer/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Polymer/vulcanize","description":"Build tool for HTMLImports and Web Components","fork":false,"url":"https://api.github.com/repos/Polymer/vulcanize","forks_url":"https://api.github.com/repos/Polymer/vulcanize/forks","keys_url":"https://api.github.com/repos/Polymer/vulcanize/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Polymer/vulcanize/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Polymer/vulcanize/teams","hooks_url":"https://api.github.com/repos/Polymer/vulcanize/hooks","issue_events_url":"https://api.github.com/repos/Polymer/vulcanize/issues/events{/number}","events_url":"https://api.github.com/repos/Polymer/vulcanize/events","assignees_url":"https://api.github.com/repos/Polymer/vulcanize/assignees{/user}","branches_url":"https://api.github.com/repos/Polymer/vulcanize/branches{/branch}","tags_url":"https://api.github.com/repos/Polymer/vulcanize/tags","blobs_url":"https://api.github.com/repos/Polymer/vulcanize/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Polymer/vulcanize/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Polymer/vulcanize/git/refs{/sha}","trees_url":"https://api.github.com/repos/Polymer/vulcanize/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Polymer/vulcanize/statuses/{sha}","languages_url":"https://api.github.com/repos/Polymer/vulcanize/languages","stargazers_url":"https://api.github.com/repos/Polymer/vulcanize/stargazers","contributors_url":"https://api.github.com/repos/Polymer/vulcanize/contributors","subscribers_url":"https://api.github.com/repos/Polymer/vulcanize/subscribers","subscription_url":"https://api.github.com/repos/Polymer/vulcanize/subscription","commits_url":"https://api.github.com/repos/Polymer/vulcanize/commits{/sha}","git_commits_url":"https://api.github.com/repos/Polymer/vulcanize/git/commits{/sha}","comments_url":"https://api.github.com/repos/Polymer/vulcanize/comments{/number}","issue_comment_url":"https://api.github.com/repos/Polymer/vulcanize/issues/comments{/number}","contents_url":"https://api.github.com/repos/Polymer/vulcanize/contents/{+path}","compare_url":"https://api.github.com/repos/Polymer/vulcanize/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Polymer/vulcanize/merges","archive_url":"https://api.github.com/repos/Polymer/vulcanize/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Polymer/vulcanize/downloads","issues_url":"https://api.github.com/repos/Polymer/vulcanize/issues{/number}","pulls_url":"https://api.github.com/repos/Polymer/vulcanize/pulls{/number}","milestones_url":"https://api.github.com/repos/Polymer/vulcanize/milestones{/number}","notifications_url":"https://api.github.com/repos/Polymer/vulcanize/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Polymer/vulcanize/labels{/name}","releases_url":"https://api.github.com/repos/Polymer/vulcanize/releases{/id}","deployments_url":"https://api.github.com/repos/Polymer/vulcanize/deployments","created_at":"2013-10-15T18:56:20Z","updated_at":"2016-08-29T16:15:55Z","pushed_at":"2016-08-29T18:33:20Z","git_url":"git://github.com/Polymer/vulcanize.git","ssh_url":"git@github.com:Polymer/vulcanize.git","clone_url":"https://github.com/Polymer/vulcanize.git","svn_url":"https://github.com/Polymer/vulcanize","homepage":"","size":1028,"stargazers_count":1100,"watchers_count":1100,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":114,"mirror_url":null,"open_issues_count":75,"forks":114,"open_issues":75,"watchers":1100,"default_branch":"master"}},"base":{"label":"Polymer:v3","ref":"v3","sha":"47533966f1071bffc636f47d62917c43590a0d67","user":{"login":"Polymer","id":2159051,"avatar_url":"https://avatars.githubusercontent.com/u/2159051?v=3","gravatar_id":"","url":"https://api.github.com/users/Polymer","html_url":"https://github.com/Polymer","followers_url":"https://api.github.com/users/Polymer/followers","following_url":"https://api.github.com/users/Polymer/following{/other_user}","gists_url":"https://api.github.com/users/Polymer/gists{/gist_id}","starred_url":"https://api.github.com/users/Polymer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Polymer/subscriptions","organizations_url":"https://api.github.com/users/Polymer/orgs","repos_url":"https://api.github.com/users/Polymer/repos","events_url":"https://api.github.com/users/Polymer/events{/privacy}","received_events_url":"https://api.github.com/users/Polymer/received_events","type":"Organization","site_admin":false},"repo":{"id":13599100,"name":"vulcanize","full_name":"Polymer/vulcanize","owner":{"login":"Polymer","id":2159051,"avatar_url":"https://avatars.githubusercontent.com/u/2159051?v=3","gravatar_id":"","url":"https://api.github.com/users/Polymer","html_url":"https://github.com/Polymer","followers_url":"https://api.github.com/users/Polymer/followers","following_url":"https://api.github.com/users/Polymer/following{/other_user}","gists_url":"https://api.github.com/users/Polymer/gists{/gist_id}","starred_url":"https://api.github.com/users/Polymer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Polymer/subscriptions","organizations_url":"https://api.github.com/users/Polymer/orgs","repos_url":"https://api.github.com/users/Polymer/repos","events_url":"https://api.github.com/users/Polymer/events{/privacy}","received_events_url":"https://api.github.com/users/Polymer/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Polymer/vulcanize","description":"Build tool for HTMLImports and Web Components","fork":false,"url":"https://api.github.com/repos/Polymer/vulcanize","forks_url":"https://api.github.com/repos/Polymer/vulcanize/forks","keys_url":"https://api.github.com/repos/Polymer/vulcanize/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Polymer/vulcanize/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Polymer/vulcanize/teams","hooks_url":"https://api.github.com/repos/Polymer/vulcanize/hooks","issue_events_url":"https://api.github.com/repos/Polymer/vulcanize/issues/events{/number}","events_url":"https://api.github.com/repos/Polymer/vulcanize/events","assignees_url":"https://api.github.com/repos/Polymer/vulcanize/assignees{/user}","branches_url":"https://api.github.com/repos/Polymer/vulcanize/branches{/branch}","tags_url":"https://api.github.com/repos/Polymer/vulcanize/tags","blobs_url":"https://api.github.com/repos/Polymer/vulcanize/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Polymer/vulcanize/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Polymer/vulcanize/git/refs{/sha}","trees_url":"https://api.github.com/repos/Polymer/vulcanize/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Polymer/vulcanize/statuses/{sha}","languages_url":"https://api.github.com/repos/Polymer/vulcanize/languages","stargazers_url":"https://api.github.com/repos/Polymer/vulcanize/stargazers","contributors_url":"https://api.github.com/repos/Polymer/vulcanize/contributors","subscribers_url":"https://api.github.com/repos/Polymer/vulcanize/subscribers","subscription_url":"https://api.github.com/repos/Polymer/vulcanize/subscription","commits_url":"https://api.github.com/repos/Polymer/vulcanize/commits{/sha}","git_commits_url":"https://api.github.com/repos/Polymer/vulcanize/git/commits{/sha}","comments_url":"https://api.github.com/repos/Polymer/vulcanize/comments{/number}","issue_comment_url":"https://api.github.com/repos/Polymer/vulcanize/issues/comments{/number}","contents_url":"https://api.github.com/repos/Polymer/vulcanize/contents/{+path}","compare_url":"https://api.github.com/repos/Polymer/vulcanize/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Polymer/vulcanize/merges","archive_url":"https://api.github.com/repos/Polymer/vulcanize/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Polymer/vulcanize/downloads","issues_url":"https://api.github.com/repos/Polymer/vulcanize/issues{/number}","pulls_url":"https://api.github.com/repos/Polymer/vulcanize/pulls{/number}","milestones_url":"https://api.github.com/repos/Polymer/vulcanize/milestones{/number}","notifications_url":"https://api.github.com/repos/Polymer/vulcanize/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Polymer/vulcanize/labels{/name}","releases_url":"https://api.github.com/repos/Polymer/vulcanize/releases{/id}","deployments_url":"https://api.github.com/repos/Polymer/vulcanize/deployments","created_at":"2013-10-15T18:56:20Z","updated_at":"2016-08-29T16:15:55Z","pushed_at":"2016-08-29T18:33:20Z","git_url":"git://github.com/Polymer/vulcanize.git","ssh_url":"git@github.com:Polymer/vulcanize.git","clone_url":"https://github.com/Polymer/vulcanize.git","svn_url":"https://github.com/Polymer/vulcanize","homepage":"","size":1028,"stargazers_count":1100,"watchers_count":1100,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":114,"mirror_url":null,"open_issues_count":75,"forks":114,"open_issues":75,"watchers":1100,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Polymer/vulcanize/pulls/365"},"html":{"href":"https://github.com/Polymer/vulcanize/pull/365"},"issue":{"href":"https://api.github.com/repos/Polymer/vulcanize/issues/365"},"comments":{"href":"https://api.github.com/repos/Polymer/vulcanize/issues/365/comments"},"review_comments":{"href":"https://api.github.com/repos/Polymer/vulcanize/pulls/365/comments"},"review_comment":{"href":"https://api.github.com/repos/Polymer/vulcanize/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Polymer/vulcanize/pulls/365/commits"},"statuses":{"href":"https://api.github.com/repos/Polymer/vulcanize/statuses/85fbc7916f499aa43d5180ca63c3df36d9dd9b15"}}}}
{"actor":{"display_login":"usergenic"}}