You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I spotted a bug that crashed editor during rendering. It appeared that Renderer wants to re-render a part of a tree that is detached from main tree. What was weird about that tree was that detached-root had a child but that child's parent property was set to null. Similarly, that child also had a child which also had parent set to null.
After debugging it appeared that in view.Writer some nodes were supposed to be moved from one node to another, however those nodes were not removed from their original parent before appending to new parent, which caused this bug.
The text was updated successfully, but these errors were encountered:
I agree that appendChild should remove them from the previous parent. In the model, #4009 will (should) solver it. However, we should solve it in the view too.
Fix: View and model nodes will now be removed from their old parents when they are added to a new parent to prevent having same node on multiple elements' children lists. Closes #1139.
BREAKING CHANGE: View and model nodes are now automatically removed from their old parents when they are inserted into new elements. This is important e.g. if you iterate through element's children and they are moved during that iteration. In that case, it's safest to cache the element's children in an array.
mlewand
transferred this issue from ckeditor/ckeditor5-engine
Oct 9, 2019
I spotted a bug that crashed editor during rendering. It appeared that
Renderer
wants to re-render a part of a tree that is detached from main tree. What was weird about that tree was that detached-root had a child but that child'sparent
property was set tonull
. Similarly, that child also had a child which also hadparent
set tonull
.After debugging it appeared that in
view.Writer
some nodes were supposed to be moved from one node to another, however those nodes were not removed from their original parent before appending to new parent, which caused this bug.The text was updated successfully, but these errors were encountered: