Testing IE workboards and icons and I'm not able in prod or sb to drag tasks in Internet Explorer with any version (8-11).
Description
Revisions and Commits
Event Timeline
For IE8, the first big issue is Array.indexOf is not supported in IE8. Sadly, if you just do something like
if (!Array.prototype.indexOf) { Array.prototype.indexOf = function indexOf() { // working implementation here } }
The javascript breaks in new fun ways because this indexOf method will end up as something we iterate on for various for ... in ... calls, i.e. if you for x in y x will have the value 'indexOf' at some point in IE-only. As you might expect, this causes lots of errors all over the place.
So paths forward I see, in my order of preference
- Make some Javelin lib, like lib/ArrayUtils.php that to start has an indexOf implementation that takes an array as the first argument, rather than being a method on all array objects. Next, replace indexOf calls with this new hotness.
- this will likely need a few more functions that IE* doesn't support for arrays that we use
- should probably add some lint rule(s) to catch indexOf calls, etc. so we don't add more
- loudly say we don't support IE8, see what happens with IE9...
- do the prototype thing, which means going through the whole code base and looking for potential for ... in ... errors and fixing them.
This is a pretty big deal I think as Javascript probably doesn't work well in IE all over the place? here's callsites of indexOf in Javelin:
core/Event.js:147: if (supportedEvents.indexOf(this.getType()) == -1) {
core/Stratcom.js:534: return sigils && (' ' + sigils + ' ').indexOf(' ' + sigil + ' ') > -1;
lib/__tests__/Cookie.js:38: var data = doc.cookie.substr(0, doc.cookie.indexOf(';'));
lib/Cookie.js:46: key.indexOf('$') === 0)) {
lib/DOM.js:722: var has = ((' '+node.className+' ').indexOf(' '+className+' ') > -1);
lib/Request.js:141: uri += ((uri.indexOf('?') === -1) ? '?' : '&') + q;
lib/Request.js:217: if (expect_guard && xport.responseText.indexOf('for (;;);') !== 0) {
lib/Resource.js:50: if (path.indexOf('.css') == path.length - 4) {
...and the rest of the code in Phabricator:
application/differential/behavior-keyboard-nav.js:70: if (row.className.indexOf('inline') !== -1) {
application/differential/behavior-keyboard-nav.js:74: if (row.className.indexOf('differential-changeset') !== -1) {
application/differential/behavior-keyboard-nav.js:83: if (cells[ii].className.indexOf('old') !== -1 ||
application/differential/behavior-keyboard-nav.js:84: cells[ii].className.indexOf('new') !== -1) {
application/differential/DifferentialInlineCommentEditor.js:24: while (node && node.className.indexOf('inline') !== -1) {
core/behavior-oncopy.js:37: if (text.indexOf(zws) == -1) {
core/behavior-oncopy.js:50: pos = lines[ii].indexOf(zws);
Most of those are 'string'.indexOf(), which is supported (I assume). Which one is causing the problem? The only one I see which looks like array.indexOf is this one:
if (supportedEvents.indexOf(this.getType()) == -1) {
...but that's trivial to fix and the call isn't desirable anyway. Is that the issue?
That's the first one that fires, yeah. I wouldn't be so bold as to claim that will fix this end to end though until I test.
@chad - D9118 should get you IE9+ "working", which I quote only because I wouldn't be surprised if it is somehow glitchy.
IE8 is still pretty broken and I *think* we might want to just not support it, damning all those Windows XP users to some Phabricator-less hell. Basically, while doing D9118 and the various Internet research to figure things out I got the sense IE8 is pretty busted. In terms of this IE8 busted-ness, for starters, see
http://www.quirksmode.org/mobile/tableViewport_desktop.html
- e.g. "In IE8 offsetHeight a few pixels higher than clientHeight."
http://www.quirksmode.org/dom/w3c_cssom.html
- e.g. "When the element has no scrollbars IE makes the scrollHeight equal to the actual height of the content; and not the height of the element. scrollWidth is correct, except in IE8, where it’s 5 pixels off."
Let's not support IE8 - that would be really nice of us but seems unnecessary, particularly given the clients are engineers primarily. As far as I know, this works in IE9 plus now nicely. :)
We may have other IE bugs in Phabricator - I'm happy to fix 'em if you find 'em.