Page MenuHomePhabricator

VisualEditor linking doesn’t work in IE11
Closed, ResolvedPublic

Description

Using Internet Explorer 11, the new link feature of VisualEditor doesn’t work in almost all situations.

I tested the following:

  • Link button on toolbar: doesn’t work
  • +K: doesn’t work
  • Typing [[:
    • Using English keyboard (US, international; has dedicated [ key): works
    • Using Hungarian keyboard ([ can be typed as AltGr+F): doesn’t work
  • Clicking on the edit button in the popup of an existing link: works

I tested it with two versions of IE11, yielding the same results:

  • v11.165.17134.0 on Windows 10
  • v11.0.9600.19080 on Windows 7

I got the following error messages on the Win10 machine after clicking on the toolbar button in debug mode:

jQuery.Deferred exception: Object doesn't support property or method 'find' TypeError: Object doesn't support property or method 'find'
   at ve.dm.TransactionProcessor.processors.annotate (https://hu.wikipedia.org/w/extensions/VisualEditor/lib/ve/src/dm/ve.dm.TransactionProcessor.js?e3165:497:3)
   at ve.dm.TransactionProcessor.prototype.executeOperation (https://hu.wikipedia.org/w/extensions/VisualEditor/lib/ve/src/dm/ve.dm.TransactionProcessor.js?e3165:71:3)
   at ve.dm.TransactionProcessor.prototype.process (https://hu.wikipedia.org/w/extensions/VisualEditor/lib/ve/src/dm/ve.dm.TransactionProcessor.js?e3165:94:3)
   at ve.dm.Document.prototype.commit (https://hu.wikipedia.org/w/extensions/VisualEditor/lib/ve/src/dm/ve.dm.Document.js?821e2:335:2)
   at ve.dm.Surface.prototype.changeInternal (https://hu.wikipedia.org/w/extensions/VisualEditor/lib/ve/src/dm/ve.dm.Surface.js?238b3:880:6)
   at ve.dm.Surface.prototype.change (https://hu.wikipedia.org/w/extensions/VisualEditor/lib/ve/src/dm/ve.dm.Surface.js?238
jQuery.Deferred exception: Object doesn't support property or method 'find' TypeError: Object doesn't support property or method 'find'
   at ve.dm.TransactionProcessor.processors.annotate (https://hu.wikipedia.org/w/extensions/VisualEditor/lib/ve/src/dm/ve.dm.TransactionProcessor.js?e3165:497:3)
   at ve.dm.TransactionProcessor.prototype.executeOperation (https://hu.wikipedia.org/w/extensions/VisualEditor/lib/ve/src/dm/ve.dm.TransactionProcessor.js?e3165:71:3)
   at ve.dm.TransactionProcessor.prototype.process (https://hu.wikipedia.org/w/extensions/VisualEditor/lib/ve/src/dm/ve.dm.TransactionProcessor.js?e3165:94:3)
   at ve.dm.Document.prototype.commit (https://hu.wikipedia.org/w/extensions/VisualEditor/lib/ve/src/dm/ve.dm.Document.js?821e2:335:2)
   at ve.dm.Surface.prototype.changeInternal (https://hu.wikipedia.org/w/extensions/VisualEditor/lib/ve/src/dm/ve.dm.Surface.js?238b3:880:6)
   at ve.dm.Surface.prototype.change (https://hu.wikipedia.org/w/extensions/VisualEditor/lib/ve/src/dm/ve.dm.Surface.js?238
jQuery.Deferred exception: Object doesn't support property or method 'find' TypeError: Object doesn't support property or method 'find'
   at ve.dm.TransactionProcessor.processors.annotate (https://hu.wikipedia.org/w/extensions/VisualEditor/lib/ve/src/dm/ve.dm.TransactionProcessor.js?e3165:497:3)
   at ve.dm.TransactionProcessor.prototype.executeOperation (https://hu.wikipedia.org/w/extensions/VisualEditor/lib/ve/src/dm/ve.dm.TransactionProcessor.js?e3165:71:3)
   at ve.dm.TransactionProcessor.prototype.process (https://hu.wikipedia.org/w/extensions/VisualEditor/lib/ve/src/dm/ve.dm.TransactionProcessor.js?e3165:94:3)
   at ve.dm.Document.prototype.commit (https://hu.wikipedia.org/w/extensions/VisualEditor/lib/ve/src/dm/ve.dm.Document.js?821e2:335:2)
   at ve.dm.Surface.prototype.changeInternal (https://hu.wikipedia.org/w/extensions/VisualEditor/lib/ve/src/dm/ve.dm.Surface.js?238b3:880:6)
   at ve.dm.Surface.prototype.change (https://hu.wikipedia.org/w/extensions/VisualEditor/lib/ve/src/dm/ve.dm.Surface.js?238
jQuery.Deferred exception: Object doesn't support property or method 'find' TypeError: Object doesn't support property or method 'find'
   at ve.dm.TransactionProcessor.processors.annotate (https://hu.wikipedia.org/w/extensions/VisualEditor/lib/ve/src/dm/ve.dm.TransactionProcessor.js?e3165:497:3)
   at ve.dm.TransactionProcessor.prototype.executeOperation (https://hu.wikipedia.org/w/extensions/VisualEditor/lib/ve/src/dm/ve.dm.TransactionProcessor.js?e3165:71:3)
   at ve.dm.TransactionProcessor.prototype.process (https://hu.wikipedia.org/w/extensions/VisualEditor/lib/ve/src/dm/ve.dm.TransactionProcessor.js?e3165:94:3)
   at ve.dm.Document.prototype.commit (https://hu.wikipedia.org/w/extensions/VisualEditor/lib/ve/src/dm/ve.dm.Document.js?821e2:335:2)
   at ve.dm.Surface.prototype.changeInternal (https://hu.wikipedia.org/w/extensions/VisualEditor/lib/ve/src/dm/ve.dm.Surface.js?238b3:880:6)
   at ve.dm.Surface.prototype.change (https://hu.wikipedia.org/w/extensions/VisualEditor/lib/ve/src/dm/ve.dm.Surface.js?238
jQuery.Deferred exception: Unable to get property 'always' of undefined or null reference TypeError: Unable to get property 'always' of undefined or null reference
   at Anonymous function (https://hu.wikipedia.org/w/extensions/VisualEditor/lib/ve/src/ui/contexts/ve.ui.LinearContext.js?f399f:183:4)
   at fire (https://hu.wikipedia.org/w/load.php?debug=true&lang=hu&modules=jquery%7Cmediawiki.base%7Cmediawiki.legacy.wikibits&only=scripts&skin=vector&version=19lyfvl:3317:6)
   at self.fireWith (https://hu.wikipedia.org/w/load.php?debug=true&lang=hu&modules=jquery%7Cmediawiki.base%7Cmediawiki.legacy.wikibits&only=scripts&skin=vector&version=19lyfvl:3447:7)
   at deferred[] (https://hu.wikipedia.org/w/load.php?debug=true&lang=hu&modules=jquery%7Cmediawiki.base%7Cmediawiki.legacy.wikibits&only=scripts&skin=vector&version=19lyfvl:3778:5)
   at Anonymous function (https://hu.wikipedia.org/w/resources/lib/oojs-ui/oojs-ui-windows.js?344b9:1393:5)
   at mightThrow (https://hu.wikipedia.org/w/load.php?debug=true&lang=hu&

(Yes, the last error message ends with an ampersand, without letting me know what module it is.)

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

The problem is in this fragment in TransactionProcessor:

		index = this.changes.find( function ( change ) {
			return change.method === method && change.annotation === annotation;
		} );
		if ( index === undefined ) {
			throw new Error( 'Trying to stop an unstarted change' );
		}
		this.changes.splice( index, 1 );

The find() function is part of ES6, and not suppored by IE 11: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find

However, this code looks like it should not work in other browsers either. find() actually returns the found value, and not the index. (There is a separate findIndex() function, also ES6-only.) So I think this ends up always removing the first item from the changes array (it cats the value to 0), rather than the correct one.

(This code was added in 8d533f71ba856a948a6c701bd3369735cb25cc32.)

Change 449269 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[VisualEditor/VisualEditor@master] ve.dm.TransactionProcessor: Fix edge case handling, avoid ES6 methods

https://gerrit.wikimedia.org/r/449269

Change 449269 merged by jenkins-bot:
[VisualEditor/VisualEditor@master] ve.dm.TransactionProcessor: Fix edge case handling, avoid ES6 methods

https://gerrit.wikimedia.org/r/449269

Change 449530 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (086de2707)

https://gerrit.wikimedia.org/r/449530

Change 449530 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (086de2707)

https://gerrit.wikimedia.org/r/449530

Confirmed to work (on the Win7 machine).