8000 Cleanup old code that was there to support the Internet Explorer by archmoj · Pull Request #7251 · plotly/plotly.js · GitHub
[go: up one dir, main page]

Skip to content

Cleanup old code that was there to support the Internet Explorer #7251

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Oct 24, 2024
Merged
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
simplify test_syntax
  • Loading branch information
archmoj committed Oct 24, 2024
commit 75407ffc6fb25bdf6afc4c474d9bef5b7fafa2c9
27 changes: 0 additions & 27 deletions tasks/test_syntax.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,23 +90,13 @@ function assertJasmineSuites() {

/*
* tests about the contents of source (and lib) files:
* - check that we don't have any features that break in IE
* - check that we don't use getComputedStyle unexpectedly
* - check that require statements use lowercase (to match assertFileNames)
* or match the case of the source file
*/
function assertSrcContents() {
var logs = [];

// These are forbidden in IE *only in SVG* but since
// that's 99% of what we do here, we'll forbid them entirely
// until there's some HTML use case where we need them.
// (not sure what we'd do then, but we'd think of something!)
var IE_SVG_BLACK_LIST = ['innerHTML', 'parentElement', 'children'];

// Forbidden in IE in any context
var IE_BLACK_LIST = ['classList'];

// require'd built-in modules
var BUILTINS = ['events'];

Expand All @@ -122,28 +112,11 @@ function assertSrcContents() {
// look for .classList
if(node.type === 'MemberExpression') {
var source = node.source();
var parts = source.split('.');
var lastPart = parts[parts.length - 1];

if(source === 'Math.sign') {
logs.push(file + ' : contains Math.sign (IE failure)');
} else if(source === 'window.getComputedStyle') {
getComputedStyleCnt++;
} else if(IE_BLACK_LIST.indexOf(lastPart) !== -1) {
logs.push(file + ' : contains .' + lastPart + ' (IE failure)');
} else if(IE_SVG_BLACK_LIST.indexOf(lastPart) !== -1) {
// add special case for sunburst, icicle and treemap where we use 'children'
// off the d3-hierarchy output
var dirParts = path.dirname(file).split(path.sep);
var filename = dirParts[dirParts.length - 1];
var isSunburstOrIcicleOrTreemap =
filename === 'sunburst' ||
filename === 'icicle' ||
filename === 'treemap';
var isLinkedToObject = ['pt', 'd', 'parent', 'node'].indexOf(parts[parts.length - 2]) !== -1;
if(!(isSunburstOrIcicleOrTreemap && isLinkedToObject)) {
logs.push(file + ' : contains .' + lastPart + ' (IE failure in SVG)');
}
}
} else if(node.type === 'Identifier' && node.source() === 'getComputedStyle') {
if(node.parent.source() !== 'window.getComputedStyle') {
Expand Down
0