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

Should model.Writer#setTextData() be removed? #4316

Closed
Reinmar opened this issue Mar 15, 2018 · 5 comments · Fixed by ckeditor/ckeditor5-engine#1394
Closed

Should model.Writer#setTextData() be removed? #4316

Reinmar opened this issue Mar 15, 2018 · 5 comments · Fixed by ckeditor/ckeditor5-engine#1394
Assignees
Labels
package:engine status:discussion type:bug This issue reports a buggy (incorrect) behavior.
Milestone

Comments

@Reinmar
Copy link
Member

Reinmar commented Mar 15, 2018

I can't see it used... and it shouldn't be used at all because it changes the text node's data directly:

	/**
	 * Sets the text content for the specified `textNode`.
	 *
	 * @param {String} value New value.
	 * @param {module:engine/model/text~Text} textNode Text node that will be updated.
	 */
	setTextData( value, textNode ) {
		textNode._data = value;
	}
@Reinmar
Copy link
Member Author

Reinmar commented Mar 16, 2018

OK, but this can be done only in a veeeery specific situation – on detached nodes. Am I right? You must not do such changes on text nodes which were already inserted into the document or are in the graveyard.

@pjasiun
Copy link

pjasiun commented Mar 16, 2018

This is the view writer, and I believe it should work allways. You should usually not change view without changes in the model, but it is a different topic.

@Reinmar
Copy link
Member Author

Reinmar commented Mar 16, 2018

It's the view writer? In upcast converters? I'm a bit lost. I was talking about the model writer which also has the setTextData() method.

@pjasiun
Copy link

pjasiun commented Mar 16, 2018

Ach, I agree then. Model writer should not have this method.

Reinmar referenced this issue in ckeditor/ckeditor5-engine Apr 5, 2018
Other: Removed the unnecesary `model.Writer#setTextData()` method. Closes #1363.
Reinmar referenced this issue in ckeditor/ckeditor5-list Apr 5, 2018
Internal: Aligned to the changes in engine (removed both `writer.setTextData()` methods). See ckeditor/ckeditor5-engine#1363.
@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 status:discussion 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 status:discussion type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants