{"action":"created","issue":{"url":"https://api.github.com/repos/servo/html5ever/issues/201","repository_url":"https://api.github.com/repos/servo/html5ever","labels_url":"https://api.github.com/repos/servo/html5ever/issues/201/labels{/name}","comments_url":"https://api.github.com/repos/servo/html5ever/issues/201/comments","events_url":"https://api.github.com/repos/servo/html5ever/issues/201/events","html_url":"https://github.com/servo/html5ever/issues/201","id":141040718,"number":201,"title":"Lazy parsing mode","user":{"login":"RReverser","id":557590,"avatar_url":"https://avatars.githubusercontent.com/u/557590?v=3","gravatar_id":"","url":"https://api.github.com/users/RReverser","html_url":"https://github.com/RReverser","followers_url":"https://api.github.com/users/RReverser/followers","following_url":"https://api.github.com/users/RReverser/following{/other_user}","gists_url":"https://api.github.com/users/RReverser/gists{/gist_id}","starred_url":"https://api.github.com/users/RReverser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RReverser/subscriptions","organizations_url":"https://api.github.com/users/RReverser/orgs","repos_url":"https://api.github.com/users/RReverser/repos","events_url":"https://api.github.com/users/RReverser/events{/privacy}","received_events_url":"https://api.github.com/users/RReverser/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-03-15T17:14:03Z","updated_at":"2016-03-15T18:14:05Z","closed_at":null,"body":"We're willing to use html5ever's tokenizer for streaming transformation of HTML (that is, replacing specific attributes on specific tags only - e.g. `src` in `img` or `src` in `script` or `href` in `link`). For that, it would be useful to have lazy mode that would not force parser to parse attributes and content that we don't care about and then force us to serialize them back properly, thus 1) preserve formatting as closely to original as possible and 2) improve performance by avoiding lots of unnecessary work.\r\n\r\nWould be that possible to implement? I'm pretty new to Rust, but I would be happy to take an attempt to do this myself if given some basic pointers and directions on where to look / what might need to be changed.\r\n\r\nThanks.\r\n\r\nP.S. Theoretically, Servo could benefit from lazy parsing, too, if decoding attributes would happen only on first access as it might safely ignore many attributes for rendering and call such lazy decoder only when actually accessing them e.g. via DOM API (whether they are `data-*` attributes or any other that renderer doesn't care about and only JS code might do)."},"comment":{"url":"https://api.github.com/repos/servo/html5ever/issues/comments/196956159","html_url":"https://github.com/servo/html5ever/issues/201#issuecomment-196956159","issue_url":"https://api.github.com/repos/servo/html5ever/issues/201","id":196956159,"user":{"login":"SimonSapin","id":291359,"avatar_url":"https://avatars.githubusercontent.com/u/291359?v=3","gravatar_id":"","url":"https://api.github.com/users/SimonSapin","html_url":"https://github.com/SimonSapin","followers_url":"https://api.github.com/users/SimonSapin/followers","following_url":"https://api.github.com/users/SimonSapin/following{/other_user}","gists_url":"https://api.github.com/users/SimonSapin/gists{/gist_id}","starred_url":"https://api.github.com/users/SimonSapin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SimonSapin/subscriptions","organizations_url":"https://api.github.com/users/SimonSapin/orgs","repos_url":"https://api.github.com/users/SimonSapin/repos","events_url":"https://api.github.com/users/SimonSapin/events{/privacy}","received_events_url":"https://api.github.com/users/SimonSapin/received_events","type":"User","site_admin":false},"created_at":"2016-03-15T18:14:05Z","updated_at":"2016-03-15T18:14:05Z","body":"I’m somewhat skeptical that the pref impact would be significant. The tokenizer has to go through every byte of the value anyway in order to find where it ends, and I think that not having any character reference in a given value is the common case (though admittedly I have zero data on this)."}}