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

View File

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

View File

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

View File

@ -257,10 +257,7 @@ class mxEdgeHandler {
) { ) {
this.parentHighlight = this.createParentHighlightShape(pstate); this.parentHighlight = this.createParentHighlightShape(pstate);
// VML dialect required here for event transparency in IE // VML dialect required here for event transparency in IE
this.parentHighlight.dialect = this.parentHighlight.dialect = mxConstants.DIALECT_SVG;
this.graph.dialect !== mxConstants.DIALECT_SVG
? mxConstants.DIALECT_VML
: mxConstants.DIALECT_SVG;
this.parentHighlight.pointerEvents = false; this.parentHighlight.pointerEvents = false;
this.parentHighlight.rotation = Number( this.parentHighlight.rotation = Number(
pstate.style[mxConstants.STYLE_ROTATION] || '0' 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 // Makes sure to use either VML or SVG shapes in order to implement
// event-transparency on the background area of the rectangle since // event-transparency on the background area of the rectangle since
// HTML shapes do not let mouseevents through even when transparent // HTML shapes do not let mouseevents through even when transparent
shape.dialect = shape.dialect = mxConstants.DIALECT_SVG;
this.graph.dialect !== mxConstants.DIALECT_SVG
? mxConstants.DIALECT_VML
: mxConstants.DIALECT_SVG;
shape.init(this.graph.getView().getOverlayPane()); shape.init(this.graph.getView().getOverlayPane());
shape.pointerEvents = false; shape.pointerEvents = false;

View File

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

View File

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

View File

@ -9,7 +9,7 @@ const mxMarker = {
/** /**
* Class: 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. * registry. NOTE: The signatures in this class will change.
* *
* Variable: markers * Variable: markers

View File

@ -128,13 +128,6 @@ class mxShape {
*/ */
stencilPointerEvents = false; stencilPointerEvents = false;
/**
* Variable: vmlScale
*
* Scale for improving the precision of VML rendering. Default is 1.
*/
vmlScale = 1;
/** /**
* Variable: outline * Variable: outline
* *
@ -259,17 +252,6 @@ class mxShape {
this.flipV = false; 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 * Function: isHtmlAllowed
* *

View File

@ -203,16 +203,6 @@ class mxText extends mxShape {
this.updateMargin(); 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 * Function: isHtmlAllowed
* *
@ -771,19 +761,6 @@ class mxText extends mxShape {
c.setFontStyle(this.fontStyle); 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 * Function: getHtmlValue
* *

View File

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

View File

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

View File

@ -637,19 +637,6 @@ const mxUtils = {
return s; 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 * Function: getXml
* *

View File

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

View File

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