Page MenuHomePhabricator

Graph does not support IE8 and throws JS errors
Closed, DeclinedPublic

Description

IE8 currently doesn't show any Graphs at all and throws a JS error.

The cause for the JS error is because the Vega library has definitions like:

vg.true = function() { return true; };

So it's using a reserved keyword as a property, which is not possible on older browsers like IE8. I guess we need to disable the scripts on IE8, because there is quite a bit of es5 being used by these libs.

IE8 also doesn't support canvas, so even if we can get it to be es3 compatible, it still won't be able to actually draw something. We probably need to check for the existence of window.CanvasRenderingContext2D

Details

Related Gerrit Patches:
mediawiki/extensions/Graph : masterBumped Vega to 1.5.3

Event Timeline

TheDJ created this task.May 9 2015, 7:42 PM
TheDJ raised the priority of this task from to High.
TheDJ updated the task description. (Show Details)
TheDJ added a subscriber: TheDJ.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 9 2015, 7:42 PM

ES3 parsing compatibility for upstream in: https://github.com/hartman/vega/tree/jshint

Yurik added a subscriber: Yurik.May 11 2015, 8:31 AM

Merged with https://github.com/nyurik/vega (this is our Vega fork). Submitted to upstream.

Change 210008 had a related patch set uploaded (by Yurik):
Bumped Vega to 1.5.3

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

Yurik added a comment.EditedMay 11 2015, 8:43 AM

Even though I merged the patch, I am still having doubts if we should do this if IE8 does not support canvases. Should we simply wrap around it, checking if canvases are supported, and keep the syntax cleaner (ES5)?

Yurik added a comment.May 11 2015, 9:46 AM

Upon further thinking, I think it would be a bad idea to introduce ES3-compatible code here - makes it too ugly. Instead, we should solve this with the conditional IMG fallback loading, e.g. detect canvas support and use the <img> tag if not. The fix should also prevent vega/d3 lib loading.

Change 210008 abandoned by Yurik:
Bumped Vega to 1.5.3

Reason:
per https://phabricator.wikimedia.org/T98689#1275665 - not a good approach

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

Well, the problem is that without the ES3 compatibility, you cannot DELIVER it to an IE8 client (it's a parsing error, not an execution error). That means that you need to do client side module loading, which MIGHT be a good idea, fore reasons stated in T98704

For execution on IE8, you would need an s5-shim and a canvas polyfill.

Since we are switching to <img> for everyone except when editing, see 209823, this issue should be solved for non-editing case.

TheDJ set Security to None.
Yurik added a comment.Jan 8 2016, 7:38 AM

Do we want to keep this issue, since now IE8 is no longer supported as grade A?

Yurik lowered the priority of this task from High to Low.Jan 8 2016, 7:39 AM
Ricordisamoa closed this task as Declined.Jan 8 2016, 10:15 AM
Ricordisamoa claimed this task.

Static PNGs are the only viable option.

Restricted Application removed a subscriber: Liuxinyu970226. · View Herald TranscriptJan 8 2016, 10:15 AM
Ricordisamoa removed Ricordisamoa as the assignee of this task.Jan 8 2016, 10:15 AM