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

Commit b484822

Browse files
authored
Merge pull request #1394 from ckeditor/t/1363
Other: Removed the unnecesary `model.Writer#setTextData()` method. Closes #1363.
2 parents 09486ce + f67fd27 commit b484822

File tree

4 files changed

+0
-46
lines changed

4 files changed

+0
-46
lines changed

src/model/writer.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -324,16 +324,6 @@ export default class Writer {
324324
}
325325
}
326326

327-
/**
328-
* Sets the text content for the specified `textNode`.
329-
*
330-
* @param {String} value New value.
331-
* @param {module:engine/model/text~Text} textNode Text node that will be updated.
332-
*/
333-
setTextData( value, textNode ) {
334-
textNode._data = value;
335-
}
336-
337327
/**
338328
* Sets value of the attribute with given key on a {@link module:engine/model/item~Item model item}
339329
* or on a {@link module:engine/model/range~Range range}.

src/view/writer.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -248,16 +248,6 @@ export default class Writer {
248248
return uiElement;
249249
}
250250

251-
/**
252-
* Sets the text content for the specified `textNode`.
253-
*
254-
* @param {String} value New value.
255-
* @param {module:engine/view/text~Text} textNode Text node that will be updated.
256-
*/
257-
setTextData( value, textNode ) {
258-
textNode._data = value;
259-
}
260-
261251
/**
262252
* Adds or overwrite element's attribute with a specified key and value.
263253
*

tests/model/writer.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -811,16 +811,6 @@ describe( 'Writer', () => {
811811
} );
812812
} );
813813

814-
describe( 'setTextData()', () => {
815-
it( 'should update the content for text node', () => {
816-
const textNode = createText( 'foo' );
817-
818-
setTextData( 'bar', textNode );
819-
820-
expect( textNode.data ).to.equal( 'bar' );
821-
} );
822-
} );
823-
824814
describe( 'setAttribute() / removeAttribute()', () => {
825815
let root, spy;
826816

@@ -2472,12 +2462,6 @@ describe( 'Writer', () => {
24722462
} );
24732463
}
24742464

2475-
function setTextData( value, textNode ) {
2476-
model.enqueueChange( batch, writer => {
2477-
writer.setTextData( value, textNode );
2478-
} );
2479-
}
2480-
24812465
function setAttribute( key, value, itemOrRange ) {
24822466
model.enqueueChange( batch, writer => {
24832467
writer.setAttribute( key, value, itemOrRange );

tests/view/writer/writer.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -130,16 +130,6 @@ describe( 'Writer', () => {
130130
} );
131131
} );
132132

133-
describe( 'setTextData()', () => {
134-
it( 'should update the content for text node', () => {
135-
const textNode = writer.createText( 'foo' );
136-
137-
writer.setTextData( 'bar', textNode );
138-
139-
expect( textNode.data ).to.equal( 'bar' );
140-
} );
141-
} );
142-
143133
describe( 'setAttribute()', () => {
144134
it( 'should set attribute on given element', () => {
145135
const element = writer.createAttributeElement( 'span' );

0 commit comments

Comments
 (0)