Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add comments and drop unused logic for IE9 and IE10
  • Loading branch information
archmoj committed Jan 5, 2021
commit 3b1fe09f3fbcdd9e5c84b9c411aa7f4f615e396a
4 changes: 0 additions & 4 deletions devtools/test_dashboard/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@
</div>
<div id="snapshot"></div>

<!-- uncomment below for IE9/10 support -->
<!-- <script>if(typeof window.Int16Array !== 'function')document.write("<scri"+"pt src='../../dist/extras/typedarray.min.js'></scr"+"ipt>");</script>
<script>document.write("<scri"+"pt src='../../dist/extras/request_animation_frame.js'></scr"+"ipt>");</script> -->

<script src="../../dist/extras/mathjax/MathJax.js?config=TeX-AMS-MML_SVG"></script>
<script id="source" src="../../build/plotly.js" charset="utf-8"></script>
<script src="../../build/test_dashboard-bundle.js" charset="utf-8"></script>
Expand Down
9 changes: 0 additions & 9 deletions dist/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,6 @@ or the un-minified version as:
<script src="plotly.js" charset="utf-8"></script>
```

### To support IE9

*Before* the plotly.js script tag, add:

```html
<script>if(typeof window.Int16Array !== 'function')document.write("<scri"+"pt src='extras/typedarray.min.js'></scr"+"ipt>");</script>
<script>document.write("<scri"+"pt src='extras/request_animation_frame.js'></scr"+"ipt>");</script>
```

### To support MathJax

*Before* the plotly.js script tag, add:
Expand Down
11 changes: 2 additions & 9 deletions src/lib/array.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,8 @@

var isArray = Array.isArray;

// IE9 fallbacks

var ab = (typeof ArrayBuffer === 'undefined' || !ArrayBuffer.isView) ?
{isView: function() { return false; }} :
ArrayBuffer;

var dv = (typeof DataView === 'undefined') ?
function() {} :
DataView;
var ab = ArrayBuffer;
var dv = DataView;

function isTypedArray(a) {
return ab.isView(a) && !(a instanceof dv);
Expand Down
7 changes: 2 additions & 5 deletions src/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -712,11 +712,6 @@ lib.isIE = function() {
return typeof window.navigator.msSaveBlob !== 'undefined';
};

var IS_IE9_OR_BELOW_REGEX = /MSIE [1-9]\./;
lib.isIE9orBelow = function() {
return lib.isIE() && IS_IE9_OR_BELOW_REGEX.test(window.navigator.userAgent);
};

var IS_SAFARI_REGEX = /Version\/[\d\.]+.*Safari/;
lib.isSafari = function() {
return IS_SAFARI_REGEX.test(window.navigator.userAgent);
Expand All @@ -727,6 +722,8 @@ lib.isIOS = function() {
return IS_IOS_REGEX.test(window.navigator.userAgent);
};

// Do we need this process now that IE9 and IE10 are not supported?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, we could probably get rid of this now - and revert the change here that's its only consumer: 98adfae#diff-9c325f1fe845cf45c705407012f4d4d0be31a9d9fbead70d1f70c5dedde9c634

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 42c97e2.


/**
* Duck typing to recognize a d3 selection, mostly for IE9's benefit
* because it doesn't handle instanceof like modern browsers
Expand Down
4 changes: 0 additions & 4 deletions src/snapshot/filesaver.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ function fileSaver(url, name, format) {
var blob;
var objectUrl;

if(Lib.isIE9orBelow()) {
reject(new Error('IE < 10 unsupported'));
}

// Safari doesn't allow downloading of blob urls
if(Lib.isSafari()) {
var prefix = format === 'svg' ? ',' : ';base64,';
Expand Down
2 changes: 1 addition & 1 deletion src/snapshot/svgtoimg.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function svgToImg(opts) {
var img = new Image();
var svgBlob, url;

if(format === 'svg' || Lib.isIE9orBelow() || Lib.isSafari()) {
if(format === 'svg' || Lib.isSafari()) {
url = helpers.encodeSVG(svg);
} else {
svgBlob = helpers.createBlob(svg, 'svg');
Expand Down
2 changes: 2 additions & 0 deletions src/snapshot/tosvg.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ module.exports = function toSVG(gd, format, scale) {
// Fix quotations around font strings and gradient URLs
s = s.replace(DUMMY_REGEX, '\'');

// Do we need this process now that IE9 and IE10 are not supported?

// IE is very strict, so we will need to clean
// svg with the following regex
// yes this is messy, but do not know a better way
Expand Down
9 changes: 0 additions & 9 deletions tasks/stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,6 @@ function getInfoContent() {
'<script src="plotly.js" charset="utf-8"></script>',
'```',
'',
'### To support IE9',
'',
'*Before* the plotly.js script tag, add:',
'',
'```html',
'<script>if(typeof window.Int16Array !== \'function\')document.write("<scri"+"pt src=\'extras/typedarray.min.js\'></scr"+"ipt>");</script>',
'<script>document.write("<scri"+"pt src=\'extras/request_animation_frame.js\'></scr"+"ipt>");</script>',
'```',
'',
'### To support MathJax',
'',
'*Before* the plotly.js script tag, add:',
Expand Down
3 changes: 3 additions & 0 deletions test/image/strict-d3.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
* strict-d3: wrap selection.style to prohibit specific incorrect style values
* that are known to cause problems in IE (at least IE9)
*/

// Do we need this process now that IE9 and IE10 are not supported?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, if you look down below there's plenty here that applies to other browsers too. There may be some parts we could relax but no harm leaving it all for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. I removed the comment in 9276d08.


'use strict';

var d3 = require('@plotly/d3');
Expand Down
42 changes: 0 additions & 42 deletions test/jasmine/bundle_tests/ie9_test.js

This file was deleted.

11 changes: 0 additions & 11 deletions test/jasmine/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ if(argv.info) {
'Run all tests with the `noCI` tag on Firefox in a 1500px wide window:',
' $ npm run test-jasmine -- --tags=noCI --FF --width=1500',
'',
'Run the `ie9_test.js` bundle test with the verbose reporter:',
' $ npm run test-jasmine -- --bundleTest=ie9 --verbose',
'',
'Arguments:',
' - All non-flagged arguments corresponds to the test suites in `test/jasmine/tests/` to be run.',
' No need to add the `_test.js` suffix, we expand them correctly here.',
Expand Down Expand Up @@ -122,7 +119,6 @@ if(isFullSuite) {
var pathToShortcutPath = path.join(__dirname, '..', '..', 'tasks', 'util', 'shortcut_paths.js');
var pathToStrictD3 = path.join(__dirname, '..', '..', 'tasks', 'util', 'strict_d3.js');
var pathToJQuery = path.join(__dirname, 'assets', 'jquery-1.8.3.min.js');
var pathToIE9mock = path.join(__dirname, 'assets', 'ie9_mock.js');
var pathToCustomMatchers = path.join(__dirname, 'assets', 'custom_matchers.js');
var pathToUnpolyfill = path.join(__dirname, 'assets', 'unpolyfill.js');
var pathToMathJax = path.join(constants.pathToDist, 'extras', 'mathjax');
Expand Down Expand Up @@ -323,13 +319,6 @@ if(isBundleTest) {
func.defaultConfig.files.push(constants.pathToPlotlyDistMin);
func.defaultConfig.preprocessors[testFileGlob] = ['browserify'];
break;
case 'ie9':
// load ie9_mock.js before plotly.js+test bundle
// to catch reference errors that could occur
// when plotly.js is first loaded.
func.defaultConfig.files.push(pathToIE9mock);
func.defaultConfig.preprocessors[testFileGlob] = ['browserify'];
break;
case 'plotschema':
func.defaultConfig.browserify.ignoreTransform = './tasks/compress_attributes.js';
func.defaultConfig.preprocessors[testFileGlob] = ['browserify'];
Expand Down