Page MenuHomePhabricator

Remove code supporting IE 6-9 from jquery.textSelection
Closed, ResolvedPublic1 Story Points

Description

We should remove code supporting IE 6-9 from jquery.textSelection.js. We do not ship JavaScript to these browsers anymore.

The string IE appears in the source code 24 times, and most of these refer to IE 6 (as that was the only IE that mattered when this code was written).

We can probably remove like half of that file. We have to do it carefully though, so as to not remove any workarounds for more recent IEs.

Event Timeline

matmarex created this task.Jan 30 2018, 2:19 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 30 2018, 2:19 PM

OO.ui.TextInputWidget.prototype.selectRange/getRange would be a good place to start.

It's weird even reading this code, the IE 6 era APIs like document.selection or document.body.createTextRange no longer have any documentation anywhere, it's hard to even tell when they were introduced and when they were dropped. All the blogs that must have blogged about them are dead and even Microsoft stopped hosting their docs. It seems the only places on the Internet that still mention them are http://help.dottoro.com/ljfjepre.php and some StackOverflow questions where the answers are all like "just use this other new API". Fun :)

document.body.createTextRange

I think https://msdn.microsoft.com/en-us/library/ms533042(v=vs.85).aspx might be the Microsoft documentation for that?

Oh, neat, the few Microsoft MSDN links I ran into were redirecting to Mozilla's MDN, which obviously did not have any docs for that.

Anyway, it's not like we need to read these docs, this task just awoke my inner archivist ;)

Change 406977 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/core@master] jquery.textSelection: Remove code supporting IE 6 selection APIs

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

Change 406977 merged by jenkins-bot:
[mediawiki/core@master] jquery.textSelection: Remove code supporting IE 6 selection APIs

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

Jdforrester-WMF closed this task as Resolved.Jan 31 2018, 4:05 PM
Jdforrester-WMF edited projects, added VisualEditor; removed Patch-For-Review.
Jdforrester-WMF set the point value for this task to 1.
Jdforrester-WMF claimed this task.
Restricted Application added a project: User-Ryasmeen. · View Herald TranscriptJan 31 2018, 4:05 PM
matmarex claimed this task.Jan 31 2018, 5:28 PM
matmarex added a subscriber: Jdforrester-WMF.