{"action":"created","issue":{"url":"https://api.github.com/repos/servo/servo/issues/13713","repository_url":"https://api.github.com/repos/servo/servo","labels_url":"https://api.github.com/repos/servo/servo/issues/13713/labels{/name}","comments_url":"https://api.github.com/repos/servo/servo/issues/13713/comments","events_url":"https://api.github.com/repos/servo/servo/issues/13713/events","html_url":"https://github.com/servo/servo/pull/13713","id":182463971,"number":13713,"title":"[WIP] Fiix referrer policy tests for a-tag","user":{"login":"TheKK","id":5238484,"avatar_url":"https://avatars.githubusercontent.com/u/5238484?v=3","gravatar_id":"","url":"https://api.github.com/users/TheKK","html_url":"https://github.com/TheKK","followers_url":"https://api.github.com/users/TheKK/followers","following_url":"https://api.github.com/users/TheKK/following{/other_user}","gists_url":"https://api.github.com/users/TheKK/gists{/gist_id}","starred_url":"https://api.github.com/users/TheKK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheKK/subscriptions","organizations_url":"https://api.github.com/users/TheKK/orgs","repos_url":"https://api.github.com/users/TheKK/repos","events_url":"https://api.github.com/users/TheKK/events{/privacy}","received_events_url":"https://api.github.com/users/TheKK/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/servo/servo/labels/S-awaiting-answer","name":"S-awaiting-answer","color":"d4c5f9"}],"state":"open","locked":false,"assignee":{"login":"jdm","id":27658,"avatar_url":"https://avatars.githubusercontent.com/u/27658?v=3","gravatar_id":"","url":"https://api.github.com/users/jdm","html_url":"https://github.com/jdm","followers_url":"https://api.github.com/users/jdm/followers","following_url":"https://api.github.com/users/jdm/following{/other_user}","gists_url":"https://api.github.com/users/jdm/gists{/gist_id}","starred_url":"https://api.github.com/users/jdm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdm/subscriptions","organizations_url":"https://api.github.com/users/jdm/orgs","repos_url":"https://api.github.com/users/jdm/repos","events_url":"https://api.github.com/users/jdm/events{/privacy}","received_events_url":"https://api.github.com/users/jdm/received_events","type":"User","site_admin":false},"assignees":[{"login":"jdm","id":27658,"avatar_url":"https://avatars.githubusercontent.com/u/27658?v=3","gravatar_id":"","url":"https://api.github.com/users/jdm","html_url":"https://github.com/jdm","followers_url":"https://api.github.com/users/jdm/followers","following_url":"https://api.github.com/users/jdm/following{/other_user}","gists_url":"https://api.github.com/users/jdm/gists{/gist_id}","starred_url":"https://api.github.com/users/jdm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdm/subscriptions","organizations_url":"https://api.github.com/users/jdm/orgs","repos_url":"https://api.github.com/users/jdm/repos","events_url":"https://api.github.com/users/jdm/events{/privacy}","received_events_url":"https://api.github.com/users/jdm/received_events","type":"User","site_admin":false}],"milestone":null,"comments":8,"created_at":"2016-10-12T08:24:30Z","updated_at":"2016-10-15T20:06:39Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/servo/servo/pulls/13713","html_url":"https://github.com/servo/servo/pull/13713","diff_url":"https://github.com/servo/servo/pull/13713.diff","patch_url":"https://github.com/servo/servo/pull/13713.patch"},"body":"This RP tries to fix referrer policy test for <a> which was introduced in #12493 (sorry for my silly mistake). But the fact that Servo lakes of some functionalities make these tests a little tricky to do.\r\n\r\nThe desired solution for tests for <a> is to:\r\n\r\n1. create a document which is running test harness\r\n2. append an `<iframe>` to its parent document and give it a name\r\n3. append and `<a>` to its parent document and set its `target` as `<iframe>`'s name\r\n4. each referrer policy attribute (eg. HTTP header, <meta>) would contribute to `<a>` directly\r\n5. we call `click()` on `<a>` and when the test was done, we call `postMessage()` inside `<iframe>` to notify its parent document\r\n\r\nAnd target feature for `<a>` and cross origin `postMessage()` is still on its way. My solution is:\r\n\r\n1. create a document which is running test harness\r\n2. append an `<iframe>` to its parent document\r\n3. append and `<a>` into `<iframe>`\r\n4. we call `click()` on `<a>` and `<iframe>` navigate to `<a>`'s href\r\n\r\nCurrent solution does not work for some cases:\r\n\r\n- HTTP header, it only apply to test harness html document but `<a>` inside `<iframe>`\r\n- cross origin detection, we navigate `<iframe>` rather than its parent document, which make test expectation wrong\r\n\r\nOne workaround in my mind is to load our test harness html document **inside** `<iframe>` under sandbox, so the test won't run again and we get `<meta>` and HTTP header as we expect. But this would break some consistency in `common.js` and make thing more complex.\r\n\r\n----\r\nSorry for the long description. But I'd like to hear more thought before I actually make things dirty, and find the most proper solution for this.\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/servo/servo/13713)\n<!-- Reviewable:end -->\n"},"comment":{"url":"https://api.github.com/repos/servo/servo/issues/comments/254007933","html_url":"https://github.com/servo/servo/pull/13713#issuecomment-254007933","issue_url":"https://api.github.com/repos/servo/servo/issues/13713","id":254007933,"user":{"login":"TheKK","id":5238484,"avatar_url":"https://avatars.githubusercontent.com/u/5238484?v=3","gravatar_id":"","url":"https://api.github.com/users/TheKK","html_url":"https://github.com/TheKK","followers_url":"https://api.github.com/users/TheKK/followers","following_url":"https://api.github.com/users/TheKK/following{/other_user}","gists_url":"https://api.github.com/users/TheKK/gists{/gist_id}","starred_url":"https://api.github.com/users/TheKK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheKK/subscriptions","organizations_url":"https://api.github.com/users/TheKK/orgs","repos_url":"https://api.github.com/users/TheKK/repos","events_url":"https://api.github.com/users/TheKK/events{/privacy}","received_events_url":"https://api.github.com/users/TheKK/received_events","type":"User","site_admin":false},"created_at":"2016-10-15T20:06:38Z","updated_at":"2016-10-15T20:06:38Z","body":"Maybe we can modify \r\n\r\n```javascript\r\n      /* referrer-policy-test-case.js */\r\n\r\n      /* eg. http://www1.web-platform.test:8000/_mozilla/mozilla/referrer-policy/generic/subresource/a-tag.html?redirection=no-redirect&cache_destroyer=1476561407449 */\r\n      t._subresourceUrl = t._scenario.target_protocol + \"://\" +\r\n                          domainForOrigin[t._scenario.origin] +\r\n                          normalizePort(targetPort) +\r\n                          t._scenario[\"subresource_path\"] +\r\n                          \"?redirection=\" + t._scenario[\"redirection\"] +\r\n                          \"&cache_destroyer=\" + (new Date()).getTime();\r\n```\r\n\r\nand\r\n\r\n```javascript\r\n      /* a-tag-html */\r\n      var a = document.createElement(\"a\");\r\n      a.href = \"/_mozilla/mozilla/referrer-policy/generic/subresource/document.py\" +\r\n        \"?id=\" + id +\r\n        \"&redirection=\" + redirection +\r\n        \"&cache_destroyer=\" + cache_destroyer;\r\n```\r\n\r\nto delay the origin changing for `<a>` test. I'll try this and see how it going tomorrow."}}
{"actor":{"display_login":"TheKK"}}