{"action":"created","issue":{"url":"https://api.github.com/repos/servo/servo/issues/7757","labels_url":"https://api.github.com/repos/servo/servo/issues/7757/labels{/name}","comments_url":"https://api.github.com/repos/servo/servo/issues/7757/comments","events_url":"https://api.github.com/repos/servo/servo/issues/7757/events","html_url":"https://github.com/servo/servo/issues/7757","id":108535444,"number":7757,"title":"Only display text caret in focused inputs","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-layout/inline","name":"A-layout/inline","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-easy","name":"E-easy","color":"02e10c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-27T13:41:22Z","updated_at":"2015-10-12T14:29:27Z","closed_at":null,"body":"Right now the caret is always displayed, but we should build on #7756 to only return a caret position from `get_insertion_point_for_layout` when the node has focus (ie. check the IN_FOCUS_STATE flag).\r\n\r\nCode: components/script/dom/htmlinputelement.rs"},"comment":{"url":"https://api.github.com/repos/servo/servo/issues/comments/147413529","html_url":"https://github.com/servo/servo/issues/7757#issuecomment-147413529","issue_url":"https://api.github.com/repos/servo/servo/issues/7757","id":147413529,"user":{"login":"j3parker","id":597907,"avatar_url":"https://avatars.githubusercontent.com/u/597907?v=3","gravatar_id":"","url":"https://api.github.com/users/j3parker","html_url":"https://github.com/j3parker","followers_url":"https://api.github.com/users/j3parker/followers","following_url":"https://api.github.com/users/j3parker/following{/other_user}","gists_url":"https://api.github.com/users/j3parker/gists{/gist_id}","starred_url":"https://api.github.com/users/j3parker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/j3parker/subscriptions","organizations_url":"https://api.github.com/users/j3parker/orgs","repos_url":"https://api.github.com/users/j3parker/repos","events_url":"https://api.github.com/users/j3parker/events{/privacy}","received_events_url":"https://api.github.com/users/j3parker/received_events","type":"User","site_admin":false},"created_at":"2015-10-12T14:29:27Z","updated_at":"2015-10-12T14:29:27Z","body":"Ok, so following the suggestion is easy enough but I don't think this is 100% ready to get fixed. Here's what I have so far: https://github.com/servo/servo/compare/master...j3parker:input-caret-only-when-focused?expand=1\r\n\r\nIn the first commit I'm making `get_insertion_point_for_layout` return `None` when the input is not focused. This works initially: when you load a page with no focused input tags there will be no carets. When you click on one and move the caret everything is fine.\r\n\r\nThe trouble comes when you de-focus. Because the insertion point is \"cached\" on the fragment (still learning the terminology/control flow here) and we can't access the node when drawing the fragment (we only have an `OpaqueNode` handle) we're stuck.\r\n\r\nIt seems like we should be forcing a relayout when one of these nodes loses focus. It looks like `focusout` events are currently not supported: https://github.com/servo/servo/blob/96356a4b339af07831dec79e0084079328b43b53/components/script/dom/document.rs#L520\r\n\r\nThe next two commits in my branch are what I think should be done if `focusout` did exist.\r\n\r\nDoes that sound right? Should we open up an issue for implementing `focusout` (and friends)?"}}