Skip to content

Commit 1f36292

Browse files
authored
Merge pull request #7251 from plotly/cleanup-IE-cases
Cleanup old code that was there to support the Internet Explorer
2 parents bd56393 + 14aeddd commit 1f36292

File tree

18 files changed

+6
-215
lines changed

18 files changed

+6
-215
lines changed

draftlogs/7251_change.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Cleanup remaining code that was there to support the Internet Explorer [[#7251](https://github.com/plotly/plotly.js/pull/7251)]

src/components/modebar/buttons.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,6 @@ modeBarButtons.toImage = {
5151

5252
Lib.notifier(_(gd, 'Taking snapshot - this may take a few seconds'), 'long');
5353

54-
if(opts.format !== 'svg' && Lib.isIE()) {
55-
Lib.notifier(_(gd, 'IE only supports svg. Changing format to svg.'), 'long');
56-
opts.format = 'svg';
57-
}
58-
5954
['filename', 'width', 'height', 'scale'].forEach(function(key) {
6055
if(key in toImageButtonOptions) {
6156
opts[key] = toImageButtonOptions[key];

src/css/_base.scss

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ a {
2727
@include vendor('user-select', none);
2828
}
2929

30-
//Required for IE11. Other browsers set this by default.
31-
svg { overflow: hidden; }
32-
3330
svg a { fill: $color-brand-primary; }
3431
svg a:hover { fill: #3c6dc5; }
3532

src/lib/index.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -755,10 +755,6 @@ lib.containsAny = function(s, fragments) {
755755
return false;
756756
};
757757

758-
lib.isIE = function() {
759-
return typeof window.navigator.msSaveBlob !== 'undefined';
760-
};
761-
762758
var IS_SAFARI_REGEX = /Version\/[\d\.]+.*Safari/;
763759
lib.isSafari = function() {
764760
return IS_SAFARI_REGEX.test(window.navigator.userAgent);

src/lib/search.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ exports.sorterDes = function(a, b) { return b - a; };
6464
*/
6565
exports.distinctVals = function(valsIn) {
6666
var vals = valsIn.slice(); // otherwise we sort the original array...
67-
vals.sort(exports.sorterAsc); // undefined listed in the end - also works on IE11
67+
vals.sort(exports.sorterAsc); // undefined listed in the end
6868

6969
var last;
7070
for(last = vals.length - 1; last > -1; last--) {

src/lib/supports_pixelated_image.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function supportsPixelatedImage() {
1919
_supportsPixelated = false;
2020

2121
// @see https://github.com/plotly/plotly.js/issues/6604
22-
var unsupportedBrowser = Lib.isIE() || Lib.isSafari() || Lib.isIOS();
22+
var unsupportedBrowser = Lib.isSafari() || Lib.isIOS();
2323

2424
if(window.navigator.userAgent && !unsupportedBrowser) {
2525
var declarations = Array.from(constants.CSS_DECLARATIONS).reverse();

src/plots/plots.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ plots.addLinks = function(gd) {
146146

147147
// If text's width is bigger than the layout
148148
// Check that text is a child node or document.body
149-
// because otherwise IE/Edge might throw an exception
149+
// because otherwise Edge might throw an exception
150150
// when calling getComputedTextLength().
151151
// Apparently offsetParent is null for invisibles.
152152
if(document.body.contains(text) && text.getComputedTextLength() >= (fullLayout.width - 20)) {

src/snapshot/download.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,6 @@ function downloadImage(gd, opts) {
3232
reject(new Error('Snapshotting already in progress.'));
3333
}
3434

35-
// see comments within svgtoimg for additional
36-
// discussion of problems with IE
37-
// can now draw to canvas, but CORS tainted canvas
38-
// does not allow toDataURL
39-
// svg format will work though
40-
if(Lib.isIE() && opts.format !== 'svg') {
41-
reject(new Error(helpers.MSG_IE_BAD_FORMAT));
42-
}
43-
4435
if(_gd) _gd._snapshotInProgress = true;
4536
var promise = toImage(gd, opts);
4637

src/snapshot/filesaver.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,6 @@ function fileSaver(url, name, format) {
2323
var blob;
2424
var objectUrl;
2525

26-
// IE 10+ (native saveAs)
27-
if(Lib.isIE()) {
28-
// At this point we are only dealing with a decoded SVG as
29-
// a data URL (since IE only supports SVG)
30-
blob = helpers.createBlob(url, 'svg');
31-
window.navigator.msSaveBlob(blob, name);
32-
blob = null;
33-
return resolve(name);
34-
}
35-
3626
if(canUseSaveLink) {
3727
blob = helpers.createBlob(url, format);
3828
objectUrl = helpers.createObjectURL(blob);

src/snapshot/helpers.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,3 @@ function fixBinary(b) {
6363
}
6464

6565
exports.IMAGE_URL_PREFIX = /^data:image\/\w+;base64,/;
66-
67-
exports.MSG_IE_BAD_FORMAT = 'Sorry IE does not support downloading from canvas. Try {format:\'svg\'} instead.';

0 commit comments

Comments
 (0)