Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

view.Writer should deeply unlink attribute elements from their groups when they are removed #4337

Closed
scofalik opened this issue Apr 9, 2018 · 2 comments · Fixed by ckeditor/ckeditor5-engine#1403
Assignees
Labels
package:engine type:bug This issue reports a buggy (incorrect) behavior.
Milestone

Comments

@scofalik
Copy link
Contributor

scofalik commented Apr 9, 2018

Currently, view.AttributeElements which have id property set are linked together in view.Writer in so called "clone groups". All elements with the same id that are still in document tree are inside the group.

When elements are removed from the document tree, they are removed from the groups. However, the function that does so is not looking recursively for the elements.

That means that in following scenarios it will fail to remove <span class="a">:

<p>f[oo</p>
<p>b<span class="a"a</span>r</p>
<p>b]az</p>
@scofalik scofalik self-assigned this Apr 9, 2018
@scofalik
Copy link
Contributor Author

scofalik commented Apr 9, 2018

There might be a similar problem with adding elements to groups.

@scofalik
Copy link
Contributor Author

Additionally, I noticed that the attribute elements might be added to clone groups if they are added in a DocumentFragment (outside of document tree) which is wrong too.

pjasiun referenced this issue in ckeditor/ckeditor5-engine Apr 11, 2018
Fix: `view.Writer` should deeply add and remove `view.AttributeElement`s to/from their clone groups. Closes #1401.
@mlewand mlewand transferred this issue from ckeditor/ckeditor5-engine Oct 9, 2019
@mlewand mlewand added this to the iteration 16 milestone Oct 9, 2019
@mlewand mlewand added module:view type:bug This issue reports a buggy (incorrect) behavior. package:engine labels Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:engine type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
2 participants