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

Renderer does not re-render spaces in text nodes correctly #4156

Closed
scofalik opened this issue Aug 22, 2017 · 4 comments · Fixed by ckeditor/ckeditor5-engine#1366
Closed
Assignees
Labels
package:engine type:bug This issue reports a buggy (incorrect) behavior.
Milestone

Comments

@scofalik
Copy link
Contributor

There are (at least) two cases when spaces are not correctly from view text nodes to dom text nodes after a change.

Those errors are caused by the fact, that during re-render only the changed dom text node is updated. ckeditor/ckeditor5-engine#1083 changes the way spaces are converter to  . Now, changing to   bases on the data of the previous text node. This means that whenever a text node is changed, next touching text node has to be re-rendered, etc.

Mentioned cases:

Case 1:

  1. DOM is <p>x<strong> y</strong></p>.
  2. Type space after x.
  3. DOM becomes <p>x <strong> y</strong></p>.
  4. Only one space is rendered.

Case 2:

  1. DOM is <p><strong>&nbsp;y</strong></p>.
  2. Put caret before &nbsp; and turn off bold.
  3. Type x.
  4. DOM becomes <p>x<strong>&nbsp;y</strong></p>.
  5. Incorrect &nbsp; stays in DOM.

We know that there is a "bug" in DomConverter.viewChildrenToDom. View elements mapped to DOM elements are not re-rendered. Those elements might have text nodes that need refreshing and this is the moment when the bug occurs. Unfortunately if we want to change viewChildrenToDom behavior, we will do a bit more processing. Hopefuly, this won't have negative impact on editor.

PS.
@Reinmar told me to hide those tests in case we need them: https://gist.github.com/scofalik/7d33adb45b82722bf5f6ca59ae8439d8

@Reinmar
Copy link
Member

Reinmar commented Sep 5, 2017

The second part of this issue (the viewChildrenToDom()'s poor behaviour) is caused by https://github.com/ckeditor/ckeditor5-engine/issues/1125.

@Reinmar
Copy link
Member

Reinmar commented Oct 13, 2017

You said @scofalik that you've been working on this. Or am I wrong?

@scofalik
Copy link
Contributor Author

Yes, there should be branch pushed with proposed changes, but I'll have to take a look at it as it was week or more time ago and there are couple related tickets.

@scofalik
Copy link
Contributor Author

scofalik referenced this issue in ckeditor/ckeditor5-engine Mar 28, 2018
Other: Introduced deep children text nodes rerendering. Closes #1125. Closes #1093. Closes ckeditor/ckeditor5-typing#120.
@mlewand mlewand transferred this issue from ckeditor/ckeditor5-engine Oct 9, 2019
@mlewand mlewand added this to the iteration 15 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
Development

Successfully merging a pull request may close this issue.

3 participants