@@ -550,9 +550,7 @@ window.CodeMirror = (function() {
550550 function patchDisplay ( cm , from , to , intact , updateNumbersFrom ) {
551551 var dims = getDimensions ( cm ) ;
552552 var display = cm . display , lineNumbers = cm . options . lineNumbers ;
553- // IE does bad things to nodes when .innerHTML = "" is used on a parent
554- // we still need widgets and markers intact to add back to the new content later
555- if ( ! intact . length && ! ie && ( ! webkit || ! cm . display . currentWheelTarget ) )
553+ if ( ! intact . length && ( ! webkit || ! cm . display . currentWheelTarget ) )
556554 removeChildren ( display . lineDiv ) ;
557555 var container = display . lineDiv , cur = container . firstChild ;
558556
@@ -1114,7 +1112,6 @@ window.CodeMirror = (function() {
11141112 }
11151113 removeChildrenAndAdd ( display . measure , measureText ) ;
11161114 var height = measureText . offsetHeight / 50 ;
1117- display . measure . removeChild ( measureText ) ;
11181115 if ( height > 3 ) display . cachedTextHeight = height ;
11191116 removeChildren ( display . measure ) ;
11201117 return height || 1 ;
@@ -4354,7 +4351,9 @@ window.CodeMirror = (function() {
43544351 }
43554352
43564353 function removeChildren ( e ) {
4357- e . innerHTML = "" ;
4354+ // IE will break all parent-child relations in subnodes when setting innerHTML
4355+ if ( ! ie ) e . innerHTML = "" ;
4356+ else while ( e . firstChild ) e . removeChild ( e . firstChild ) ;
43584357 return e ;
43594358 }
43604359
0 commit comments