@@ -285,11 +285,7 @@ export default class MutationBuffer {
285285 return nextId ;
286286 } ;
287287 const pushAdd = ( n : Node ) => {
288- if (
289- ! n . parentNode ||
290- ! inDom ( n ) ||
291- ( n . parentNode as Element ) . tagName === 'TEXTAREA'
292- ) {
288+ if ( ! n . parentNode || ! inDom ( n ) ) {
293289 return ;
294290 }
295291 const parentId = isShadowRoot ( n . parentNode )
@@ -439,20 +435,10 @@ export default class MutationBuffer {
439435
440436 const payload = {
441437 texts : this . texts
442- . map ( ( text ) => {
443- const n = text . node ;
444- if (
445- n . parentNode &&
446- ( n . parentNode as Element ) . tagName === 'TEXTAREA'
447- ) {
448- // the node is being ignored as it isn't in the mirror, so shift mutation to attributes on parent textarea
449- this . genTextAreaValueMutation ( n . parentNode as HTMLTextAreaElement ) ;
450- }
451- return {
452- id : this . mirror . getId ( n ) ,
453- value : text . value ,
454- } ;
455- } )
438+ . map ( ( text ) => ( {
439+ id : this . mirror . getId ( text . node ) ,
440+ value : text . value ,
441+ } ) )
456442 // no need to include them on added elements, as they have just been serialized with up to date attribubtes
457443 . filter ( ( text ) => ! addedIds . has ( text . id ) )
458444 // text mutation's id was not in the mirror map means the target node has been removed
@@ -511,24 +497,6 @@ export default class MutationBuffer {
511497 this . mutationCb ( payload ) ;
512498 } ;
513499
514- private genTextAreaValueMutation = ( textarea : HTMLTextAreaElement ) => {
515- let item = this . attributeMap . get ( textarea ) ;
516- if ( ! item ) {
517- item = {
518- node : textarea ,
519- attributes : { } ,
520- styleDiff : { } ,
521- _unchangedStyles : { } ,
522- } ;
523- this . attributes . push ( item ) ;
524- this . attributeMap . set ( textarea , item ) ;
525- }
526- item . attributes . value = Array . from (
527- textarea . childNodes ,
528- ( cn ) => cn . textContent || '' ,
529- ) . join ( '' ) ;
530- } ;
531-
532500 private processMutation = ( m : mutationRecord ) => {
533501 if ( isIgnored ( m . target , this . mirror ) ) {
534502 return ;
@@ -674,12 +642,6 @@ export default class MutationBuffer {
674642 if ( isBlocked ( m . target , this . blockClass , this . blockSelector , true ) )
675643 return ;
676644
677- if ( ( m . target as Element ) . tagName === 'TEXTAREA' ) {
678- // children would be ignored in genAdds as they aren't in the mirror
679- this . genTextAreaValueMutation ( m . target as HTMLTextAreaElement ) ;
680- return ; // any removedNodes won't have been in mirror either
681- }
682-
683645 m . addedNodes . forEach ( ( n ) => this . genAdds ( n , m . target ) ) ;
684646 m . removedNodes . forEach ( ( n ) => {
685647 const nodeId = this . mirror . getId ( n ) ;
0 commit comments