-
Notifications
You must be signed in to change notification settings - Fork 40
Introduced deep children text nodes rerendering #1366
Conversation
@Mgsy Could you check this PR? There's a wide range of test cases so we should ba careful. |
This PR introduces mechanism which forces rerendering of sibling One visible issue of previous behaviour is described in #1093 - in general, renderer failed when changes in one The other change which may have some impact is change in rendering order. Previously, The last thing was a change in processing mutations already described in https://github.com/ckeditor/ckeditor5-engine/issues/1125#issuecomment-373376368. Here it affects how mutations are generated (previously |
I've spent some time testing this one. It fixes mentioned issues and I haven't noticed any regressions caused by this fix. |
There's one thing that would make us feel safer – a test which checks rendering one big batch of various type of changes – in text nodes, removing, adding elements in various places on various levels of a tree. The troublesome part is how text updates mix with element updates due to shifts in indexes. |
Makes perfect sense, I will try to create such test so we could check if the change in rendering order had some unexpected effects. |
src/view/renderer.js
Outdated
for ( const child of viewElement.getChildren() ) { | ||
this._markDescendantTextToSync( child ); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder when this else path is taken (what else could viewElement
be), but CC is 100%.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Theoretically it shouldn't be anything else so simple if - else
should be sufficient. But checking it in both cases is more future proof.
@scofalik after merging |
Edit: I haven't seen your comment. For me the PR looks good. I've pushed some slight changes in docs and merged |
And I pushed tests @Reinmar requested, so now we just need to figure out why this one test is failing on Travis. |
This test also fails on |
Suggested merge commit message (convention)
Other: Introduced deep children text nodes rerendering. Closes ckeditor/ckeditor5#4174. Closes ckeditor/ckeditor5#4156. Closes ckeditor/ckeditor5#3103.
Additional information
The proposed solution is very similar to what was initially proposed by @scofalik - https://github.com/ckeditor/ckeditor5-engine/issues/1125#issuecomment-332791847. The logic marking text nodes is placed in
renderer._updateChildren
as this is the place where element nodes are modified and based on that modifications we can decide which elements' text nodes should be considered for rerendered.The mutation observer change is also described here - https://github.com/ckeditor/ckeditor5-engine/issues/1125#issuecomment-373376368.