{"action":"created","issue":{"url":"https://api.github.com/repos/servo/servo/issues/7856","labels_url":"https://api.github.com/repos/servo/servo/issues/7856/labels{/name}","comments_url":"https://api.github.com/repos/servo/servo/issues/7856/comments","events_url":"https://api.github.com/repos/servo/servo/issues/7856/events","html_url":"https://github.com/servo/servo/issues/7856","id":109713354,"number":7856,"title":"Implement Websocket.bufferedAmount","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/dom","name":"A-content/dom","color":"d7e102"},{"url":"https://api.github.com/repos/servo/servo/labels/C-assigned","name":"C-assigned","color":"02d7e1"},{"url":"https://api.github.com/repos/servo/servo/labels/E-less%20easy","name":"E-less easy","color":"02e10c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-10-04T23:40:00Z","updated_at":"2015-10-06T21:09:32Z","closed_at":null,"body":"There are a bunch of websocket tests that fail due to `bufferedAmount` being missing, and that's making it harder to figure out the incorrect parts of our implementation. `bufferedAmount` has [rather particular](https://html.spec.whatwg.org/multipage/comms.html#dom-websocket-bufferedamount) requirements - basically, we want to increase the counter in `send`, and dispatch a [runnable](http://doc.servo.org/servo/script/script_task/trait.Runnable.html) (see `WebSocketEvent` for an example) to the script event loop that will reset the counter to 0 when it is processed. We should also set a flag that there's a runnable outstanding, so that multiple `send` calls during the same turn of the event loop only enqueue a single runnable.\r\n\r\nCode: components/script/dom/websocket.rs"},"comment":{"url":"https://api.github.com/repos/servo/servo/issues/comments/146001632","html_url":"https://github.com/servo/servo/issues/7856#issuecomment-146001632","issue_url":"https://api.github.com/repos/servo/servo/issues/7856","id":146001632,"user":{"login":"jimberlage","id":4751760,"avatar_url":"https://avatars.githubusercontent.com/u/4751760?v=3","gravatar_id":"","url":"https://api.github.com/users/jimberlage","html_url":"https://github.com/jimberlage","followers_url":"https://api.github.com/users/jimberlage/followers","following_url":"https://api.github.com/users/jimberlage/following{/other_user}","gists_url":"https://api.github.com/users/jimberlage/gists{/gist_id}","starred_url":"https://api.github.com/users/jimberlage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimberlage/subscriptions","organizations_url":"https://api.github.com/users/jimberlage/orgs","repos_url":"https://api.github.com/users/jimberlage/repos","events_url":"https://api.github.com/users/jimberlage/events{/privacy}","received_events_url":"https://api.github.com/users/jimberlage/received_events","type":"User","site_admin":false},"created_at":"2015-10-06T21:09:32Z","updated_at":"2015-10-06T21:09:32Z","body":"Ah, this makes a lot more sense now."}}