{"action":"created","comment":{"url":"https://api.github.com/repos/servo/servo/pulls/comments/53429208","id":53429208,"diff_hunk":"@@ -1126,36 +1126,53 @@ impl XMLHttpRequest {\n \n     // https://xhr.spec.whatwg.org/#document-response\n     fn document_response(&self) -> Option<Root<Document>> {\n-        let mime_type = self.final_mime_type();\n-        //TODO: prescan the response to determine encoding if final charset is null\n-        let charset = self.final_charset().unwrap_or(UTF_8);\n-        let temp_doc: Root<Document>;\n-        match mime_type {\n-            Some(Mime(mime::TopLevel::Text, mime::SubLevel::Html, _)) => {\n-                if self.response_type.get() == XMLHttpRequestResponseType::_empty {\n-                    return None;\n-                }\n-                else {\n-                    temp_doc = self.document_text_html();\n-                }\n+        //step 1\n+        match self.response_xml.get() {\n+            Some(_) => {\n+                return self.response_xml.get();\n             },\n-            Some(Mime(mime::TopLevel::Text, mime::SubLevel::Xml, _)) |\n-            Some(Mime(mime::TopLevel::Application, mime::SubLevel::Xml, _)) |\n             None => {\n-                temp_doc = self.handle_xml();\n-            },\n-            Some(Mime(_, mime::SubLevel::Ext(sub), _)) => {\n-                if sub.ends_with(\"+xml\") {\n-                    temp_doc = self.handle_xml();\n-                }\n-                else {\n-                    return None;\n+                let mime_type = self.final_mime_type();\n+                //TODO: prescan the response to determine encoding if final charset is null\n+                let charset = self.final_charset().unwrap_or(UTF_8);\n+                let temp_doc: Root<Document>;\n+                match mime_type {\n+                    Some(Mime(mime::TopLevel::Text, mime::SubLevel::Html, _)) => {\n+                        //step 5\n+                        if self.response_type.get() != XMLHttpRequestResponseType::_empty {\n+                            return None;\n+                        }\n+                        //step 6\n+                        else {\n+                            temp_doc = self.document_text_html();\n+                        }\n+                    },\n+                    //step 7","path":"components/script/dom/xmlhttprequest.rs","position":58,"original_position":58,"commit_id":"b468f587f39308ac28987df40c20a0b47cddf4f7","original_commit_id":"b468f587f39308ac28987df40c20a0b47cddf4f7","user":{"login":"KiChjang","id":3248587,"avatar_url":"https://avatars.githubusercontent.com/u/3248587?v=3","gravatar_id":"","url":"https://api.github.com/users/KiChjang","html_url":"https://github.com/KiChjang","followers_url":"https://api.github.com/users/KiChjang/followers","following_url":"https://api.github.com/users/KiChjang/following{/other_user}","gists_url":"https://api.github.com/users/KiChjang/gists{/gist_id}","starred_url":"https://api.github.com/users/KiChjang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KiChjang/subscriptions","organizations_url":"https://api.github.com/users/KiChjang/orgs","repos_url":"https://api.github.com/users/KiChjang/repos","events_url":"https://api.github.com/users/KiChjang/events{/privacy}","received_events_url":"https://api.github.com/users/KiChjang/received_events","type":"User","site_admin":false},"body":"nit: Space after double slash and capitalize S.","created_at":"2016-02-19T07:15:13Z","updated_at":"2016-02-19T07:15:13Z","html_url":"https://github.com/servo/servo/pull/9610#discussion_r53429208","pull_request_url":"https://api.github.com/repos/servo/servo/pulls/9610","_links":{"self":{"href":"https://api.github.com/repos/servo/servo/pulls/comments/53429208"},"html":{"href":"https://github.com/servo/servo/pull/9610#discussion_r53429208"},"pull_request":{"href":"https://api.github.com/repos/servo/servo/pulls/9610"}}},"pull_request":{"url":"https://api.github.com/repos/servo/servo/pulls/9610","id":59103930,"html_url":"https://github.com/servo/servo/pull/9610","diff_url":"https://github.com/servo/servo/pull/9610.diff","patch_url":"https://github.com/servo/servo/pull/9610.patch","issue_url":"https://api.github.com/repos/servo/servo/issues/9610","number":9610,"state":"open","locked":false,"title":"Bypass GetResponseXML to better match spec","user":{"login":"liviuba","id":6621007,"avatar_url":"https://avatars.githubusercontent.com/u/6621007?v=3","gravatar_id":"","url":"https://api.github.com/users/liviuba","html_url":"https://github.com/liviuba","followers_url":"https://api.github.com/users/liviuba/followers","following_url":"https://api.github.com/users/liviuba/following{/other_user}","gists_url":"https://api.github.com/users/liviuba/gists{/gist_id}","starred_url":"https://api.github.com/users/liviuba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liviuba/subscriptions","organizations_url":"https://api.github.com/users/liviuba/orgs","repos_url":"https://api.github.com/users/liviuba/repos","events_url":"https://api.github.com/users/liviuba/events{/privacy}","received_events_url":"https://api.github.com/users/liviuba/received_events","type":"User","site_admin":false},"body":"Resolves https://github.com/servo/servo/issues/9553\n\n<!-- Reviewable:start -->\n[<img src=\"https://reviewable.io/review_button.svg\" height=\"40\" alt=\"Review on Reviewable\"/>](https://reviewable.io/reviews/servo/servo/9610)\n<!-- Reviewable:end -->\n","created_at":"2016-02-11T22:25:15Z","updated_at":"2016-02-19T07:15:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"34ebc574d8e42d4cc60544bb200121f46d90ab38","assignee":{"login":"KiChjang","id":3248587,"avatar_url":"https://avatars.githubusercontent.com/u/3248587?v=3","gravatar_id":"","url":"https://api.github.com/users/KiChjang","html_url":"https://github.com/KiChjang","followers_url":"https://api.github.com/users/KiChjang/followers","following_url":"https://api.github.com/users/KiChjang/following{/other_user}","gists_url":"https://api.github.com/users/KiChjang/gists{/gist_id}","starred_url":"https://api.github.com/users/KiChjang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KiChjang/subscriptions","organizations_url":"https://api.github.com/users/KiChjang/orgs","repos_url":"https://api.github.com/users/KiChjang/repos","events_url":"https://api.github.com/users/KiChjang/events{/privacy}","received_events_url":"https://api.github.com/users/KiChjang/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/servo/servo/pulls/9610/commits","review_comments_url":"https://api.github.com/repos/servo/servo/pulls/9610/comments","review_comment_url":"https://api.github.com/repos/servo/servo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/servo/servo/issues/9610/comments","statuses_url":"https://api.github.com/repos/servo/servo/statuses/b468f587f39308ac28987df40c20a0b47cddf4f7","head":{"label":"liviuba:Fix-9553","ref":"Fix-9553","sha":"b468f587f39308ac28987df40c20a0b47cddf4f7","user":{"login":"liviuba","id":6621007,"avatar_url":"https://avatars.githubusercontent.com/u/6621007?v=3","gravatar_id":"","url":"https://api.github.com/users/liviuba","html_url":"https://github.com/liviuba","followers_url":"https://api.github.com/users/liviuba/followers","following_url":"https://api.github.com/users/liviuba/following{/other_user}","gists_url":"https://api.github.com/users/liviuba/gists{/gist_id}","starred_url":"https://api.github.com/users/liviuba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liviuba/subscriptions","organizations_url":"https://api.github.com/users/liviuba/orgs","repos_url":"https://api.github.com/users/liviuba/repos","events_url":"https://api.github.com/users/liviuba/events{/privacy}","received_events_url":"https://api.github.com/users/liviuba/received_events","type":"User","site_admin":false},"repo":{"id":51531692,"name":"servo","full_name":"liviuba/servo","owner":{"login":"liviuba","id":6621007,"avatar_url":"https://avatars.githubusercontent.com/u/6621007?v=3","gravatar_id":"","url":"https://api.github.com/users/liviuba","html_url":"https://github.com/liviuba","followers_url":"https://api.github.com/users/liviuba/followers","following_url":"https://api.github.com/users/liviuba/following{/other_user}","gists_url":"https://api.github.com/users/liviuba/gists{/gist_id}","starred_url":"https://api.github.com/users/liviuba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liviuba/subscriptions","organizations_url":"https://api.github.com/users/liviuba/orgs","repos_url":"https://api.github.com/users/liviuba/repos","events_url":"https://api.github.com/users/liviuba/events{/privacy}","received_events_url":"https://api.github.com/users/liviuba/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/liviuba/servo","description":"The Servo Browser Engine","fork":true,"url":"https://api.github.com/repos/liviuba/servo","forks_url":"https://api.github.com/repos/liviuba/servo/forks","keys_url":"https://api.github.com/repos/liviuba/servo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/liviuba/servo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/liviuba/servo/teams","hooks_url":"https://api.github.com/repos/liviuba/servo/hooks","issue_events_url":"https://api.github.com/repos/liviuba/servo/issues/events{/number}","events_url":"https://api.github.com/repos/liviuba/servo/events","assignees_url":"https://api.github.com/repos/liviuba/servo/assignees{/user}","branches_url":"https://api.github.com/repos/liviuba/servo/branches{/branch}","tags_url":"https://api.github.com/repos/liviuba/servo/tags","blobs_url":"https://api.github.com/repos/liviuba/servo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/liviuba/servo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/liviuba/servo/git/refs{/sha}","trees_url":"https://api.github.com/repos/liviuba/servo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/liviuba/servo/statuses/{sha}","languages_url":"https://api.github.com/repos/liviuba/servo/languages","stargazers_url":"https://api.github.com/repos/liviuba/servo/stargazers","contributors_url":"https://api.github.com/repos/liviuba/servo/contributors","subscribers_url":"https://api.github.com/repos/liviuba/servo/subscribers","subscription_url":"https://api.github.com/repos/liviuba/servo/subscription","commits_url":"https://api.github.com/repos/liviuba/servo/commits{/sha}","git_commits_url":"https://api.github.com/repos/liviuba/servo/git/commits{/sha}","comments_url":"https://api.github.com/repos/liviuba/servo/comments{/number}","issue_comment_url":"https://api.github.com/repos/liviuba/servo/issues/comments{/number}","contents_url":"https://api.github.com/repos/liviuba/servo/contents/{+path}","compare_url":"https://api.github.com/repos/liviuba/servo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/liviuba/servo/merges","archive_url":"https://api.github.com/repos/liviuba/servo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/liviuba/servo/downloads","issues_url":"https://api.github.com/repos/liviuba/servo/issues{/number}","pulls_url":"https://api.github.com/repos/liviuba/servo/pulls{/number}","milestones_url":"https://api.github.com/repos/liviuba/servo/milestones{/number}","notifications_url":"https://api.github.com/repos/liviuba/servo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/liviuba/servo/labels{/name}","releases_url":"https://api.github.com/repos/liviuba/servo/releases{/id}","deployments_url":"https://api.github.com/repos/liviuba/servo/deployments","created_at":"2016-02-11T17:21:32Z","updated_at":"2016-02-11T01:18:02Z","pushed_at":"2016-02-18T22:37:14Z","git_url":"git://github.com/liviuba/servo.git","ssh_url":"git@github.com:liviuba/servo.git","clone_url":"https://github.com/liviuba/servo.git","svn_url":"https://github.com/liviuba/servo","homepage":"https://servo.org/","size":170682,"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":"2374e9d30e015884e87305006ac61a77b7efd5ee","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-02-19T04:44:03Z","pushed_at":"2016-02-19T03:45:00Z","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":205204,"stargazers_count":5661,"watchers_count":5661,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":967,"mirror_url":null,"open_issues_count":1292,"forks":967,"open_issues":1292,"watchers":5661,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/servo/servo/pulls/9610"},"html":{"href":"https://github.com/servo/servo/pull/9610"},"issue":{"href":"https://api.github.com/repos/servo/servo/issues/9610"},"comments":{"href":"https://api.github.com/repos/servo/servo/issues/9610/comments"},"review_comments":{"href":"https://api.github.com/repos/servo/servo/pulls/9610/comments"},"review_comment":{"href":"https://api.github.com/repos/servo/servo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/servo/servo/pulls/9610/commits"},"statuses":{"href":"https://api.github.com/repos/servo/servo/statuses/b468f587f39308ac28987df40c20a0b47cddf4f7"}}}}