Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Merge pull request #1394 from ckeditor/t/1363
Browse files Browse the repository at this point in the history
Other: Removed the unnecesary `model.Writer#setTextData()` method. Closes #1363.
  • Loading branch information
Reinmar authored Apr 5, 2018
2 parents 09486ce + f67fd27 commit b484822
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 46 deletions.
10 changes: 0 additions & 10 deletions src/model/writer.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,16 +324,6 @@ export default class Writer {
}
}

/**
* 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;
}

/**
* Sets value of the attribute with given key on a {@link module:engine/model/item~Item model item}
* or on a {@link module:engine/model/range~Range range}.
Expand Down
10 changes: 0 additions & 10 deletions src/view/writer.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,16 +248,6 @@ export default class Writer {
return uiElement;
}

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

/**
* Adds or overwrite element's attribute with a specified key and value.
*
Expand Down
16 changes: 0 additions & 16 deletions tests/model/writer.js
Original file line number Diff line number Diff line change
Expand Up @@ -811,16 +811,6 @@ describe( 'Writer', () => {
} );
} );

describe( 'setTextData()', () => {
it( 'should update the content for text node', () => {
const textNode = createText( 'foo' );

setTextData( 'bar', textNode );

expect( textNode.data ).to.equal( 'bar' );
} );
} );

describe( 'setAttribute() / removeAttribute()', () => {
let root, spy;

Expand Down Expand Up @@ -2472,12 +2462,6 @@ describe( 'Writer', () => {
} );
}

function setTextData( value, textNode ) {
model.enqueueChange( batch, writer => {
writer.setTextData( value, textNode );
} );
}

function setAttribute( key, value, itemOrRange ) {
model.enqueueChange( batch, writer => {
writer.setAttribute( key, value, itemOrRange );
Expand Down
10 changes: 0 additions & 10 deletions tests/view/writer/writer.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,16 +130,6 @@ describe( 'Writer', () => {
} );
} );

describe( 'setTextData()', () => {
it( 'should update the content for text node', () => {
const textNode = writer.createText( 'foo' );

writer.setTextData( 'bar', textNode );

expect( textNode.data ).to.equal( 'bar' );
} );
} );

describe( 'setAttribute()', () => {
it( 'should set attribute on given element', () => {
const element = writer.createAttributeElement( 'span' );
Expand Down

0 comments on commit b484822

Please sign in to comment.