{"action":"closed","issue":{"url":"https://api.github.com/repos/servo/servo/issues/3974","labels_url":"https://api.github.com/repos/servo/servo/issues/3974/labels{/name}","comments_url":"https://api.github.com/repos/servo/servo/issues/3974/comments","events_url":"https://api.github.com/repos/servo/servo/issues/3974/events","html_url":"https://github.com/servo/servo/issues/3974","id":48692061,"number":3974,"title":"Redesign page loading","user":{"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},"labels":[{"url":"https://api.github.com/repos/servo/servo/labels/A-content/parsers","name":"A-content/parsers","color":"d7e102"},{"url":"https://api.github.com/repos/servo/servo/labels/A-content/script","name":"A-content/script","color":"d7e102"},{"url":"https://api.github.com/repos/servo/servo/labels/E-less%20easy","name":"E-less easy","color":"02e10c"},{"url":"https://api.github.com/repos/servo/servo/labels/I-refactor","name":"I-refactor","color":"e10c02"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2014-11-13T21:08:37Z","updated_at":"2015-02-24T20:45:47Z","closed_at":"2015-02-24T20:45:47Z","body":"`ScriptTask::load` and `parse_html` are weirdly tied up in each other. We can achieve a much cleaner separation of concerns in the following way:\r\n* move all explicit networking out of parse_html and into callers. parse_html can take an iterator and parse chunks incrementally from it (we can use `load_bytes_iter` or something similar for network case)\r\n* don't create a document until HTTP headers are received, at which point we can properly set the final page URL as well\r\n* most of the contents of `ScriptTask::load` should probably migrate to a method on `Page` instead"}}