From 18f869770362582d1cc4398f3535a2cb5e65d8eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Dziewo=C5=84ski?= Date: Wed, 5 Sep 2018 18:56:52 +0200 Subject: [PATCH] ve.dm.MWTransclusionModel: Remove workaround for T135127 The bug this works around seems to be fixed. Change-Id: I62837ad795ee6bd35663b163f6de76572e1a6594 --- .../ve-mw/dm/models/ve.dm.MWTransclusionModel.js | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/modules/ve-mw/dm/models/ve.dm.MWTransclusionModel.js b/modules/ve-mw/dm/models/ve.dm.MWTransclusionModel.js index 8e8f99d75e..e823c94f46 100644 --- a/modules/ve-mw/dm/models/ve.dm.MWTransclusionModel.js +++ b/modules/ve-mw/dm/models/ve.dm.MWTransclusionModel.js @@ -70,7 +70,6 @@ function insertNode( isInline, generatedContents ) { var hash, store, nodeClass, type = isInline ? baseNodeClass.static.inlineType : baseNodeClass.static.blockType, - range = surfaceFragment.getSelection().getCoveringRange(), data = [ { type: type, @@ -90,16 +89,8 @@ store.hash( generatedContents, hash ); } - if ( range.isCollapsed() ) { - surfaceFragment.insertContent( data ); - } else { - // Generate a replacement transaction instead of using surfaceFragment.insertContent - // (which generates a removal and insertion) as blanking a reference triggers T135127. - // TODO: Once T135127 is fixed, revert to using surfaceFragment.insert. - surfaceFragment.getSurface().change( - ve.dm.TransactionBuilder.static.newFromReplacement( surfaceFragment.getDocument(), range, data ) - ); - } + surfaceFragment.insertContent( data ); + deferred.resolve(); }