Skip to content

Commit c151a1b

Browse files
committed
Merge branch 't/11972'
2 parents c6b36c2 + 702ca0f commit c151a1b

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Fixed Issues:
2424
* [#11387](http://dev.ckeditor.com/ticket/11387): Fixed: `role="radiogroup"` should be applied only to radio inputs' container.
2525
* [#7975](http://dev.ckeditor.com/ticket/7975): [IE8] Fixed: Errors when trying to select empty table cell on IE8.
2626
* [#11947](http://dev.ckeditor.com/ticket/11947): [FF+IE11] Fixed: Shift+Enter in lists produces two line breaks.
27+
* [#11972](http://dev.ckeditor.com/ticket/11972): Fixed: Feature detection in the [`element.setText()`](http://docs.ckeditor.com/#!/api/CKEDITOR.dom.element-method-setText) method should not trigger layout engine.
2728

2829
## CKEditor 4.4.1
2930

core/dom/element.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -469,16 +469,15 @@ CKEDITOR.tools.extend( CKEDITOR.dom.element.prototype, {
469469
* @param {String} text The text to be set.
470470
* @returns {String} The inserted text.
471471
*/
472-
setText: function( text ) {
473-
CKEDITOR.dom.element.prototype.setText = ( this.$.innerText != undefined ) ?
474-
function( text ) {
475-
return this.$.innerText = text;
476-
} : function( text ) {
477-
return this.$.textContent = text;
478-
};
472+
setText: ( function() {
473+
var supportsTextContent = document.createElement( 'p' );
474+
supportsTextContent.innerHTML = 'x';
475+
supportsTextContent = supportsTextContent.textContent;
479476

480-
return this.setText( text );
481-
},
477+
return function( text ) {
478+
this.$[ supportsTextContent ? 'textContent' : 'innerText' ] = text;
479+
};
480+
} )(),
482481

483482
/**
484483
* Gets the value of an element attribute.

0 commit comments

Comments
 (0)