{"action":"created","issue":{"url":"https://api.github.com/repos/ckeditor/ckeditor5-engine/issues/1417","repository_url":"https://api.github.com/repos/ckeditor/ckeditor5-engine","labels_url":"https://api.github.com/repos/ckeditor/ckeditor5-engine/issues/1417/labels{/name}","comments_url":"https://api.github.com/repos/ckeditor/ckeditor5-engine/issues/1417/comments","events_url":"https://api.github.com/repos/ckeditor/ckeditor5-engine/issues/1417/events","html_url":"https://github.com/ckeditor/ckeditor5-engine/issues/1417","id":321870582,"node_id":"MDU6SXNzdWUzMjE4NzA1ODI=","number":1417,"title":"Avoid unnecessary structure updates in renderer","user":{"login":"f1ames","id":1061942,"node_id":"MDQ6VXNlcjEwNjE5NDI=","avatar_url":"https://avatars2.githubusercontent.com/u/1061942?v=4","gravatar_id":"","url":"https://api.github.com/users/f1ames","html_url":"https://github.com/f1ames","followers_url":"https://api.github.com/users/f1ames/followers","following_url":"https://api.github.com/users/f1ames/following{/other_user}","gists_url":"https://api.github.com/users/f1ames/gists{/gist_id}","starred_url":"https://api.github.com/users/f1ames/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/f1ames/subscriptions","organizations_url":"https://api.github.com/users/f1ames/orgs","repos_url":"https://api.github.com/users/f1ames/repos","events_url":"https://api.github.com/users/f1ames/events{/privacy}","received_events_url":"https://api.github.com/users/f1ames/received_events","type":"User","site_admin":false},"labels":[{"id":297499637,"node_id":"MDU6TGFiZWwyOTc0OTk2Mzc=","url":"https://api.github.com/repos/ckeditor/ckeditor5-engine/labels/module:view","name":"module:view","color":"fef2c0","default":false},{"id":284751383,"node_id":"MDU6TGFiZWwyODQ3NTEzODM=","url":"https://api.github.com/repos/ckeditor/ckeditor5-engine/labels/status:confirmed","name":"status:confirmed","color":"e6e6e6","default":false},{"id":164253812,"node_id":"MDU6TGFiZWwxNjQyNTM4MTI=","url":"https://api.github.com/repos/ckeditor/ckeditor5-engine/labels/type:enhancement","name":"type:enhancement","color":"84b6eb","default":false}],"state":"open","locked":false,"assignee":{"login":"f1ames","id":1061942,"node_id":"MDQ6VXNlcjEwNjE5NDI=","avatar_url":"https://avatars2.githubusercontent.com/u/1061942?v=4","gravatar_id":"","url":"https://api.github.com/users/f1ames","html_url":"https://github.com/f1ames","followers_url":"https://api.github.com/users/f1ames/followers","following_url":"https://api.github.com/users/f1ames/following{/other_user}","gists_url":"https://api.github.com/users/f1ames/gists{/gist_id}","starred_url":"https://api.github.com/users/f1ames/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/f1ames/subscriptions","organizations_url":"https://api.github.com/users/f1ames/orgs","repos_url":"https://api.github.com/users/f1ames/repos","events_url":"https://api.github.com/users/f1ames/events{/privacy}","received_events_url":"https://api.github.com/users/f1ames/received_events","type":"User","site_admin":false},"assignees":[{"login":"f1ames","id":1061942,"node_id":"MDQ6VXNlcjEwNjE5NDI=","avatar_url":"https://avatars2.githubusercontent.com/u/1061942?v=4","gravatar_id":"","url":"https://api.github.com/users/f1ames","html_url":"https://github.com/f1ames","followers_url":"https://api.github.com/users/f1ames/followers","following_url":"https://api.github.com/users/f1ames/following{/other_user}","gists_url":"https://api.github.com/users/f1ames/gists{/gist_id}","starred_url":"https://api.github.com/users/f1ames/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/f1ames/subscriptions","organizations_url":"https://api.github.com/users/f1ames/orgs","repos_url":"https://api.github.com/users/f1ames/repos","events_url":"https://api.github.com/users/f1ames/events{/privacy}","received_events_url":"https://api.github.com/users/f1ames/received_events","type":"User","site_admin":false}],"milestone":null,"comments":10,"created_at":"2018-05-10T09:39:39Z","updated_at":"2018-06-04T11:45:55Z","closed_at":null,"author_association":"MEMBER","body":"Extracted from #1342:\r\n\r\n> Background: #1334.\r\n>\r\n> How does selection conversion work?\r\n>\r\n> 1. MODEL: `<p><$text bold=true>xx</text></p>`  + `selection[bold=true]`\r\n>  2. VIEW:\r\n\t1. `<p><b>xx</b></p>`\r\n\t2. `<p>[]<b>xx</b></p>` (after position conversion)\r\n\t3. `<p><B>[]</B><b>xx</b></p>` (during `writer.wrap( selection )` )\r\n\t4. `<p><B>[]xx</B></p>` (after attribute conversion; we're merging to the left, so a new element `<B>` is left)\r\n> 3. RENDERING:\r\n\t* actual DOM: `<p><b>xx</b></p>`\r\n\t* expected DOM `<p><B>XX</B></p>` (we need to replace the entire `<b>` element; IDEA: don't replace `<b>` with `<B>` because they are similar!)\r\n> \r\n> BUT... WHAT IF SOMETHING ELSE HAS CHANGED?\r\n> \r\n> * actual DOM: `<p><b>xx</b></p>`\r\n> * expected DOM `<p><B>XXY</B></p>` (don't replace `<b>` with `<B>` but recursively go deeper to apply other possible changes, see #1125)\r\n> \r\n> Possible solution: \r\n> \r\n> 1. Make `diff( actual, expected, sameNode )` skip elements which have the same names and attributes (see `view.Element#isSimilar()`) - it is described in more details in #1334.\r\n> 2. As a result, we won't replace `<b>` with `<B>`, which means that the view to DOM mapping will be outdated – the new view `<B>` element will be mapped to the new DOM `<B>` element which is not in the tree (because the old DOM `<b>` element was left there). Which means that we should update bindings after skipping such replacements. How to do that? Perhaps we can simply and blindly set new mappings after rendering: purge existing bindings (in a limited scope), `updatedDomElements.forEach( mapToUpdatedViewElement )`.\r\n\r\nAlso intersting analysis of a specific case is available in https://github.com/ckeditor/ckeditor5-engine/issues/1342#issuecomment-373778804."},"comment":{"url":"https://api.github.com/repos/ckeditor/ckeditor5-engine/issues/comments/394326519","html_url":"https://github.com/ckeditor/ckeditor5-engine/issues/1417#issuecomment-394326519","issue_url":"https://api.github.com/repos/ckeditor/ckeditor5-engine/issues/1417","id":394326519,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NDMyNjUxOQ==","user":{"login":"f1ames","id":1061942,"node_id":"MDQ6VXNlcjEwNjE5NDI=","avatar_url":"https://avatars2.githubusercontent.com/u/1061942?v=4","gravatar_id":"","url":"https://api.github.com/users/f1ames","html_url":"https://github.com/f1ames","followers_url":"https://api.github.com/users/f1ames/followers","following_url":"https://api.github.com/users/f1ames/following{/other_user}","gists_url":"https://api.github.com/users/f1ames/gists{/gist_id}","starred_url":"https://api.github.com/users/f1ames/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/f1ames/subscriptions","organizations_url":"https://api.github.com/users/f1ames/orgs","repos_url":"https://api.github.com/users/f1ames/repos","events_url":"https://api.github.com/users/f1ames/events{/privacy}","received_events_url":"https://api.github.com/users/f1ames/received_events","type":"User","site_admin":false},"created_at":"2018-06-04T11:45:55Z","updated_at":"2018-06-04T11:45:55Z","author_association":"MEMBER","body":"@Reinmar I modified the description you mentioned, trying to describe more precisely which cases doesn't work, I hope it is easier to understand now."}}
{"actor":{"display_login":"f1ames"}}