removed support for IE version checks via documentMode

development
mcyph 2021-03-20 15:44:25 +11:00
parent ea47e07a1e
commit 8d5296163c
18 changed files with 19 additions and 244 deletions

View File

@ -366,9 +366,7 @@ Editor.prototype.editAsNew = function(xml, title)
p += ((p.length > 0) ? '&' : '?') + 'ui=' + urlParams['ui'];
}
if (typeof window.postMessage !== 'undefined' &&
(document.documentMode == null ||
document.documentMode >= 10))
if (typeof window.postMessage !== 'undefined' )
{
var wnd = null;
@ -386,11 +384,6 @@ Editor.prototype.editAsNew = function(xml, title)
p + ((p.length > 0) ? '&' : '?') +
'client=1'), null, true);
}
else
{
this.graph.openLink(this.getEditBlankUrl(p) +
'#R' + encodeURIComponent(xml));
}
};
/**

View File

@ -1789,12 +1789,7 @@ EditorUi.prototype.initCanvas = function()
var st = graph.container.scrollTop;
var sl = graph.container.scrollLeft;
var sb = 14;
if (document.documentMode == 8 || document.documentMode == 9)
{
sb += 3;
}
var cw = graph.container.offsetWidth - sb;
var ch = graph.container.offsetHeight - sb;
@ -4214,18 +4209,11 @@ EditorUi.prototype.extractGraphModelFromEvent = function(evt)
if (provider != null)
{
if (document.documentMode == 10 || document.documentMode == 11)
data = (mxUtils.indexOf(provider.types, 'text/html') >= 0) ? provider.getData('text/html') : null;
if (mxUtils.indexOf(provider.types, 'text/plain' && (data == null || data.length == 0)))
{
data = provider.getData('Text');
}
else
{
data = (mxUtils.indexOf(provider.types, 'text/html') >= 0) ? provider.getData('text/html') : null;
if (mxUtils.indexOf(provider.types, 'text/plain' && (data == null || data.length == 0)))
{
data = provider.getData('text/plain');
}
data = provider.getData('text/plain');
}
if (data != null)

View File

@ -805,7 +805,7 @@ BaseFormatPanel.prototype.createStepper = function(input, update, step, height,
step = (step != null) ? step : 1;
height = (height != null) ? height : 8;
if (mxClient.IS_MT || document.documentMode >= 8)
if (mxClient.IS_MT)
{
height = height + 1;
}
@ -6154,7 +6154,7 @@ DiagramFormatPanel.prototype.addView = function(div)
btn.style.position = 'absolute';
btn.className = 'geColorBtn';
btn.style.marginTop = '-4px';
btn.style.paddingBottom = (document.documentMode == 11 || mxClient.IS_MT) ? '0px' : '2px';
btn.style.paddingBottom = mxClient.IS_MT ? '0px' : '2px';
btn.style.height = '22px';
btn.style.right = '72px';
btn.style.width = '56px';

View File

@ -1264,20 +1264,10 @@ Menus.prototype.menuCreated = function(menu, elt, className)
if (!menu.enabled)
{
elt.className = className + ' mxDisabled';
if (document.documentMode == 8)
{
elt.style.color = '#c3c3c3';
}
}
else
{
elt.className = className;
if (document.documentMode == 8)
{
elt.style.color = '';
}
}
});
}

View File

@ -2519,10 +2519,6 @@ class mxEditor extends mxEventSource {
div.style.background = 'white';
div.style.cursor = 'move';
if (document.documentMode == 8) {
div.style.filter = 'progid:DXImageTransform.Microsoft.alpha(opacity=100)';
}
var wnd = new mxWindow(
mxResources.get(this.outlineResource) ||
this.outlineResource,

View File

@ -30,21 +30,6 @@ var mxClient = {
*/
IS_EDGE: navigator.userAgent != null && !!navigator.userAgent.match(/Edge\//),
/**
* Variable: IS_QUIRKS
*
* True if the current browser is Internet Explorer and it is in quirks mode.
*/
IS_QUIRKS: navigator.userAgent != null && navigator.userAgent.indexOf('MSIE') >= 0 &&
(document.documentMode == null || document.documentMode == 5),
/**
* Variable: IS_EM
*
* True if the browser is IE11 in enterprise mode (IE8 standards mode).
*/
IS_EM: 'spellcheck' in document.createElement('textarea') && document.documentMode == 8,
/**
* Variable: IS_NS
*

View File

@ -474,7 +474,7 @@ class mxShape {
/**
* Function: redrawShape
*
* Updates the SVG or VML shape.
* Updates the SVG shape.
*/
redrawShape = () => {
var canvas = this.createCanvas();
@ -492,16 +492,6 @@ class mxShape {
this.node.insertAdjacentHTML('beforeend', canvas.root.outerHTML);
}
if (this.node.nodeName === 'DIV' && document.documentMode === 8) {
// Makes DIV transparent to events for IE8 in IE8 standards
// mode (Note: Does not work for IE9 in IE8 standards mode
// and not for IE11 in enterprise mode)
this.node.style.filter = '';
// Adds event transparency in IE8 standards
mxUtils.addTransparentBackgroundFilter(this.node);
}
this.destroyCanvas(canvas);
}
};
@ -573,46 +563,6 @@ class mxShape {
return canvas;
};
/**
* Function: createVmlCanvas
*
* Creates and returns an <mxVmlCanvas2D> for rendering this shape.
*/
createVmlCanvas = () => {
// Workaround for VML rendering bug in IE8 standards mode
var node = (document.documentMode === 8 && this.isParseVml()) ? this.createVmlGroup() : this.node;
var canvas = new mxVmlCanvas2D(node, false);
if (node.tagUrn != '') {
var w = Math.max(1, Math.round(this.bounds.width));
var h = Math.max(1, Math.round(this.bounds.height));
node.coordsize = (w * this.vmlScale) + ',' + (h * this.vmlScale);
canvas.scale(this.vmlScale);
canvas.vmlScale = this.vmlScale;
}
// Painting relative to top, left shape corner
var s = this.scale;
canvas.translate(-Math.round(this.bounds.x / s), -Math.round(this.bounds.y / s));
return canvas;
};
/**
* Function: updateVmlContainer
*
* Updates the bounds of the VML container.
*/
updateVmlContainer = () => {
this.node.style.left = Math.round(this.bounds.x) + 'px';
this.node.style.top = Math.round(this.bounds.y) + 'px';
var w = Math.max(1, Math.round(this.bounds.width));
var h = Math.max(1, Math.round(this.bounds.height));
this.node.style.width = w + 'px';
this.node.style.height = h + 'px';
this.node.style.overflow = 'visible';
};
/**
* Function: redrawHtml
*

View File

@ -482,37 +482,7 @@ class mxText extends mxShape {
var sizeDiv = node;
if (document.documentMode == 8 && !mxClient.IS_EM) {
var w = Math.round(this.bounds.width / this.scale);
if (this.wrap && w > 0) {
node.style.wordWrap = mxConstants.WORD_WRAP;
node.style.whiteSpace = 'normal';
if (node.style.wordWrap != 'break-word') {
// Innermost DIV is used for measuring text
var divs = sizeDiv.getElementsByTagName('div');
if (divs.length > 0) {
sizeDiv = divs[divs.length - 1];
}
ow = sizeDiv.offsetWidth + 2;
divs = this.node.getElementsByTagName('div');
if (this.clipped) {
ow = Math.min(w, ow);
}
// Second last DIV width must be updated in DOM tree
if (divs.length > 1) {
divs[divs.length - 2].style.width = ow + 'px';
}
}
} else {
node.style.whiteSpace = 'nowrap';
}
} else if (sizeDiv.firstChild != null && sizeDiv.firstChild.nodeName == 'DIV') {
if (sizeDiv.firstChild != null && sizeDiv.firstChild.nodeName == 'DIV') {
sizeDiv = sizeDiv.firstChild;
}

View File

@ -180,8 +180,7 @@ var mxLog =
// Workaround for ignored textarea height in various setups
if ((mxClient.IS_NS && !mxClient.IS_GC &&
!mxClient.IS_SF && document.compatMode != 'BackCompat') ||
document.documentMode == 11)
!mxClient.IS_SF && document.compatMode != 'BackCompat'))
{
var elt = mxLog.window.getElement();

View File

@ -538,12 +538,6 @@ isMenuShowing = ()=>
*/
showMenu = ()=>
{
// Disables filter-based shadow in IE9 standards mode
if (document.documentMode >= 9)
{
this.div.style.filter = 'none';
}
// Fits the div inside the viewport
document.body.appendChild(this.div);
mxUtils.fit(this.div);

View File

@ -898,7 +898,7 @@ mxSvgCanvas2setLink = (link)=>
// Workaround for implicit namespace handling in HTML5 export, IE adds NS1 namespace so use code below
// in all IE versions except quirks mode. KNOWN: Adds xlink namespace to each image tag in output.
if (node.setAttributeNS == null || (this.root.ownerDocument != document && document.documentMode == null))
if (node.setAttributeNS == null || (this.root.ownerDocument != document))
{
node.setAttribute('xlink:href', link);
}

View File

@ -3373,11 +3373,6 @@ var mxUtils = {
doc.open();
}
// Workaround for missing print output in IE9 standards
if (document.documentMode == 9) {
doc.writeln('<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=9"><![endif]-->');
}
var bounds = graph.getGraphBounds();
var dx = Math.ceil(x0 - bounds.x);
var dy = Math.ceil(y0 - bounds.y);

View File

@ -279,14 +279,6 @@ minimumSize = new mxRectangle(0, 0, 50, 40);
*/
destroyOnClose = true;
/**
* Variable: contentHeightCorrection
*
* Defines the correction factor for computing the height of the contentWrapper.
* Default is 6 for IE 7/8 standards mode and 2 for all other browsers and modes.
*/
contentHeightCorrection = (document.documentMode == 8 || document.documentMode == 7) ? 6 : 2;
/**
* Variable: title
*
@ -358,11 +350,6 @@ init = (x, y, width, height, style)=>
tr = document.createElement('tr');
this.td = document.createElement('td');
this.td.className = style + 'Pane';
if (document.documentMode == 7)
{
this.td.style.height = '100%';
}
this.contentWrapper = document.createElement('div');
this.contentWrapper.className = style + 'Pane';

View File

@ -243,7 +243,7 @@ getXml = ()=>
// type errors in the mxCellCodec when putting the nodes into a new
// document. This happens in IE9 standards mode and with XML user
// objects only, as they are used directly as values in cells.
if (document.documentMode >= 9 || xml == null || xml.documentElement == null)
if (xml == null || xml.documentElement == null)
{
xml = mxUtils.parseXml(this.request.responseText);
}
@ -336,7 +336,7 @@ send = (onload, onerror, timeout, ontimeout)=>
this.request.withCredentials = 'true';
}
if ((document.documentMode == null || document.documentMode > 9) &&
if ((document.documentMode == null) &&
window.XMLHttpRequest && timeout != null && ontimeout != null)
{
this.request.timeout = timeout;

View File

@ -451,17 +451,8 @@ installListeners = (elt)=>
mxEvent.addListener(elt, evtName, resizeHandler);
mxEvent.addListener(window, 'resize', resizeHandler);
if (document.documentMode >= 9)
{
mxEvent.addListener(elt, 'DOMNodeRemoved', resizeHandler);
mxEvent.addListener(elt, 'DOMNodeInserted', resizeHandler);
}
else
{
mxEvent.addListener(elt, 'cut', resizeHandler);
mxEvent.addListener(elt, 'paste', resizeHandler);
}
mxEvent.addListener(elt, 'cut', resizeHandler);
mxEvent.addListener(elt, 'paste', resizeHandler);
};
/**
@ -604,7 +595,7 @@ resize = ()=>
this.textarea.style.whiteSpace = 'normal';
// Forces automatic reflow if text is removed from an oversize label and normal word wrap
var tmp = Math.round(this.bounds.width / ((document.documentMode == 8) ? scale : scale)) + this.wordWrapPadding;
var tmp = Math.round(this.bounds.width / scale) + this.wordWrapPadding;
if (this.textarea.style.position != 'relative')
{

View File

@ -692,25 +692,6 @@ validateBackgroundImage = ()=>
this.backgroundImage.dialect = this.graph.dialect;
this.backgroundImage.init(this.backgroundPane);
this.backgroundImage.redraw();
// Workaround for ignored event on background in IE8 standards mode
if (document.documentMode == 8 && !mxClient.IS_EM)
{
mxEvent.addGestureListeners(this.backgroundImage.node,
mxUtils.bind(this, (evt)=>
{
this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN, new mxMouseEvent(evt));
}),
mxUtils.bind(this, (evt)=>
{
this.graph.fireMouseEvent(mxEvent.MOUSE_MOVE, new mxMouseEvent(evt));
}),
mxUtils.bind(this, (evt)=>
{
this.graph.fireMouseEvent(mxEvent.MOUSE_UP, new mxMouseEvent(evt));
})
);
}
}
this.redrawBackgroundImage(this.backgroundImage, bg);

View File

@ -160,16 +160,6 @@ minScale = 0.0001;
*/
suspended = false;
/**
* Variable: forceVmlHandles
*
* Specifies if VML should be used to render the handles in this control. This
* is true for IE8 standards mode and false for all other browsers and modes.
* This is a workaround for rendering issues of HTML elements over elements
* with filters in IE 8 standards mode.
*/
forceVmlHandles = document.documentMode == 8;
/**
* Function: createGraph
*

View File

@ -352,21 +352,6 @@ getWindow = ()=>
getDoctype = ()=>
{
var dt = '';
if (document.documentMode == 5)
{
dt = '<meta http-equiv="X-UA-Compatible" content="IE=5">';
}
else if (document.documentMode == 8)
{
dt = '<meta http-equiv="X-UA-Compatible" content="IE=8">';
}
else if (document.documentMode > 8)
{
// Comment needed to make standards doctype apply in IE
dt = '<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]-->';
}
return dt;
};
@ -533,7 +518,7 @@ open = (css, targetWindow, forcePageBreaks, keepOpen)=>
// to create the complete page and then copy it over to the
// new window.document. This can be fixed later by using the
// ownerDocument of the container in mxShape and mxGraphView.
if (isNewWindow && (document.documentMode >= 11 || mxClient.IS_EDGE))
if (isNewWindow && mxClient.IS_EDGE)
{
// For some obscure reason, removing the DIV from the
// parent before fetching its outerHTML has missing
@ -542,7 +527,7 @@ open = (css, targetWindow, forcePageBreaks, keepOpen)=>
doc.writeln(div.outerHTML);
div.parentNode.removeChild(div);
}
else if (document.documentMode >= 11 || mxClient.IS_EDGE)
else if (mxClient.IS_EDGE)
{
var clone = doc.createElement('div');
clone.innerHTML = div.outerHTML;
@ -825,19 +810,6 @@ renderPage = (w, h, dx, dy, content, pageNumber)=>
viewport.style.marginLeft = dx + 'px';
viewport.style.marginTop = dy + 'px';
// FIXME: IE8 standards output problems
if (doc.documentMode == 8)
{
innerDiv.style.position = 'absolute';
viewport.style.position = 'absolute';
}
if (doc.documentMode == 10)
{
viewport.style.width = '100%';
viewport.style.height = '100%';
}
innerDiv.appendChild(viewport);
div.appendChild(innerDiv);
document.body.appendChild(div);
@ -851,12 +823,6 @@ renderPage = (w, h, dx, dy, content, pageNumber)=>
div.style.overflow = 'hidden';
div.style.pageBreakInside = 'avoid';
// IE8 uses above branch currently
if (doc.documentMode == 8)
{
div.style.position = 'relative';
}
var innerDiv = document.createElement('div');
innerDiv.style.width = (w - 2 * this.border) + 'px';
innerDiv.style.height = (h - 2 * this.border) + 'px';