Last modified: 2014-08-14 19:26:11 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T59489, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 57489 - document.selection.createRange should not be unconditionally accessed in MSIE (document.selection was removed in IE11)
document.selection.createRange should not be unconditionally accessed in MSIE...
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
WikiEditor (Other open bugs)
master
All All
: Highest major (vote)
: ---
Assigned To: Nobody - You can work on this!
:
: 66531 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-23 20:48 UTC by Umherirrender
Modified: 2014-08-14 19:26 UTC (History)
6 users (show)

See Also:
Web browser: Internet Explorer
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Umherirrender 2013-11-23 20:48:29 UTC
document.selection is no longer supported in IE11, that breaks some browser compatibility checks in WikiEditor and therefor the dialogs for links and images.

document.selection.createRange is accessed without check of document.selection, that gives a javascript error.

I am not sure, if it is enough to replace the msie check with a check for document.selection && document.selection.createRange or to add a version to the check.

See http://msdn.microsoft.com/en-us/library/ie/ms535869(v=vs.85).aspx

Thanks.
Comment 1 Umherirrender 2013-11-23 20:50:18 UTC
core makes it right in resource/jquery/jquery.textSelection.js
Comment 2 Umherirrender 2013-12-10 19:55:42 UTC
More users updates her browsers to IE11, so there are more and more questions at least on the german village pump -> bumping priority, because this is a new browser version, not a old one.
Comment 3 Andre Klapper 2013-12-11 14:11:05 UTC
$:andre\> grep -r "document.selection" .
./modules/jquery.wikiEditor.iframe.js:
	if ( !e && context.$iframe[0].contentWindow.document.selection ) {
	var range = context.$iframe[0].contentWindow.document.selection.createRange();
	context.savedSelection = context.$iframe[0].contentWindow.document.selection.createRange();
	} else if ( context.$iframe[0].contentWindow.document.selection ) { // should come last; Opera!
	var selection = context.$iframe[0].contentWindow.document.selection.createRange();
	} else if ( context.$iframe[0].contentWindow.document.selection ) { // should come last; Opera!
	retval = context.$iframe[0].contentWindow.document.selection.createRange();
	} else if ( context.$iframe[0].contentWindow.document.selection ) {
	var range = context.$iframe[0].contentWindow.document.selection.createRange();
	var range2 = context.$iframe[0].contentWindow.document.selection.createRange();
	var range3 = context.$iframe[0].contentWindow.document.selection.createRange();
	} else if ( context.$iframe[0].contentWindow.document.selection ) {
./modules/jquery.wikiEditor.js:
		context.savedSelection = document.selection.createRange();
Comment 4 Umherirrender 2013-12-11 18:28:04 UTC
The fatal is on:

/**
 * Save text selection for IE
 */
saveSelection: function () {
	if ( $.client.profile().name === 'msie' ) {
		context.$textarea.focus();
		context.savedSelection = document.selection.createRange();
	}
},

That is easy to fix by adding "&& document.selection " to the if, but when grep for 'msie' you will found this:


/**
 * Save scrollTop and cursor position for IE
 */
saveCursorAndScrollTop: function () {
	if ( $.client.profile().name === 'msie' ) {
		var IHateIE = {
			'scrollTop' : context.$textarea.scrollTop(),
			'pos': context.$textarea.textSelection( 'getCaretPosition', { startAndEnd: true } )
		};
		context.$textarea.data( 'IHateIE', IHateIE );
	}
},

And I cannot say, if that is still needed in IE11. I cannot test IE11 at the moment.
Comment 5 TMg 2013-12-29 19:38:19 UTC
Who is responsible for the extension? More users are asking for this: https://de.wikipedia.org/wiki/Wikipedia:Fragen_zur_Wikipedia#Editieren_mit_IE11
Comment 6 Andre Klapper 2014-01-02 11:51:58 UTC
(In reply to comment #5)
> Who is responsible for the extension?

All maintainers that I am aware of are CC'ed. 
For future reference, see also "Author(s)" on http://www.mediawiki.org/wiki/Extension:WikiEditor and https://www.mediawiki.org/wiki/Developers/Maintainers
Comment 7 Gerrit Notification Bot 2014-01-05 16:50:59 UTC
Change 105517 had a related patch set uploaded by Umherirrender:
document.selection is undefined in IE11

https://gerrit.wikimedia.org/r/105517
Comment 8 Gerrit Notification Bot 2014-01-06 11:14:52 UTC
Change 105517 merged by jenkins-bot:
document.selection is undefined in IE11

https://gerrit.wikimedia.org/r/105517
Comment 9 Umherirrender 2014-01-06 17:18:22 UTC
successfully merged
Comment 10 Derk-Jan Hartman 2014-08-14 19:26:11 UTC
*** Bug 66531 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links