removed more references to vml

development
mcyph 2021-03-21 23:04:36 +11:00
parent 1727af552d
commit 85c51d327e
15 changed files with 21 additions and 138 deletions

View File

@ -131,7 +131,7 @@ class mxCellHighlight {
if (
!this.keepOnTop &&
this.shape.node.parentNode.firstChild != this.shape.node
this.shape.node.parentNode.firstChild !== this.shape.node
) {
this.shape.node.parentNode.insertBefore(
this.shape.node,
@ -156,14 +156,11 @@ class mxCellHighlight {
shape.isDashed = this.dashed;
shape.isShadow = false;
shape.dialect =
this.graph.dialect != mxConstants.DIALECT_SVG
? mxConstants.DIALECT_VML
: mxConstants.DIALECT_SVG;
shape.dialect = mxConstants.DIALECT_SVG;
shape.init(this.graph.getView().getOverlayPane());
mxEvent.redirectMouseEvents(shape.node, this.graph, this.state);
if (this.graph.dialect != mxConstants.DIALECT_SVG) {
if (this.graph.dialect !== mxConstants.DIALECT_SVG) {
shape.pointerEvents = false;
} else {
shape.svgPointerEvents = 'stroke';
@ -232,7 +229,7 @@ class mxCellHighlight {
* Marks the <markedState> and fires a <mark> event.
*/
highlight = state => {
if (this.state != state) {
if (this.state !== state) {
if (this.shape != null) {
this.shape.destroy();
this.shape = null;
@ -258,7 +255,7 @@ class mxCellHighlight {
let elt = document.elementFromPoint(x, y);
while (elt != null) {
if (elt == this.shape.node) {
if (elt === this.shape.node) {
hit = true;
break;
}

View File

@ -471,10 +471,7 @@ class mxConnectionHandler extends mxEventSource {
this.livePreview && this.edgeState != null
? this.graph.cellRenderer.createShape(this.edgeState)
: new mxPolyline([], mxConstants.INVALID_COLOR);
shape.dialect =
this.graph.dialect !== mxConstants.DIALECT_SVG
? mxConstants.DIALECT_VML
: mxConstants.DIALECT_SVG;
shape.dialect = mxConstants.DIALECT_SVG;
shape.scale = this.graph.view.scale;
shape.pointerEvents = false;
shape.isDashed = true;
@ -785,10 +782,7 @@ class mxConnectionHandler extends mxEventSource {
icon.dialect = mxConstants.DIALECT_STRICTHTML;
icon.init(this.graph.container);
} else {
icon.dialect =
this.graph.dialect === mxConstants.DIALECT_SVG
? mxConstants.DIALECT_SVG
: mxConstants.DIALECT_VML;
icon.dialect = mxConstants.DIALECT_SVG;
icon.init(this.graph.getView().getOverlayPane());
// Move the icon back in the overlay pane

View File

@ -326,10 +326,7 @@ class mxConstraintHandler {
if (this.focusHighlight == null) {
const hl = this.createHighlightShape();
hl.dialect =
this.graph.dialect == mxConstants.DIALECT_SVG
? mxConstants.DIALECT_SVG
: mxConstants.DIALECT_VML;
hl.dialect = mxConstants.DIALECT_SVG
hl.pointerEvents = false;
hl.init(this.graph.getView().getOverlayPane());

View File

@ -257,10 +257,7 @@ class mxEdgeHandler {
) {
this.parentHighlight = this.createParentHighlightShape(pstate);
// VML dialect required here for event transparency in IE
this.parentHighlight.dialect =
this.graph.dialect !== mxConstants.DIALECT_SVG
? mxConstants.DIALECT_VML
: mxConstants.DIALECT_SVG;
this.parentHighlight.dialect = mxConstants.DIALECT_SVG;
this.parentHighlight.pointerEvents = false;
this.parentHighlight.rotation = Number(
pstate.style[mxConstants.STYLE_ROTATION] || '0'

View File

@ -774,10 +774,7 @@ class mxGraphHandler {
// Makes sure to use either VML or SVG shapes in order to implement
// event-transparency on the background area of the rectangle since
// HTML shapes do not let mouseevents through even when transparent
shape.dialect =
this.graph.dialect !== mxConstants.DIALECT_SVG
? mxConstants.DIALECT_VML
: mxConstants.DIALECT_SVG;
shape.dialect = mxConstants.DIALECT_SVG;
shape.init(this.graph.getView().getOverlayPane());
shape.pointerEvents = false;

View File

@ -209,10 +209,7 @@ class mxVertexHandler {
);
this.selectionBorder = this.createSelectionShape(this.bounds);
// VML dialect required here for event transparency in IE
this.selectionBorder.dialect =
this.graph.dialect !== mxConstants.DIALECT_SVG
? mxConstants.DIALECT_VML
: mxConstants.DIALECT_SVG;
this.selectionBorder.dialect = mxConstants.DIALECT_SVG;
this.selectionBorder.pointerEvents = false;
this.selectionBorder.rotation = Number(
this.state.style[mxConstants.STYLE_ROTATION] || '0'
@ -546,7 +543,7 @@ class mxVertexHandler {
shape.bounds.y = Math.floor(y - shape.bounds.height / 2);
// Fixes visible inactive handles in VML
if (shape.node != null && shape.node.style.display != 'none') {
if (shape.node != null && shape.node.style.display !== 'none') {
shape.redraw();
}
}
@ -718,10 +715,7 @@ class mxVertexHandler {
this.preview.dialect = mxConstants.DIALECT_STRICTHTML;
this.preview.init(this.graph.container);
} else {
this.preview.dialect =
this.graph.dialect != mxConstants.DIALECT_SVG
? mxConstants.DIALECT_VML
: mxConstants.DIALECT_SVG;
this.preview.dialect = mxConstants.DIALECT_SVG;
this.preview.init(this.graph.view.getOverlayPane());
}
}
@ -2149,10 +2143,7 @@ class mxVertexHandler {
) {
this.parentHighlight = this.createParentHighlightShape(pstate);
// VML dialect required here for event transparency in IE
this.parentHighlight.dialect =
this.graph.dialect !== mxConstants.DIALECT_SVG
? mxConstants.DIALECT_VML
: mxConstants.DIALECT_SVG;
this.parentHighlight.dialect = mxConstants.DIALECT_SVG;
this.parentHighlight.pointerEvents = false;
this.parentHighlight.rotation = Number(
pstate.style[mxConstants.STYLE_ROTATION] || '0'

View File

@ -10,13 +10,6 @@ import mxConstants from '../util/mxConstants';
import mxUtils from '../util/mxUtils';
class mxDoubleEllipse extends mxShape {
/**
* Variable: vmlScale
*
* Scale for improving the precision of VML rendering. Default is 10.
*/
vmlScale = 10;
/**
* Class: mxDoubleEllipse
*

View File

@ -9,7 +9,7 @@ const mxMarker = {
/**
* Class: mxMarker
*
* A static class that implements all markers for VML and SVG using a
* A static class that implements all markers for SVG using a
* registry. NOTE: The signatures in this class will change.
*
* Variable: markers

View File

@ -128,13 +128,6 @@ class mxShape {
*/
stencilPointerEvents = false;
/**
* Variable: vmlScale
*
* Scale for improving the precision of VML rendering. Default is 1.
*/
vmlScale = 1;
/**
* Variable: outline
*
@ -259,17 +252,6 @@ class mxShape {
this.flipV = false;
};
/**
* Function: isParseVml
*
* Specifies if any VML should be added via insertAdjacentHtml to the DOM. This
* is only needed in IE8 and only if the shape contains VML markup. This method
* returns true.
*/
isParseVml = () => {
return true;
};
/**
* Function: isHtmlAllowed
*

View File

@ -203,16 +203,6 @@ class mxText extends mxShape {
this.updateMargin();
}
/**
* Function: isParseVml
*
* Text shapes do not contain VML markup and do not need to be parsed. This
* method returns false to speed up rendering in IE8.
*/
isParseVml = () => {
return false;
};
/**
* Function: isHtmlAllowed
*
@ -771,19 +761,6 @@ class mxText extends mxShape {
c.setFontStyle(this.fontStyle);
};
/**
* Function: updateVmlContainer
*
* Sets the width and height of the container to 1px.
*/
updateVmlContainer = () => {
this.node.style.left = `${Math.round(this.bounds.x)}px`;
this.node.style.top = `${Math.round(this.bounds.y)}px`;
this.node.style.width = '1px';
this.node.style.height = '1px';
this.node.style.overflow = 'visible';
};
/**
* Function: getHtmlValue
*

View File

@ -63,13 +63,6 @@ const mxConstants = {
*/
DIALECT_SVG: 'svg',
/**
* Variable: DIALECT_VML
*
* Defines the VML display dialect name.
*/
DIALECT_VML: 'vml',
/**
* Variable: DIALECT_MIXEDHTML
*

View File

@ -3,6 +3,8 @@
* Copyright (c) 2006-2015, Gaudenz Alder
* Updated to ES9 syntax by David Morrissey 2021
*/
import mxConstants from "./mxConstants";
/**
* Class: mxGuide
*
@ -194,13 +196,10 @@ class mxGuide {
if (this.guideX == null) {
this.guideX = this.createGuideShape(true);
// Makes sure to use either VML or SVG shapes in order to implement
// Makes sure to use SVG shapes in order to implement
// event-transparency on the background area of the rectangle since
// HTML shapes do not let mouseevents through even when transparent
this.guideX.dialect =
this.graph.dialect != mxConstants.DIALECT_SVG
? mxConstants.DIALECT_VML
: mxConstants.DIALECT_SVG;
this.guideX.dialect = mxConstants.DIALECT_SVG;
this.guideX.pointerEvents = false;
this.guideX.init(this.graph.getView().getOverlayPane());
}
@ -236,13 +235,10 @@ class mxGuide {
if (this.guideY == null) {
this.guideY = this.createGuideShape(false);
// Makes sure to use either VML or SVG shapes in order to implement
// Makes sure to use SVG shapes in order to implement
// event-transparency on the background area of the rectangle since
// HTML shapes do not let mouseevents through even when transparent
this.guideY.dialect =
this.graph.dialect != mxConstants.DIALECT_SVG
? mxConstants.DIALECT_VML
: mxConstants.DIALECT_SVG;
this.guideY.dialect = mxConstants.DIALECT_SVG;
this.guideY.pointerEvents = false;
this.guideY.init(this.graph.getView().getOverlayPane());
}

View File

@ -637,19 +637,6 @@ const mxUtils = {
return s;
},
/**
* Function: isVml
*
* Returns true if the given node is in the VML namespace.
*
* Parameters:
*
* node - DOM node whose tag urn should be checked.
*/
isVml: node => {
return node != null && node.tagUrn == 'urn:schemas-microsoft-com:vml';
},
/**
* Function: getXml
*

View File

@ -261,12 +261,6 @@ class mxOutline {
);
this.selectionBorder.dialect = this.outline.dialect;
if (this.forceVmlHandles) {
this.selectionBorder.isHtmlAllowed = () => {
return false;
};
}
this.selectionBorder.init(this.outline.getView().getOverlayPane());
// Handles event by catching the initial pointer start and then listening to the
@ -294,12 +288,6 @@ class mxOutline {
// Creates a small blue rectangle for sizing (sizer handle)
this.sizer = this.createSizer();
if (this.forceVmlHandles) {
this.sizer.isHtmlAllowed = () => {
return false;
};
}
this.sizer.init(this.outline.getView().getOverlayPane());
if (this.enabled) {

View File

@ -822,10 +822,6 @@ class mxPrintPreview {
innerDiv.style.top = `${this.border}px`;
innerDiv.style.left = `${this.border}px`;
if (this.graph.dialect == mxConstants.DIALECT_VML) {
innerDiv.style.position = 'absolute';
}
div.appendChild(innerDiv);
document.body.appendChild(div);
arg = innerDiv;
@ -910,8 +906,6 @@ class mxPrintPreview {
dx = 0;
dy = 0;
}
} else if (this.graph.dialect == mxConstants.DIALECT_VML) {
view.createVml();
} else {
view.createHtml();
}