diff --git a/index.es.js b/index.es.js
index 4bf2f7f22..84ebad54d 100644
--- a/index.es.js
+++ b/index.es.js
@@ -376,14 +376,13 @@ var UPDATE_KEY = {
UPDATE_NODE: 0,
UPDATE_STYLE: 1,
UPDATE_FOCUS: 2,
- UPDATE_MEASURE: 3,
- UPDATE_COMPONENT: 4,
- UPDATE_OVERWRITE: 5,
- UPDATE_KEYS: 6,
- UPDATE_LIST: 7,
- UPDATE_CONFIG: 8,
- UPDATE_ADD_DOM: 9,
- UPDATE_REMOVE_DOM: 10
+ UPDATE_COMPONENT: 3,
+ UPDATE_OVERWRITE: 4,
+ UPDATE_KEYS: 5,
+ UPDATE_LIST: 6,
+ UPDATE_CONFIG: 7,
+ UPDATE_ADD_DOM: 8,
+ UPDATE_REMOVE_DOM: 9
}; // animation计算每帧使用
var KEY_FRAME_KEY = {
@@ -496,7 +495,8 @@ var enums = {
KEY_FRAME_KEY: KEY_FRAME_KEY,
NODE_KEY: NODE_KEY,
STRUCT_KEY: STRUCT_KEY,
- ANIMATE_KEY: ANIMATE_KEY
+ ANIMATE_KEY: ANIMATE_KEY,
+ ELLIPSIS: '…'
};
var _enums$STRUCT_KEY = enums.STRUCT_KEY,
@@ -529,6 +529,7 @@ var Node = /*#__PURE__*/function () {
this.__domParent = null;
this.__root = null;
this.__host = null;
+ this.__virtualDom = null;
}
_createClass(Node, [{
@@ -754,9 +755,8 @@ var o$1 = {
lgr: 0.03271484375,
// line-gap ratio,67/2048,默认0
// 个别字符误差,初次之外误差还有根据经验得的比例系数,https://github.com/karasjs/karas/issues/145
- padding: {
- 1: 1,
- f: 0.9
+ padding: {// 1: 1,
+ // f: 0.9,
}
},
helvetica: {
@@ -820,7 +820,7 @@ var o$1 = {
}
},
support: function support(fontFamily) {
- return this.info.hasOwnProperty(fontFamily);
+ return this.info.hasOwnProperty(fontFamily) && this.info[fontFamily].checked;
},
register: function register(name, info) {
var _ref = info || {},
@@ -841,6 +841,15 @@ var o$1 = {
padding: padding
};
},
+ hasRegister: function hasRegister(fontFamily) {
+ return this.info.hasOwnProperty(fontFamily);
+ },
+ hasChecked: function hasChecked(fontFamily) {
+ return this.hasRegister(fontFamily) && this.info[fontFamily].hasOwnProperty('checked');
+ },
+ setChecked: function setChecked(fontFamily, res) {
+ return this.info[fontFamily].checked = res;
+ },
addPadding: function addPadding(name, padding) {
Object.assign(this.info[name.toLowerCase()].padding, padding);
}
@@ -2381,6 +2390,91 @@ var painter = {
svgFilter: canvasFilter
};
+var _enums$STYLE_KEY$1 = enums.STYLE_KEY,
+ FONT_SIZE = _enums$STYLE_KEY$1.FONT_SIZE,
+ FONT_FAMILY = _enums$STYLE_KEY$1.FONT_FAMILY,
+ FONT_WEIGHT = _enums$STYLE_KEY$1.FONT_WEIGHT,
+ FONT_STYLE = _enums$STYLE_KEY$1.FONT_STYLE,
+ COLOR = _enums$STYLE_KEY$1.COLOR,
+ NODE_VIRTUAL_DOM = enums.NODE_KEY.NODE_VIRTUAL_DOM;
+var CANVAS = mode.CANVAS,
+ SVG = mode.SVG,
+ WEBGL = mode.WEBGL;
+var CHAR = '…';
+
+var Ellipsis = /*#__PURE__*/function (_Node) {
+ _inherits(Ellipsis, _Node);
+
+ var _super = _createSuper(Ellipsis);
+
+ function Ellipsis(x, y, width, parent) {
+ var _this;
+
+ _classCallCheck(this, Ellipsis);
+
+ _this = _super.call(this);
+ _this.__x = _this.__sx1 = x;
+ _this.__y = _this.__sy1 = y;
+ _this.__width = width;
+ _this.__parent = _this.__domParent = parent;
+ parent.__ellipsis = _assertThisInitialized(_this);
+ _this.__parentLineBox = null;
+ _this.__baseline = css.getBaseline(parent.computedStyle);
+ return _this;
+ }
+
+ _createClass(Ellipsis, [{
+ key: "render",
+ value: function render(renderMode, lv, ctx, cache) {
+ var dx = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
+ var dy = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
+ var x = this.x,
+ y = this.y,
+ parent = this.parent;
+ var ox = parent.ox,
+ oy = parent.oy,
+ computedStyle = parent.computedStyle,
+ color = parent.cacheStyle[COLOR];
+ y += css.getBaseline(computedStyle);
+ x += ox + dx;
+ y += oy + dy;
+
+ if (renderMode === CANVAS || renderMode === WEBGL) {
+ var font = css.setFontStyle(computedStyle);
+
+ if (ctx.font !== font) {
+ ctx.font = font;
+ }
+
+ if (ctx.fillStyle !== color) {
+ ctx.fillStyle = color;
+ }
+
+ ctx.fillText(CHAR, x, y);
+ } else if (renderMode === SVG) {
+ var props = [['x', x], ['y', y], ['fill', color], ['font-family', computedStyle[FONT_FAMILY]], ['font-weight', computedStyle[FONT_WEIGHT]], ['font-style', computedStyle[FONT_STYLE]], ['font-size', computedStyle[FONT_SIZE] + 'px']];
+ var vd = this.__config[NODE_VIRTUAL_DOM] = this.__virtualDom = {
+ type: 'text',
+ children: [{
+ type: 'item',
+ tagName: 'text',
+ props: props,
+ content: CHAR
+ }]
+ };
+ parent.virtualDom.children.push(vd);
+ }
+ }
+ }, {
+ key: "parentLineBox",
+ get: function get() {
+ return this.__parentLineBox;
+ }
+ }]);
+
+ return Ellipsis;
+}(Node);
+
var H$1 = geom.H;
var PX = o.PX,
PERCENT = o.PERCENT,
@@ -2391,18 +2485,18 @@ var PX = o.PX,
VMIN = o.VMIN;
var canvasPolygon$1 = painter.canvasPolygon,
svgPolygon$1 = painter.svgPolygon;
-var _enums$STYLE_KEY$1 = enums.STYLE_KEY,
- BORDER_LEFT_WIDTH = _enums$STYLE_KEY$1.BORDER_LEFT_WIDTH,
- BORDER_TOP_WIDTH = _enums$STYLE_KEY$1.BORDER_TOP_WIDTH,
- BORDER_BOTTOM_WIDTH = _enums$STYLE_KEY$1.BORDER_BOTTOM_WIDTH,
- PADDING_LEFT = _enums$STYLE_KEY$1.PADDING_LEFT,
- PADDING_BOTTOM = _enums$STYLE_KEY$1.PADDING_BOTTOM,
- PADDING_TOP = _enums$STYLE_KEY$1.PADDING_TOP,
- BORDER_TOP_LEFT_RADIUS = _enums$STYLE_KEY$1.BORDER_TOP_LEFT_RADIUS,
- BORDER_TOP_RIGHT_RADIUS = _enums$STYLE_KEY$1.BORDER_TOP_RIGHT_RADIUS,
- BORDER_BOTTOM_LEFT_RADIUS = _enums$STYLE_KEY$1.BORDER_BOTTOM_LEFT_RADIUS,
- BORDER_BOTTOM_RIGHT_RADIUS = _enums$STYLE_KEY$1.BORDER_BOTTOM_RIGHT_RADIUS,
- FONT_SIZE = _enums$STYLE_KEY$1.FONT_SIZE;
+var _enums$STYLE_KEY$2 = enums.STYLE_KEY,
+ BORDER_LEFT_WIDTH = _enums$STYLE_KEY$2.BORDER_LEFT_WIDTH,
+ BORDER_TOP_WIDTH = _enums$STYLE_KEY$2.BORDER_TOP_WIDTH,
+ BORDER_BOTTOM_WIDTH = _enums$STYLE_KEY$2.BORDER_BOTTOM_WIDTH,
+ PADDING_LEFT = _enums$STYLE_KEY$2.PADDING_LEFT,
+ PADDING_BOTTOM = _enums$STYLE_KEY$2.PADDING_BOTTOM,
+ PADDING_TOP = _enums$STYLE_KEY$2.PADDING_TOP,
+ BORDER_TOP_LEFT_RADIUS = _enums$STYLE_KEY$2.BORDER_TOP_LEFT_RADIUS,
+ BORDER_TOP_RIGHT_RADIUS = _enums$STYLE_KEY$2.BORDER_TOP_RIGHT_RADIUS,
+ BORDER_BOTTOM_LEFT_RADIUS = _enums$STYLE_KEY$2.BORDER_BOTTOM_LEFT_RADIUS,
+ BORDER_BOTTOM_RIGHT_RADIUS = _enums$STYLE_KEY$2.BORDER_BOTTOM_RIGHT_RADIUS,
+ FONT_SIZE$1 = _enums$STYLE_KEY$2.FONT_SIZE;
/* 获取合适的虚线实体空白宽度ps/pd和数量n
* 总长total,start边长bs,end边长be,内容长w,
* 实体长范围[smin,smax],空白长范围[dmin,dmax]
@@ -4636,7 +4730,7 @@ function calBorderRadius(w, h, currentStyle, computedStyle, root) {
} else if (item[1] === PERCENT) {
return Math.max(0, item[0] * (i ? h : w) * 0.01);
} else if (item[1] === REM) {
- return Math.max(0, item[0] * root.computedStyle[FONT_SIZE]);
+ return Math.max(0, item[0] * root.computedStyle[FONT_SIZE$1]);
} else if (item[1] === VW) {
return Math.max(0, item[0] * root.width * 0.01);
} else if (item[1] === VH) {
@@ -4683,6 +4777,10 @@ function calBorderRadiusInline(contentBoxList, currentStyle, computedStyle) {
if (contentBoxList.length) {
first = contentBoxList[0];
last = contentBoxList[contentBoxList.length - 1];
+
+ if (last instanceof Ellipsis) {
+ last = contentBoxList[contentBoxList.length - 2];
+ }
} // 先看first的左侧
@@ -4898,8 +4996,7 @@ function joinVd(vd) {
overflow = vd.overflow,
filter = vd.filter,
mixBlendMode = vd.mixBlendMode;
- return '' + _s2 + '';
+ return '' + _s2 + '';
}
}
@@ -5364,18 +5461,6 @@ var debug = {
flag: false
};
-var textCache = {
- list: [],
- // 每次渲染前的更新后,等待测量的文字对象列表
- data: {},
- // Text中存入的特殊等待测量的信息,字体+字号+粗细为key
- charWidth: {},
- // key的文字宽度hash
- padding: {},
- // key的文字宽度偏移,少量字体的少量文字有
- ELLIPSIS: '…'
-};
-
var ca = {
alpha: true,
antialias: true,
@@ -5955,8 +6040,8 @@ var webgl = {
};
var SPF = 1000 / 60;
-var CANVAS = {};
-var WEBGL = {};
+var CANVAS$1 = {};
+var WEBGL$1 = {};
var CANVAS_LIST = [];
var WEBGL_LIST = [];
var SUPPORT_OFFSCREEN_CANVAS = typeof OffscreenCanvas === 'function' && util.isFunction(OffscreenCanvas.prototype.getContext);
@@ -5966,7 +6051,7 @@ function cache(key, width, height, hash, message) {
var o;
if (!key) {
- var target = hash === CANVAS ? CANVAS_LIST : WEBGL_LIST;
+ var target = hash === CANVAS$1 ? CANVAS_LIST : WEBGL_LIST;
if (target.length) {
o = target.pop();
@@ -5985,7 +6070,7 @@ function cache(key, width, height, hash, message) {
if (debug.flag) {
o.style.width = width + 'px';
o.style.height = height + 'px';
- o.setAttribute('type', hash === CANVAS ? 'canvas' : 'webgl');
+ o.setAttribute('type', hash === CANVAS$1 ? 'canvas' : 'webgl');
if (key) {
o.setAttribute('key', key);
@@ -6000,7 +6085,7 @@ function cache(key, width, height, hash, message) {
var ctx;
- if (hash === CANVAS) {
+ if (hash === CANVAS$1) {
ctx = o.getContext('2d');
} else {
ctx = o.getContext('webgl', ca) || o.getContext('experimental-webgl', ca);
@@ -6015,7 +6100,7 @@ function cache(key, width, height, hash, message) {
available: true,
release: function release() {
if (!key && this.available) {
- if (hash === CANVAS) {
+ if (hash === CANVAS$1) {
CANVAS_LIST.push(this.canvas);
} else {
WEBGL_LIST.push(this.canvas);
@@ -6028,11 +6113,11 @@ function cache(key, width, height, hash, message) {
}
function cacheCanvas(key, width, height, message) {
- return cache(key, width, height, CANVAS, message);
+ return cache(key, width, height, CANVAS$1, message);
}
function cacheWebgl(key, width, height, message) {
- return cache(key, width, height, WEBGL, message);
+ return cache(key, width, height, WEBGL$1, message);
}
var IMG = {};
@@ -6041,96 +6126,55 @@ var LOADING = 1;
var LOADED = 2;
var FONT = {};
var COMPONENT = {};
-var inject = {
- measureText: function measureText() {
- var list = textCache.list,
- data = textCache.data;
- var html = '';
- var keys = [];
- var lengths = [];
- var chars = [];
- Object.keys(data).forEach(function (key) {
- var _data$key = data[key],
- ff = _data$key.ff,
- fs = _data$key.fs,
- fw = _data$key.fw,
- s = _data$key.s;
-
- if (s) {
- keys.push(key);
- lengths.push(s.length);
- var inline = "position:absolute;font-family:".concat(ff, ";font-size:").concat(fs, "px;font-weight:").concat(fw);
-
- for (var i = 0, len = s.length; i < len; i++) {
- var _char = s.charAt(i);
-
- chars.push(_char);
- html += "").concat(_char.replace(/, '<').replace(' ', ' '), "");
- }
-
- data[key].s = '';
- }
- });
+var div;
- if (!html) {
- return;
+function createDiv() {
+ div = document.createElement('div');
+ div.style.position = 'absolute';
+ div.style.left = '99999px';
+ div.style.top = '-99999px';
+ div.style.visibility = 'hidden';
+ div.style.whiteSpace = 'nowrap';
+ document.body.appendChild(div);
+}
+
+var inject = {
+ measureTextSync: function measureTextSync(str, ff, fs, fw) {
+ if (!div) {
+ createDiv();
}
- var div = document.createElement('div');
- div.style.position = 'absolute';
- div.style.left = '99999px';
- div.style.top = '-99999px';
- div.style.visibility = 'hidden';
- document.body.appendChild(div);
- div.innerHTML = html;
- var cns = div.childNodes;
- var charWidth = textCache.charWidth;
- var count = 0,
- index = 0,
- key;
+ div.style.fontFamily = ff;
+ div.style.fontSize = fs + 'px';
+ div.style.fontWeight = fw;
+ div.innerHTML = str.replace(/' + str.charAt(i).replace('<', '<').replace(/[ \n]/, ' ') + '';
+ }
- if (++count === lengths[index]) {
- index++;
- count = 0;
- }
+ div.innerHTML = s;
+ var max = 0;
+ var cns = div.childNodes;
- var _char2 = chars[i]; // clientWidth只返回ceil整数,精度必须用getComputedStyle
+ for (var _i = 0, _len = cns.length; _i < _len; _i++) {
+ var node = cns[_i]; // clientWidth只返回ceil整数,精度必须用getComputedStyle
- var css = window.getComputedStyle(node, null);
- charWidth[key][_char2] = parseFloat(css.width);
+ max = Math.max(max, parseFloat(window.getComputedStyle(node, null).width));
}
- list.forEach(function (text) {
- return text.__measureCb();
- });
- textCache.list = [];
- textCache.data = {};
-
- if (!debug.flag) {
- document.body.removeChild(div);
- }
- },
- measureTextSync: function measureTextSync(key, ff, fs, fw, _char3) {
- var inline = "position:absolute;font-family:".concat(ff, ";font-size:").concat(fs, "px;font-weight:").concat(fw);
- var html = "").concat(_char3, "").concat(_char3).concat(_char3, "");
- var div = document.createElement('div');
- div.style.position = 'absolute';
- div.style.left = '99999px';
- div.style.top = '-99999px';
- div.style.visibility = 'hidden';
- document.body.appendChild(div);
- div.innerHTML = html;
- var cns = div.childNodes;
- var w1 = parseFloat(window.getComputedStyle(cns[0], null).width);
- var w2 = parseFloat(window.getComputedStyle(cns[1], null).width);
- return w1 * 2 - w2;
+ return max;
},
IMG: IMG,
INIT: INIT,
@@ -6294,7 +6338,7 @@ var inject = {
return Date.now();
},
hasCacheCanvas: function hasCacheCanvas(key) {
- return key && CANVAS.hasOwnProperty(key);
+ return key && CANVAS$1.hasOwnProperty(key);
},
getCacheCanvas: function getCacheCanvas(width, height, key, message) {
return cacheCanvas(key, width, height, message);
@@ -6303,10 +6347,10 @@ var inject = {
CANVAS_LIST.push(o);
},
delCacheCanvas: function delCacheCanvas(key) {
- key && delete CANVAS[key];
+ key && delete CANVAS$1[key];
},
hasCacheWebgl: function hasCacheWebgl(key) {
- return key && WEBGL.hasOwnProperty(key);
+ return key && WEBGL$1.hasOwnProperty(key);
},
getCacheWebgl: function getCacheWebgl(width, height, key, message) {
return cacheWebgl(key, width, height, message);
@@ -6315,7 +6359,7 @@ var inject = {
WEBGL_LIST.push(o);
},
delCacheWebgl: function delCacheWebgl(key) {
- key && delete WEBGL[key];
+ key && delete WEBGL$1[key];
},
isDom: function isDom(o) {
if (o) {
@@ -6348,10 +6392,14 @@ var inject = {
return o instanceof WebGLTexture;
}
},
+ defaultFontFamily: 'arial',
+ getFontCanvas: function getFontCanvas() {
+ return inject.getCacheCanvas(16, 16, '__$$CHECK_SUPPORT_FONT_FAMILY$$__');
+ },
checkSupportFontFamily: function checkSupportFontFamily(ff) {
ff = ff.toLowerCase(); // 强制arial兜底
- if (ff === 'arial' || ff === 'serif' || ff === 'sans-serif' || ff === 'sansserif') {
+ if (ff === this.defaultFontFamily || ff === 'serif' || ff === 'sans-serif' || ff === 'sansserif') {
return true;
}
@@ -6363,7 +6411,7 @@ var inject = {
return o$1.info[ff].checked;
}
- var canvas = inject.getCacheCanvas(16, 16, '__$$CHECK_SUPPORT_FONT_FAMILY$$__');
+ var canvas = inject.getFontCanvas();
var context = canvas.ctx;
context.textAlign = 'center';
context.fillStyle = '#000';
@@ -6371,7 +6419,7 @@ var inject = {
if (!defaultFontFamilyData) {
context.clearRect(0, 0, 16, 16);
- context.font = '16px arial';
+ context.font = '16px ' + this.defaultFontFamily;
context.fillText('a', 8, 8);
canvas.draw();
defaultFontFamilyData = context.getImageData(0, 0, 16, 16).data;
@@ -6552,9 +6600,8 @@ var PX$1 = o.PX,
VMIN$1 = o.VMIN,
calUnit = o.calUnit;
var d2r$1 = geom.d2r;
-var canvasPolygon$2 = painter.canvasPolygon,
- svgPolygon$2 = painter.svgPolygon;
-var FONT_SIZE$1 = enums.STYLE_KEY.FONT_SIZE,
+var canvasPolygon$2 = painter.canvasPolygon;
+var FONT_SIZE$2 = enums.STYLE_KEY.FONT_SIZE,
NODE_DEFS_CACHE = enums.NODE_KEY.NODE_DEFS_CACHE;
function getLinearDeg(v) {
@@ -6620,7 +6667,7 @@ function getColorStop(v, length, root) {
if (p[1] === PERCENT$1) {
list.push([item[0], p[0] * 0.01]);
} else if (p[1] === REM$1) {
- list.push([item[0], p[0] * root.computedStyle[FONT_SIZE$1] / length]);
+ list.push([item[0], p[0] * root.computedStyle[FONT_SIZE$2] / length]);
} else if (p[1] === VW$1) {
list.push([item[0], p[0] * root.width / length]);
} else if (p[1] === VH$1) {
@@ -6810,7 +6857,7 @@ function calCircleCentre(position, x1, y1, iw, ih, root) {
if (positionX[1] === PERCENT$1) {
cx = x1 + positionX[0] * iw * 0.01;
} else if (positionX[1] === REM$1) {
- cx = x1 + positionX[0] * root.computedStyle[FONT_SIZE$1];
+ cx = x1 + positionX[0] * root.computedStyle[FONT_SIZE$2];
} else if (positionX[1] === VW$1) {
cx = x1 + positionX[0] * root.width * 0.01;
} else if (positionX[1] === VH$1) {
@@ -6826,7 +6873,7 @@ function calCircleCentre(position, x1, y1, iw, ih, root) {
if (positionY[1] === PERCENT$1) {
cy = y1 + positionY[0] * ih * 0.01;
} else if (positionY[1] === REM$1) {
- cy = y1 + positionY[0] * root.computedStyle[FONT_SIZE$1];
+ cy = y1 + positionY[0] * root.computedStyle[FONT_SIZE$2];
} else if (positionY[1] === VW$1) {
cy = y1 + positionY[0] * root.width * 0.01;
} else if (positionY[1] === VH$1) {
@@ -7289,44 +7336,6 @@ function renderConic(xom, renderMode, ctx, res, x, y, w, h, btlr, btrr, bbrr, bb
ctx.drawImage(offscreen.canvas, x, y);
ctx.restore();
offscreen.ctx.clearRect(0, 0, w, h);
- } else if (renderMode === mode.SVG) {
- if (isInline) {
- var v = {
- tagName: 'symbol',
- props: [],
- children: []
- };
-
- xom.__config[NODE_DEFS_CACHE].push(v);
-
- res.forEach(function (item) {
- v.children.push({
- type: 'item',
- tagName: 'path',
- props: [['d', svgPolygon$2(item[0])], ['fill', item[1]]]
- });
- });
- return ctx.add(v);
- } else {
- var _v2 = {
- tagName: 'clipPath',
- children: [{
- tagName: 'path',
- props: [['d', svgPolygon$2(list)]]
- }]
- };
-
- xom.__config[NODE_DEFS_CACHE].push(_v2);
-
- var clip = ctx.add(_v2);
- res.forEach(function (item) {
- xom.virtualDom.bb.push({
- type: 'item',
- tagName: 'path',
- props: [['d', svgPolygon$2(item[0])], ['fill', item[1]], ['clip-path', 'url(#' + clip + ')']]
- });
- });
- }
}
}
@@ -7458,7 +7467,10 @@ Object.keys(GEOM).forEach(function (k) {
});
});
var INHERIT = {
- fontFamily: 'arial',
+ get fontFamily() {
+ return inject.defaultFontFamily;
+ },
+
fontSize: 16,
fontWeight: 400,
fontStyle: 'normal',
@@ -7885,10 +7897,9 @@ var key = {
GRADIENT_TYPE: GRADIENT_TYPE
};
-var _REPAINT, _MEASURE;
+var _REPAINT;
var RESET_DOM = reset.DOM,
RESET_GEOM = reset.GEOM;
-var INHERIT$1 = o.INHERIT;
var STYLE_KEY$2 = enums.STYLE_KEY;
var GEOM$1 = {};
var GEOM_KEY_SET$1 = [];
@@ -7896,13 +7907,11 @@ var GEOM_KEY_SET$1 = [];
var IGNORE = _defineProperty({}, STYLE_KEY$2.POINTER_EVENTS, true);
var REPAINT = (_REPAINT = {}, _defineProperty(_REPAINT, STYLE_KEY$2.TRANSFORM, true), _defineProperty(_REPAINT, STYLE_KEY$2.TRANSLATE_X, true), _defineProperty(_REPAINT, STYLE_KEY$2.TRANSLATE_Y, true), _defineProperty(_REPAINT, STYLE_KEY$2.SKEW_X, true), _defineProperty(_REPAINT, STYLE_KEY$2.SKEW_Y, true), _defineProperty(_REPAINT, STYLE_KEY$2.SCALE_X, true), _defineProperty(_REPAINT, STYLE_KEY$2.SCALE_Y, true), _defineProperty(_REPAINT, STYLE_KEY$2.ROTATE_Z, true), _defineProperty(_REPAINT, STYLE_KEY$2.COLOR, true), _defineProperty(_REPAINT, STYLE_KEY$2.FONT_STYLE, true), _defineProperty(_REPAINT, STYLE_KEY$2.STROKE_WIDTH, true), _defineProperty(_REPAINT, STYLE_KEY$2.FILL, true), _defineProperty(_REPAINT, STYLE_KEY$2.STROKE_DASHARRAY, true), _defineProperty(_REPAINT, STYLE_KEY$2.STROKE_LINECAP, true), _defineProperty(_REPAINT, STYLE_KEY$2.STROKE_LINEJOIN, true), _defineProperty(_REPAINT, STYLE_KEY$2.STROKE_MITERLIMIT, true), _defineProperty(_REPAINT, STYLE_KEY$2.BACKGROUND_COLOR, true), _defineProperty(_REPAINT, STYLE_KEY$2.BACKGROUND_IMAGE, true), _defineProperty(_REPAINT, STYLE_KEY$2.BACKGROUND_POSITION_X, true), _defineProperty(_REPAINT, STYLE_KEY$2.BACKGROUND_POSITION_Y, true), _defineProperty(_REPAINT, STYLE_KEY$2.BACKGROUND_REPEAT, true), _defineProperty(_REPAINT, STYLE_KEY$2.BACKGROUND_SIZE, true), _defineProperty(_REPAINT, STYLE_KEY$2.STROKE, true), _defineProperty(_REPAINT, STYLE_KEY$2.BORDER_BOTTOM_COLOR, true), _defineProperty(_REPAINT, STYLE_KEY$2.BORDER_LEFT_COLOR, true), _defineProperty(_REPAINT, STYLE_KEY$2.BORDER_RIGHT_COLOR, true), _defineProperty(_REPAINT, STYLE_KEY$2.BORDER_TOP_COLOR, true), _defineProperty(_REPAINT, STYLE_KEY$2.BORDER_TOP_LEFT_RADIUS, true), _defineProperty(_REPAINT, STYLE_KEY$2.BORDER_TOP_RIGHT_RADIUS, true), _defineProperty(_REPAINT, STYLE_KEY$2.BORDER_BOTTOM_RIGHT_RADIUS, true), _defineProperty(_REPAINT, STYLE_KEY$2.BORDER_BOTTOM_LEFT_RADIUS, true), _defineProperty(_REPAINT, STYLE_KEY$2.VISIBILITY, true), _defineProperty(_REPAINT, STYLE_KEY$2.OPACITY, true), _defineProperty(_REPAINT, STYLE_KEY$2.Z_INDEX, true), _defineProperty(_REPAINT, STYLE_KEY$2.FILTER, true), _defineProperty(_REPAINT, STYLE_KEY$2.BOX_SHADOW, true), _defineProperty(_REPAINT, STYLE_KEY$2.OVERFLOW, true), _defineProperty(_REPAINT, STYLE_KEY$2.BACKGROUND_CLIP, true), _defineProperty(_REPAINT, STYLE_KEY$2.TEXT_STROKE_WIDTH, true), _defineProperty(_REPAINT, STYLE_KEY$2.TEXT_STROKE_COLOR, true), _defineProperty(_REPAINT, STYLE_KEY$2.TEXT_STROKE_OVER, true), _REPAINT);
-var MEASURE = (_MEASURE = {}, _defineProperty(_MEASURE, STYLE_KEY$2.FONT_SIZE, true), _defineProperty(_MEASURE, STYLE_KEY$2.FONT_WEIGHT, true), _defineProperty(_MEASURE, STYLE_KEY$2.FONT_FAMILY, true), _MEASURE);
var o$2 = {
GEOM: GEOM$1,
GEOM_KEY_SET: GEOM_KEY_SET$1,
IGNORE: IGNORE,
REPAINT: REPAINT,
- MEASURE: MEASURE,
addGeom: function addGeom(tagName, ks, cb) {
if (Array.isArray(ks)) {
ks.forEach(function (k) {
@@ -7926,9 +7935,6 @@ var o$2 = {
isRepaint: function isRepaint(k, tagName) {
return REPAINT.hasOwnProperty(k) || o$2.isGeom(tagName, k);
},
- isMeasure: function isMeasure(k) {
- return MEASURE.hasOwnProperty(k);
- },
isValid: function isValid(tagName, k) {
if (!k) {
return false;
@@ -7954,39 +7960,6 @@ var o$2 = {
return false;
}
};
-var MEASURE_KEY_SET = o$2.MEASURE_KEY_SET = Object.keys(MEASURE).map(function (i) {
- return parseInt(i);
-});
-var len = MEASURE_KEY_SET.length;
-
-o$2.isMeasureInherit = function (target) {
- if (target) {
- for (var i = 0; i < len; i++) {
- var k = MEASURE_KEY_SET[i];
-
- if (target.hasOwnProperty(k) && target[k][1] === INHERIT$1) {
- return true;
- }
- }
- }
-
- return false;
-};
-
-o$2.measureInheritList = function (target) {
- var list = [];
-
- for (var i = 0; i < len; i++) {
- var k = MEASURE_KEY_SET[i];
-
- if (target.hasOwnProperty(k) && target[k][1] === INHERIT$1) {
- list.push(k);
- }
- }
-
- return list;
-};
-
o$2.addGeom('$line', ['x1', 'y1', 'x2', 'y2', 'controlA', 'controlB', 'start', 'end']);
o$2.addGeom('$circle', ['r']);
o$2.addGeom('$ellipse', ['rx', 'ry']);
@@ -7999,78 +7972,79 @@ var _VALUE, _ARRAY_, _ARRAY_0_;
var STYLE_KEY$3 = enums.STYLE_KEY,
STYLE_RV_KEY$1 = enums.STYLE_RV_KEY,
style2Upper$1 = enums.style2Upper,
- _enums$STYLE_KEY$2 = enums.STYLE_KEY,
- POSITION = _enums$STYLE_KEY$2.POSITION,
- WIDTH$1 = _enums$STYLE_KEY$2.WIDTH,
- HEIGHT$1 = _enums$STYLE_KEY$2.HEIGHT,
- TRANSLATE_X = _enums$STYLE_KEY$2.TRANSLATE_X,
- TRANSLATE_Y = _enums$STYLE_KEY$2.TRANSLATE_Y,
- TRANSLATE_Z = _enums$STYLE_KEY$2.TRANSLATE_Z,
- SCALE_X = _enums$STYLE_KEY$2.SCALE_X,
- SCALE_Y = _enums$STYLE_KEY$2.SCALE_Y,
- SCALE_Z = _enums$STYLE_KEY$2.SCALE_Z,
- SKEW_X = _enums$STYLE_KEY$2.SKEW_X,
- SKEW_Y = _enums$STYLE_KEY$2.SKEW_Y,
- ROTATE_X = _enums$STYLE_KEY$2.ROTATE_X,
- ROTATE_Y = _enums$STYLE_KEY$2.ROTATE_Y,
- ROTATE_Z = _enums$STYLE_KEY$2.ROTATE_Z,
- ROTATE_3D = _enums$STYLE_KEY$2.ROTATE_3D,
- PERSPECTIVE = _enums$STYLE_KEY$2.PERSPECTIVE,
- PERSPECTIVE_ORIGIN = _enums$STYLE_KEY$2.PERSPECTIVE_ORIGIN,
- TRANSFORM = _enums$STYLE_KEY$2.TRANSFORM,
- TRANSFORM_ORIGIN$1 = _enums$STYLE_KEY$2.TRANSFORM_ORIGIN,
- BACKGROUND_IMAGE = _enums$STYLE_KEY$2.BACKGROUND_IMAGE,
- BACKGROUND_COLOR = _enums$STYLE_KEY$2.BACKGROUND_COLOR,
- BACKGROUND_POSITION_X = _enums$STYLE_KEY$2.BACKGROUND_POSITION_X,
- BACKGROUND_POSITION_Y = _enums$STYLE_KEY$2.BACKGROUND_POSITION_Y,
- BACKGROUND_SIZE = _enums$STYLE_KEY$2.BACKGROUND_SIZE,
- OPACITY = _enums$STYLE_KEY$2.OPACITY,
- Z_INDEX = _enums$STYLE_KEY$2.Z_INDEX,
- COLOR = _enums$STYLE_KEY$2.COLOR,
- FONT_SIZE$2 = _enums$STYLE_KEY$2.FONT_SIZE,
- FONT_FAMILY = _enums$STYLE_KEY$2.FONT_FAMILY,
- FONT_WEIGHT = _enums$STYLE_KEY$2.FONT_WEIGHT,
- FONT_STYLE = _enums$STYLE_KEY$2.FONT_STYLE,
- LINE_HEIGHT = _enums$STYLE_KEY$2.LINE_HEIGHT,
- TEXT_ALIGN = _enums$STYLE_KEY$2.TEXT_ALIGN,
- FILTER = _enums$STYLE_KEY$2.FILTER,
- VISIBILITY = _enums$STYLE_KEY$2.VISIBILITY,
- BOX_SHADOW = _enums$STYLE_KEY$2.BOX_SHADOW,
- POINTER_EVENTS = _enums$STYLE_KEY$2.POINTER_EVENTS,
- FILL = _enums$STYLE_KEY$2.FILL,
- STROKE = _enums$STYLE_KEY$2.STROKE,
- STROKE_WIDTH = _enums$STYLE_KEY$2.STROKE_WIDTH,
- STROKE_DASHARRAY = _enums$STYLE_KEY$2.STROKE_DASHARRAY,
- BORDER_TOP_WIDTH$1 = _enums$STYLE_KEY$2.BORDER_TOP_WIDTH,
- BORDER_RIGHT_WIDTH = _enums$STYLE_KEY$2.BORDER_RIGHT_WIDTH,
- BORDER_BOTTOM_WIDTH$1 = _enums$STYLE_KEY$2.BORDER_BOTTOM_WIDTH,
- BORDER_LEFT_WIDTH$1 = _enums$STYLE_KEY$2.BORDER_LEFT_WIDTH,
- DISPLAY = _enums$STYLE_KEY$2.DISPLAY,
- FLEX_DIRECTION = _enums$STYLE_KEY$2.FLEX_DIRECTION,
- FLEX_GROW = _enums$STYLE_KEY$2.FLEX_GROW,
- FLEX_SHRINK = _enums$STYLE_KEY$2.FLEX_SHRINK,
- FLEX_BASIS = _enums$STYLE_KEY$2.FLEX_BASIS,
- JUSTIFY_CONTENT = _enums$STYLE_KEY$2.JUSTIFY_CONTENT,
- ALIGN_SELF = _enums$STYLE_KEY$2.ALIGN_SELF,
- ALIGN_ITEMS = _enums$STYLE_KEY$2.ALIGN_ITEMS,
- MATRIX = _enums$STYLE_KEY$2.MATRIX,
- LETTER_SPACING = _enums$STYLE_KEY$2.LETTER_SPACING,
- BACKGROUND_CLIP = _enums$STYLE_KEY$2.BACKGROUND_CLIP,
- WHITE_SPACE = _enums$STYLE_KEY$2.WHITE_SPACE,
- TEXT_OVERFLOW = _enums$STYLE_KEY$2.TEXT_OVERFLOW,
- LINE_CLAMP = _enums$STYLE_KEY$2.LINE_CLAMP,
- ORDER = _enums$STYLE_KEY$2.ORDER,
- FLEX_WRAP = _enums$STYLE_KEY$2.FLEX_WRAP,
- ALIGN_CONTENT = _enums$STYLE_KEY$2.ALIGN_CONTENT,
- TRANSLATE_PATH = _enums$STYLE_KEY$2.TRANSLATE_PATH,
- TEXT_STROKE_COLOR = _enums$STYLE_KEY$2.TEXT_STROKE_COLOR,
- TEXT_STROKE_WIDTH = _enums$STYLE_KEY$2.TEXT_STROKE_WIDTH,
- TEXT_STROKE_OVER = _enums$STYLE_KEY$2.TEXT_STROKE_OVER;
+ _enums$STYLE_KEY$3 = enums.STYLE_KEY,
+ POSITION = _enums$STYLE_KEY$3.POSITION,
+ WIDTH$1 = _enums$STYLE_KEY$3.WIDTH,
+ HEIGHT$1 = _enums$STYLE_KEY$3.HEIGHT,
+ TRANSLATE_X = _enums$STYLE_KEY$3.TRANSLATE_X,
+ TRANSLATE_Y = _enums$STYLE_KEY$3.TRANSLATE_Y,
+ TRANSLATE_Z = _enums$STYLE_KEY$3.TRANSLATE_Z,
+ SCALE_X = _enums$STYLE_KEY$3.SCALE_X,
+ SCALE_Y = _enums$STYLE_KEY$3.SCALE_Y,
+ SCALE_Z = _enums$STYLE_KEY$3.SCALE_Z,
+ SKEW_X = _enums$STYLE_KEY$3.SKEW_X,
+ SKEW_Y = _enums$STYLE_KEY$3.SKEW_Y,
+ ROTATE_X = _enums$STYLE_KEY$3.ROTATE_X,
+ ROTATE_Y = _enums$STYLE_KEY$3.ROTATE_Y,
+ ROTATE_Z = _enums$STYLE_KEY$3.ROTATE_Z,
+ ROTATE_3D = _enums$STYLE_KEY$3.ROTATE_3D,
+ PERSPECTIVE = _enums$STYLE_KEY$3.PERSPECTIVE,
+ PERSPECTIVE_ORIGIN = _enums$STYLE_KEY$3.PERSPECTIVE_ORIGIN,
+ TRANSFORM = _enums$STYLE_KEY$3.TRANSFORM,
+ TRANSFORM_ORIGIN$1 = _enums$STYLE_KEY$3.TRANSFORM_ORIGIN,
+ BACKGROUND_IMAGE = _enums$STYLE_KEY$3.BACKGROUND_IMAGE,
+ BACKGROUND_COLOR = _enums$STYLE_KEY$3.BACKGROUND_COLOR,
+ BACKGROUND_POSITION_X = _enums$STYLE_KEY$3.BACKGROUND_POSITION_X,
+ BACKGROUND_POSITION_Y = _enums$STYLE_KEY$3.BACKGROUND_POSITION_Y,
+ BACKGROUND_SIZE = _enums$STYLE_KEY$3.BACKGROUND_SIZE,
+ OPACITY = _enums$STYLE_KEY$3.OPACITY,
+ Z_INDEX = _enums$STYLE_KEY$3.Z_INDEX,
+ COLOR$1 = _enums$STYLE_KEY$3.COLOR,
+ FONT_SIZE$3 = _enums$STYLE_KEY$3.FONT_SIZE,
+ FONT_FAMILY$1 = _enums$STYLE_KEY$3.FONT_FAMILY,
+ FONT_WEIGHT$1 = _enums$STYLE_KEY$3.FONT_WEIGHT,
+ FONT_STYLE$1 = _enums$STYLE_KEY$3.FONT_STYLE,
+ LINE_HEIGHT = _enums$STYLE_KEY$3.LINE_HEIGHT,
+ TEXT_ALIGN = _enums$STYLE_KEY$3.TEXT_ALIGN,
+ FILTER = _enums$STYLE_KEY$3.FILTER,
+ VISIBILITY = _enums$STYLE_KEY$3.VISIBILITY,
+ BOX_SHADOW = _enums$STYLE_KEY$3.BOX_SHADOW,
+ POINTER_EVENTS = _enums$STYLE_KEY$3.POINTER_EVENTS,
+ FILL = _enums$STYLE_KEY$3.FILL,
+ STROKE = _enums$STYLE_KEY$3.STROKE,
+ STROKE_WIDTH = _enums$STYLE_KEY$3.STROKE_WIDTH,
+ STROKE_DASHARRAY = _enums$STYLE_KEY$3.STROKE_DASHARRAY,
+ BORDER_TOP_WIDTH$1 = _enums$STYLE_KEY$3.BORDER_TOP_WIDTH,
+ BORDER_RIGHT_WIDTH = _enums$STYLE_KEY$3.BORDER_RIGHT_WIDTH,
+ BORDER_BOTTOM_WIDTH$1 = _enums$STYLE_KEY$3.BORDER_BOTTOM_WIDTH,
+ BORDER_LEFT_WIDTH$1 = _enums$STYLE_KEY$3.BORDER_LEFT_WIDTH,
+ DISPLAY = _enums$STYLE_KEY$3.DISPLAY,
+ FLEX_DIRECTION = _enums$STYLE_KEY$3.FLEX_DIRECTION,
+ FLEX_GROW = _enums$STYLE_KEY$3.FLEX_GROW,
+ FLEX_SHRINK = _enums$STYLE_KEY$3.FLEX_SHRINK,
+ FLEX_BASIS = _enums$STYLE_KEY$3.FLEX_BASIS,
+ JUSTIFY_CONTENT = _enums$STYLE_KEY$3.JUSTIFY_CONTENT,
+ ALIGN_SELF = _enums$STYLE_KEY$3.ALIGN_SELF,
+ ALIGN_ITEMS = _enums$STYLE_KEY$3.ALIGN_ITEMS,
+ MATRIX = _enums$STYLE_KEY$3.MATRIX,
+ LETTER_SPACING = _enums$STYLE_KEY$3.LETTER_SPACING,
+ BACKGROUND_CLIP = _enums$STYLE_KEY$3.BACKGROUND_CLIP,
+ WHITE_SPACE = _enums$STYLE_KEY$3.WHITE_SPACE,
+ TEXT_OVERFLOW = _enums$STYLE_KEY$3.TEXT_OVERFLOW,
+ LINE_CLAMP = _enums$STYLE_KEY$3.LINE_CLAMP,
+ ORDER = _enums$STYLE_KEY$3.ORDER,
+ FLEX_WRAP = _enums$STYLE_KEY$3.FLEX_WRAP,
+ ALIGN_CONTENT = _enums$STYLE_KEY$3.ALIGN_CONTENT,
+ TRANSLATE_PATH = _enums$STYLE_KEY$3.TRANSLATE_PATH,
+ TEXT_STROKE_COLOR = _enums$STYLE_KEY$3.TEXT_STROKE_COLOR,
+ TEXT_STROKE_WIDTH = _enums$STYLE_KEY$3.TEXT_STROKE_WIDTH,
+ TEXT_STROKE_OVER = _enums$STYLE_KEY$3.TEXT_STROKE_OVER,
+ OVERFLOW = _enums$STYLE_KEY$3.OVERFLOW;
var AUTO = o.AUTO,
PX$2 = o.PX,
PERCENT$2 = o.PERCENT,
NUMBER$1 = o.NUMBER,
- INHERIT$2 = o.INHERIT,
+ INHERIT$1 = o.INHERIT,
DEG$1 = o.DEG,
RGBA = o.RGBA,
STRING = o.STRING,
@@ -8083,8 +8057,7 @@ var AUTO = o.AUTO,
var isNil$3 = util.isNil,
rgba2int$2 = util.rgba2int,
equalArr$1 = util.equalArr;
-var MEASURE_KEY_SET$1 = o$2.MEASURE_KEY_SET,
- isGeom = o$2.isGeom,
+var isGeom = o$2.isGeom,
GEOM$2 = o$2.GEOM,
GEOM_KEY_SET$2 = o$2.GEOM_KEY_SET;
var COLOR_HASH$1 = key.COLOR_HASH,
@@ -8741,9 +8714,9 @@ function normalize(style) {
if (temp !== undefined) {
if (temp === 'inherit') {
- res[COLOR] = [[], INHERIT$2];
+ res[COLOR$1] = [[], INHERIT$1];
} else {
- res[COLOR] = [rgba2int$2(temp), RGBA];
+ res[COLOR$1] = [rgba2int$2(temp), RGBA];
}
}
@@ -8751,7 +8724,7 @@ function normalize(style) {
if (temp !== undefined) {
if (temp === 'inherit') {
- res[TEXT_STROKE_COLOR] = [[], INHERIT$2];
+ res[TEXT_STROKE_COLOR] = [[], INHERIT$1];
} else {
res[TEXT_STROKE_COLOR] = [rgba2int$2(temp), RGBA];
}
@@ -8761,19 +8734,19 @@ function normalize(style) {
if (temp !== undefined) {
if (temp === 'inherit') {
- res[FONT_SIZE$2] = [0, INHERIT$2];
+ res[FONT_SIZE$3] = [0, INHERIT$1];
} else {
var _v = calUnit$1(temp); // fontSize不能为负数,否则为继承
if (_v < 0) {
- res[FONT_SIZE$2] = [0, INHERIT$2];
+ res[FONT_SIZE$3] = [0, INHERIT$1];
} else {
if ([NUMBER$1, DEG$1].indexOf(_v[1]) > -1) {
_v[1] = PX$2;
}
- res[FONT_SIZE$2] = _v;
+ res[FONT_SIZE$3] = _v;
}
}
}
@@ -8782,13 +8755,13 @@ function normalize(style) {
if (temp !== undefined) {
if (temp === 'inherit') {
- res[TEXT_STROKE_WIDTH] = [0, INHERIT$2];
+ res[TEXT_STROKE_WIDTH] = [0, INHERIT$1];
} else {
var _v2 = calUnit$1(temp); // textStrokeWidth不能为负数,否则为继承
if (_v2 < 0) {
- res[TEXT_STROKE_WIDTH] = [0, INHERIT$2];
+ res[TEXT_STROKE_WIDTH] = [0, INHERIT$1];
} else {
if ([NUMBER$1, DEG$1, PERCENT$2].indexOf(_v2[1]) > -1) {
_v2[1] = PX$2;
@@ -8803,7 +8776,7 @@ function normalize(style) {
if (temp !== undefined) {
if (temp === null || temp === 'inherit') {
- res[TEXT_STROKE_OVER] = [0, INHERIT$2];
+ res[TEXT_STROKE_OVER] = [0, INHERIT$1];
} else {
var _v3 = temp.toString();
@@ -8819,15 +8792,15 @@ function normalize(style) {
if (temp !== undefined) {
if (temp === 'bold') {
- res[FONT_WEIGHT] = [700, NUMBER$1];
+ res[FONT_WEIGHT$1] = [700, NUMBER$1];
} else if (temp === 'normal') {
- res[FONT_WEIGHT] = [400, NUMBER$1];
+ res[FONT_WEIGHT$1] = [400, NUMBER$1];
} else if (temp === 'lighter') {
- res[FONT_WEIGHT] = [200, NUMBER$1];
+ res[FONT_WEIGHT$1] = [200, NUMBER$1];
} else if (temp === 'inherit') {
- res[FONT_WEIGHT] = [0, INHERIT$2];
+ res[FONT_WEIGHT$1] = [0, INHERIT$1];
} else {
- res[FONT_WEIGHT] = [Math.max(0, parseInt(temp)) || 400, NUMBER$1];
+ res[FONT_WEIGHT$1] = [Math.max(0, parseInt(temp)) || 400, NUMBER$1];
}
}
@@ -8835,9 +8808,9 @@ function normalize(style) {
if (temp !== undefined) {
if (temp === null || temp === 'inherit') {
- res[FONT_STYLE] = [0, INHERIT$2];
+ res[FONT_STYLE$1] = [0, INHERIT$1];
} else {
- res[FONT_STYLE] = [temp, STRING];
+ res[FONT_STYLE$1] = [temp, STRING];
}
}
@@ -8845,10 +8818,10 @@ function normalize(style) {
if (temp !== undefined) {
if (temp === null || temp === 'inherit') {
- res[FONT_FAMILY] = [0, INHERIT$2];
+ res[FONT_FAMILY$1] = [0, INHERIT$1];
} else {
// 统一文字声明格式
- res[FONT_FAMILY] = [temp.toString().toLowerCase().replace(/['"]/, '').replace(/\s*,\s*/g, ','), STRING];
+ res[FONT_FAMILY$1] = [temp.toString().toLowerCase().replace(/['"]/, '').replace(/\s*,\s*/g, ','), STRING];
}
}
@@ -8856,7 +8829,7 @@ function normalize(style) {
if (temp !== undefined) {
if (temp === null || temp === 'inherit') {
- res[TEXT_ALIGN] = [0, INHERIT$2];
+ res[TEXT_ALIGN] = [0, INHERIT$1];
} else {
res[TEXT_ALIGN] = [temp, STRING];
}
@@ -8866,7 +8839,7 @@ function normalize(style) {
if (temp !== undefined) {
if (temp === 'inherit') {
- res[LINE_HEIGHT] = [0, INHERIT$2];
+ res[LINE_HEIGHT] = [0, INHERIT$1];
} else if (temp === 'normal') {
res[LINE_HEIGHT] = [0, AUTO];
} // lineHeight默认数字,想要px必须强制带单位
@@ -8893,7 +8866,7 @@ function normalize(style) {
if (temp !== undefined) {
if (temp === null || temp === 'inherit') {
- res[LETTER_SPACING] = [0, INHERIT$2];
+ res[LETTER_SPACING] = [0, INHERIT$1];
} else if (temp === 'normal') {
res[LETTER_SPACING] = [0, PX$2];
} else if (/^[-+]?[\d.]/.test(temp)) {
@@ -8913,7 +8886,7 @@ function normalize(style) {
if (temp !== undefined) {
if (temp === null || temp === 'inherit') {
- res[WHITE_SPACE] = [0, INHERIT$2];
+ res[WHITE_SPACE] = [0, INHERIT$1];
} else {
res[WHITE_SPACE] = [temp, STRING];
}
@@ -9092,7 +9065,7 @@ function normalize(style) {
if (temp !== undefined) {
if (temp === null || temp === 'inherit') {
- res[VISIBILITY] = [0, INHERIT$2];
+ res[VISIBILITY] = [0, INHERIT$1];
} else {
res[VISIBILITY] = [temp, STRING];
}
@@ -9102,7 +9075,7 @@ function normalize(style) {
if (temp !== undefined) {
if (temp === null || temp === 'inherit') {
- res[POINTER_EVENTS] = [0, INHERIT$2];
+ res[POINTER_EVENTS] = [0, INHERIT$1];
} else {
res[POINTER_EVENTS] = [temp, STRING];
}
@@ -9183,35 +9156,40 @@ function normalize(style) {
return res;
}
/**
- * 第一次和REFLOW等级下,刷新前首先执行,生成computedStyle
- * 影响文字测量的只有字体和大小和重量,需要提前处理
- * 继承相关的计算
+ * 每次布局前需要计算的reflow相关的computedStyle,每次布局只计算一次,布局完后清除缓存标
* @param node 对象节点
- * @param isRoot 是否是根节点,无继承需使用默认值
*/
-function computeMeasure(node, isRoot) {
+function computeReflow(node) {
+ if (node.__hasComputeReflow) {
+ return;
+ }
+
+ node.__hasComputeReflow = true;
var currentStyle = node.currentStyle,
computedStyle = node.computedStyle,
- domParent = node.domParent;
- var parentComputedStyle = !isRoot && domParent.computedStyle;
- MEASURE_KEY_SET$1.forEach(function (k) {
+ parent = node.domParent,
+ root = node.root;
+ var rem = root.computedStyle[FONT_SIZE$3];
+ var isRoot = !parent;
+ var parentComputedStyle = parent && parent.computedStyle;
+ [FONT_SIZE$3, FONT_FAMILY$1, FONT_WEIGHT$1].forEach(function (k) {
var v = currentStyle[k]; // ff特殊处理
- if (k === FONT_FAMILY) {
- if (v[1] === INHERIT$2) {
+ if (k === FONT_FAMILY$1) {
+ if (v[1] === INHERIT$1) {
computedStyle[k] = getFontFamily(isRoot ? reset.INHERIT[STYLE_RV_KEY$1[k]] : parentComputedStyle[k]);
} else {
computedStyle[k] = getFontFamily(v[0]);
}
- } else if (v[1] === INHERIT$2) {
+ } else if (v[1] === INHERIT$1) {
computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY$1[k]] : parentComputedStyle[k];
} // 只有fontSize会有%
else if (v[1] === PERCENT$2) {
computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY$1[k]] : parentComputedStyle[k] * v[0] * 0.01;
} else if (v[1] === REM$2) {
- computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY$1[k]] : node.root.computedStyle[FONT_SIZE$2] * v[0];
+ computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY$1[k]] : node.root.computedStyle[FONT_SIZE$3] * v[0];
} else if (v[1] === VW$2) {
computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY$1[k]] : node.root.width * 0.01 * v[0];
} else if (v[1] === VH$2) {
@@ -9224,26 +9202,6 @@ function computeMeasure(node, isRoot) {
computedStyle[k] = v[0];
}
});
-}
-/**
- * 每次布局前需要计算的reflow相关的computedStyle,每次布局只计算一次,布局完后清除缓存标
- * @param node 对象节点
- */
-
-
-function computeReflow(node) {
- if (node.__hasComputeReflow) {
- return;
- }
-
- node.__hasComputeReflow = true;
- var currentStyle = node.currentStyle,
- computedStyle = node.computedStyle,
- parent = node.domParent,
- root = node.root;
- var rem = root.computedStyle[FONT_SIZE$2];
- var isRoot = !parent;
- var parentComputedStyle = parent && parent.computedStyle;
[BORDER_TOP_WIDTH$1, BORDER_RIGHT_WIDTH, BORDER_BOTTOM_WIDTH$1, BORDER_LEFT_WIDTH$1].forEach(function (k) {
// border-width不支持百分比
var item = currentStyle[k];
@@ -9264,7 +9222,7 @@ function computeReflow(node) {
computedStyle[k] = 0;
}
});
- [POSITION, DISPLAY, FLEX_DIRECTION, JUSTIFY_CONTENT, ALIGN_ITEMS, ALIGN_SELF, FLEX_GROW, FLEX_SHRINK, LINE_CLAMP, ORDER, FLEX_WRAP, ALIGN_CONTENT].forEach(function (k) {
+ [POSITION, DISPLAY, FLEX_DIRECTION, JUSTIFY_CONTENT, ALIGN_ITEMS, ALIGN_SELF, FLEX_GROW, FLEX_SHRINK, LINE_CLAMP, ORDER, FLEX_WRAP, ALIGN_CONTENT, OVERFLOW, TEXT_OVERFLOW].forEach(function (k) {
computedStyle[k] = currentStyle[k];
}); // 匿名块对象
@@ -9276,16 +9234,16 @@ function computeReflow(node) {
var textAlign = currentStyle[TEXT_ALIGN];
- if (textAlign[1] === INHERIT$2) {
+ if (textAlign[1] === INHERIT$1) {
computedStyle[TEXT_ALIGN] = isRoot ? 'left' : parentComputedStyle[TEXT_ALIGN];
} else {
computedStyle[TEXT_ALIGN] = textAlign[0];
}
- var fontSize = computedStyle[FONT_SIZE$2];
+ var fontSize = computedStyle[FONT_SIZE$3];
var lineHeight = currentStyle[LINE_HEIGHT]; // lineHeight继承很特殊,数字和normal不同于普通单位
- if (lineHeight[1] === INHERIT$2) {
+ if (lineHeight[1] === INHERIT$1) {
if (isRoot) {
computedStyle[LINE_HEIGHT] = calNormalLineHeight(computedStyle);
} else {
@@ -9295,7 +9253,7 @@ function computeReflow(node) {
while (p) {
ph = p.currentStyle[LINE_HEIGHT];
- if (ph[1] !== INHERIT$2) {
+ if (ph[1] !== INHERIT$1) {
break;
}
@@ -9303,7 +9261,7 @@ function computeReflow(node) {
} // 到root还是inherit或normal,或者中途遇到了normal,使用normal
- if ([AUTO, INHERIT$2].indexOf(ph[1]) > -1) {
+ if ([AUTO, INHERIT$1].indexOf(ph[1]) > -1) {
computedStyle[LINE_HEIGHT] = calNormalLineHeight(computedStyle);
} // 数字继承
else if (ph[1] === NUMBER$1) {
@@ -9337,7 +9295,7 @@ function computeReflow(node) {
var letterSpacing = currentStyle[LETTER_SPACING];
- if (letterSpacing[1] === INHERIT$2) {
+ if (letterSpacing[1] === INHERIT$1) {
computedStyle[LETTER_SPACING] = isRoot ? 0 : parentComputedStyle[LETTER_SPACING];
} else if (letterSpacing[1] === PERCENT$2) {
computedStyle[LETTER_SPACING] = fontSize * 0.01 * letterSpacing[0];
@@ -9358,7 +9316,7 @@ function computeReflow(node) {
var whiteSpace = currentStyle[WHITE_SPACE];
- if (whiteSpace[1] === INHERIT$2) {
+ if (whiteSpace[1] === INHERIT$1) {
computedStyle[WHITE_SPACE] = isRoot ? 'normal' : parentComputedStyle[WHITE_SPACE];
} else {
computedStyle[WHITE_SPACE] = whiteSpace[0];
@@ -9366,23 +9324,38 @@ function computeReflow(node) {
}
function setFontStyle(style) {
- var fontSize = style[FONT_SIZE$2] || 0;
- var fontFamily = style[FONT_FAMILY] || 'arial';
+ var fontSize = style[FONT_SIZE$3] || 0;
+ var fontFamily = style[FONT_FAMILY$1] || inject.defaultFontFamily || 'arial';
if (/\s/.test(fontFamily)) {
fontFamily = '"' + fontFamily.replace(/"/g, '\\"') + '"';
}
- return (style[FONT_STYLE] || 'normal') + ' ' + (style[FONT_WEIGHT] || '400') + ' ' + fontSize + 'px/' + fontSize + 'px ' + fontFamily;
+ return (style[FONT_STYLE$1] || 'normal') + ' ' + (style[FONT_WEIGHT$1] || '400') + ' ' + fontSize + 'px/' + fontSize + 'px ' + fontFamily;
}
function getFontFamily(str) {
- var ff = str.split(',');
- var f = 'arial';
+ var ff = str.split(/\s*,\s*/);
+ var f = inject.defaultFontFamily;
for (var i = 0, len = ff.length; i < len; i++) {
- if (o$1.support(ff[i])) {
- f = ff[i];
+ var fontFamily = ff[i].replace(/^['"]/, '').replace(/['"]$/, '');
+
+ if (!o$1.hasRegister(fontFamily)) {
+ continue;
+ }
+
+ if (!o$1.hasChecked(fontFamily)) {
+ var res = inject.checkSupportFontFamily(fontFamily);
+
+ if (o$1.setChecked(fontFamily, res)) {
+ f = fontFamily;
+ break;
+ }
+ }
+
+ if (o$1.support(fontFamily)) {
+ f = fontFamily;
break;
}
}
@@ -9391,15 +9364,15 @@ function getFontFamily(str) {
}
function getBaseline(style) {
- var fontSize = style[FONT_SIZE$2];
- var ff = getFontFamily(style[FONT_FAMILY]);
- var normal = fontSize * (o$1.info[ff] || o$1.info.arial).lhr;
- return (style[LINE_HEIGHT] - normal) * 0.5 + fontSize * (o$1.info[ff] || o$1.info.arial).blr;
+ var fontSize = style[FONT_SIZE$3];
+ var ff = getFontFamily(style[FONT_FAMILY$1]);
+ var normal = fontSize * (o$1.info[ff] || o$1.info[inject.defaultFontFamily] || o$1.info.arial).lhr;
+ return (style[LINE_HEIGHT] - normal) * 0.5 + fontSize * (o$1.info[ff] || o$1.info[inject.defaultFontFamily] || o$1.info.arial).blr;
}
function calNormalLineHeight(style) {
- var ff = getFontFamily(style[FONT_FAMILY]);
- return style[FONT_SIZE$2] * (o$1.info[ff] || o$1.info.arial).lhr;
+ var ff = getFontFamily(style[FONT_FAMILY$1]);
+ return style[FONT_SIZE$3] * (o$1.info[ff] || o$1.info[inject.defaultFontFamily] || o$1.info.arial).lhr;
}
function calRelativePercent(n, parent, k) {
@@ -9420,7 +9393,7 @@ function calRelativePercent(n, parent, k) {
n *= style[0] * 0.01;
parent = parent.domParent;
} else if (style[1] === REM$2) {
- return n * style[0] * parent.root.computedStyle[FONT_SIZE$2];
+ return n * style[0] * parent.root.computedStyle[FONT_SIZE$3];
} else if (style[1] === VW$2) {
return n * style[0] * parent.root.width * 0.01;
} else if (style[1] === VH$2) {
@@ -9447,7 +9420,7 @@ function calRelative(currentStyle, k, v, parent, isWidth) {
v = calRelativePercent(v[0], parent, HEIGHT$1);
}
} else if (v[1] === REM$2) {
- v = v[0] * parent.root.computedStyle[FONT_SIZE$2];
+ v = v[0] * parent.root.computedStyle[FONT_SIZE$3];
} else if (v[1] === VW$2) {
v = v[0] * parent.root.width * 0.01;
} else if (v[1] === VH$2) {
@@ -9469,7 +9442,7 @@ function calAbsolute(currentStyle, k, v, size, root) {
} else if (v[1] === PERCENT$2) {
v = v[0] * size * 0.01;
} else if (v[1] === REM$2) {
- v = v[0] * root.computedStyle[FONT_SIZE$2];
+ v = v[0] * root.computedStyle[FONT_SIZE$3];
} else if (v[1] === VW$2) {
v = v[0] * root.width * 0.01;
} else if (v[1] === VH$2) {
@@ -9602,7 +9575,7 @@ function isRelativeOrAbsolute(node) {
var VALUE = (_VALUE = {}, _defineProperty(_VALUE, POSITION, true), _defineProperty(_VALUE, DISPLAY, true), _defineProperty(_VALUE, STYLE_KEY$3.BACKGROUND_REPEAT, true), _defineProperty(_VALUE, FLEX_DIRECTION, true), _defineProperty(_VALUE, FLEX_GROW, true), _defineProperty(_VALUE, FLEX_SHRINK, true), _defineProperty(_VALUE, FLEX_WRAP, true), _defineProperty(_VALUE, JUSTIFY_CONTENT, true), _defineProperty(_VALUE, ALIGN_ITEMS, true), _defineProperty(_VALUE, ALIGN_SELF, true), _defineProperty(_VALUE, STYLE_KEY$3.OVERFLOW, true), _defineProperty(_VALUE, STYLE_KEY$3.MIX_BLEND_MODE, true), _defineProperty(_VALUE, STYLE_KEY$3.STROKE_LINECAP, true), _defineProperty(_VALUE, STYLE_KEY$3.STROKE_LINEJOIN, true), _defineProperty(_VALUE, STYLE_KEY$3.STROKE_MITERLIMIT, true), _defineProperty(_VALUE, STYLE_KEY$3.FILL_RULE, true), _defineProperty(_VALUE, OPACITY, true), _defineProperty(_VALUE, Z_INDEX, true), _defineProperty(_VALUE, BACKGROUND_CLIP, true), _defineProperty(_VALUE, TEXT_OVERFLOW, true), _defineProperty(_VALUE, LINE_CLAMP, true), _VALUE); // 仅1维数组
-var ARRAY_0 = (_ARRAY_ = {}, _defineProperty(_ARRAY_, COLOR, true), _defineProperty(_ARRAY_, TEXT_STROKE_COLOR, true), _defineProperty(_ARRAY_, BACKGROUND_COLOR, true), _defineProperty(_ARRAY_, STYLE_KEY$3.BORDER_TOP_COLOR, true), _defineProperty(_ARRAY_, STYLE_KEY$3.BORDER_RIGHT_COLOR, true), _defineProperty(_ARRAY_, STYLE_KEY$3.BORDER_BOTTOM_COLOR, true), _defineProperty(_ARRAY_, STYLE_KEY$3.BORDER_LEFT_COLOR, true), _ARRAY_); // 仅2维数组且只有2个值
+var ARRAY_0 = (_ARRAY_ = {}, _defineProperty(_ARRAY_, COLOR$1, true), _defineProperty(_ARRAY_, TEXT_STROKE_COLOR, true), _defineProperty(_ARRAY_, BACKGROUND_COLOR, true), _defineProperty(_ARRAY_, STYLE_KEY$3.BORDER_TOP_COLOR, true), _defineProperty(_ARRAY_, STYLE_KEY$3.BORDER_RIGHT_COLOR, true), _defineProperty(_ARRAY_, STYLE_KEY$3.BORDER_BOTTOM_COLOR, true), _defineProperty(_ARRAY_, STYLE_KEY$3.BORDER_LEFT_COLOR, true), _ARRAY_); // 仅2维数组且只有2个值
var ARRAY_0_1 = (_ARRAY_0_ = {}, _defineProperty(_ARRAY_0_, STYLE_KEY$3.BORDER_TOP_LEFT_RADIUS, true), _defineProperty(_ARRAY_0_, STYLE_KEY$3.BORDER_TOP_RIGHT_RADIUS, true), _defineProperty(_ARRAY_0_, STYLE_KEY$3.BORDER_BOTTOM_RIGHT_RADIUS, true), _defineProperty(_ARRAY_0_, STYLE_KEY$3.BORDER_BOTTOM_LEFT_RADIUS, true), _defineProperty(_ARRAY_0_, TRANSFORM_ORIGIN$1, true), _defineProperty(_ARRAY_0_, PERSPECTIVE_ORIGIN, true), _ARRAY_0_);
@@ -9714,7 +9687,7 @@ function calAbsFixedSize(value, size, root) {
} else if (value[1] === PERCENT$2) {
return value[0] * 0.01 * size;
} else if (value[1] === REM$2) {
- return value[0] * root.computedStyle[FONT_SIZE$2];
+ return value[0] * root.computedStyle[FONT_SIZE$3];
} else if (value[1] === VW$2) {
return value[0] * root.width * 0.01;
} else if (value[1] === VH$2) {
@@ -9730,7 +9703,6 @@ function calAbsFixedSize(value, size, root) {
var css = {
normalize: normalize,
- computeMeasure: computeMeasure,
computeReflow: computeReflow,
setFontStyle: setFontStyle,
getFontFamily: getFontFamily,
@@ -9743,16 +9715,16 @@ var css = {
cloneStyle: cloneStyle
};
-var _enums$STYLE_KEY$3 = enums.STYLE_KEY,
- COLOR$1 = _enums$STYLE_KEY$3.COLOR,
- FONT_WEIGHT$1 = _enums$STYLE_KEY$3.FONT_WEIGHT,
- FONT_FAMILY$1 = _enums$STYLE_KEY$3.FONT_FAMILY,
- FONT_SIZE$3 = _enums$STYLE_KEY$3.FONT_SIZE,
- FONT_STYLE$1 = _enums$STYLE_KEY$3.FONT_STYLE,
- LETTER_SPACING$1 = _enums$STYLE_KEY$3.LETTER_SPACING,
- TEXT_STROKE_COLOR$1 = _enums$STYLE_KEY$3.TEXT_STROKE_COLOR,
- TEXT_STROKE_WIDTH$1 = _enums$STYLE_KEY$3.TEXT_STROKE_WIDTH,
- TEXT_STROKE_OVER$1 = _enums$STYLE_KEY$3.TEXT_STROKE_OVER;
+var _enums$STYLE_KEY$4 = enums.STYLE_KEY,
+ COLOR$2 = _enums$STYLE_KEY$4.COLOR,
+ FONT_WEIGHT$2 = _enums$STYLE_KEY$4.FONT_WEIGHT,
+ FONT_FAMILY$2 = _enums$STYLE_KEY$4.FONT_FAMILY,
+ FONT_SIZE$4 = _enums$STYLE_KEY$4.FONT_SIZE,
+ FONT_STYLE$2 = _enums$STYLE_KEY$4.FONT_STYLE,
+ LETTER_SPACING$1 = _enums$STYLE_KEY$4.LETTER_SPACING,
+ TEXT_STROKE_COLOR$1 = _enums$STYLE_KEY$4.TEXT_STROKE_COLOR,
+ TEXT_STROKE_WIDTH$1 = _enums$STYLE_KEY$4.TEXT_STROKE_WIDTH,
+ TEXT_STROKE_OVER$1 = _enums$STYLE_KEY$4.TEXT_STROKE_OVER;
/**
* 表示一行文本的类,保存它的位置、内容、从属信息,在布局阶段生成,并在渲染阶段被Text调用render()
* 关系上直属于Text类,一个Text类可能因为换行原因导致有多个TextBox,一行内容中也可能有不同Text从而不同TextBox
@@ -9761,7 +9733,7 @@ var _enums$STYLE_KEY$3 = enums.STYLE_KEY,
*/
var TextBox = /*#__PURE__*/function () {
- function TextBox(parent, index, x, y, w, h, content, wList) {
+ function TextBox(parent, index, x, y, w, h, content) {
_classCallCheck(this, TextBox);
this.__parent = parent;
@@ -9771,60 +9743,96 @@ var TextBox = /*#__PURE__*/function () {
this.__width = w;
this.__height = h;
this.__content = content;
- this.__wList = wList;
this.__virtualDom = {};
+ this.__parentLineBox = null;
}
- /**
- * 渲染阶段被Text类调用,多行Text会有多个TextBox,内容被分拆开
- * @param renderMode
- * @param ctx
- * @param computedStyle
- * @param cacheStyle Text父节点Dom的缓存样式,相比computedStyle可以直接用,比如color被缓存为style字符串
- * @param dx
- * @param dy
- */
-
_createClass(TextBox, [{
+ key: "setEllipsis",
+ value: function setEllipsis(fontFamily, fontSize, fontWeight) {
+ this.__fontFamily = fontFamily;
+ this.__fontSize = fontSize;
+ this.__fontWeight = fontWeight;
+ }
+ }, {
+ key: "setDom",
+ value: function setDom(dom) {
+ this.__dom = dom;
+ }
+ /**
+ * 渲染阶段被Text类调用,多行Text会有多个TextBox,内容被分拆开
+ * @param renderMode
+ * @param ctx
+ * @param computedStyle
+ * @param cacheStyle Text父节点Dom的缓存样式,相比computedStyle可以直接用,比如color被缓存为style字符串
+ * @param dx
+ * @param dy
+ */
+
+ }, {
key: "render",
value: function render(renderMode, ctx, computedStyle, cacheStyle, dx, dy) {
var content = this.content,
x = this.x,
y = this.y,
parent = this.parent,
- wList = this.wList,
- width = this.width;
+ width = this.width,
+ dom = this.dom;
var ox = parent.ox,
oy = parent.oy;
y += css.getBaseline(computedStyle);
x += ox + dx;
y += oy + dy;
this.__endX = x + width;
- this.__endY = y;
- var letterSpacing = computedStyle[LETTER_SPACING$1],
- textStrokeWidth = computedStyle[TEXT_STROKE_WIDTH$1],
- textStrokeColor = computedStyle[TEXT_STROKE_COLOR$1];
+ this.__endY = y; // ELLIPSIS使用block的样式
+
+ if (dom) {
+ cacheStyle = dom.cacheStyle;
+ computedStyle = dom.computedStyle;
+ }
+
+ var _computedStyle = computedStyle,
+ letterSpacing = _computedStyle[LETTER_SPACING$1],
+ textStrokeWidth = _computedStyle[TEXT_STROKE_WIDTH$1],
+ textStrokeColor = _computedStyle[TEXT_STROKE_COLOR$1];
var i = 0,
length = content.length;
if (renderMode === mode.CANVAS || renderMode === mode.WEBGL) {
+ if (dom) {
+ computedStyle = dom.computedStyle;
+ var font = css.setFontStyle(computedStyle);
+
+ if (ctx.font !== font) {
+ ctx.font = font;
+ }
+
+ var color = cacheStyle[COLOR$2];
+
+ if (ctx.fillStyle !== color) {
+ ctx.fillStyle = color;
+ }
+ }
+
var overFill = computedStyle[TEXT_STROKE_OVER$1] === 'fill';
if (letterSpacing) {
for (; i < length; i++) {
+ var c = content.charAt(i);
+
if (overFill) {
- ctx.fillText(content.charAt(i), x, y);
+ ctx.fillText(c, x, y);
}
if (textStrokeWidth && (textStrokeColor[3] > 0 || textStrokeColor.length === 3)) {
- ctx.strokeText(content.charAt(i), x, y);
+ ctx.strokeText(c, x, y);
}
if (!overFill) {
- ctx.fillText(content.charAt(i), x, y);
+ ctx.fillText(c, x, y);
}
- x += wList[i] + letterSpacing;
+ x += ctx.measureText(c).width + letterSpacing;
}
} else {
if (overFill) {
@@ -9840,7 +9848,7 @@ var TextBox = /*#__PURE__*/function () {
}
}
} else if (renderMode === mode.SVG) {
- var props = [['x', x], ['y', y], ['fill', cacheStyle[COLOR$1]], ['font-family', computedStyle[FONT_FAMILY$1]], ['font-weight', computedStyle[FONT_WEIGHT$1]], ['font-style', computedStyle[FONT_STYLE$1]], ['font-size', computedStyle[FONT_SIZE$3] + 'px']]; // svg无法定义stroke的over
+ var props = [['x', x], ['y', y], ['fill', cacheStyle[COLOR$2]], ['font-family', computedStyle[FONT_FAMILY$2]], ['font-weight', computedStyle[FONT_WEIGHT$2]], ['font-style', computedStyle[FONT_STYLE$2]], ['font-size', computedStyle[FONT_SIZE$4] + 'px']]; // svg无法定义stroke的over
if (textStrokeWidth && (textStrokeColor[3] > 0 || textStrokeColor.length === 3)) {
props.push(['stroke', cacheStyle[TEXT_STROKE_COLOR$1]]);
@@ -9935,14 +9943,14 @@ var TextBox = /*#__PURE__*/function () {
return this.__parentLineBox;
}
}, {
- key: "wList",
+ key: "isReplaced",
get: function get() {
- return this.__wList;
+ return false;
}
}, {
- key: "isReplaced",
+ key: "dom",
get: function get() {
- return false;
+ return this.__dom;
}
}]);
@@ -12856,22 +12864,22 @@ var math = {
}
};
-var _enums$STYLE_KEY$4 = enums.STYLE_KEY,
- TRANSLATE_X$1 = _enums$STYLE_KEY$4.TRANSLATE_X,
- TRANSLATE_Y$1 = _enums$STYLE_KEY$4.TRANSLATE_Y,
- TRANSLATE_Z$1 = _enums$STYLE_KEY$4.TRANSLATE_Z,
- SCALE_X$1 = _enums$STYLE_KEY$4.SCALE_X,
- SCALE_Y$1 = _enums$STYLE_KEY$4.SCALE_Y,
- SCALE_Z$1 = _enums$STYLE_KEY$4.SCALE_Z,
- SKEW_X$1 = _enums$STYLE_KEY$4.SKEW_X,
- SKEW_Y$1 = _enums$STYLE_KEY$4.SKEW_Y,
- ROTATE_X$1 = _enums$STYLE_KEY$4.ROTATE_X,
- ROTATE_Y$1 = _enums$STYLE_KEY$4.ROTATE_Y,
- ROTATE_Z$1 = _enums$STYLE_KEY$4.ROTATE_Z,
- ROTATE_3D$1 = _enums$STYLE_KEY$4.ROTATE_3D,
- PERSPECTIVE$1 = _enums$STYLE_KEY$4.PERSPECTIVE,
- MATRIX$1 = _enums$STYLE_KEY$4.MATRIX,
- FONT_SIZE$4 = _enums$STYLE_KEY$4.FONT_SIZE;
+var _enums$STYLE_KEY$5 = enums.STYLE_KEY,
+ TRANSLATE_X$1 = _enums$STYLE_KEY$5.TRANSLATE_X,
+ TRANSLATE_Y$1 = _enums$STYLE_KEY$5.TRANSLATE_Y,
+ TRANSLATE_Z$1 = _enums$STYLE_KEY$5.TRANSLATE_Z,
+ SCALE_X$1 = _enums$STYLE_KEY$5.SCALE_X,
+ SCALE_Y$1 = _enums$STYLE_KEY$5.SCALE_Y,
+ SCALE_Z$1 = _enums$STYLE_KEY$5.SCALE_Z,
+ SKEW_X$1 = _enums$STYLE_KEY$5.SKEW_X,
+ SKEW_Y$1 = _enums$STYLE_KEY$5.SKEW_Y,
+ ROTATE_X$1 = _enums$STYLE_KEY$5.ROTATE_X,
+ ROTATE_Y$1 = _enums$STYLE_KEY$5.ROTATE_Y,
+ ROTATE_Z$1 = _enums$STYLE_KEY$5.ROTATE_Z,
+ ROTATE_3D$1 = _enums$STYLE_KEY$5.ROTATE_3D,
+ PERSPECTIVE$1 = _enums$STYLE_KEY$5.PERSPECTIVE,
+ MATRIX$1 = _enums$STYLE_KEY$5.MATRIX,
+ FONT_SIZE$5 = _enums$STYLE_KEY$5.FONT_SIZE;
var PX$3 = o.PX,
PERCENT$3 = o.PERCENT,
REM$3 = o.REM,
@@ -13056,7 +13064,7 @@ function normalizeSingle(k, v, ow, oh, root) {
if (v[1] === PERCENT$3) {
return v[0] * ow * 0.01;
} else if (v[1] === REM$3) {
- return v[0] * root.computedStyle[FONT_SIZE$4];
+ return v[0] * root.computedStyle[FONT_SIZE$5];
} else if (v[1] === VW$3) {
return v[0] * root.width * 0.01;
} else if (v[1] === VH$3) {
@@ -13070,7 +13078,7 @@ function normalizeSingle(k, v, ow, oh, root) {
if (v[1] === PERCENT$3) {
return v[0] * oh * 0.01;
} else if (v[1] === REM$3) {
- return v[0] * root.computedStyle[FONT_SIZE$4];
+ return v[0] * root.computedStyle[FONT_SIZE$5];
} else if (v[1] === VW$3) {
return v[0] * root.width * 0.01;
} else if (v[1] === VH$3) {
@@ -13109,7 +13117,7 @@ function calOrigin(transformOrigin, w, h, root) {
} else if (item[1] === PERCENT$3) {
tfo.push(item[0] * (i ? h : w) * 0.01);
} else if (item[1] === REM$3) {
- tfo.push(item[0] * root.computedStyle[FONT_SIZE$4]);
+ tfo.push(item[0] * root.computedStyle[FONT_SIZE$5]);
} else if (item[1] === VW$3) {
tfo.push(item[0] * root.width * 0.01);
} else if (item[1] === VH$3) {
@@ -13249,9 +13257,9 @@ var blur = {
gaussianWeight: gaussianWeight
};
-var _enums$STYLE_KEY$5 = enums.STYLE_KEY,
- TRANSFORM_ORIGIN$2 = _enums$STYLE_KEY$5.TRANSFORM_ORIGIN,
- TRANSFORM$1 = _enums$STYLE_KEY$5.TRANSFORM; // 根据一个共享cache的信息,生成一个独立的离屏canvas,一般是filter,mask用
+var _enums$STYLE_KEY$6 = enums.STYLE_KEY,
+ TRANSFORM_ORIGIN$2 = _enums$STYLE_KEY$6.TRANSFORM_ORIGIN,
+ TRANSFORM$1 = _enums$STYLE_KEY$6.TRANSFORM; // 根据一个共享cache的信息,生成一个独立的离屏canvas,一般是filter,mask用
function genSingle(cache, message) {
var size = cache.size,
@@ -13718,14 +13726,14 @@ _defineProperty(Cache, "SELF", 3);
var _TRANSFORMS;
var STYLE_KEY$4 = enums.STYLE_KEY,
- _enums$STYLE_KEY$6 = enums.STYLE_KEY,
- TRANSLATE_X$2 = _enums$STYLE_KEY$6.TRANSLATE_X,
- TRANSLATE_Y$2 = _enums$STYLE_KEY$6.TRANSLATE_Y,
- TRANSLATE_Z$2 = _enums$STYLE_KEY$6.TRANSLATE_Z,
- OPACITY$1 = _enums$STYLE_KEY$6.OPACITY,
- FILTER$1 = _enums$STYLE_KEY$6.FILTER,
- PERSPECTIVE$2 = _enums$STYLE_KEY$6.PERSPECTIVE,
- PERSPECTIVE_ORIGIN$1 = _enums$STYLE_KEY$6.PERSPECTIVE_ORIGIN;
+ _enums$STYLE_KEY$7 = enums.STYLE_KEY,
+ TRANSLATE_X$2 = _enums$STYLE_KEY$7.TRANSLATE_X,
+ TRANSLATE_Y$2 = _enums$STYLE_KEY$7.TRANSLATE_Y,
+ TRANSLATE_Z$2 = _enums$STYLE_KEY$7.TRANSLATE_Z,
+ OPACITY$1 = _enums$STYLE_KEY$7.OPACITY,
+ FILTER$1 = _enums$STYLE_KEY$7.FILTER,
+ PERSPECTIVE$2 = _enums$STYLE_KEY$7.PERSPECTIVE,
+ PERSPECTIVE_ORIGIN$1 = _enums$STYLE_KEY$7.PERSPECTIVE_ORIGIN;
var ENUM = {
// 低位表示= length) {
+ // 特殊情况不应该走进这里
+ return [0, 0, false];
+ }
- var _super = _createSuper(Text);
+ var i = start,
+ j = length,
+ rw = 0,
+ newLine = false; // 特殊降级,有letterSpacing时,canvas无法完全兼容,只能采取单字测量的方式完成
- function Text(content) {
- var _this;
+ if (letterSpacing && [CANVAS$2, WEBGL$2].indexOf(renderMode) > -1) {
+ var count = 0;
- _classCallCheck(this, Text);
+ for (; i < length; i++) {
+ var mw = ctx.measureText(content.charAt(i)).width + letterSpacing;
- _this = _super.call(this);
- _this.__content = util.isNil(content) ? '' : content.toString();
- _this.__textBoxes = [];
- _this.__charWidthList = [];
- _this.__charWidth = 0; // 最小字符宽度(单个)
+ if (i > start && count + mw > w + 1e-10) {
+ newLine = true;
+ break;
+ }
- _this.__textWidth = 0; // 整体宽度
+ count += mw;
+ }
- _this.__bp = null; // block父节点
+ return [i - start, count, newLine || count > w + 1e-10];
+ } // 没有letterSpacing或者是svg模式可以完美获取TextMetrics
- return _this;
- }
- /**
- * 预先计算每个字的宽度,在每次布局渲染前做
- * @param renderMode
- * @param ctx
- * @private
- */
+ var hypotheticalNum = Math.round(w / perW); // 不能增长0个字符,至少也要1个
- _createClass(Text, [{
- key: "__computeMeasure",
- value: function __computeMeasure(renderMode, ctx) {
- var content = this.content,
- computedStyle = this.computedStyle,
- charWidthList = this.charWidthList; // 每次都要清空重新计算,计算会有缓存
+ if (hypotheticalNum <= 0) {
+ hypotheticalNum = 1;
+ } // 超过内容长度范围也不行
+ else if (hypotheticalNum > length - start) {
+ hypotheticalNum = length - start;
+ } // 类似2分的一个循环
- charWidthList.splice(0);
- var ffs = computedStyle[FONT_FAMILY$2].split(',');
- var ff = 'arial';
- for (var i = 0, len = ffs.length; i < len; i++) {
- if (inject.checkSupportFontFamily(ffs[i])) {
- ff = ffs[i];
- break;
- }
- }
+ while (i < j) {
+ var _mw = void 0,
+ str = content.slice(start, start + hypotheticalNum);
- this.__ff = ff;
- var fs = computedStyle[FONT_SIZE$5];
- var fw = computedStyle[FONT_WEIGHT$2];
- var key = this.__key = computedStyle[FONT_SIZE$5] + ',' + ff + ',' + fw;
- var wait = textCache.data[key] = textCache.data[key] || {
- ff: ff,
- fs: fs,
- fw: fw,
- hash: {},
- s: ''
- };
- var cache = textCache.charWidth[key] = textCache.charWidth[key] || {};
- var sum = 0;
- var needMeasure = false;
- var parentComputedStyle = this.domParent.computedStyle;
- var pff = 'arial';
-
- for (var _i = 0, pffs = parentComputedStyle[FONT_FAMILY$2].split(','), _len = pffs.length; _i < _len; _i++) {
- if (inject.checkSupportFontFamily(pffs[_i])) {
- ff = ffs[_i];
- break;
- }
- }
+ if (renderMode === CANVAS$2 || renderMode === WEBGL$2) {
+ _mw = ctx.measureText(str).width;
+ } else if (renderMode === SVG$1) {
+ _mw = inject.measureTextSync(str, fontFamily, fontSize, fontWeight);
+ }
- var pfs = parentComputedStyle[FONT_SIZE$5];
- var pfw = parentComputedStyle[FONT_WEIGHT$2];
- var pKey = this.__pKey = pfs + ',' + pff + ',' + pfw;
- var parentCache = textCache.charWidth[pKey] = textCache.charWidth[pKey] || {};
+ if (letterSpacing) {
+ _mw += hypotheticalNum * letterSpacing;
+ }
- if (renderMode === mode.CANVAS || renderMode === mode.WEBGL) {
- if (renderMode === mode.WEBGL) {
- ctx = inject.getCacheCanvas(16, 16, '__$$CHECK_SUPPORT_FONT_FAMILY$$__').ctx;
- }
+ if (_mw === w) {
+ rw = w;
+ newLine = true;
+ break;
+ } // 超出,设置右边界,并根据余量推测减少个数,精度问题,固定宽度或者累加的剩余空间,不用相等判断,而是为原本w宽度加一点点冗余1e-10
- if (!parentCache.hasOwnProperty(ELLIPSIS)) {
- ctx.font = css.setFontStyle(parentComputedStyle);
- parentCache[ELLIPSIS] = ctx.measureText(ELLIPSIS).width;
- }
- ctx.font = css.setFontStyle(computedStyle);
- } else if (renderMode === mode.SVG) {
- if (!parentCache.hasOwnProperty(ELLIPSIS)) {
- parentCache[ELLIPSIS] = 0;
-
- var _wait = textCache.data[pKey] = textCache.data[pKey] || {
- ff: pff,
- fs: pfs,
- fw: pfw,
- hash: {},
- s: ''
- };
+ if (_mw > w + 1e-10) {
+ newLine = true; // 限制至少1个
- _wait.s += ELLIPSIS;
- needMeasure = true;
- }
- } // 逐字测量,canvas可瞬间得到信息,svg先预存统一进行
+ if (i === start) {
+ rw = _mw;
+ break;
+ } // 注意特殊判断i和j就差1个可直接得出结果,因为现在超了而-1不超肯定是-1的结果
- for (var _i2 = 0, length = content.length; _i2 < length; _i2++) {
- var _char = content.charAt(_i2);
+ if (i === j - 1 || i - start === hypotheticalNum - 1) {
+ hypotheticalNum = i - start;
+ break;
+ }
- var mw = void 0;
+ j = hypotheticalNum - 1;
+ var reduce = Math.round((_mw - w) / perW);
- if (cache.hasOwnProperty(_char)) {
- mw = cache[_char];
- charWidthList.push(mw);
- sum += mw;
- this.__charWidth = Math.max(this.charWidth, mw);
- } else if (renderMode === mode.CANVAS || renderMode === mode.WEBGL) {
- mw = cache[_char] = ctx.measureText(_char).width;
- charWidthList.push(mw);
- sum += mw;
- this.__charWidth = Math.max(this.charWidth, mw);
- } else {
- if (!wait.hash.hasOwnProperty(_char)) {
- wait.s += _char;
- }
+ if (reduce <= 0) {
+ reduce = 1;
+ }
- wait.hash[_char] = true; // 先预存标识位-1,测量完后替换它
+ hypotheticalNum -= reduce;
- charWidthList.push(-1);
- needMeasure = true;
- }
+ if (hypotheticalNum < i - start) {
+ hypotheticalNum = i - start;
}
+ } // 还有空余,设置左边界,并根据余量推测增加的个数
+ else {
+ rw = _mw;
- this.__textWidth = sum;
-
- if (needMeasure) {
- textCache.list.push(this);
+ if (hypotheticalNum === length - start) {
+ break;
}
- }
- }, {
- key: "__measureCb",
- value: function __measureCb() {
- var content = this.content,
- charWidthList = this.charWidthList;
- var key = this.__key;
- var cache = textCache.charWidth[key];
- var sum = 0;
- for (var i = 0, len = charWidthList.length; i < len; i++) {
- if (charWidthList[i] < 0) {
- var mw = charWidthList[i] = cache[content.charAt(i)];
- sum += mw;
- this.__charWidth = Math.max(this.charWidth, mw);
- }
+ i = hypotheticalNum + start;
+ var add = Math.round((w - _mw) / perW);
+
+ if (add <= 0) {
+ add = 1;
}
- this.__textWidth = sum;
+ hypotheticalNum += add;
+
+ if (hypotheticalNum > j - start) {
+ hypotheticalNum = j - start;
+ }
}
- /**
- * text在virtual时和普通一样,无需特殊处理
- * endSpace由外界inline布局控制,末尾最后一行的空白mpb,包含递归情况,递归为多个嵌套末尾节点的空白mpb之和
- * 即便宽度不足,每行还是强制渲染一个字符,换行依据lx开始,因为x可能是从中间开始的,非inline则两个相等
- * 最后一个字符排版时要考虑末尾mpb,排不下的话回退删掉这个字符,如果最后一个字符另起开头,排不下也强制排,每行至少1个字符
- * 在textOverflow时很特殊,多个inline同行,回退可能到前一个inline节点,这个通过x和lx判断是否行首,决定至少1个字符规则
- * @param data
- * @private
- */
+ }
- }, {
+ return [hypotheticalNum, rw, newLine];
+}
+
+function getFontKey(ff, fs, fw, ls) {
+ return ff + '_' + fs + '_' + fw + '_' + ls;
+}
+
+var Text = /*#__PURE__*/function (_Node) {
+ _inherits(Text, _Node);
+
+ var _super = _createSuper(Text);
+
+ function Text(content) {
+ var _this;
+
+ _classCallCheck(this, Text);
+
+ _this = _super.call(this);
+ _this.__content = util.isNil(content) ? '' : content.toString();
+ _this.__textBoxes = [];
+ _this.__charWidth = 0; // 最小字符宽度(单个)
+
+ _this.__textWidth = 0; // 整体宽度
+
+ _this.__bp = null; // block父节点
+
+ _this.__widthHash = {}; // 存储当前字体样式key下的charWidth/textWidth
+
+ return _this;
+ }
+ /**
+ * text在virtual时和普通一样,无需特殊处理
+ * endSpace由外界inline布局控制,末尾最后一行的空白mpb,包含递归情况,递归为多个嵌套末尾节点的空白mpb之和
+ * 即便宽度不足,每行还是强制渲染一个字符,换行依据lx开始,因为x可能是从中间开始的,非inline则两个相等
+ * 最后一个字符排版时要考虑末尾mpb,排不下的话回退删掉这个字符,如果最后一个字符另起开头,排不下也强制排,每行至少1个字符
+ * 在textOverflow时很特殊,多个inline同行,回退可能到前一个inline节点,这个通过x和lx判断是否行首,决定至少1个字符规则
+ * @param data
+ * @private
+ */
+
+
+ _createClass(Text, [{
key: "__layout",
value: function __layout(data) {
var __cache = this.__config[NODE_CACHE];
@@ -14036,10 +14054,7 @@ var Text = /*#__PURE__*/function (_Node) {
content = this.content,
computedStyle = this.computedStyle,
textBoxes = this.textBoxes,
- charWidthList = this.charWidthList,
- root = this.root,
- __ff = this.__ff,
- __key = this.__key;
+ root = this.root;
textBoxes.splice(0);
var __config = this.__config;
__config[NODE_LIMIT_CACHE] = false; // 空内容w/h都为0可以提前跳出
@@ -14050,24 +14065,17 @@ var Text = /*#__PURE__*/function (_Node) {
this.__ox = this.__oy = 0; // 顺序尝试分割字符串为TextBox,形成多行,begin为每行起始索引,i是当前字符索引
- var begin = 0;
var i = 0;
var beginSpace = x - lx; // x>=lx,当第一行非起始处时前面被prev节点占据,这个差值可认为是count宽度
- var count = beginSpace;
var length = content.length;
var maxW = 0;
var lineHeight = computedStyle[LINE_HEIGHT$1],
letterSpacing = computedStyle[LETTER_SPACING$2],
whiteSpace = computedStyle[WHITE_SPACE$1],
- fontSize = computedStyle[FONT_SIZE$5],
- fontWeight = computedStyle[FONT_WEIGHT$2]; // 特殊字体中特殊字符连续时需减少一定的padding量
-
- var padding = o$1.info[__ff].padding;
- var needReduce = !!padding;
- var lastChar;
- var ew = textCache.charWidth[this.__pKey][ELLIPSIS]; // block的overflow:hidden和textOverflow:clip/ellipsis一起才生效,inline要看最近非inline父元素
-
+ fontSize = computedStyle[FONT_SIZE$6],
+ fontWeight = computedStyle[FONT_WEIGHT$3],
+ fontFamily = computedStyle[FONT_FAMILY$3];
var bp = this.domParent;
while (bp.computedStyle[DISPLAY$1] === 'inline') {
@@ -14075,336 +14083,411 @@ var Text = /*#__PURE__*/function (_Node) {
}
this.__bp = bp;
+ var textOverflow = bp.computedStyle[TEXT_OVERFLOW$1];
+ css.getFontFamily(fontFamily); // 有检测过程必须执行
+ // 布局测量前置,根据renderMode不同提供不同的测量方法
+
+ var renderMode = root.renderMode;
+ var ctx;
+
+ if (renderMode === CANVAS$2 || renderMode === WEBGL$2) {
+ ctx = renderMode === WEBGL$2 ? inject.getFontCanvas().ctx : root.ctx;
+ ctx.font = css.setFontStyle(computedStyle);
+ } // fontSize在中文是正好1个字宽度,英文不一定,等宽为2个,不等宽可能1~2个,特殊字符甚至>2个,取预估均值然后倒数得每个均宽0.8
+
+
+ var perW = fontSize * 0.8 + letterSpacing;
var lineCount = 0; // 不换行特殊对待,同时考虑overflow和textOverflow
if (whiteSpace === 'nowrap') {
- var isTextOverflow;
- var _bp$currentStyle = bp.currentStyle,
- display = _bp$currentStyle[DISPLAY$1],
- overflow = _bp$currentStyle[OVERFLOW],
- width = _bp$currentStyle[WIDTH$2],
- textOverflow = _bp$currentStyle[TEXT_OVERFLOW$1]; // 只要是overflow隐藏,不管textOverflow如何(默认是clip等同于overflow:hidden的功能)都截取
+ var isTextOverflow,
+ textWidth = this.textWidth;
+ var _bp$computedStyle = bp.computedStyle,
+ position = _bp$computedStyle[POSITION$1],
+ overflow = _bp$computedStyle[OVERFLOW$1];
+ var widthC = bp.currentStyle[WIDTH$2]; // 只要是overflow隐藏,不管textOverflow如何(默认是clip等同于overflow:hidden的功能)都截取
if (overflow === 'hidden') {
- while (i < length) {
- count += charWidthList[i] + letterSpacing;
-
- if (count > w) {
- // block/flex无需宽度,inline-block需要设置宽度才生效
- if (display === 'block' || display === 'flex') {
- isTextOverflow = true;
- } else if (width[1] !== AUTO$1) {
- isTextOverflow = true;
- }
-
- break;
- }
-
- i++;
- }
- } else {
- while (i < length) {
- count += charWidthList[i++] + letterSpacing;
+ // abs自适应宽度时不裁剪
+ if (position === 'absolute' && widthC[1] === AUTO$1) {
+ isTextOverflow = false;
+ } else {
+ isTextOverflow = textWidth > w + 1e-10 - beginSpace - endSpace;
}
} // ellipsis生效情况,本节点开始向前回退查找,尝试放下一部分字符
if (isTextOverflow && textOverflow === 'ellipsis') {
- var _this$__lineBack = this.__lineBack(count, w, beginSpace, endSpace, ew, letterSpacing, begin, i, length, lineCount, lineHeight, lx, x, y, maxW, textBoxes, content, charWidthList, lineBoxManager);
+ var _this$__lineBack = this.__lineBack(ctx, renderMode, i, length, content, w - endSpace - beginSpace, perW, x, y, maxW, endSpace, lineHeight, textBoxes, lineBoxManager, fontFamily, fontSize, fontWeight, letterSpacing);
- var _this$__lineBack2 = _slicedToArray(_this$__lineBack, 2);
+ var _this$__lineBack2 = _slicedToArray(_this$__lineBack, 1);
y = _this$__lineBack2[0];
- maxW = _this$__lineBack2[1];
- } // 默认clip跟随overflow:hidden,无需感知
+ lineCount++;
+ } // 默认是否clip跟随overflow:hidden,无需感知,裁剪由dom做,这里不裁剪
else {
- var textBox = new TextBox(this, textBoxes.length, x, y, count - beginSpace, lineHeight, content, charWidthList);
+ var textBox = new TextBox(this, textBoxes.length, x, y, textWidth, lineHeight, content);
textBoxes.push(textBox);
- lineBoxManager.addItem(textBox);
- maxW = count - beginSpace;
+ lineBoxManager.addItem(textBox, false);
y += lineHeight;
- }
+
+ if (isTextOverflow) {
+ lineCount++;
+ }
+ } // 和html一样,maxW此时在html是满格
+
+
+ maxW = textWidth;
} // 普通换行,注意x和lx的区别,可能相同(block起始处)可能不同(非起始处),第1行从x开始,第2行及以后都从lx开始
// 然后第一次换行还有特殊之处,可能同一行前半部行高很大,此时y增加并非自身的lineHeight,而是整体LineBox的
else {
while (i < length) {
- var cw = charWidthList[i] + letterSpacing;
- count += cw; // 连续字符减少padding,除了连续还需判断char是否在padding的hash中
+ var wl = i ? w : w - beginSpace;
- if (needReduce) {
- var _char2 = content[i];
+ if (lineClamp && lineCount + lineClampCount >= lineClamp - 1) {
+ wl -= endSpace;
+ }
- if (_char2 === lastChar && padding.hasOwnProperty(_char2) && padding[_char2]) {
- var hasCache = void 0,
- p = textCache.padding[__key] = textCache.padding[__key] || {};
+ var _measureLineWidth = measureLineWidth(ctx, renderMode, i, length, content, wl, perW, fontFamily, fontSize, fontWeight, letterSpacing),
+ _measureLineWidth2 = _slicedToArray(_measureLineWidth, 3),
+ num = _measureLineWidth2[0],
+ rw = _measureLineWidth2[1],
+ newLine = _measureLineWidth2[2]; // 多行文本截断,这里肯定需要回退,注意防止恰好是最后一个字符,此时无需截取
- if (textCache.padding.hasOwnProperty(__key)) {
- if (p.hasOwnProperty(_char2)) {
- hasCache = true;
- count -= p[_char2];
- }
- }
- if (!hasCache) {
- var n = 0;
-
- if (root.renderMode === mode.CANVAS) {
- root.ctx.font = css.setFontStyle(computedStyle);
- var w1 = root.ctx.measureText(_char2).width;
- var w2 = root.ctx.measureText(_char2 + _char2).width;
- n = w1 * 2 - w2;
- n *= padding[_char2];
- } else if (root.renderMode === mode.SVG) {
- n = inject.measureTextSync(__key, __ff, fontSize, fontWeight, _char2);
- n *= padding[_char2];
- }
+ if (lineClamp && newLine && lineCount + lineClampCount >= lineClamp - 1) {
+ var _this$__lineBack3 = this.__lineBack(ctx, renderMode, i, i + num, content, wl - endSpace, perW, lineCount ? lx : x, y, maxW, endSpace, lineHeight, textBoxes, lineBoxManager, fontFamily, fontSize, fontWeight, letterSpacing);
- count -= n;
- p[_char2] = n;
- }
- }
+ var _this$__lineBack4 = _slicedToArray(_this$__lineBack3, 2);
- lastChar = _char2;
- } // 忽略零宽字符
+ y = _this$__lineBack4[0];
+ maxW = _this$__lineBack4[1];
+ lineCount++;
+ break;
+ } // 最后一行考虑endSpace,可能不够需要回退,但不能是1个字符
- if (cw === 0) {
- i++;
- continue;
- } // 换行都要判断i不是0的时候,第1个字符强制不换行
+ if (i + num === length && endSpace && rw + endSpace > wl + 1e-10 && num > 1) {
+ var _measureLineWidth3 = measureLineWidth(ctx, renderMode, i, length, content, wl - endSpace, perW, fontFamily, fontSize, fontWeight, letterSpacing);
+ var _measureLineWidth4 = _slicedToArray(_measureLineWidth3, 3);
- if (count === w) {
- // 多行文本截断,这里肯定需要回退,注意防止恰好是最后一个字符,此时无需截取
- if (lineClamp && lineCount + lineClampCount >= lineClamp - 1 && i < length - 1) {
- var _this$__lineBack3 = this.__lineBack(count, w, beginSpace, endSpace, ew, letterSpacing, begin, i, length, lineCount, lineHeight, lx, x, y, maxW, textBoxes, content, charWidthList, lineBoxManager);
+ num = _measureLineWidth4[0];
+ rw = _measureLineWidth4[1];
+ newLine = _measureLineWidth4[2];
- var _this$__lineBack4 = _slicedToArray(_this$__lineBack3, 2);
+ // 可能加上endSpace后超过了,还得再判断一次
+ if (lineClamp && newLine && lineCount + lineClampCount >= lineClamp - 1) {
+ var _this$__lineBack5 = this.__lineBack(ctx, renderMode, i, i + num, content, wl - endSpace, perW, lineCount ? lx : x, y, maxW, endSpace, lineHeight, textBoxes, lineBoxManager, fontFamily, fontSize, fontWeight, letterSpacing);
- y = _this$__lineBack4[0];
- maxW = _this$__lineBack4[1];
+ var _this$__lineBack6 = _slicedToArray(_this$__lineBack5, 2);
+
+ y = _this$__lineBack6[0];
+ maxW = _this$__lineBack6[1];
lineCount++;
break;
}
+ }
- var _textBox = void 0; // 特殊情况,恰好最后一行最后一个排满,此时查看末尾mpb,要防止i为0的情况首个字符特殊不回退,无需看开头mpb
+ maxW = Math.max(maxW, rw); // 根据是否第一行分开处理行首空白
+ var _textBox = new TextBox(this, textBoxes.length, lineCount ? lx : x, y, rw, lineHeight, content.slice(i, i + num));
- if (i === length - 1 && count > w - endSpace && i) {
- count -= charWidthList[i--];
- }
+ textBoxes.push(_textBox);
+ lineBoxManager.addItem(_textBox, newLine);
+ y += Math.max(lineHeight, lineBoxManager.lineHeight); // 至少也要1个字符形成1行,哪怕是首行,因为是否放得下逻辑在dom中做过了
- i++;
+ i += num;
- if (!lineCount) {
- maxW = count - beginSpace;
- _textBox = new TextBox(this, textBoxes.length, x, y, maxW, lineHeight, content.slice(begin, i), charWidthList.slice(begin, i));
- } else {
- _textBox = new TextBox(this, textBoxes.length, lx, y, count, lineHeight, content.slice(begin, i), charWidthList.slice(begin, i));
- maxW = Math.max(maxW, count);
- } // 必须先添加再设置y,当有diff的lineHeight时,第一个换行不影响,再换行时第2个换行即第3行会被第1行影响
+ if (newLine) {
+ lineCount++;
+ }
+ } // 换行后Text的x重设为lx
- textBoxes.push(_textBox);
- lineBoxManager.addItem(_textBox, true);
- y += Math.max(lineHeight, lineBoxManager.lineHeight);
- begin = i;
- count = 0;
- lineCount++;
- lastChar = null; // 换行后连续字符reduce不生效重新计数
- } // 奇怪的精度问题,暂时不用相等判断,而是为原本w宽度加一点点冗余1e-10
- else if (count > w + 1e-10) {
- // 多行文本截断,这里肯定需要回退
- if (lineClamp && lineCount + lineClampCount >= lineClamp - 1) {
- var _this$__lineBack5 = this.__lineBack(count, w, beginSpace, endSpace, ew, letterSpacing, begin, i, length, lineCount, lineHeight, lx, x, y, maxW, textBoxes, content, charWidthList, lineBoxManager);
+ if (lineCount) {
+ this.__x = this.__sx1 = lx;
+ }
+ }
- var _this$__lineBack6 = _slicedToArray(_this$__lineBack5, 2);
+ this.__width = maxW;
+ this.__height = y - data.y;
+ this.__baseline = css.getBaseline(computedStyle);
+ return lineClampCount + lineCount;
+ }
+ }, {
+ key: "__layoutNone",
+ value: function __layoutNone() {
+ this.__width = this.__height = this.__baseline = 0;
- y = _this$__lineBack6[0];
- maxW = _this$__lineBack6[1];
- lineCount++;
- break;
- } // 普通非多行文本阶段逻辑
+ this.__textBoxes.splice(0);
+ } // 末尾行因ellipsis的缘故向前回退字符生成textBox,可能会因不满足宽度导致无法生成,此时向前继续回退TextBox
+ }, {
+ key: "__lineBack",
+ value: function __lineBack(ctx, renderMode, i, length, content, wl, perW, x, y, maxW, endSpace, lineHeight, textBoxes, lineBoxManager, fontFamily, fontSize, fontWeight, letterSpacing) {
+ var ew,
+ bp = this.__bp,
+ computedStyle = bp.computedStyle; // 临时测量ELLIPSIS的尺寸
- var _width = void 0; // 宽度不足时无法跳出循环,至少也要塞个字符形成一行,无需判断第1行,因为是否放得下逻辑在dom中做过了,
- // 如果第1行放不下,一定会另起一行,此时作为开头再放不下才会进这里,这个if只有0或1个字符的情况
+ if (renderMode === CANVAS$2 || renderMode === WEBGL$2) {
+ var font = css.setFontStyle(computedStyle);
+ if (ctx.font !== font) {
+ ctx.font = font;
+ }
- if (i <= begin) {
- _width = count;
- } // 超过2个字符回退1个
- else {
- _width = count - charWidthList[i--];
- }
+ ew = ctx.measureText(ELLIPSIS).width;
+ } else {
+ ew = inject.measureTextSync(ELLIPSIS, computedStyle[FONT_FAMILY$3], computedStyle[FONT_SIZE$6], computedStyle[FONT_WEIGHT$3]);
+ }
- i++; // 根据是否第一行分开处理行首空白
+ if (renderMode === CANVAS$2 || renderMode === WEBGL$2) {
+ var _font = css.setFontStyle(this.computedStyle);
- var _textBox2 = void 0;
+ if (ctx.font !== _font) {
+ ctx.font = _font;
+ }
+ }
- if (!lineCount) {
- maxW = _width - beginSpace;
- _textBox2 = new TextBox(this, textBoxes.length, x, y, maxW, lineHeight, content.slice(begin, i), charWidthList.slice(begin, i));
- } else {
- _textBox2 = new TextBox(this, textBoxes.length, lx, y, _width, lineHeight, content.slice(begin, i), charWidthList.slice(begin, i));
- maxW = Math.max(maxW, _width);
- } // 必须先添加再设置y,同上
+ var _measureLineWidth5 = measureLineWidth(ctx, renderMode, i, length, content, wl - ew - endSpace, perW, fontFamily, fontSize, fontWeight, letterSpacing),
+ _measureLineWidth6 = _slicedToArray(_measureLineWidth5, 2),
+ num = _measureLineWidth6[0],
+ rw = _measureLineWidth6[1]; // 还是不够,需要回溯查找前一个inline节点继续回退,同时防止空行首,要至少一个textBox且一个字符
- textBoxes.push(_textBox2);
- lineBoxManager.addItem(_textBox2, true);
- y += Math.max(lineHeight, lineBoxManager.lineHeight);
- begin = i;
- count = 0;
- lineCount++;
- lastChar = null;
- } else {
- i++;
- }
- } // 换行后Text的x重设为lx
+ if (rw + ew > wl + 1e-10 - endSpace) {
+ // 向前回溯已有的tb,需注意可能是新行开头这时还没生成新的lineBox,而旧行则至少1个内容
+ // 新行的话进不来,会添加上面num的内容,旧行不添加只修改之前的tb内容也有可能删除一些
+ var lineBox = lineBoxManager.lineBox;
+ if (!lineBoxManager.isNewLine && lineBox && lineBox.size) {
+ var list = lineBox.list;
- if (lineCount) {
- this.__x = this.__sx1 = lx;
- } // 最后一行,只有一行未满时也进这里,需查看末尾mpb,排不下回退一个字符
- // 声明了lineClamp时特殊考虑,这里一定是最后一行,要对比行数不能超过,超过忽略掉这些文本
+ for (var j = list.length - 1; j >= 0; j--) {
+ var tb = list[j]; // 可能是个inlineBlock,整个省略掉,除非是第一个不作ellipsis处理
+ if (!(tb instanceof TextBox)) {
+ if (!j) {
+ break;
+ }
- if (begin < length && (!lineClamp || lineCount + lineClampCount < lineClamp)) {
- var _textBox3;
+ var _item = list.pop();
- if (!lineCount) {
- var needBack; // 防止开头第一个begin=0时回退,这在inline有padding且是第一个child时会发生
+ x -= _item.outerWidth;
+ wl += _item.outerWidth;
- if (begin && count > w - endSpace) {
- needBack = true;
- count -= charWidthList[length - 1];
- }
+ _item.__layoutNone();
- maxW = count - beginSpace;
- _textBox3 = new TextBox(this, textBoxes.length, x, y, maxW, lineHeight, content.slice(begin, needBack ? length - 1 : length), charWidthList.slice(begin, needBack ? length - 1 : length));
- textBoxes.push(_textBox3);
- lineBoxManager.addItem(_textBox3);
- y += Math.max(lineHeight, lineBoxManager.lineHeight);
-
- if (needBack) {
- var _width2 = charWidthList[length - 1];
- _textBox3 = new TextBox(this, textBoxes.length, lx, y, _width2, lineHeight, content.slice(length - 1), charWidthList.slice(length - 1));
- maxW = Math.max(maxW, _width2);
- textBoxes.push(_textBox3);
- lineBoxManager.setNewLine();
- lineBoxManager.addItem(_textBox3);
- y += lineHeight;
- lineCount++;
+ continue;
+ } // 先判断整个tb都删除是否可以容纳下,同时注意第1个tb不能删除因此必进
+
+
+ var _content = tb.content,
+ width = tb.width,
+ parent = tb.parent;
+
+ if (!j || wl >= width + ew + 1e-10 + endSpace) {
+ var _length = _content.length;
+ var _parent$computedStyle = parent.computedStyle,
+ _lineHeight = _parent$computedStyle[LINE_HEIGHT$1],
+ _letterSpacing = _parent$computedStyle[LETTER_SPACING$2],
+ _fontSize = _parent$computedStyle[FONT_SIZE$6],
+ _fontWeight = _parent$computedStyle[FONT_WEIGHT$3],
+ _fontFamily = _parent$computedStyle[FONT_FAMILY$3];
+
+ if (renderMode === CANVAS$2 || renderMode === WEBGL$2) {
+ ctx.font = css.setFontStyle(parent.computedStyle);
+ } // 再进行查找,这里也会有至少一个字符不用担心
+
+
+ var _measureLineWidth7 = measureLineWidth(ctx, renderMode, 0, _length, _content, wl - ew + width - endSpace, perW, _fontFamily, _fontSize, _fontWeight, _letterSpacing),
+ _measureLineWidth8 = _slicedToArray(_measureLineWidth7, 2),
+ _num = _measureLineWidth8[0],
+ _rw = _measureLineWidth8[1]; // 可能发生x回退,当tb的内容产生减少时
+
+
+ if (_num !== _content.length) {
+ tb.__content = _content.slice(0, _num);
+ x -= width - _rw;
+ tb.__width = _rw;
+ } // 重新设置lineHeight和baseline,因为可能删除了东西
+
+
+ lineBox.__resetLb(computedStyle[LINE_HEIGHT$1], css.getBaseline(computedStyle));
+
+ var _ep = new Ellipsis(x + endSpace, y, ew, bp);
+
+ lineBoxManager.addItem(_ep, true);
+ y += Math.max(_lineHeight, lineBoxManager.lineHeight);
+ maxW = Math.max(maxW, _rw + ew);
+ return [y, maxW];
+ } // 舍弃这个tb,x也要向前回退,w增加,这会发生在ELLIPSIS字体很大,里面内容字体很小时
+
+
+ var item = list.pop();
+ wl += width;
+ x -= width;
+ var tbs = item.parent.textBoxes;
+ var k = tbs.indexOf(item);
+
+ if (k > -1) {
+ tbs.splice(k, 1);
+ } // 还得去掉dom,防止inline嵌套一直向上,同时得判断不能误删前面一个的dom
+
+
+ var dom = item.parent.parent;
+ var prev = list[list.length - 1];
+
+ if (prev instanceof TextBox) {
+ prev = prev.parent.parent;
}
- } else {
- var _needBack; // 防止begin在结尾时回退,必须要有个字符,这在最后一行1个字符排不下时会出现
+ while (dom !== bp && dom !== prev) {
+ var _contentBoxList = dom.contentBoxList || [];
- if (count > w - endSpace && begin < length - 1) {
- _needBack = true;
- count -= charWidthList[length - 1];
+ var _i2 = _contentBoxList.indexOf(item);
+
+ if (_i2 > -1) {
+ _contentBoxList.splice(_i2, 1);
+ }
+
+ var _computedStyle = dom.computedStyle;
+ var mbp = _computedStyle[MARGIN_LEFT] + _computedStyle[MARGIN_RIGHT] + _computedStyle[PADDING_LEFT$1] + _computedStyle[PADDING_RIGHT] + _computedStyle[BORDER_LEFT_WIDTH$2] + _computedStyle[BORDER_RIGHT_WIDTH$1];
+ x -= mbp;
+ wl += mbp;
+
+ dom.__layoutNone();
+
+ dom = dom.domParent;
}
- _textBox3 = new TextBox(this, textBoxes.length, lx, y, count, lineHeight, content.slice(begin, _needBack ? length - 1 : length), charWidthList.slice(begin, _needBack ? length - 1 : length));
- maxW = Math.max(maxW, count);
- textBoxes.push(_textBox3);
- lineBoxManager.addItem(_textBox3);
- y += Math.max(lineHeight, lineBoxManager.lineHeight);
-
- if (_needBack) {
- var _width3 = charWidthList[length - 1];
- _textBox3 = new TextBox(this, textBoxes.length, lx, y, _width3, lineHeight, content.slice(length - 1), charWidthList.slice(length - 1));
- maxW = Math.max(maxW, _width3);
- textBoxes.push(_textBox3);
- lineBoxManager.setNewLine();
- lineBoxManager.addItem(_textBox3);
- y += lineHeight;
- lineCount++;
+ var contentBoxList = prev.contentBoxList || [];
+
+ var _i = contentBoxList.indexOf(item);
+
+ if (_i > -1) {
+ contentBoxList.splice(_i, 1);
}
}
}
- }
+ } // 本次回退不用向前追溯删除textBox会进这里,最少一个字符兜底
- this.__width = maxW;
- this.__height = y - data.y;
- this.__baseline = css.getBaseline(computedStyle);
- return lineCount;
- } // 末尾行因ellipsis的缘故向前回退字符生成textBox,可能会因不满足宽度导致无法生成,此时向前继续回退TextBox
+
+ var textBox = new TextBox(this, textBoxes.length, x, y, rw, lineHeight, content.slice(i, i + num));
+ textBoxes.push(textBox);
+ lineBoxManager.addItem(textBox, false); // ELLIPSIS也作为内容加入,但特殊的是指向最近block使用其样式渲染
+
+ var ep = new Ellipsis(x + rw + endSpace, y, ew, bp);
+ lineBoxManager.addItem(ep, true);
+ y += Math.max(lineHeight, lineBoxManager.lineHeight);
+ maxW = Math.max(maxW, rw + ew);
+ return [y, maxW];
+ } // 外部dom换行发现超行,且一定是ellipsis时,会进这里让上一行text回退,lineBox一定有值且最后一个一定是本text的最后的textBox
}, {
- key: "__lineBack",
- value: function __lineBack(count, w, beginSpace, endSpace, ew, letterSpacing, begin, i, length, lineCount, lineHeight, lx, x, y, maxW, textBoxes, content, charWidthList, lineBoxManager) {
- for (; i >= begin; i--) {
- count -= charWidthList[i] + letterSpacing;
+ key: "__backtrack",
+ value: function __backtrack(bp, lineBoxManager, lineBox, textBox, wl, endSpace, ew, computedStyle, ctx, renderMode) {
+ var list = lineBox.list;
- if (count + ew + endSpace <= w) {
- // 至少1个字符不用回退,到0也没找到需要回退
- if (i) {
- maxW = count - (lineCount ? 0 : beginSpace);
- var textBox = new TextBox(this, textBoxes.length, lineCount ? lx : x, y, maxW, lineHeight, content.slice(begin, i), charWidthList.slice(begin, i));
- textBoxes.push(textBox);
- lineBoxManager.addItem(textBox, true);
- y += Math.max(lineHeight, lineBoxManager.lineHeight);
- this.__ellipsis = true;
+ for (var j = list.length - 1; j >= 0; j--) {
+ var tb = list[j]; // 可能是个inlineBlock,整个省略掉,除非是第一个不作ellipsis处理
+
+ if (!(tb instanceof TextBox)) {
+ if (!j) {
break;
}
- }
- } // 最后也没找到,看是否要查找前一个inline节点,还是本身是行首兜底首字母
+ var _item2 = list.pop();
- if (i < 0) {
- var lineBox = lineBoxManager.lineBox; // lineBox为空是行首,至少放1个字符
+ wl += _item2.outerWidth;
- if (!lineBox || !lineBox.size) {
- maxW = count - (lineCount ? 0 : beginSpace);
+ _item2.__layoutNone();
- var _textBox4 = new TextBox(this, textBoxes.length, lineCount ? lx : x, y, maxW, lineHeight, content.charAt(begin), charWidthList.slice(begin, begin + 1));
+ continue;
+ } // 先判断整个tb都删除是否可以容纳下,同时注意第1个tb不能删除因此必进
- textBoxes.push(_textBox4);
- lineBoxManager.addItem(_textBox4, true);
- y += Math.max(lineHeight, lineBoxManager.lineHeight);
- this.__ellipsis = true;
- } // 向前查找inline节点,可能会有前面inline嵌套,因此直接用lineBox,不会出现inlineBlock,
- // 这里和css不同,ib强制超限换行不会同行
- else {
- var list = lineBox.list;
- outer: for (var j = list.length - 1; j >= 0; j--) {
- var tb = list[j];
- var _content = tb.content,
- wList = tb.wList,
- width = tb.width; // 整体减去可以说明可能在这个tb中,只要最后发现不是空文本节点就行,否则继续;第0个强制进入保证1字符
-
- if (count - width + ew <= w || !j) {
- // 找到可以跳出outer循环,找不到继续,注意第0个且1个字符判断
- for (var k = wList.length - 1; k >= 0; k--) {
- if (!k && !j || count + ew <= w) {
- tb.__content = _content;
- tb.__width = width;
- tb.parent.__ellipsis = true;
- break outer;
- } else {
- var w2 = wList[k];
- tb.__endY -= w2;
- width -= w2;
- _content = _content.slice(0, k);
- count -= w2;
- wList.pop();
- }
- }
- } // 不够则看前一个tb并且删掉这个
- else {
- count -= width;
- }
+ var content = tb.content,
+ width = tb.width,
+ parent = tb.parent;
+
+ if (!j || wl >= width + ew + 1e-10 + endSpace) {
+ var length = content.length;
+ var _parent$computedStyle2 = parent.computedStyle,
+ letterSpacing = _parent$computedStyle2[LETTER_SPACING$2],
+ fontSize = _parent$computedStyle2[FONT_SIZE$6],
+ fontWeight = _parent$computedStyle2[FONT_WEIGHT$3],
+ fontFamily = _parent$computedStyle2[FONT_FAMILY$3];
- list.pop();
- tb.parent.textBoxes.pop();
+ if (renderMode === CANVAS$2 || renderMode === WEBGL$2) {
+ ctx.font = css.setFontStyle(parent.computedStyle);
}
+
+ var perW = fontSize * 0.8 + letterSpacing; // 再进行查找,这里也会有至少一个字符不用担心
+
+ var _measureLineWidth9 = measureLineWidth(ctx, renderMode, 0, length, content, wl - ew - endSpace + width, perW, fontFamily, fontSize, fontWeight, letterSpacing),
+ _measureLineWidth10 = _slicedToArray(_measureLineWidth9, 2),
+ num = _measureLineWidth10[0],
+ rw = _measureLineWidth10[1]; // 可能发生x回退,当tb的内容产生减少时
+
+
+ if (num !== content.length) {
+ tb.__content = content.slice(0, num);
+ tb.__width = rw;
+ } // 重新设置lineHeight和baseline,因为可能删除了东西
+
+
+ lineBox.__resetLb(computedStyle[LINE_HEIGHT$1], css.getBaseline(computedStyle));
+
+ var ep = new Ellipsis(tb.x + rw + endSpace, tb.y, ew, bp);
+ lineBoxManager.addItem(ep, true);
+ return;
+ } // 舍弃这个tb,x也要向前回退,w增加,这会发生在ELLIPSIS字体很大,里面内容字体很小时
+
+
+ var item = list.pop();
+ wl += width;
+ var tbs = item.parent.textBoxes;
+ var k = tbs.indexOf(item);
+
+ if (k > -1) {
+ tbs.splice(k, 1);
+ } // 还得去掉dom,防止inline嵌套一直向上,同时得判断不能误删前面一个的dom
+
+
+ var dom = item.parent.parent;
+ var prev = list[list.length - 1];
+
+ if (prev instanceof TextBox) {
+ prev = prev.parent.parent;
}
- }
- return [y, maxW];
+ while (dom !== bp && dom !== prev) {
+ var _contentBoxList2 = dom.contentBoxList || [];
+
+ var _i3 = _contentBoxList2.indexOf(item);
+
+ if (_i3 > -1) {
+ _contentBoxList2.splice(_i3, 1);
+ }
+
+ var _computedStyle2 = dom.computedStyle;
+ var mbp = _computedStyle2[MARGIN_LEFT] + _computedStyle2[MARGIN_RIGHT] + _computedStyle2[PADDING_LEFT$1] + _computedStyle2[PADDING_RIGHT] + _computedStyle2[BORDER_LEFT_WIDTH$2] + _computedStyle2[BORDER_RIGHT_WIDTH$1];
+ wl += mbp;
+
+ dom.__layoutNone();
+
+ dom = dom.domParent;
+ }
+
+ var contentBoxList = prev.contentBoxList || [];
+ var i = contentBoxList.indexOf(item);
+
+ if (i > -1) {
+ contentBoxList.splice(i, 1);
+ }
+ }
}
}, {
key: "__offsetX",
@@ -14435,7 +14518,7 @@ var Text = /*#__PURE__*/function (_Node) {
}, {
key: "__tryLayInline",
value: function __tryLayInline(w) {
- return w - this.charWidthList[0];
+ return w - this.firstCharWidth;
}
}, {
key: "__inlineSize",
@@ -14464,12 +14547,10 @@ var Text = /*#__PURE__*/function (_Node) {
computedStyle = this.computedStyle,
textBoxes = this.textBoxes,
cacheStyle = this.cacheStyle,
- __ellipsis = this.__ellipsis,
- __bp = this.__bp,
__config = this.__config;
- if (renderMode === mode.SVG) {
- __config[NODE_VIRTUAL_DOM] = this.__virtualDom = {
+ if (renderMode === SVG$1) {
+ __config[NODE_VIRTUAL_DOM$1] = this.__virtualDom = {
type: 'text',
children: []
};
@@ -14479,9 +14560,9 @@ var Text = /*#__PURE__*/function (_Node) {
return;
}
- if (renderMode === mode.CANVAS || renderMode === mode.WEBGL) {
+ if (renderMode === CANVAS$2 || renderMode === WEBGL$2) {
// webgl借用离屏canvas绘制文本,cache标识为true是普通绘制,否则是超限降级情况
- if (renderMode === mode.WEBGL) {
+ if (renderMode === WEBGL$2) {
if (cache) {
var sx = this.sx,
sy = this.sy,
@@ -14517,13 +14598,13 @@ var Text = /*#__PURE__*/function (_Node) {
}
}
- var _font = css.setFontStyle(computedStyle);
+ var font = css.setFontStyle(computedStyle);
- if (ctx.font !== _font) {
- ctx.font = _font;
+ if (ctx.font !== font) {
+ ctx.font = font;
}
- var color = cacheStyle[COLOR$2];
+ var color = cacheStyle[COLOR$3];
if (ctx.fillStyle !== color) {
ctx.fillStyle = color;
@@ -14547,42 +14628,10 @@ var Text = /*#__PURE__*/function (_Node) {
item.render(renderMode, ctx, computedStyle, cacheStyle, dx, dy);
});
- if (renderMode === mode.SVG) {
+ if (renderMode === SVG$1) {
this.virtualDom.children = textBoxes.map(function (textBox) {
return textBox.virtualDom;
});
- } // textOverflow的省略号font使用最近非inline的父节点
-
-
- if (__ellipsis) {
- var last = textBoxes[textBoxes.length - 1];
- var endX = last.endX,
- endY = last.endY;
- var _computedStyle = __bp.computedStyle;
-
- if (renderMode === mode.CANVAS || renderMode === mode.WEBGL) {
- var _font2 = css.setFontStyle(_computedStyle);
-
- if (ctx.font !== _font2) {
- ctx.font = _font2;
- }
-
- var _color = __bp.__cacheStyle[COLOR$2];
-
- if (ctx.fillStyle !== _color) {
- ctx.fillStyle = _color;
- }
-
- ctx.fillText(ELLIPSIS, endX, endY);
- } else if (renderMode === mode.SVG) {
- var props = [['x', endX], ['y', endY], ['fill', __bp.__cacheStyle[COLOR$2]], ['font-family', _computedStyle[FONT_FAMILY$2]], ['font-weight', _computedStyle[FONT_WEIGHT$2]], ['font-style', _computedStyle[FONT_STYLE$2]], ['font-size', _computedStyle[FONT_SIZE$5] + 'px']];
- this.virtualDom.children.push({
- type: 'item',
- tagName: 'text',
- props: props,
- content: ELLIPSIS
- });
- }
}
}
}, {
@@ -14630,7 +14679,6 @@ var Text = /*#__PURE__*/function (_Node) {
var res = {};
var vd = self.domParent;
res[UPDATE_NODE] = vd;
- res[UPDATE_MEASURE] = true;
res[UPDATE_FOCUS] = o$3.REFLOW;
res[UPDATE_CONFIG] = vd.__config;
var root = vd.root;
@@ -14657,25 +14705,120 @@ var Text = /*#__PURE__*/function (_Node) {
get: function get() {
return this.__textBoxes;
}
- }, {
- key: "charWidthList",
- get: function get() {
- return this.__charWidthList;
- }
}, {
key: "charWidth",
get: function get() {
- return this.__charWidth;
+ var __widthHash = this.__widthHash,
+ content = this.content,
+ computedStyle = this.computedStyle,
+ _this$root = this.root,
+ ctx = _this$root.ctx,
+ renderMode = _this$root.renderMode;
+ var fontFamily = computedStyle[FONT_FAMILY$3],
+ fontSize = computedStyle[FONT_SIZE$6],
+ fontWeight = computedStyle[FONT_WEIGHT$3],
+ letterSpacing = computedStyle[LETTER_SPACING$2];
+ var fontKey = getFontKey(fontFamily, fontSize, fontWeight, letterSpacing);
+
+ if (!__widthHash.hasOwnProperty(fontKey)) {
+ __widthHash[fontKey] = {};
+ }
+
+ var o = __widthHash[fontKey];
+
+ if (!o.hasOwnProperty('charWidth')) {
+ var max = 0;
+
+ if (renderMode === CANVAS$2 || renderMode === WEBGL$2) {
+ if (renderMode === WEBGL$2) {
+ ctx = inject.getFontCanvas().ctx;
+ }
+
+ ctx.font = css.setFontStyle(computedStyle);
+
+ for (var i = 0, len = content.length; i < len; i++) {
+ max = Math.max(max, ctx.measureText(content.charAt([i])).width);
+ }
+ } else if (renderMode === SVG$1) {
+ max = inject.measureTextListMax(content, fontFamily, fontSize, fontWeight);
+ }
+
+ o.charWidth = max + letterSpacing;
+ }
+
+ return o.charWidth;
}
}, {
key: "firstCharWidth",
get: function get() {
- return this.charWidthList[0] || 0;
+ var __widthHash = this.__widthHash,
+ content = this.content,
+ computedStyle = this.computedStyle,
+ _this$root2 = this.root,
+ ctx = _this$root2.ctx,
+ renderMode = _this$root2.renderMode;
+ var fontFamily = computedStyle[FONT_FAMILY$3],
+ fontSize = computedStyle[FONT_SIZE$6],
+ fontWeight = computedStyle[FONT_WEIGHT$3],
+ letterSpacing = computedStyle[LETTER_SPACING$2];
+ var fontKey = getFontKey(fontFamily, fontSize, fontWeight, letterSpacing);
+
+ if (!__widthHash.hasOwnProperty(fontKey)) {
+ __widthHash[fontKey] = {};
+ }
+
+ var o = __widthHash[fontKey];
+
+ if (!o.hasOwnProperty('firstCharWidth')) {
+ if (renderMode === CANVAS$2 || renderMode === WEBGL$2) {
+ if (renderMode === WEBGL$2) {
+ ctx = inject.getFontCanvas().ctx;
+ }
+
+ ctx.font = css.setFontStyle(computedStyle);
+ o.firstCharWidth = ctx.measureText(content.charAt(0)).width + letterSpacing;
+ } else if (renderMode === SVG$1) {
+ o.firstCharWidth = inject.measureTextSync(content.charAt(0), fontFamily, fontSize, fontWeight) + letterSpacing;
+ }
+ }
+
+ return o.firstCharWidth;
}
}, {
key: "textWidth",
get: function get() {
- return this.__textWidth;
+ var __widthHash = this.__widthHash,
+ content = this.content,
+ computedStyle = this.computedStyle,
+ _this$root3 = this.root,
+ ctx = _this$root3.ctx,
+ renderMode = _this$root3.renderMode;
+ var fontFamily = computedStyle[FONT_FAMILY$3],
+ fontSize = computedStyle[FONT_SIZE$6],
+ fontWeight = computedStyle[FONT_WEIGHT$3],
+ letterSpacing = computedStyle[LETTER_SPACING$2];
+ var fontKey = getFontKey(fontFamily, fontSize, fontWeight, letterSpacing);
+
+ if (!__widthHash.hasOwnProperty(fontKey)) {
+ __widthHash[fontKey] = {};
+ }
+
+ var o = __widthHash[fontKey];
+
+ if (!o.hasOwnProperty('textWidth')) {
+ if (renderMode === CANVAS$2 || renderMode === WEBGL$2) {
+ if (renderMode === WEBGL$2) {
+ ctx = inject.getFontCanvas().ctx;
+ }
+
+ ctx.font = css.setFontStyle(computedStyle);
+ o.textWidth = ctx.measureText(content).width + letterSpacing * content.length;
+ } else if (renderMode === SVG$1) {
+ o.textWidth = inject.measureTextSync(content, fontFamily, fontSize, fontWeight) + letterSpacing * content.length;
+ }
+ }
+
+ return o.textWidth;
}
}, {
key: "baseline",
@@ -14719,7 +14862,7 @@ var Text = /*#__PURE__*/function (_Node) {
var half = 0;
if (textStrokeWidth[1] === REM$4) {
- half = Math.max(textStrokeWidth[0] * root.computedStyle[FONT_SIZE$5], half);
+ half = Math.max(textStrokeWidth[0] * root.computedStyle[FONT_SIZE$6], half);
} else if (textStrokeWidth[1] === VW$4) {
half = Math.max(textStrokeWidth[0] * root.width, half);
} else if (textStrokeWidth[1] === VH$4) {
@@ -15588,9 +15731,186 @@ Object.keys(o$2.GEOM).concat(['x', 'y', 'ox', 'oy', 'sx', 'sy', // '__sx1',
};
});
-var _enums$STYLE_KEY$8 = enums.STYLE_KEY,
- SCALE_X$2 = _enums$STYLE_KEY$8.SCALE_X,
- SCALE_Y$2 = _enums$STYLE_KEY$8.SCALE_Y;
+var _enums$STYLE_KEY$9 = enums.STYLE_KEY,
+ MARGIN_LEFT$1 = _enums$STYLE_KEY$9.MARGIN_LEFT,
+ MARGIN_RIGHT$1 = _enums$STYLE_KEY$9.MARGIN_RIGHT,
+ PADDING_LEFT$2 = _enums$STYLE_KEY$9.PADDING_LEFT,
+ PADDING_RIGHT$1 = _enums$STYLE_KEY$9.PADDING_RIGHT,
+ BORDER_LEFT_WIDTH$3 = _enums$STYLE_KEY$9.BORDER_LEFT_WIDTH,
+ BORDER_RIGHT_WIDTH$2 = _enums$STYLE_KEY$9.BORDER_RIGHT_WIDTH;
+/**
+ * 获取inline的每一行内容的矩形坐标4个点,同时附带上border的矩形,比前面4个点尺寸大或相等(有无border/padding)
+ * @param xom
+ * @param contentBoxList
+ * @param start
+ * @param end
+ * @param lineBox
+ * @param baseline
+ * @param lineHeight
+ * @param diffL
+ * @param isStart
+ * @param isEnd
+ * @param backgroundClip
+ * @param paddingTop
+ * @param paddingRight
+ * @param paddingBottom
+ * @param paddingLeft
+ * @param borderTopWidth
+ * @param borderRightWidth
+ * @param borderBottomWidth
+ * @param borderLeftWidth
+ * @returns {(*|number)[]}
+ */
+
+function getInlineBox(xom, contentBoxList, start, end, lineBox, baseline, lineHeight, diffL, isStart, isEnd, backgroundClip, paddingTop, paddingRight, paddingBottom, paddingLeft, borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth) {
+ // 根据bgClip确定y伸展范围,inline渲染bg扩展到pb的位置不影响布局
+ var eyt = 0,
+ eyb = 0;
+
+ if (backgroundClip === 'paddingBox' || backgroundClip === 'padding-box') {
+ eyt = paddingTop;
+ eyb = paddingBottom;
+ } else if (backgroundClip !== 'contentBox' && backgroundClip !== 'content-box') {
+ eyt = paddingTop + borderTopWidth;
+ eyb = paddingBottom + borderBottomWidth;
+ } // 同y的border伸展范围,其影响border渲染
+
+
+ var pbt = paddingTop + borderTopWidth;
+ var pbb = paddingBottom + borderBottomWidth; // inline的baseline和lineBox的差值
+
+ var diff = lineBox.baseline - baseline; // x坐标取首尾contentBox的左右2侧,clip布局时已算好;y是根据lineHeight和lineBox的高度以及baseline对齐后计算的
+
+ var x1 = start.x;
+ var dom = start instanceof TextBox ? start.parent.domParent : start.domParent;
+
+ while (dom !== xom) {
+ var list = dom.contentBoxList;
+
+ if (start === list[0]) {
+ var _dom$computedStyle = dom.computedStyle,
+ marginLeft = _dom$computedStyle[MARGIN_LEFT$1],
+ _paddingLeft = _dom$computedStyle[PADDING_LEFT$2],
+ _borderLeftWidth = _dom$computedStyle[BORDER_LEFT_WIDTH$3];
+ x1 -= marginLeft + _paddingLeft + _borderLeftWidth;
+ }
+
+ dom = dom.domParent;
+ }
+
+ var bx1 = x1;
+
+ if (isStart) {
+ if (backgroundClip === 'paddingBox' || backgroundClip === 'padding-box') {
+ x1 -= paddingLeft;
+ } else if (backgroundClip !== 'contentBox' && backgroundClip !== 'content-box') {
+ x1 -= paddingLeft + borderLeftWidth;
+ }
+
+ bx1 -= paddingLeft + borderLeftWidth;
+ }
+
+ var y1 = lineBox.y + diff - eyt;
+ var by1 = lineBox.y + diff - pbt;
+ var x2 = end.x + end.outerWidth; // TextBox的parent是Text,再是Dom,这里一定是inline,无嵌套就是xom本身,有则包含若干层最上层还是xom
+
+ dom = end instanceof TextBox ? end.parent.domParent : end.domParent; // 从end开始,向上获取dom节点的尾部mpb进行累加,直到xom跳出
+
+ while (dom !== xom) {
+ var _list = dom.contentBoxList;
+
+ if (end === _list[_list.length - 1]) {
+ var _dom$computedStyle2 = dom.computedStyle,
+ marginRight = _dom$computedStyle2[MARGIN_RIGHT$1],
+ _paddingRight = _dom$computedStyle2[PADDING_RIGHT$1],
+ _borderRightWidth = _dom$computedStyle2[BORDER_RIGHT_WIDTH$2];
+ x2 += marginRight + _paddingRight + _borderRightWidth;
+ }
+
+ dom = dom.domParent;
+ }
+
+ var bx2 = x2;
+
+ if (isEnd) {
+ if (backgroundClip === 'paddingBox' || backgroundClip === 'padding-box') {
+ x2 += paddingRight;
+ } else if (backgroundClip !== 'contentBox' && backgroundClip !== 'content-box') {
+ x2 += paddingRight + borderRightWidth;
+ }
+
+ bx2 += paddingRight + borderRightWidth;
+ }
+
+ var y2 = lineBox.y + diff + lineHeight - diffL + eyb;
+ var by2 = lineBox.y + diff + lineHeight - diffL + pbb; // x要考虑xom的ox值
+
+ x1 += xom.ox;
+ x2 += xom.ox;
+ bx1 += xom.ox;
+ bx2 += xom.ox;
+ y1 += xom.oy;
+ y2 += xom.oy;
+ by1 += xom.oy;
+ by2 += xom.oy;
+ return [x1, y1, x2, y2, bx1, by1, bx2, by2];
+}
+/**
+ * 统计inline的所有contentBox排成一行时的总宽度,考虑嵌套的mpb
+ * @param xom
+ * @param contentBoxList
+ * @returns {number}
+ */
+
+
+function getInlineWidth(xom, contentBoxList) {
+ var sum = 0;
+ var length = contentBoxList.length;
+
+ if (contentBoxList[length - 1] instanceof Ellipsis) {
+ length--;
+ }
+
+ for (var i = 0; i < length; i++) {
+ var contentBox = contentBoxList[i];
+ sum += contentBox.width; // 嵌套时,首尾box考虑mpb
+
+ var dom = contentBox instanceof TextBox ? contentBox.parent.domParent : contentBox.domParent;
+
+ while (dom !== xom) {
+ var list = dom.contentBoxList;
+
+ if (contentBox === list[0]) {
+ var _dom$computedStyle3 = dom.computedStyle,
+ marginLeft = _dom$computedStyle3[MARGIN_LEFT$1],
+ paddingLeft = _dom$computedStyle3[PADDING_LEFT$2],
+ borderLeftWidth = _dom$computedStyle3[BORDER_LEFT_WIDTH$3];
+ sum += marginLeft + paddingLeft + borderLeftWidth;
+ }
+
+ if (contentBox === list[list.length - 1]) {
+ var _dom$computedStyle4 = dom.computedStyle,
+ marginRight = _dom$computedStyle4[MARGIN_RIGHT$1],
+ paddingRight = _dom$computedStyle4[PADDING_RIGHT$1],
+ borderRightWidth = _dom$computedStyle4[BORDER_RIGHT_WIDTH$2];
+ sum += marginRight + paddingRight + borderRightWidth;
+ }
+
+ dom = dom.domParent;
+ }
+ }
+
+ return sum;
+}
+
+var inline = {
+ getInlineBox: getInlineBox,
+ getInlineWidth: getInlineWidth
+};
+
+var _enums$STYLE_KEY$a = enums.STYLE_KEY,
+ SCALE_X$2 = _enums$STYLE_KEY$a.SCALE_X,
+ SCALE_Y$2 = _enums$STYLE_KEY$a.SCALE_Y;
var PERCENT$4 = o.PERCENT,
NUMBER$3 = o.NUMBER;
@@ -15610,15 +15930,15 @@ var image = {
matrixResize: matrixResize
};
-var _enums$STYLE_KEY$9 = enums.STYLE_KEY,
- BACKGROUND_POSITION_X$1 = _enums$STYLE_KEY$9.BACKGROUND_POSITION_X,
- BACKGROUND_POSITION_Y$1 = _enums$STYLE_KEY$9.BACKGROUND_POSITION_Y,
- FONT_SIZE$6 = _enums$STYLE_KEY$9.FONT_SIZE,
+var _enums$STYLE_KEY$b = enums.STYLE_KEY,
+ BACKGROUND_POSITION_X$1 = _enums$STYLE_KEY$b.BACKGROUND_POSITION_X,
+ BACKGROUND_POSITION_Y$1 = _enums$STYLE_KEY$b.BACKGROUND_POSITION_Y,
+ FONT_SIZE$7 = _enums$STYLE_KEY$b.FONT_SIZE,
NODE_DEFS_CACHE$1 = enums.NODE_KEY.NODE_DEFS_CACHE;
var clone$2 = util.clone,
joinArr$1 = util.joinArr;
var canvasPolygon$3 = painter.canvasPolygon,
- svgPolygon$3 = painter.svgPolygon;
+ svgPolygon$2 = painter.svgPolygon;
var AUTO$2 = o.AUTO,
PX$4 = o.PX,
PERCENT$5 = o.PERCENT,
@@ -15695,7 +16015,7 @@ function renderBgc(xom, renderMode, ctx, color, list, x, y, w, h, btlr, btrr, bb
ctx.restore();
}
} else if (renderMode === mode.SVG) {
- var d = svgPolygon$3(list);
+ var d = svgPolygon$2(list);
if (isInline) {
var v = {
@@ -15734,7 +16054,7 @@ function calBackgroundSize(value, w, h, root) {
} else if (item[1] === PERCENT$5) {
res.push(item[0] * (i ? h : w) * 0.01);
} else if (item[1] === REM$5) {
- res.push(item[0] * root.computedStyle[FONT_SIZE$6]);
+ res.push(item[0] * root.computedStyle[FONT_SIZE$7]);
} else if (item[1] === VW$5) {
res.push(item[0] * root.width * 0.01);
} else if (item[1] === VH$5) {
@@ -15759,7 +16079,7 @@ function calBackgroundPosition(position, container, size, root) {
} else if (position[1] === PERCENT$5) {
return (container - size) * position[0] * 0.01;
} else if (position[1] === REM$5) {
- return position[0] * root.computedStyle[FONT_SIZE$6];
+ return position[0] * root.computedStyle[FONT_SIZE$7];
} else if (position[1] === VW$5) {
return position[0] * root.width * 0.01;
} else if (position[1] === VH$5) {
@@ -16459,39 +16779,39 @@ easing['ease-in'] = easing.easeIn;
easing['ease-out'] = easing.easeOut;
easing['ease-in-out'] = easing.easeInOut;
-var _enums$STYLE_KEY$a = enums.STYLE_KEY,
- FILTER$2 = _enums$STYLE_KEY$a.FILTER,
- TRANSFORM_ORIGIN$3 = _enums$STYLE_KEY$a.TRANSFORM_ORIGIN,
- PERSPECTIVE_ORIGIN$2 = _enums$STYLE_KEY$a.PERSPECTIVE_ORIGIN,
- BACKGROUND_CLIP$1 = _enums$STYLE_KEY$a.BACKGROUND_CLIP,
- BACKGROUND_POSITION_X$2 = _enums$STYLE_KEY$a.BACKGROUND_POSITION_X,
- BACKGROUND_POSITION_Y$2 = _enums$STYLE_KEY$a.BACKGROUND_POSITION_Y,
- BOX_SHADOW$1 = _enums$STYLE_KEY$a.BOX_SHADOW,
- TRANSLATE_X$3 = _enums$STYLE_KEY$a.TRANSLATE_X,
- TRANSLATE_Y$3 = _enums$STYLE_KEY$a.TRANSLATE_Y,
- TRANSLATE_Z$3 = _enums$STYLE_KEY$a.TRANSLATE_Z,
- BACKGROUND_SIZE$1 = _enums$STYLE_KEY$a.BACKGROUND_SIZE,
- FONT_SIZE$7 = _enums$STYLE_KEY$a.FONT_SIZE,
- FLEX_BASIS$1 = _enums$STYLE_KEY$a.FLEX_BASIS,
- FLEX_DIRECTION$1 = _enums$STYLE_KEY$a.FLEX_DIRECTION,
- WIDTH$3 = _enums$STYLE_KEY$a.WIDTH,
- HEIGHT$2 = _enums$STYLE_KEY$a.HEIGHT,
- TOP = _enums$STYLE_KEY$a.TOP,
- BOTTOM = _enums$STYLE_KEY$a.BOTTOM,
- LINE_HEIGHT$2 = _enums$STYLE_KEY$a.LINE_HEIGHT,
- OPACITY$2 = _enums$STYLE_KEY$a.OPACITY,
- Z_INDEX$1 = _enums$STYLE_KEY$a.Z_INDEX,
- TRANSFORM$2 = _enums$STYLE_KEY$a.TRANSFORM,
- COLOR$3 = _enums$STYLE_KEY$a.COLOR,
- FONT_WEIGHT$3 = _enums$STYLE_KEY$a.FONT_WEIGHT,
- FONT_STYLE$3 = _enums$STYLE_KEY$a.FONT_STYLE,
- FONT_FAMILY$3 = _enums$STYLE_KEY$a.FONT_FAMILY,
- TEXT_ALIGN$1 = _enums$STYLE_KEY$a.TEXT_ALIGN,
- MATRIX$2 = _enums$STYLE_KEY$a.MATRIX,
- ROTATE_3D$2 = _enums$STYLE_KEY$a.ROTATE_3D,
- TRANSLATE_PATH$1 = _enums$STYLE_KEY$a.TRANSLATE_PATH,
- TEXT_STROKE_COLOR$3 = _enums$STYLE_KEY$a.TEXT_STROKE_COLOR,
- TEXT_STROKE_OVER$2 = _enums$STYLE_KEY$a.TEXT_STROKE_OVER,
+var _enums$STYLE_KEY$c = enums.STYLE_KEY,
+ FILTER$2 = _enums$STYLE_KEY$c.FILTER,
+ TRANSFORM_ORIGIN$3 = _enums$STYLE_KEY$c.TRANSFORM_ORIGIN,
+ PERSPECTIVE_ORIGIN$2 = _enums$STYLE_KEY$c.PERSPECTIVE_ORIGIN,
+ BACKGROUND_CLIP$1 = _enums$STYLE_KEY$c.BACKGROUND_CLIP,
+ BACKGROUND_POSITION_X$2 = _enums$STYLE_KEY$c.BACKGROUND_POSITION_X,
+ BACKGROUND_POSITION_Y$2 = _enums$STYLE_KEY$c.BACKGROUND_POSITION_Y,
+ BOX_SHADOW$1 = _enums$STYLE_KEY$c.BOX_SHADOW,
+ TRANSLATE_X$3 = _enums$STYLE_KEY$c.TRANSLATE_X,
+ TRANSLATE_Y$3 = _enums$STYLE_KEY$c.TRANSLATE_Y,
+ TRANSLATE_Z$3 = _enums$STYLE_KEY$c.TRANSLATE_Z,
+ BACKGROUND_SIZE$1 = _enums$STYLE_KEY$c.BACKGROUND_SIZE,
+ FONT_SIZE$8 = _enums$STYLE_KEY$c.FONT_SIZE,
+ FLEX_BASIS$1 = _enums$STYLE_KEY$c.FLEX_BASIS,
+ FLEX_DIRECTION$1 = _enums$STYLE_KEY$c.FLEX_DIRECTION,
+ WIDTH$3 = _enums$STYLE_KEY$c.WIDTH,
+ HEIGHT$2 = _enums$STYLE_KEY$c.HEIGHT,
+ TOP = _enums$STYLE_KEY$c.TOP,
+ BOTTOM = _enums$STYLE_KEY$c.BOTTOM,
+ LINE_HEIGHT$2 = _enums$STYLE_KEY$c.LINE_HEIGHT,
+ OPACITY$2 = _enums$STYLE_KEY$c.OPACITY,
+ Z_INDEX$1 = _enums$STYLE_KEY$c.Z_INDEX,
+ TRANSFORM$2 = _enums$STYLE_KEY$c.TRANSFORM,
+ COLOR$4 = _enums$STYLE_KEY$c.COLOR,
+ FONT_WEIGHT$4 = _enums$STYLE_KEY$c.FONT_WEIGHT,
+ FONT_STYLE$3 = _enums$STYLE_KEY$c.FONT_STYLE,
+ FONT_FAMILY$4 = _enums$STYLE_KEY$c.FONT_FAMILY,
+ TEXT_ALIGN$1 = _enums$STYLE_KEY$c.TEXT_ALIGN,
+ MATRIX$2 = _enums$STYLE_KEY$c.MATRIX,
+ ROTATE_3D$2 = _enums$STYLE_KEY$c.ROTATE_3D,
+ TRANSLATE_PATH$1 = _enums$STYLE_KEY$c.TRANSLATE_PATH,
+ TEXT_STROKE_COLOR$3 = _enums$STYLE_KEY$c.TEXT_STROKE_COLOR,
+ TEXT_STROKE_OVER$2 = _enums$STYLE_KEY$c.TEXT_STROKE_OVER,
_enums$UPDATE_KEY$1 = enums.UPDATE_KEY,
UPDATE_NODE$1 = _enums$UPDATE_KEY$1.UPDATE_NODE,
UPDATE_STYLE = _enums$UPDATE_KEY$1.UPDATE_STYLE,
@@ -16551,7 +16871,7 @@ var _enums$STYLE_KEY$a = enums.STYLE_KEY,
var AUTO$3 = o.AUTO,
PX$5 = o.PX,
PERCENT$6 = o.PERCENT,
- INHERIT$3 = o.INHERIT,
+ INHERIT$2 = o.INHERIT,
RGBA$1 = o.RGBA,
STRING$2 = o.STRING,
NUMBER$4 = o.NUMBER,
@@ -16648,14 +16968,14 @@ function inherit(frames, keys, target) {
var oh = target.outerHeight;
var m = transform$1.calMatrix(v, ow, oh);
style[k] = [[MATRIX$2, m]];
- } else if (v[1] === INHERIT$3) {
- if (k === COLOR$3 || k === TEXT_STROKE_COLOR$3) {
+ } else if (v[1] === INHERIT$2) {
+ if (k === COLOR$4 || k === TEXT_STROKE_COLOR$3) {
style[k] = [util.rgba2int(computedStyle[k]), RGBA$1];
} else if (LENGTH_HASH$2.hasOwnProperty(k)) {
style[k] = [computedStyle[k], PX$5];
- } else if (k === FONT_WEIGHT$3) {
+ } else if (k === FONT_WEIGHT$4) {
style[k] = [computedStyle[k], NUMBER$4];
- } else if (k === FONT_STYLE$3 || k === FONT_FAMILY$3 || k === TEXT_ALIGN$1 || k === TEXT_STROKE_OVER$2) {
+ } else if (k === FONT_STYLE$3 || k === FONT_FAMILY$4 || k === TEXT_ALIGN$1 || k === TEXT_STROKE_OVER$2) {
style[k] = [computedStyle[k], STRING$2];
}
}
@@ -16728,7 +17048,7 @@ function calByUnit(p, n, container, root) {
if (n[1] === PERCENT$6) {
return n[0] * 0.01 * container - p[0];
} else if (n[1] === REM$6) {
- return n[0] * root.computedStyle[FONT_SIZE$7] - p[0];
+ return n[0] * root.computedStyle[FONT_SIZE$8] - p[0];
} else if (n[1] === VW$6) {
return n[0] * root.width * 0.01 - p[0];
} else if (n[1] === VH$6) {
@@ -16742,7 +17062,7 @@ function calByUnit(p, n, container, root) {
if (n[1] === PX$5) {
return n[0] * 100 / container - p[0];
} else if (n[1] === REM$6) {
- return n[0] * root.computedStyle[FONT_SIZE$7] * 100 / container - p[0];
+ return n[0] * root.computedStyle[FONT_SIZE$8] * 100 / container - p[0];
} else if (n[1] === VW$6) {
return n[0] * root.width / container - p[0];
} else if (n[1] === VH$6) {
@@ -16754,23 +17074,23 @@ function calByUnit(p, n, container, root) {
}
} else if (p[1] === REM$6) {
if (n[1] === PX$5) {
- return n[0] / root.computedStyle[FONT_SIZE$7] - p[0];
+ return n[0] / root.computedStyle[FONT_SIZE$8] - p[0];
} else if (n[1] === PERCENT$6) {
- return n[0] * 0.01 * container / root.computedStyle[FONT_SIZE$7] - p[0];
+ return n[0] * 0.01 * container / root.computedStyle[FONT_SIZE$8] - p[0];
} else if (n[1] === VW$6) {
- return n[0] * root.width * 0.01 / root.computedStyle[FONT_SIZE$7] - p[0];
+ return n[0] * root.width * 0.01 / root.computedStyle[FONT_SIZE$8] - p[0];
} else if (n[1] === VH$6) {
- return n[0] * root.height * 0.01 / root.computedStyle[FONT_SIZE$7] - p[0];
+ return n[0] * root.height * 0.01 / root.computedStyle[FONT_SIZE$8] - p[0];
} else if (n[1] === VMAX$6) {
- return n[0] * Math.max(root.width, root.height) * 0.01 / root.computedStyle[FONT_SIZE$7] - p[0];
+ return n[0] * Math.max(root.width, root.height) * 0.01 / root.computedStyle[FONT_SIZE$8] - p[0];
} else if (n[1] === VMIN$6) {
- return n[0] * Math.min(root.width, root.height) * 0.01 / root.computedStyle[FONT_SIZE$7] - p[0];
+ return n[0] * Math.min(root.width, root.height) * 0.01 / root.computedStyle[FONT_SIZE$8] - p[0];
}
} else if (p[1] === VW$6) {
if (n[1] === PX$5) {
return n[0] * 100 / root.width - p[0];
} else if (n[1] === REM$6) {
- return n[0] * 100 * root.computedStyle[FONT_SIZE$7] / root.width - p[0];
+ return n[0] * 100 * root.computedStyle[FONT_SIZE$8] / root.width - p[0];
} else if (n[1] === PERCENT$6) {
return n[0] * container / root.width - p[0];
} else if (n[1] === VH$6) {
@@ -16784,7 +17104,7 @@ function calByUnit(p, n, container, root) {
if (n[1] === PX$5) {
return n[0] * 100 / root.height - p[0];
} else if (n[1] === REM$6) {
- return n[0] * 100 * root.computedStyle[FONT_SIZE$7] / root.height - p[0];
+ return n[0] * 100 * root.computedStyle[FONT_SIZE$8] / root.height - p[0];
} else if (n[1] === VW$6) {
return n[0] * root.width / root.height - p[0];
} else if (n[1] === PERCENT$6) {
@@ -16798,7 +17118,7 @@ function calByUnit(p, n, container, root) {
if (n[1] === PX$5) {
return n[0] * 100 / Math.max(root.width, root.height) - p[0];
} else if (n[1] === REM$6) {
- return n[0] * 100 * root.computedStyle[FONT_SIZE$7] / Math.max(root.width, root.height) - p[0];
+ return n[0] * 100 * root.computedStyle[FONT_SIZE$8] / Math.max(root.width, root.height) - p[0];
} else if (n[1] === PERCENT$6) {
return n[0] * container / Math.max(root.width, root.height) - p[0];
} else if (n[1] === VW$6) {
@@ -16812,7 +17132,7 @@ function calByUnit(p, n, container, root) {
if (n[1] === PX$5) {
return n[0] * 100 / Math.min(root.width, root.height) - p[0];
} else if (n[1] === REM$6) {
- return n[0] * 100 * root.computedStyle[FONT_SIZE$7] / Math.min(root.width, root.height) - p[0];
+ return n[0] * 100 * root.computedStyle[FONT_SIZE$8] / Math.min(root.width, root.height) - p[0];
} else if (n[1] === PERCENT$6) {
return n[0] * container / Math.min(root.width, root.height) - p[0];
} else if (n[1] === VW$6) {
@@ -17299,10 +17619,10 @@ function calDiff(prev, next, k, target, tagName) {
diff = n[0] - p[0];
} // lineHeight奇怪的单位变化,%相对于fontSize
else if (k === LINE_HEIGHT$2) {
- diff = calByUnit(p, n, computedStyle[FONT_SIZE$7], target.root);
+ diff = calByUnit(p, n, computedStyle[FONT_SIZE$8], target.root);
} // fontSize的%相对于parent的
- else if (k === FONT_SIZE$7) {
- diff = calByUnit(p, n, parentComputedStyle[FONT_SIZE$7], target.root);
+ else if (k === FONT_SIZE$8) {
+ diff = calByUnit(p, n, parentComputedStyle[FONT_SIZE$8], target.root);
} // 相对于父height的特殊属性
else if (k === FLEX_BASIS$1 && ['column', 'column-reverse', 'columnReverse'].indexOf(computedStyle[FLEX_DIRECTION$1]) > -1 || [HEIGHT$2, TOP, BOTTOM].indexOf(k) > -1) {
if (p[1] !== AUTO$3 && n[1] !== AUTO$3) {
@@ -17496,7 +17816,7 @@ function calDiff(prev, next, k, target, tagName) {
return [(parseFloat(v) || 0) * 0.01 * target[_k3], PX$5];
}
} else if (u === REM$6) {
- return [(parseFloat(v) || 0) * root.computedStyle[FONT_SIZE$7] * 100, PX$5];
+ return [(parseFloat(v) || 0) * root.computedStyle[FONT_SIZE$8] * 100, PX$5];
} else if (u === VW$6) {
return [(parseFloat(v) || 0) * 0.01 * root.width, PX$5];
} else if (u === VH$6) {
@@ -19239,7 +19559,7 @@ var Animation = /*#__PURE__*/function (_Event) {
var NODE_DEFS_CACHE$2 = enums.NODE_KEY.NODE_DEFS_CACHE;
var int2rgba$1 = util.int2rgba;
var canvasPolygon$4 = painter.canvasPolygon,
- svgPolygon$4 = painter.svgPolygon;
+ svgPolygon$3 = painter.svgPolygon;
function renderBoxShadow(xom, renderMode, ctx, data, x1, y1, x2, y2, w, h) {
var dx = arguments.length > 10 && arguments[10] !== undefined ? arguments[10] : 0;
@@ -19443,7 +19763,7 @@ function renderBoxShadow(xom, renderMode, ctx, data, x1, y1, x2, y2, w, h) {
tagName: 'clipPath',
children: [{
tagName: 'path',
- props: [['d', svgPolygon$4(_cross2) + svgPolygon$4(box.slice(0).reverse())], ['fill', '#FFF']]
+ props: [['d', svgPolygon$3(_cross2) + svgPolygon$3(box.slice(0).reverse())], ['fill', '#FFF']]
}]
};
var clip = ctx.add(v2);
@@ -19453,13 +19773,13 @@ function renderBoxShadow(xom, renderMode, ctx, data, x1, y1, x2, y2, w, h) {
xom.virtualDom.bb.push({
type: 'item',
tagName: 'path',
- props: [['d', svgPolygon$4(box)], ['fill', c], ['clip-path', 'url(#' + clip + ')']]
+ props: [['d', svgPolygon$3(box)], ['fill', c], ['clip-path', 'url(#' + clip + ')']]
});
v = {
tagName: 'clipPath',
children: [{
tagName: 'path',
- props: [['d', svgPolygon$4(_cross2)], ['fill', '#FFF']]
+ props: [['d', svgPolygon$3(_cross2)], ['fill', '#FFF']]
}]
};
clip = ctx.add(v);
@@ -19469,7 +19789,7 @@ function renderBoxShadow(xom, renderMode, ctx, data, x1, y1, x2, y2, w, h) {
xom.virtualDom.bb.push({
type: 'item',
tagName: 'path',
- props: [['d', svgPolygon$4([[_xa2, _ya2], [_xb2, _ya2], [_xb2, _yb2], [x1 - n, _yb2], [x1 - n, y2 + n], [x2 + n, y2 + n], [x2 + n, y1 - n], [x1 - n, y1 - n], [x1 - n, _yb2], [_xa2, _yb2], [_xa2, _ya2]])], ['fill', '#FFF'], ['filter', 'url(#' + filter + ')'], ['clip-path', 'url(#' + clip + ')']]
+ props: [['d', svgPolygon$3([[_xa2, _ya2], [_xb2, _ya2], [_xb2, _yb2], [x1 - n, _yb2], [x1 - n, y2 + n], [x2 + n, y2 + n], [x2 + n, y1 - n], [x1 - n, y1 - n], [x1 - n, _yb2], [_xa2, _yb2], [_xa2, _ya2]])], ['fill', '#FFF'], ['filter', 'url(#' + filter + ')'], ['clip-path', 'url(#' + clip + ')']]
});
} else {
var _v = {
@@ -19489,7 +19809,7 @@ function renderBoxShadow(xom, renderMode, ctx, data, x1, y1, x2, y2, w, h) {
tagName: 'clipPath',
children: [{
tagName: 'path',
- props: [['d', svgPolygon$4(box)], ['fill', '#FFF']]
+ props: [['d', svgPolygon$3(box)], ['fill', '#FFF']]
}]
};
@@ -19500,7 +19820,7 @@ function renderBoxShadow(xom, renderMode, ctx, data, x1, y1, x2, y2, w, h) {
xom.virtualDom.bb.push({
type: 'item',
tagName: 'path',
- props: [['d', svgPolygon$4([[x1, y1], [x2, y1], [x2, y2], [x1 - n, y2], [x1 - n, y2 + n], [x2 + n, y2 + n], [x2 + n, y1 - n], [x1 - n, y1 - n], [x1 - n, y2], [x1, y2], [x1, y1]])], ['fill', '#FFF'], ['filter', 'url(#' + _filter + ')'], ['clip-path', 'url(#' + _clip + ')']]
+ props: [['d', svgPolygon$3([[x1, y1], [x2, y1], [x2, y2], [x1 - n, y2], [x1 - n, y2 + n], [x2 + n, y2 + n], [x2 + n, y1 - n], [x1 - n, y1 - n], [x1 - n, y2], [x1, y2], [x1, y1]])], ['fill', '#FFF'], ['filter', 'url(#' + _filter + ')'], ['clip-path', 'url(#' + _clip + ')']]
});
}
} else {
@@ -19534,7 +19854,7 @@ function renderBoxShadow(xom, renderMode, ctx, data, x1, y1, x2, y2, w, h) {
tagName: 'clipPath',
children: [{
tagName: 'path',
- props: [['d', svgPolygon$4(box) + svgPolygon$4(_blurBox.slice(0).reverse())], ['fill', '#FFF']]
+ props: [['d', svgPolygon$3(box) + svgPolygon$3(_blurBox.slice(0).reverse())], ['fill', '#FFF']]
}]
};
@@ -19545,13 +19865,13 @@ function renderBoxShadow(xom, renderMode, ctx, data, x1, y1, x2, y2, w, h) {
xom.virtualDom.bb.push({
type: 'item',
tagName: 'path',
- props: [['d', svgPolygon$4(_blurBox)], ['fill', c], ['clip-path', 'url(#' + _clip2 + ')']]
+ props: [['d', svgPolygon$3(_blurBox)], ['fill', c], ['clip-path', 'url(#' + _clip2 + ')']]
});
_v2 = {
tagName: 'clipPath',
children: [{
tagName: 'path',
- props: [['d', (_cross3 ? svgPolygon$4([[_cross3[0], _cross3[1]], [_cross3[2], _cross3[1]], [_cross3[2], _cross3[3]], [_cross3[0], _cross3[3]], [_cross3[0], _cross3[1]]].reverse()) : '') + svgPolygon$4(box) + svgPolygon$4(_blurBox) + svgPolygon$4(outer)], ['fill', '#FFF']]
+ props: [['d', (_cross3 ? svgPolygon$3([[_cross3[0], _cross3[1]], [_cross3[2], _cross3[1]], [_cross3[2], _cross3[3]], [_cross3[0], _cross3[3]], [_cross3[0], _cross3[1]]].reverse()) : '') + svgPolygon$3(box) + svgPolygon$3(_blurBox) + svgPolygon$3(outer)], ['fill', '#FFF']]
}]
};
_clip2 = ctx.add(_v2);
@@ -19561,7 +19881,7 @@ function renderBoxShadow(xom, renderMode, ctx, data, x1, y1, x2, y2, w, h) {
xom.virtualDom.bb.push({
type: 'item',
tagName: 'path',
- props: [['d', svgPolygon$4(_blurBox)], ['fill', '#FFF'], ['filter', 'url(#' + _filter2 + ')'], ['clip-path', 'url(#' + _clip2 + ')']]
+ props: [['d', svgPolygon$3(_blurBox)], ['fill', '#FFF'], ['filter', 'url(#' + _filter2 + ')'], ['clip-path', 'url(#' + _clip2 + ')']]
});
} else {
var _v3 = {
@@ -19581,7 +19901,7 @@ function renderBoxShadow(xom, renderMode, ctx, data, x1, y1, x2, y2, w, h) {
tagName: 'clipPath',
children: [{
tagName: 'path',
- props: [['d', svgPolygon$4(box) + svgPolygon$4(outer)], ['fill', '#FFF']]
+ props: [['d', svgPolygon$3(box) + svgPolygon$3(outer)], ['fill', '#FFF']]
}]
};
@@ -19592,7 +19912,7 @@ function renderBoxShadow(xom, renderMode, ctx, data, x1, y1, x2, y2, w, h) {
xom.virtualDom.bb.push({
type: 'item',
tagName: 'path',
- props: [['d', svgPolygon$4(box)], ['fill', '#FFF'], ['filter', 'url(#' + _filter3 + ')'], ['clip-path', 'url(#' + _clip3 + ')']]
+ props: [['d', svgPolygon$3(box)], ['fill', '#FFF'], ['filter', 'url(#' + _filter3 + ')'], ['clip-path', 'url(#' + _clip3 + ')']]
});
}
}
@@ -19639,265 +19959,92 @@ var mbm = {
isValidMbm: isValidMbm
};
-var _enums$STYLE_KEY$b = enums.STYLE_KEY,
- MARGIN_LEFT = _enums$STYLE_KEY$b.MARGIN_LEFT,
- MARGIN_RIGHT = _enums$STYLE_KEY$b.MARGIN_RIGHT,
- PADDING_LEFT$1 = _enums$STYLE_KEY$b.PADDING_LEFT,
- PADDING_RIGHT = _enums$STYLE_KEY$b.PADDING_RIGHT,
- BORDER_LEFT_WIDTH$2 = _enums$STYLE_KEY$b.BORDER_LEFT_WIDTH,
- BORDER_RIGHT_WIDTH$1 = _enums$STYLE_KEY$b.BORDER_RIGHT_WIDTH;
-/**
- * 获取inline的每一行内容的矩形坐标4个点,同时附带上border的矩形,比前面4个点尺寸大或相等(有无border/padding)
- * @param xom
- * @param contentBoxList
- * @param start
- * @param end
- * @param lineBox
- * @param baseline
- * @param lineHeight
- * @param diffL
- * @param isStart
- * @param isEnd
- * @param backgroundClip
- * @param paddingTop
- * @param paddingRight
- * @param paddingBottom
- * @param paddingLeft
- * @param borderTopWidth
- * @param borderRightWidth
- * @param borderBottomWidth
- * @param borderLeftWidth
- * @returns {(*|number)[]}
- */
-
-function getInlineBox(xom, contentBoxList, start, end, lineBox, baseline, lineHeight, diffL, isStart, isEnd, backgroundClip, paddingTop, paddingRight, paddingBottom, paddingLeft, borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth) {
- // 根据bgClip确定y伸展范围,inline渲染bg扩展到pb的位置不影响布局
- var eyt = 0,
- eyb = 0;
-
- if (backgroundClip === 'paddingBox' || backgroundClip === 'padding-box') {
- eyt = paddingTop;
- eyb = paddingBottom;
- } else if (backgroundClip !== 'contentBox' && backgroundClip !== 'content-box') {
- eyt = paddingTop + borderTopWidth;
- eyb = paddingBottom + borderBottomWidth;
- } // 同y的border伸展范围,其影响border渲染
-
-
- var pbt = paddingTop + borderTopWidth;
- var pbb = paddingBottom + borderBottomWidth; // inline的baseline和lineBox的差值
-
- var diff = lineBox.baseline - baseline; // x坐标取首尾contentBox的左右2侧,clip布局时已算好;y是根据lineHeight和lineBox的高度以及baseline对齐后计算的
-
- var x1 = start.x;
- var dom = start instanceof TextBox ? start.parent.domParent : start.domParent;
-
- while (dom !== xom) {
- var list = dom.contentBoxList;
-
- if (start === list[0]) {
- var _dom$computedStyle = dom.computedStyle,
- marginLeft = _dom$computedStyle[MARGIN_LEFT],
- _paddingLeft = _dom$computedStyle[PADDING_LEFT$1],
- _borderLeftWidth = _dom$computedStyle[BORDER_LEFT_WIDTH$2];
- x1 -= marginLeft + _paddingLeft + _borderLeftWidth;
- }
-
- dom = dom.domParent;
- }
-
- var bx1 = x1;
-
- if (isStart) {
- if (backgroundClip === 'paddingBox' || backgroundClip === 'padding-box') {
- x1 -= paddingLeft;
- } else if (backgroundClip !== 'contentBox' && backgroundClip !== 'content-box') {
- x1 -= paddingLeft + borderLeftWidth;
- }
-
- bx1 -= paddingLeft + borderLeftWidth;
- }
-
- var y1 = lineBox.y + diff - eyt;
- var by1 = lineBox.y + diff - pbt;
- var x2 = end.x + end.outerWidth; // TextBox的parent是Text,再是Dom,这里一定是inline,无嵌套就是xom本身,有则包含若干层最上层还是xom
-
- dom = end instanceof TextBox ? end.parent.domParent : end.domParent; // 从end开始,向上获取dom节点的尾部mpb进行累加,直到xom跳出
-
- while (dom !== xom) {
- var _list = dom.contentBoxList;
-
- if (end === _list[_list.length - 1]) {
- var _dom$computedStyle2 = dom.computedStyle,
- marginRight = _dom$computedStyle2[MARGIN_RIGHT],
- _paddingRight = _dom$computedStyle2[PADDING_RIGHT],
- _borderRightWidth = _dom$computedStyle2[BORDER_RIGHT_WIDTH$1];
- x2 += marginRight + _paddingRight + _borderRightWidth;
- }
-
- dom = dom.domParent;
- }
-
- var bx2 = x2;
-
- if (isEnd) {
- if (backgroundClip === 'paddingBox' || backgroundClip === 'padding-box') {
- x2 += paddingRight;
- } else if (backgroundClip !== 'contentBox' && backgroundClip !== 'content-box') {
- x2 += paddingRight + borderRightWidth;
- }
-
- bx2 += paddingRight + borderRightWidth;
- }
-
- var y2 = lineBox.y + diff + lineHeight - diffL + eyb;
- var by2 = lineBox.y + diff + lineHeight - diffL + pbb; // x要考虑xom的ox值
-
- x1 += xom.ox;
- x2 += xom.ox;
- bx1 += xom.ox;
- bx2 += xom.ox;
- y1 += xom.oy;
- y2 += xom.oy;
- by1 += xom.oy;
- by2 += xom.oy;
- return [x1, y1, x2, y2, bx1, by1, bx2, by2];
-}
-/**
- * 统计inline的所有contentBox排成一行时的总宽度,考虑嵌套的mpb
- * @param xom
- * @param contentBoxList
- * @returns {number}
- */
-
-
-function getInlineWidth(xom, contentBoxList) {
- var sum = 0;
- var length = contentBoxList.length;
-
- for (var i = 0; i < length; i++) {
- var contentBox = contentBoxList[i];
- sum += contentBox.width; // 嵌套时,首尾box考虑mpb
-
- var dom = contentBox instanceof TextBox ? contentBox.parent.domParent : contentBox.domParent;
-
- while (dom !== xom) {
- var list = dom.contentBoxList;
-
- if (contentBox === list[0]) {
- var _dom$computedStyle3 = dom.computedStyle,
- marginLeft = _dom$computedStyle3[MARGIN_LEFT],
- paddingLeft = _dom$computedStyle3[PADDING_LEFT$1],
- borderLeftWidth = _dom$computedStyle3[BORDER_LEFT_WIDTH$2];
- sum += marginLeft + paddingLeft + borderLeftWidth;
- }
-
- if (contentBox === list[list.length - 1]) {
- var _dom$computedStyle4 = dom.computedStyle,
- marginRight = _dom$computedStyle4[MARGIN_RIGHT],
- paddingRight = _dom$computedStyle4[PADDING_RIGHT],
- borderRightWidth = _dom$computedStyle4[BORDER_RIGHT_WIDTH$1];
- sum += marginRight + paddingRight + borderRightWidth;
- }
-
- dom = dom.domParent;
- }
- }
-
- return sum;
-}
-
-var inline = {
- getInlineBox: getInlineBox,
- getInlineWidth: getInlineWidth
-};
-
-var svgPolygon$5 = painter.svgPolygon;
-var CANVAS$1 = mode.CANVAS,
- SVG = mode.SVG,
- WEBGL$1 = mode.WEBGL;
+var svgPolygon$4 = painter.svgPolygon;
+var CANVAS$3 = mode.CANVAS,
+ SVG$2 = mode.SVG,
+ WEBGL$3 = mode.WEBGL;
var LOCAL = Cache.LOCAL;
var STYLE_KEY$5 = enums.STYLE_KEY,
STYLE_RV_KEY$2 = enums.STYLE_RV_KEY,
style2Upper$2 = enums.style2Upper,
- _enums$STYLE_KEY$c = enums.STYLE_KEY,
- BORDER_TOP_LEFT_RADIUS$1 = _enums$STYLE_KEY$c.BORDER_TOP_LEFT_RADIUS,
- BORDER_TOP_RIGHT_RADIUS$1 = _enums$STYLE_KEY$c.BORDER_TOP_RIGHT_RADIUS,
- BORDER_BOTTOM_LEFT_RADIUS$1 = _enums$STYLE_KEY$c.BORDER_BOTTOM_LEFT_RADIUS,
- BORDER_BOTTOM_RIGHT_RADIUS$1 = _enums$STYLE_KEY$c.BORDER_BOTTOM_RIGHT_RADIUS,
- PADDING_LEFT$2 = _enums$STYLE_KEY$c.PADDING_LEFT,
- PADDING_RIGHT$1 = _enums$STYLE_KEY$c.PADDING_RIGHT,
- PADDING_TOP$1 = _enums$STYLE_KEY$c.PADDING_TOP,
- PADDING_BOTTOM$1 = _enums$STYLE_KEY$c.PADDING_BOTTOM,
- MARGIN_LEFT$1 = _enums$STYLE_KEY$c.MARGIN_LEFT,
- MARGIN_TOP = _enums$STYLE_KEY$c.MARGIN_TOP,
- MARGIN_BOTTOM = _enums$STYLE_KEY$c.MARGIN_BOTTOM,
- MARGIN_RIGHT$1 = _enums$STYLE_KEY$c.MARGIN_RIGHT,
- BORDER_LEFT_WIDTH$3 = _enums$STYLE_KEY$c.BORDER_LEFT_WIDTH,
- BORDER_TOP_WIDTH$2 = _enums$STYLE_KEY$c.BORDER_TOP_WIDTH,
- BORDER_BOTTOM_WIDTH$2 = _enums$STYLE_KEY$c.BORDER_BOTTOM_WIDTH,
- BORDER_RIGHT_WIDTH$2 = _enums$STYLE_KEY$c.BORDER_RIGHT_WIDTH,
- TOP$1 = _enums$STYLE_KEY$c.TOP,
- RIGHT = _enums$STYLE_KEY$c.RIGHT,
- BOTTOM$1 = _enums$STYLE_KEY$c.BOTTOM,
- LEFT = _enums$STYLE_KEY$c.LEFT,
- POSITION$1 = _enums$STYLE_KEY$c.POSITION,
- DISPLAY$2 = _enums$STYLE_KEY$c.DISPLAY,
- WIDTH$4 = _enums$STYLE_KEY$c.WIDTH,
- HEIGHT$3 = _enums$STYLE_KEY$c.HEIGHT,
- MATRIX$3 = _enums$STYLE_KEY$c.MATRIX,
- TRANSLATE_X$4 = _enums$STYLE_KEY$c.TRANSLATE_X,
- TRANSLATE_Y$4 = _enums$STYLE_KEY$c.TRANSLATE_Y,
- TRANSLATE_Z$4 = _enums$STYLE_KEY$c.TRANSLATE_Z,
- TRANSFORM$3 = _enums$STYLE_KEY$c.TRANSFORM,
- SCALE_X$3 = _enums$STYLE_KEY$c.SCALE_X,
- SCALE_Y$3 = _enums$STYLE_KEY$c.SCALE_Y,
- SCALE_Z$2 = _enums$STYLE_KEY$c.SCALE_Z,
- ROTATE_X$2 = _enums$STYLE_KEY$c.ROTATE_X,
- ROTATE_Y$2 = _enums$STYLE_KEY$c.ROTATE_Y,
- ROTATE_Z$2 = _enums$STYLE_KEY$c.ROTATE_Z,
- SKEW_X$2 = _enums$STYLE_KEY$c.SKEW_X,
- SKEW_Y$2 = _enums$STYLE_KEY$c.SKEW_Y,
- PERSPECTIVE$3 = _enums$STYLE_KEY$c.PERSPECTIVE,
- PERSPECTIVE_ORIGIN$3 = _enums$STYLE_KEY$c.PERSPECTIVE_ORIGIN,
- ROTATE_3D$3 = _enums$STYLE_KEY$c.ROTATE_3D,
- TRANSFORM_ORIGIN$4 = _enums$STYLE_KEY$c.TRANSFORM_ORIGIN,
- BACKGROUND_POSITION_X$3 = _enums$STYLE_KEY$c.BACKGROUND_POSITION_X,
- BACKGROUND_POSITION_Y$3 = _enums$STYLE_KEY$c.BACKGROUND_POSITION_Y,
- BACKGROUND_SIZE$2 = _enums$STYLE_KEY$c.BACKGROUND_SIZE,
- BACKGROUND_COLOR$1 = _enums$STYLE_KEY$c.BACKGROUND_COLOR,
- BACKGROUND_IMAGE$1 = _enums$STYLE_KEY$c.BACKGROUND_IMAGE,
- BACKGROUND_REPEAT = _enums$STYLE_KEY$c.BACKGROUND_REPEAT,
- BOX_SHADOW$2 = _enums$STYLE_KEY$c.BOX_SHADOW,
- OPACITY$3 = _enums$STYLE_KEY$c.OPACITY,
- Z_INDEX$2 = _enums$STYLE_KEY$c.Z_INDEX,
- BORDER_TOP_STYLE = _enums$STYLE_KEY$c.BORDER_TOP_STYLE,
- BORDER_RIGHT_STYLE = _enums$STYLE_KEY$c.BORDER_RIGHT_STYLE,
- BORDER_BOTTOM_STYLE = _enums$STYLE_KEY$c.BORDER_BOTTOM_STYLE,
- BORDER_LEFT_STYLE = _enums$STYLE_KEY$c.BORDER_LEFT_STYLE,
- FILTER$3 = _enums$STYLE_KEY$c.FILTER,
- OVERFLOW$1 = _enums$STYLE_KEY$c.OVERFLOW,
- MIX_BLEND_MODE = _enums$STYLE_KEY$c.MIX_BLEND_MODE,
- TEXT_OVERFLOW$2 = _enums$STYLE_KEY$c.TEXT_OVERFLOW,
- BORDER_TOP_COLOR = _enums$STYLE_KEY$c.BORDER_TOP_COLOR,
- BORDER_BOTTOM_COLOR = _enums$STYLE_KEY$c.BORDER_BOTTOM_COLOR,
- BORDER_LEFT_COLOR = _enums$STYLE_KEY$c.BORDER_LEFT_COLOR,
- BORDER_RIGHT_COLOR = _enums$STYLE_KEY$c.BORDER_RIGHT_COLOR,
- FONT_STYLE$4 = _enums$STYLE_KEY$c.FONT_STYLE,
- COLOR$4 = _enums$STYLE_KEY$c.COLOR,
- VISIBILITY$2 = _enums$STYLE_KEY$c.VISIBILITY,
- POINTER_EVENTS$1 = _enums$STYLE_KEY$c.POINTER_EVENTS,
- BORDER_TOP = _enums$STYLE_KEY$c.BORDER_TOP,
- BORDER_RIGHT = _enums$STYLE_KEY$c.BORDER_RIGHT,
- BORDER_BOTTOM = _enums$STYLE_KEY$c.BORDER_BOTTOM,
- BORDER_LEFT = _enums$STYLE_KEY$c.BORDER_LEFT,
- BACKGROUND_CLIP$2 = _enums$STYLE_KEY$c.BACKGROUND_CLIP,
- FONT_SIZE$8 = _enums$STYLE_KEY$c.FONT_SIZE,
- FONT_FAMILY$4 = _enums$STYLE_KEY$c.FONT_FAMILY,
- LINE_HEIGHT$3 = _enums$STYLE_KEY$c.LINE_HEIGHT,
- TEXT_STROKE_COLOR$4 = _enums$STYLE_KEY$c.TEXT_STROKE_COLOR,
- TEXT_STROKE_WIDTH$3 = _enums$STYLE_KEY$c.TEXT_STROKE_WIDTH,
- TEXT_STROKE_OVER$3 = _enums$STYLE_KEY$c.TEXT_STROKE_OVER,
+ _enums$STYLE_KEY$d = enums.STYLE_KEY,
+ BORDER_TOP_LEFT_RADIUS$1 = _enums$STYLE_KEY$d.BORDER_TOP_LEFT_RADIUS,
+ BORDER_TOP_RIGHT_RADIUS$1 = _enums$STYLE_KEY$d.BORDER_TOP_RIGHT_RADIUS,
+ BORDER_BOTTOM_LEFT_RADIUS$1 = _enums$STYLE_KEY$d.BORDER_BOTTOM_LEFT_RADIUS,
+ BORDER_BOTTOM_RIGHT_RADIUS$1 = _enums$STYLE_KEY$d.BORDER_BOTTOM_RIGHT_RADIUS,
+ PADDING_LEFT$3 = _enums$STYLE_KEY$d.PADDING_LEFT,
+ PADDING_RIGHT$2 = _enums$STYLE_KEY$d.PADDING_RIGHT,
+ PADDING_TOP$1 = _enums$STYLE_KEY$d.PADDING_TOP,
+ PADDING_BOTTOM$1 = _enums$STYLE_KEY$d.PADDING_BOTTOM,
+ MARGIN_LEFT$2 = _enums$STYLE_KEY$d.MARGIN_LEFT,
+ MARGIN_TOP = _enums$STYLE_KEY$d.MARGIN_TOP,
+ MARGIN_BOTTOM = _enums$STYLE_KEY$d.MARGIN_BOTTOM,
+ MARGIN_RIGHT$2 = _enums$STYLE_KEY$d.MARGIN_RIGHT,
+ BORDER_LEFT_WIDTH$4 = _enums$STYLE_KEY$d.BORDER_LEFT_WIDTH,
+ BORDER_TOP_WIDTH$2 = _enums$STYLE_KEY$d.BORDER_TOP_WIDTH,
+ BORDER_BOTTOM_WIDTH$2 = _enums$STYLE_KEY$d.BORDER_BOTTOM_WIDTH,
+ BORDER_RIGHT_WIDTH$3 = _enums$STYLE_KEY$d.BORDER_RIGHT_WIDTH,
+ TOP$1 = _enums$STYLE_KEY$d.TOP,
+ RIGHT = _enums$STYLE_KEY$d.RIGHT,
+ BOTTOM$1 = _enums$STYLE_KEY$d.BOTTOM,
+ LEFT = _enums$STYLE_KEY$d.LEFT,
+ POSITION$2 = _enums$STYLE_KEY$d.POSITION,
+ DISPLAY$2 = _enums$STYLE_KEY$d.DISPLAY,
+ WIDTH$4 = _enums$STYLE_KEY$d.WIDTH,
+ HEIGHT$3 = _enums$STYLE_KEY$d.HEIGHT,
+ MATRIX$3 = _enums$STYLE_KEY$d.MATRIX,
+ TRANSLATE_X$4 = _enums$STYLE_KEY$d.TRANSLATE_X,
+ TRANSLATE_Y$4 = _enums$STYLE_KEY$d.TRANSLATE_Y,
+ TRANSLATE_Z$4 = _enums$STYLE_KEY$d.TRANSLATE_Z,
+ TRANSFORM$3 = _enums$STYLE_KEY$d.TRANSFORM,
+ SCALE_X$3 = _enums$STYLE_KEY$d.SCALE_X,
+ SCALE_Y$3 = _enums$STYLE_KEY$d.SCALE_Y,
+ SCALE_Z$2 = _enums$STYLE_KEY$d.SCALE_Z,
+ ROTATE_X$2 = _enums$STYLE_KEY$d.ROTATE_X,
+ ROTATE_Y$2 = _enums$STYLE_KEY$d.ROTATE_Y,
+ ROTATE_Z$2 = _enums$STYLE_KEY$d.ROTATE_Z,
+ SKEW_X$2 = _enums$STYLE_KEY$d.SKEW_X,
+ SKEW_Y$2 = _enums$STYLE_KEY$d.SKEW_Y,
+ PERSPECTIVE$3 = _enums$STYLE_KEY$d.PERSPECTIVE,
+ PERSPECTIVE_ORIGIN$3 = _enums$STYLE_KEY$d.PERSPECTIVE_ORIGIN,
+ ROTATE_3D$3 = _enums$STYLE_KEY$d.ROTATE_3D,
+ TRANSFORM_ORIGIN$4 = _enums$STYLE_KEY$d.TRANSFORM_ORIGIN,
+ BACKGROUND_POSITION_X$3 = _enums$STYLE_KEY$d.BACKGROUND_POSITION_X,
+ BACKGROUND_POSITION_Y$3 = _enums$STYLE_KEY$d.BACKGROUND_POSITION_Y,
+ BACKGROUND_SIZE$2 = _enums$STYLE_KEY$d.BACKGROUND_SIZE,
+ BACKGROUND_COLOR$1 = _enums$STYLE_KEY$d.BACKGROUND_COLOR,
+ BACKGROUND_IMAGE$1 = _enums$STYLE_KEY$d.BACKGROUND_IMAGE,
+ BACKGROUND_REPEAT = _enums$STYLE_KEY$d.BACKGROUND_REPEAT,
+ BOX_SHADOW$2 = _enums$STYLE_KEY$d.BOX_SHADOW,
+ OPACITY$3 = _enums$STYLE_KEY$d.OPACITY,
+ Z_INDEX$2 = _enums$STYLE_KEY$d.Z_INDEX,
+ BORDER_TOP_STYLE = _enums$STYLE_KEY$d.BORDER_TOP_STYLE,
+ BORDER_RIGHT_STYLE = _enums$STYLE_KEY$d.BORDER_RIGHT_STYLE,
+ BORDER_BOTTOM_STYLE = _enums$STYLE_KEY$d.BORDER_BOTTOM_STYLE,
+ BORDER_LEFT_STYLE = _enums$STYLE_KEY$d.BORDER_LEFT_STYLE,
+ FILTER$3 = _enums$STYLE_KEY$d.FILTER,
+ OVERFLOW$2 = _enums$STYLE_KEY$d.OVERFLOW,
+ MIX_BLEND_MODE = _enums$STYLE_KEY$d.MIX_BLEND_MODE,
+ TEXT_OVERFLOW$2 = _enums$STYLE_KEY$d.TEXT_OVERFLOW,
+ BORDER_TOP_COLOR = _enums$STYLE_KEY$d.BORDER_TOP_COLOR,
+ BORDER_BOTTOM_COLOR = _enums$STYLE_KEY$d.BORDER_BOTTOM_COLOR,
+ BORDER_LEFT_COLOR = _enums$STYLE_KEY$d.BORDER_LEFT_COLOR,
+ BORDER_RIGHT_COLOR = _enums$STYLE_KEY$d.BORDER_RIGHT_COLOR,
+ FONT_STYLE$4 = _enums$STYLE_KEY$d.FONT_STYLE,
+ COLOR$5 = _enums$STYLE_KEY$d.COLOR,
+ VISIBILITY$2 = _enums$STYLE_KEY$d.VISIBILITY,
+ POINTER_EVENTS$1 = _enums$STYLE_KEY$d.POINTER_EVENTS,
+ BORDER_TOP = _enums$STYLE_KEY$d.BORDER_TOP,
+ BORDER_RIGHT = _enums$STYLE_KEY$d.BORDER_RIGHT,
+ BORDER_BOTTOM = _enums$STYLE_KEY$d.BORDER_BOTTOM,
+ BORDER_LEFT = _enums$STYLE_KEY$d.BORDER_LEFT,
+ BACKGROUND_CLIP$2 = _enums$STYLE_KEY$d.BACKGROUND_CLIP,
+ FONT_SIZE$9 = _enums$STYLE_KEY$d.FONT_SIZE,
+ FONT_FAMILY$5 = _enums$STYLE_KEY$d.FONT_FAMILY,
+ LINE_HEIGHT$3 = _enums$STYLE_KEY$d.LINE_HEIGHT,
+ TEXT_STROKE_COLOR$4 = _enums$STYLE_KEY$d.TEXT_STROKE_COLOR,
+ TEXT_STROKE_WIDTH$3 = _enums$STYLE_KEY$d.TEXT_STROKE_WIDTH,
+ TEXT_STROKE_OVER$3 = _enums$STYLE_KEY$d.TEXT_STROKE_OVER,
_enums$UPDATE_KEY$2 = enums.UPDATE_KEY,
UPDATE_NODE$2 = _enums$UPDATE_KEY$2.UPDATE_NODE,
UPDATE_FOCUS$1 = _enums$UPDATE_KEY$2.UPDATE_FOCUS,
@@ -19931,12 +20078,12 @@ var STYLE_KEY$5 = enums.STYLE_KEY,
NODE_IS_INLINE = _enums$NODE_KEY$3.NODE_IS_INLINE,
NODE_PERSPECTIVE_MATRIX = _enums$NODE_KEY$3.NODE_PERSPECTIVE_MATRIX,
NODE_IS_MASK = _enums$NODE_KEY$3.NODE_IS_MASK,
- NODE_VIRTUAL_DOM$1 = _enums$NODE_KEY$3.NODE_VIRTUAL_DOM,
+ NODE_VIRTUAL_DOM$2 = _enums$NODE_KEY$3.NODE_VIRTUAL_DOM,
NODE_CACHE_AS_BITMAP = _enums$NODE_KEY$3.NODE_CACHE_AS_BITMAP;
var AUTO$4 = o.AUTO,
PX$6 = o.PX,
PERCENT$7 = o.PERCENT,
- INHERIT$4 = o.INHERIT,
+ INHERIT$3 = o.INHERIT,
NUMBER$5 = o.NUMBER,
REM$7 = o.REM,
VW$7 = o.VW,
@@ -20102,19 +20249,19 @@ var Xom$1 = /*#__PURE__*/function (_Node) {
['Top', 'Right', 'Bottom', 'Left'].forEach(function (k) {
var a = STYLE_KEY$5[style2Upper$2('margin' + k)];
var b = STYLE_KEY$5[style2Upper$2('padding' + k)];
- computedStyle[a] = _this2.__mpSize(currentStyle[a], w);
- computedStyle[b] = _this2.__mpSize(currentStyle[b], w);
+ computedStyle[a] = _this2.__calSize(currentStyle[a], w);
+ computedStyle[b] = _this2.__calSize(currentStyle[b], w);
});
}
}, {
- key: "__mpSize",
- value: function __mpSize(mp, w) {
+ key: "__calSize",
+ value: function __calSize(mp, w) {
if (mp[1] === PX$6) {
return mp[0];
} else if (mp[1] === PERCENT$7) {
return mp[0] * w * 0.01;
} else if (mp[1] === REM$7) {
- return mp[0] * this.root.computedStyle[FONT_SIZE$8];
+ return mp[0] * this.root.computedStyle[FONT_SIZE$9];
} else if (mp[1] === VW$7) {
return mp[0] * this.root.width * 0.01;
} else if (mp[1] === VH$7) {
@@ -20134,9 +20281,9 @@ var Xom$1 = /*#__PURE__*/function (_Node) {
var computedStyle = this.computedStyle; // 可能不传,在虚拟布局时用不到
if (!isNil$6(w)) {
- this.__clientWidth = w += computedStyle[PADDING_LEFT$2] + computedStyle[PADDING_RIGHT$1];
- this.__offsetWidth = w += computedStyle[BORDER_LEFT_WIDTH$3] + computedStyle[BORDER_RIGHT_WIDTH$2];
- this.__outerWidth = w + computedStyle[MARGIN_LEFT$1] + computedStyle[MARGIN_RIGHT$1];
+ this.__clientWidth = w += computedStyle[PADDING_LEFT$3] + computedStyle[PADDING_RIGHT$2];
+ this.__offsetWidth = w += computedStyle[BORDER_LEFT_WIDTH$4] + computedStyle[BORDER_RIGHT_WIDTH$3];
+ this.__outerWidth = w + computedStyle[MARGIN_LEFT$2] + computedStyle[MARGIN_RIGHT$2];
}
if (!isNil$6(h)) {
@@ -20158,7 +20305,7 @@ var Xom$1 = /*#__PURE__*/function (_Node) {
v[1] = PX$6;
n += v[0];
} else if (v[1] === REM$7) {
- n += v[0] * this.root.computedStyle[FONT_SIZE$8];
+ n += v[0] * this.root.computedStyle[FONT_SIZE$9];
} else if (v[1] === VW$7) {
n += v[0] * this.root.width * 0.01;
} else if (v[1] === VH$7) {
@@ -20175,18 +20322,18 @@ var Xom$1 = /*#__PURE__*/function (_Node) {
}, {
key: "__addMBP",
value: function __addMBP(isDirectionRow, w, currentStyle, computedStyle, res, isDirectItem) {
- var marginLeft = currentStyle[MARGIN_LEFT$1],
+ var marginLeft = currentStyle[MARGIN_LEFT$2],
marginTop = currentStyle[MARGIN_TOP],
- marginRight = currentStyle[MARGIN_RIGHT$1],
+ marginRight = currentStyle[MARGIN_RIGHT$2],
marginBottom = currentStyle[MARGIN_BOTTOM],
- paddingLeft = currentStyle[PADDING_LEFT$2],
+ paddingLeft = currentStyle[PADDING_LEFT$3],
paddingTop = currentStyle[PADDING_TOP$1],
- paddingRight = currentStyle[PADDING_RIGHT$1],
+ paddingRight = currentStyle[PADDING_RIGHT$2],
paddingBottom = currentStyle[PADDING_BOTTOM$1];
var borderTopWidth = computedStyle[BORDER_TOP_WIDTH$2],
- borderRightWidth = computedStyle[BORDER_RIGHT_WIDTH$2],
+ borderRightWidth = computedStyle[BORDER_RIGHT_WIDTH$3],
borderBottomWidth = computedStyle[BORDER_BOTTOM_WIDTH$2],
- borderLeftWidth = computedStyle[BORDER_LEFT_WIDTH$3];
+ borderLeftWidth = computedStyle[BORDER_LEFT_WIDTH$4];
var mbp = this.__calMp(marginLeft, w, !isDirectItem) + this.__calMp(marginRight, w, !isDirectItem) + this.__calMp(paddingLeft, w, !isDirectItem) + this.__calMp(paddingRight, w, !isDirectItem) + borderLeftWidth + borderRightWidth;
if (isDirectionRow) {
@@ -20212,10 +20359,18 @@ var Xom$1 = /*#__PURE__*/function (_Node) {
var isDestroyed = this.isDestroyed,
currentStyle = this.currentStyle,
computedStyle = this.computedStyle,
- __config = this.__config;
+ __config = this.__config,
+ __ellipsis = this.__ellipsis; // 虚拟省略号每次清除
+
+ if (__ellipsis) {
+ this.__ellipsis = null;
+ }
+
+ this.__parentLineBox = null;
+ this.__isIbFull = false;
var display = computedStyle[DISPLAY$2];
var width = currentStyle[WIDTH$4],
- position = currentStyle[POSITION$1];
+ position = currentStyle[POSITION$2];
this.__layoutData = {
x: data.x,
y: data.y,
@@ -20282,7 +20437,7 @@ var Xom$1 = /*#__PURE__*/function (_Node) {
break;
case REM$7:
- w = width[0] * this.root.computedStyle[FONT_SIZE$8];
+ w = width[0] * this.root.computedStyle[FONT_SIZE$9];
break;
case VW$7:
@@ -20302,17 +20457,24 @@ var Xom$1 = /*#__PURE__*/function (_Node) {
break;
}
}
- }
+ } // 只有inline会继承计算行数,其它都是原样返回
+
- var lineClampCount = 0; // 4种布局,默认block,inlineBlock基本可以复用inline逻辑,除了尺寸
+ var lineClampCount = data.lineClampCount || 0; // 4种布局,默认block,inlineBlock基本可以复用inline逻辑,除了尺寸
if (display === 'flex') {
+ data.lineClampCount = 0;
+
this.__layoutFlex(data, isAbs, isColumn);
} else if (display === 'inlineBlock' || display === 'inline-block') {
- lineClampCount = this.__layoutInline(data, isAbs, isColumn);
+ data.lineClampCount = 0;
+
+ this.__layoutInline(data, isAbs, isColumn);
} else if (display === 'inline') {
lineClampCount = this.__layoutInline(data, isAbs, isColumn, true);
} else {
+ data.lineClampCount = 0;
+
this.__layoutBlock(data, isAbs, isColumn);
} // relative渲染时做偏移,百分比基于父元素,若父元素没有定高则为0
@@ -20369,12 +20531,12 @@ var Xom$1 = /*#__PURE__*/function (_Node) {
var y = this.__sy = this.y + this.oy;
if (!__config[NODE_IS_INLINE]) {
- x = this.__sx1 = x + computedStyle[MARGIN_LEFT$1];
- x = this.__sx2 = x + computedStyle[BORDER_LEFT_WIDTH$3];
- x = this.__sx3 = x + computedStyle[PADDING_LEFT$2];
+ x = this.__sx1 = x + computedStyle[MARGIN_LEFT$2];
+ x = this.__sx2 = x + computedStyle[BORDER_LEFT_WIDTH$4];
+ x = this.__sx3 = x + computedStyle[PADDING_LEFT$3];
x = this.__sx4 = x + this.width;
- x = this.__sx5 = x + computedStyle[PADDING_RIGHT$1];
- this.__sx6 = x + computedStyle[BORDER_RIGHT_WIDTH$2];
+ x = this.__sx5 = x + computedStyle[PADDING_RIGHT$2];
+ this.__sx6 = x + computedStyle[BORDER_RIGHT_WIDTH$3];
y = this.__sy1 = y + computedStyle[MARGIN_TOP];
y = this.__sy2 = y + computedStyle[BORDER_TOP_WIDTH$2];
y = this.__sy3 = y + computedStyle[PADDING_TOP$1];
@@ -20426,7 +20588,7 @@ var Xom$1 = /*#__PURE__*/function (_Node) {
value: function __layoutNone() {
var computedStyle = this.computedStyle;
computedStyle[DISPLAY$2] = 'none';
- computedStyle[MARGIN_TOP] = computedStyle[MARGIN_RIGHT$1] = computedStyle[MARGIN_BOTTOM] = computedStyle[MARGIN_LEFT$1] = computedStyle[BORDER_TOP_WIDTH$2] = computedStyle[BORDER_RIGHT_WIDTH$2] = computedStyle[BORDER_BOTTOM_WIDTH$2] = computedStyle[BORDER_LEFT_WIDTH$3] = computedStyle[PADDING_TOP$1] = computedStyle[PADDING_RIGHT$1] = computedStyle[PADDING_BOTTOM$1] = computedStyle[PADDING_LEFT$2] = computedStyle[WIDTH$4] = computedStyle[HEIGHT$3] = this.__width = this.__height = 0;
+ computedStyle[MARGIN_TOP] = computedStyle[MARGIN_RIGHT$2] = computedStyle[MARGIN_BOTTOM] = computedStyle[MARGIN_LEFT$2] = computedStyle[BORDER_TOP_WIDTH$2] = computedStyle[BORDER_RIGHT_WIDTH$3] = computedStyle[BORDER_BOTTOM_WIDTH$2] = computedStyle[BORDER_LEFT_WIDTH$4] = computedStyle[PADDING_TOP$1] = computedStyle[PADDING_RIGHT$2] = computedStyle[PADDING_BOTTOM$1] = computedStyle[PADDING_LEFT$3] = computedStyle[WIDTH$4] = computedStyle[HEIGHT$3] = this.__width = this.__height = 0;
} // 预先计算是否是固定宽高,布局点位和尺寸考虑margin/border/padding
}, {
@@ -20441,7 +20603,6 @@ var Xom$1 = /*#__PURE__*/function (_Node) {
w3 = data.w3,
h3 = data.h3,
lx = data.lx,
- nowrap = data.nowrap,
lineBoxManager = data.lineBoxManager,
_data$endSpace = data.endSpace,
endSpace = _data$endSpace === void 0 ? 0 : _data$endSpace;
@@ -20452,17 +20613,17 @@ var Xom$1 = /*#__PURE__*/function (_Node) {
var width = currentStyle[WIDTH$4],
height = currentStyle[HEIGHT$3];
var borderTopWidth = computedStyle[BORDER_TOP_WIDTH$2],
- borderRightWidth = computedStyle[BORDER_RIGHT_WIDTH$2],
+ borderRightWidth = computedStyle[BORDER_RIGHT_WIDTH$3],
borderBottomWidth = computedStyle[BORDER_BOTTOM_WIDTH$2],
- borderLeftWidth = computedStyle[BORDER_LEFT_WIDTH$3],
+ borderLeftWidth = computedStyle[BORDER_LEFT_WIDTH$4],
marginTop = computedStyle[MARGIN_TOP],
- marginRight = computedStyle[MARGIN_RIGHT$1],
+ marginRight = computedStyle[MARGIN_RIGHT$2],
marginBottom = computedStyle[MARGIN_BOTTOM],
- marginLeft = computedStyle[MARGIN_LEFT$1],
+ marginLeft = computedStyle[MARGIN_LEFT$2],
paddingTop = computedStyle[PADDING_TOP$1],
- paddingRight = computedStyle[PADDING_RIGHT$1],
+ paddingRight = computedStyle[PADDING_RIGHT$2],
paddingBottom = computedStyle[PADDING_BOTTOM$1],
- paddingLeft = computedStyle[PADDING_LEFT$2]; // 除了auto外都是固定宽高度
+ paddingLeft = computedStyle[PADDING_LEFT$3]; // 除了auto外都是固定宽高度
var fixedWidth;
var fixedHeight; // 绝对定位是left+right这种其实等于定义了width,但不能修改原始style,存入特殊变量标识
@@ -20487,7 +20648,7 @@ var Xom$1 = /*#__PURE__*/function (_Node) {
break;
case REM$7:
- w = width[0] * this.root.computedStyle[FONT_SIZE$8];
+ w = width[0] * this.root.computedStyle[FONT_SIZE$9];
break;
case VW$7:
@@ -20527,7 +20688,7 @@ var Xom$1 = /*#__PURE__*/function (_Node) {
break;
case REM$7:
- h = height[0] * this.root.computedStyle[FONT_SIZE$8];
+ h = height[0] * this.root.computedStyle[FONT_SIZE$9];
break;
case VW$7:
@@ -20585,7 +20746,6 @@ var Xom$1 = /*#__PURE__*/function (_Node) {
h: h,
lx: lx,
lineBoxManager: lineBoxManager,
- nowrap: nowrap,
endSpace: endSpace,
selfEndSpace: selfEndSpace
};
@@ -20594,10 +20754,10 @@ var Xom$1 = /*#__PURE__*/function (_Node) {
}, {
key: "__marginAuto",
value: function __marginAuto(style, data) {
- var position = style[POSITION$1],
+ var position = style[POSITION$2],
display = style[DISPLAY$2],
- marginLeft = style[MARGIN_LEFT$1],
- marginRight = style[MARGIN_RIGHT$1],
+ marginLeft = style[MARGIN_LEFT$2],
+ marginRight = style[MARGIN_RIGHT$2],
width = style[WIDTH$4];
if (position !== 'absolute' && (display === 'block' || display === 'flex') && (width[1] !== AUTO$4 || this.isReplaced) && marginLeft[1] === AUTO$4 && marginRight[1] === AUTO$4) {
@@ -20633,7 +20793,7 @@ var Xom$1 = /*#__PURE__*/function (_Node) {
} else if (v[1] === PERCENT$7) {
v = v[0] * this.offsetWidth * 0.01;
} else if (v[1] === REM$7) {
- v = v[0] * this.root.computedStyle[FONT_SIZE$8];
+ v = v[0] * this.root.computedStyle[FONT_SIZE$9];
} else if (v[1] === VW$7) {
v = v[0] * this.root.width * 0.01;
} else if (v[1] === VH$7) {
@@ -20660,7 +20820,7 @@ var Xom$1 = /*#__PURE__*/function (_Node) {
} else if (_v[1] === PERCENT$7) {
_v = _v[0] * this.offsetHeight * 0.01;
} else if (_v[1] === REM$7) {
- _v = _v[0] * this.root.computedStyle[FONT_SIZE$8];
+ _v = _v[0] * this.root.computedStyle[FONT_SIZE$9];
} else if (_v[1] === VW$7) {
_v = _v[0] * this.root.width * 0.01;
} else if (_v[1] === VH$7) {
@@ -20687,7 +20847,7 @@ var Xom$1 = /*#__PURE__*/function (_Node) {
} else if (_v2[1] === PERCENT$7) {
_v2 = _v2[0] * this.offsetWidth * 0.01;
} else if (_v2[1] === REM$7) {
- _v2 = _v2[0] * this.root.computedStyle[FONT_SIZE$8];
+ _v2 = _v2[0] * this.root.computedStyle[FONT_SIZE$9];
} else if (_v2[1] === VW$7) {
_v2 = _v2[0] * this.root.width * 0.01;
} else if (_v2[1] === VH$7) {
@@ -20768,9 +20928,9 @@ var Xom$1 = /*#__PURE__*/function (_Node) {
}
} else if (v[1] === REM$7) {
if (k === TRANSLATE_X$4 || k === TRANSLATE_Z$4) {
- computedStyle[k] = v[0] * _this3.root.computedStyle[FONT_SIZE$8];
+ computedStyle[k] = v[0] * _this3.root.computedStyle[FONT_SIZE$9];
} else if (k === TRANSLATE_Y$4) {
- computedStyle[k] = v[0] * _this3.root.computedStyle[FONT_SIZE$8];
+ computedStyle[k] = v[0] * _this3.root.computedStyle[FONT_SIZE$9];
}
} else if (v[1] === VW$7) {
if (k === TRANSLATE_X$4 || k === TRANSLATE_Z$4) {
@@ -20886,7 +21046,7 @@ var Xom$1 = /*#__PURE__*/function (_Node) {
} // 这些直接赋值的不需要再算缓存
- [OPACITY$3, Z_INDEX$2, BORDER_TOP_STYLE, BORDER_RIGHT_STYLE, BORDER_BOTTOM_STYLE, BORDER_LEFT_STYLE, BACKGROUND_REPEAT, OVERFLOW$1, MIX_BLEND_MODE, TEXT_OVERFLOW$2, BACKGROUND_CLIP$2].forEach(function (k) {
+ [OPACITY$3, Z_INDEX$2, BORDER_TOP_STYLE, BORDER_RIGHT_STYLE, BORDER_BOTTOM_STYLE, BORDER_LEFT_STYLE, BACKGROUND_REPEAT, OVERFLOW$2, MIX_BLEND_MODE, TEXT_OVERFLOW$2, BACKGROUND_CLIP$2].forEach(function (k) {
computedStyle[k] = currentStyle[k];
});
@@ -20905,7 +21065,7 @@ var Xom$1 = /*#__PURE__*/function (_Node) {
}
if (item[1] === REM$7) {
- return item[0] * _this4.root.computedStyle[FONT_SIZE$8];
+ return item[0] * _this4.root.computedStyle[FONT_SIZE$9];
}
if (item[1] === VW$7) {
@@ -20939,7 +21099,7 @@ var Xom$1 = /*#__PURE__*/function (_Node) {
}
if (item[1] === REM$7) {
- return item[0] * _this4.root.computedStyle[FONT_SIZE$8];
+ return item[0] * _this4.root.computedStyle[FONT_SIZE$9];
}
if (item[1] === VW$7) {
@@ -21046,7 +21206,7 @@ var Xom$1 = /*#__PURE__*/function (_Node) {
v *= 0.01 * (by2 - by1);
}
} else if (item2[1] === REM$7) {
- v = v * _this4.root.computedStyle[FONT_SIZE$8];
+ v = v * _this4.root.computedStyle[FONT_SIZE$9];
} else if (item2[1] === VW$7) {
v = v * _this4.root.width * 0.01;
} else if (item2[1] === VH$7) {
@@ -21153,7 +21313,7 @@ var Xom$1 = /*#__PURE__*/function (_Node) {
var parentComputedStyle = parent && parent.computedStyle;
- if (currentStyle[FONT_STYLE$4][1] === INHERIT$4) {
+ if (currentStyle[FONT_STYLE$4][1] === INHERIT$3) {
computedStyle[FONT_STYLE$4] = parent ? parentComputedStyle[FONT_STYLE$4] : 'normal';
} else if (isNil$6(__cacheStyle[FONT_STYLE$4])) {
computedStyle[FONT_STYLE$4] = currentStyle[FONT_STYLE$4][0];
@@ -21161,15 +21321,15 @@ var Xom$1 = /*#__PURE__*/function (_Node) {
__cacheStyle[FONT_STYLE$4] = computedStyle[FONT_STYLE$4];
- if (currentStyle[COLOR$4][1] === INHERIT$4) {
- computedStyle[COLOR$4] = parent ? parentComputedStyle[COLOR$4] : [0, 0, 0, 1];
- __cacheStyle[COLOR$4] = int2rgba$2(computedStyle[COLOR$4]);
- } else if (isNil$6(__cacheStyle[COLOR$4])) {
- computedStyle[COLOR$4] = rgba2int$3(currentStyle[COLOR$4][0]);
- __cacheStyle[COLOR$4] = int2rgba$2(computedStyle[COLOR$4]);
+ if (currentStyle[COLOR$5][1] === INHERIT$3) {
+ computedStyle[COLOR$5] = parent ? parentComputedStyle[COLOR$5] : [0, 0, 0, 1];
+ __cacheStyle[COLOR$5] = int2rgba$2(computedStyle[COLOR$5]);
+ } else if (isNil$6(__cacheStyle[COLOR$5])) {
+ computedStyle[COLOR$5] = rgba2int$3(currentStyle[COLOR$5][0]);
+ __cacheStyle[COLOR$5] = int2rgba$2(computedStyle[COLOR$5]);
}
- if (currentStyle[TEXT_STROKE_COLOR$4][1] === INHERIT$4) {
+ if (currentStyle[TEXT_STROKE_COLOR$4][1] === INHERIT$3) {
computedStyle[TEXT_STROKE_COLOR$4] = parent ? parentComputedStyle[TEXT_STROKE_COLOR$4] : [0, 0, 0, 1];
__cacheStyle[TEXT_STROKE_COLOR$4] = int2rgba$2(computedStyle[TEXT_STROKE_COLOR$4]);
} else if (isNil$6(__cacheStyle[TEXT_STROKE_COLOR$4])) {
@@ -21177,14 +21337,14 @@ var Xom$1 = /*#__PURE__*/function (_Node) {
__cacheStyle[TEXT_STROKE_COLOR$4] = int2rgba$2(computedStyle[TEXT_STROKE_COLOR$4]);
}
- if (currentStyle[TEXT_STROKE_WIDTH$3][1] === INHERIT$4) {
+ if (currentStyle[TEXT_STROKE_WIDTH$3][1] === INHERIT$3) {
computedStyle[TEXT_STROKE_WIDTH$3] = parent ? parentComputedStyle[TEXT_STROKE_WIDTH$3] : 0;
__cacheStyle[TEXT_STROKE_WIDTH$3] = true;
} else if (isNil$6(__cacheStyle[TEXT_STROKE_WIDTH$3])) {
var v = currentStyle[TEXT_STROKE_WIDTH$3];
if (v[1] === REM$7) {
- v = v[0] * this.root.computedStyle[FONT_SIZE$8];
+ v = v[0] * this.root.computedStyle[FONT_SIZE$9];
} else if (v[1] === VW$7) {
v = v[0] * this.root.width * 0.01;
} else if (v[1] === VH$7) {
@@ -21201,13 +21361,13 @@ var Xom$1 = /*#__PURE__*/function (_Node) {
__cacheStyle[TEXT_STROKE_WIDTH$3] = true;
}
- if (currentStyle[TEXT_STROKE_OVER$3][1] === INHERIT$4) {
+ if (currentStyle[TEXT_STROKE_OVER$3][1] === INHERIT$3) {
__cacheStyle[TEXT_STROKE_OVER$3] = computedStyle[TEXT_STROKE_OVER$3] = parent ? parentComputedStyle[TEXT_STROKE_OVER$3] : 'none';
} else {
__cacheStyle[TEXT_STROKE_OVER$3] = computedStyle[TEXT_STROKE_OVER$3] = currentStyle[TEXT_STROKE_OVER$3][0];
}
- if (currentStyle[VISIBILITY$2][1] === INHERIT$4) {
+ if (currentStyle[VISIBILITY$2][1] === INHERIT$3) {
computedStyle[VISIBILITY$2] = parent ? parentComputedStyle[VISIBILITY$2] : 'visible';
} else if (isNil$6(__cacheStyle[VISIBILITY$2])) {
computedStyle[VISIBILITY$2] = currentStyle[VISIBILITY$2][0];
@@ -21215,7 +21375,7 @@ var Xom$1 = /*#__PURE__*/function (_Node) {
__cacheStyle[VISIBILITY$2] = computedStyle[VISIBILITY$2];
- if (currentStyle[POINTER_EVENTS$1][1] === INHERIT$4) {
+ if (currentStyle[POINTER_EVENTS$1][1] === INHERIT$3) {
computedStyle[POINTER_EVENTS$1] = parent ? parentComputedStyle[POINTER_EVENTS$1] : 'auto';
} else if (isNil$6(__cacheStyle[POINTER_EVENTS$1])) {
computedStyle[POINTER_EVENTS$1] = currentStyle[POINTER_EVENTS$1][0];
@@ -21240,7 +21400,7 @@ var Xom$1 = /*#__PURE__*/function (_Node) {
var ppt = 0;
if (v[1] === REM$7) {
- ppt = v[0] * this.root.computedStyle[FONT_SIZE$8];
+ ppt = v[0] * this.root.computedStyle[FONT_SIZE$9];
} else if (v[1] === VW$7) {
ppt = v[0] * this.root.width * 0.01;
} else if (v[1] === VH$7) {
@@ -21288,7 +21448,7 @@ var Xom$1 = /*#__PURE__*/function (_Node) {
if (v[1] === PX$6 || v[1] === DEG$2 || v[1] === PERCENT$7 || v[1] === NUMBER$5) {
v = v[0];
} else if (v[1] === REM$7) {
- v = v[0] * _this5.root.computedStyle[FONT_SIZE$8];
+ v = v[0] * _this5.root.computedStyle[FONT_SIZE$9];
} else if (v[1] === VW$7) {
v = v[0] * _this5.root.width * 0.01;
} else if (v[1] === VH$7) {
@@ -21305,7 +21465,7 @@ var Xom$1 = /*#__PURE__*/function (_Node) {
}, {
key: "__calContent",
value: function __calContent(renderMode, lv, currentStyle, computedStyle) {
- if (renderMode === CANVAS$1 || renderMode === WEBGL$1) {
+ if (renderMode === CANVAS$3 || renderMode === WEBGL$3) {
if (lv < REPAINT$1) {
return this.__hasContent;
}
@@ -21327,9 +21487,9 @@ var Xom$1 = /*#__PURE__*/function (_Node) {
var width = computedStyle[WIDTH$4],
height = computedStyle[HEIGHT$3],
paddingTop = computedStyle[PADDING_TOP$1],
- paddingRight = computedStyle[PADDING_RIGHT$1],
+ paddingRight = computedStyle[PADDING_RIGHT$2],
paddingBottom = computedStyle[PADDING_BOTTOM$1],
- paddingLeft = computedStyle[PADDING_LEFT$2];
+ paddingLeft = computedStyle[PADDING_LEFT$3];
if (width && height || paddingTop || paddingRight || paddingBottom || paddingLeft) {
return true;
@@ -21411,8 +21571,8 @@ var Xom$1 = /*#__PURE__*/function (_Node) {
var virtualDom; // svg设置vd上的lv属性标明= 0; i--) {
+ var item = list[i]; // 无论删除一个ib还是textBox,放得下的话都可以暂停循环,注意强制保留行首
+
+ if (!i || wl + item.outerWidth >= ew + 1e-10) {
+ if (item instanceof TextBox) {
+ var text = item.parent;
+
+ text.__backtrack(bp, lineBoxManager, lineBox, item, wl, endSpace, ew, computedStyle, ctx, renderMode);
+ } else {
+ var ep = new Ellipsis(item.x + item.outerWidth + endSpace, item.y, ew, bp);
+ lineBoxManager.addItem(ep, true);
+ }
+
+ break;
+ } // 放不下删除
+ else {
+ if (item instanceof TextBox) {
+ var _text = item.parent;
+
+ var _i = _text.textBoxes.indexOf(item);
+
+ if (_i > -1) {
+ _text.textBoxes.splice(_i, 1);
+ }
+ } else {
+ item.__layoutNone();
+ }
+
+ list.pop();
+ wl += item.outerWidth;
+ }
+ }
+}
var Dom$1 = /*#__PURE__*/function (_Xom) {
_inherits(Dom, _Xom);
@@ -24202,7 +24379,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
}
}
- if (!style[FONT_WEIGHT$4] && tag.BOLD.hasOwnProperty(tagName)) {
+ if (!style[FONT_WEIGHT$5] && tag.BOLD.hasOwnProperty(tagName)) {
style.fontWeight = 700;
}
@@ -24212,6 +24389,8 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
_this.__children = children || [];
_this.__flexLine = []; // flex布局多行模式时存储行
+ _this.__ellipsis = null; // 虚拟节点,有的话渲染
+
var config = _this.__config;
config[NODE_CURRENT_STYLE$2] = _this.__currentStyle;
config[NODE_STYLE$2] = _this.__style;
@@ -24312,8 +24491,8 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
var needSort;
- for (var _i = 0, len = source.length; _i < len; _i++) {
- if (source[_i] !== arr[_i]) {
+ for (var _i2 = 0, len = source.length; _i2 < len; _i2++) {
+ if (source[_i2] !== arr[_i2]) {
needSort = true;
break;
}
@@ -24343,16 +24522,18 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
}, {
key: "__tryLayInline",
value: function __tryLayInline(w, total) {
+ css.computeReflow(this);
var flowChildren = this.flowChildren,
_this$currentStyle = this.currentStyle,
display = _this$currentStyle[DISPLAY$5],
width = _this$currentStyle[WIDTH$5],
- marginLeft = _this$currentStyle[MARGIN_LEFT$3],
- marginRight = _this$currentStyle[MARGIN_RIGHT$3],
- paddingLeft = _this$currentStyle[PADDING_LEFT$4],
- paddingRight = _this$currentStyle[PADDING_RIGHT$3],
- borderLeftWidth = _this$currentStyle[BORDER_LEFT_WIDTH$5],
- borderRightWidth = _this$currentStyle[BORDER_RIGHT_WIDTH$4]; // inline没w/h,并且尝试孩子第一个能放下即可,如果是文字就是第一个字符
+ marginLeft = _this$currentStyle[MARGIN_LEFT$4],
+ marginRight = _this$currentStyle[MARGIN_RIGHT$4],
+ paddingLeft = _this$currentStyle[PADDING_LEFT$5],
+ paddingRight = _this$currentStyle[PADDING_RIGHT$4],
+ _this$computedStyle = this.computedStyle,
+ borderLeftWidth = _this$computedStyle[BORDER_LEFT_WIDTH$6],
+ borderRightWidth = _this$computedStyle[BORDER_RIGHT_WIDTH$5]; // inline没w/h,并且尝试孩子第一个能放下即可,如果是文字就是第一个字符
if (display === 'inline') {
if (flowChildren.length) {
@@ -24370,20 +24551,8 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
}
} // inlineBlock尝试所有孩子在一行上
else {
- if (width[1] === PX$8) {
- w -= width[0];
- } else if (width[1] === PERCENT$9) {
- w -= total * width[0] * 0.01;
- } else if (width[1] === REM$8) {
- w -= width[0] * this.root.computedStyle[FONT_SIZE$9];
- } else if (width[1] === VW$8) {
- w -= width[0] * this.root.width * 0.01;
- } else if (width[1] === VH$8) {
- w -= width[0] * this.root.height * 0.01;
- } else if (width[1] === VMAX$8) {
- w -= width[0] * Math.max(this.root.width, this.root.height) * 0.01;
- } else if (width[1] === VMIN$8) {
- w -= width[0] * Math.min(this.root.width, this.root.height) * 0.01;
+ if (width[1] !== AUTO$6) {
+ w -= this.__calSize(width, total);
} else {
for (var i = 0; i < flowChildren.length; i++) {
// 当放不下时直接返回,无需继续多余的尝试计算
@@ -24407,107 +24576,28 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
} // ib要减去末尾mpb
- if (marginRight[1] === PX$8) {
- w -= marginRight[0];
- } else if (marginRight[1] === PERCENT$9) {
- w -= marginRight[0] * total * 0.01;
- } else if (marginRight[1] === REM$8) {
- w -= marginRight[0] * this.root.computedStyle[FONT_SIZE$9];
- } else if (marginRight[1] === VW$8) {
- w -= marginRight[0] * this.root.width * 0.01;
- } else if (marginRight[1] === VH$8) {
- w -= marginRight[0] * this.root.height * 0.01;
- } else if (marginRight[1] === VMAX$8) {
- w -= marginRight[0] * Math.max(this.root.width, this.root.height) * 0.01;
- } else if (marginRight[1] === VMIN$8) {
- w -= marginRight[0] * Math.min(this.root.width, this.root.height) * 0.01;
- }
-
- if (paddingRight[1] === PX$8) {
- w -= paddingRight[0];
- } else if (paddingRight[1] === PERCENT$9) {
- w -= paddingRight[0] * total * 0.01;
- } else if (paddingRight[1] === REM$8) {
- w -= paddingRight[0] * this.root.computedStyle[FONT_SIZE$9];
- } else if (paddingRight[1] === VW$8) {
- w -= paddingRight[0] * this.root.width * 0.01;
- } else if (paddingRight[1] === VH$8) {
- w -= paddingRight[0] * this.root.height * 0.01;
- } else if (paddingRight[1] === VMAX$8) {
- w -= paddingRight[0] * Math.max(this.root.width, this.root.height) * 0.01;
- } else if (paddingRight[1] === VMIN$8) {
- w -= paddingRight[0] * Math.min(this.root.width, this.root.height) * 0.01;
- }
-
- if (borderRightWidth[1] === PX$8) {
- w -= borderRightWidth[0];
- } else if (borderRightWidth[1] === REM$8) {
- w -= borderRightWidth[0] * this.root.computedStyle[FONT_SIZE$9];
- } else if (borderRightWidth[1] === VW$8) {
- w -= borderRightWidth[0] * this.root.width * 0.01;
- } else if (borderRightWidth[1] === VH$8) {
- w -= borderRightWidth[0] * this.root.height * 0.01;
- } else if (borderRightWidth[1] === VMAX$8) {
- w -= borderRightWidth[0] * Math.max(this.root.width, this.root.height) * 0.01;
- } else if (borderRightWidth[1] === VMIN$8) {
- w -= borderRightWidth[0] * Math.min(this.root.width, this.root.height) * 0.01;
- }
+ w -= this.__calSize(marginRight, total);
+ w -= this.__calSize(paddingRight, total);
+ w -= borderRightWidth;
} // 还要减去开头的mpb
- if (marginLeft[1] === PX$8) {
- w -= marginLeft[0];
- } else if (marginLeft[1] === PERCENT$9) {
- w -= marginLeft[0] * total * 0.01;
- } else if (marginLeft[1] === REM$8) {
- w -= marginLeft[0] * this.root.computedStyle[FONT_SIZE$9];
- } else if (marginLeft[1] === VW$8) {
- w -= marginLeft[0] * this.root.width * 0.01;
- } else if (marginLeft[1] === VH$8) {
- w -= marginLeft[0] * this.root.height * 0.01;
- } else if (marginLeft[1] === VMAX$8) {
- w -= marginLeft[0] * Math.max(this.root.width, this.root.height) * 0.01;
- } else if (marginLeft[1] === VMIN$8) {
- w -= marginLeft[0] * Math.min(this.root.width, this.root.height) * 0.01;
- }
-
- if (paddingLeft[1] === PX$8) {
- w -= paddingLeft[0];
- } else if (paddingLeft[1] === PERCENT$9) {
- w -= paddingLeft[0] * total * 0.01;
- } else if (paddingLeft[1] === REM$8) {
- w -= paddingLeft[0] * this.root.computedStyle[FONT_SIZE$9];
- } else if (paddingLeft[1] === VW$8) {
- w -= paddingLeft[0] * this.root.width * 0.01;
- } else if (paddingLeft[1] === VH$8) {
- w -= paddingLeft[0] * this.root.height * 0.01;
- } else if (paddingLeft[1] === VMAX$8) {
- w -= paddingLeft[0] * Math.max(this.root.width, this.root.height) * 0.01;
- } else if (paddingLeft[1] === VMIN$8) {
- w -= paddingLeft[0] * Math.min(this.root.width, this.root.height) * 0.01;
- }
-
- if (borderLeftWidth[1] === PX$8) {
- w -= borderLeftWidth[0];
- } else if (borderLeftWidth[1] === REM$8) {
- w -= borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE$9];
- } else if (borderLeftWidth[1] === VW$8) {
- w -= borderLeftWidth[0] * this.root.width * 0.01;
- } else if (borderLeftWidth[1] === VH$8) {
- w -= borderLeftWidth[0] * this.root.height * 0.01;
- } else if (borderLeftWidth[1] === VMAX$8) {
- w -= borderLeftWidth[0] * Math.max(this.root.width, this.root.height) * 0.01;
- } else if (borderLeftWidth[1] === VMIN$8) {
- w -= borderLeftWidth[0] * Math.min(this.root.width, this.root.height) * 0.01;
- }
-
+ w -= this.__calSize(marginLeft, total);
+ w -= this.__calSize(paddingLeft, total);
+ w -= borderLeftWidth;
return w;
} // 设置y偏移值,递归包括children,此举在justify-content/margin-auto等对齐用
}, {
key: "__offsetX",
value: function __offsetX(diff, isLayout, lv) {
- _get(_getPrototypeOf(Dom.prototype), "__offsetX", this).call(this, diff, isLayout, lv); // 记得偏移LineBox
+ _get(_getPrototypeOf(Dom.prototype), "__offsetX", this).call(this, diff, isLayout, lv);
+
+ var ep = this.__ellipsis;
+
+ if (ep) {
+ ep.__offsetX(diff, isLayout);
+ } // 记得偏移LineBox
if (isLayout && !this.__config[NODE_IS_INLINE$1] && this.lineBoxManager) {
@@ -24525,6 +24615,12 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
value: function __offsetY(diff, isLayout, lv) {
_get(_getPrototypeOf(Dom.prototype), "__offsetY", this).call(this, diff, isLayout, lv);
+ var ep = this.__ellipsis;
+
+ if (ep) {
+ ep.__offsetY(diff, isLayout);
+ }
+
if (isLayout && !this.__config[NODE_IS_INLINE$1] && this.lineBoxManager) {
this.lineBoxManager.__offsetY(diff);
}
@@ -24574,7 +24670,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
flexBasis = currentStyle[FLEX_BASIS$2],
width = currentStyle[WIDTH$5],
height = currentStyle[HEIGHT$5];
- var lineHeight = computedStyle[LINE_HEIGHT$4],
+ var lineHeight = computedStyle[LINE_HEIGHT$5],
display = computedStyle[DISPLAY$5];
var main = isDirectionRow ? width : height; // basis3种情况:auto、固定、content
@@ -24584,38 +24680,10 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
var fixedSize; // flex的item固定basis计算
if (isFixed) {
- if (flexBasis[1] === PX$8) {
- b = fixedSize = flexBasis[0];
- } else if (flexBasis[1] === PERCENT$9) {
- b = fixedSize = (isDirectionRow ? w : h) * flexBasis[0] * 0.01;
- } else if (flexBasis[1] === REM$8) {
- b = fixedSize = flexBasis[0] * this.root.computedStyle[FONT_SIZE$9];
- } else if (flexBasis[1] === VW$8) {
- b = fixedSize = flexBasis[0] * this.root.width * 0.01;
- } else if (flexBasis[1] === VH$8) {
- b = fixedSize = flexBasis[0] * this.root.height * 0.01;
- } else if (flexBasis[1] === VMAX$8) {
- b = fixedSize = flexBasis[0] * Math.max(this.root.width, this.root.height) * 0.01;
- } else if (flexBasis[1] === VMIN$8) {
- b = fixedSize = flexBasis[0] * Math.min(this.root.width, this.root.height) * 0.01;
- }
+ b = fixedSize = this.__calSize(flexBasis, isDirectionRow ? w : h);
} // 已声明主轴尺寸的,当basis是auto时为main值
else if (isAuto && [PX$8, PERCENT$9, REM$8, VW$8, VH$8, VMAX$8, VMIN$8].indexOf(main[1]) > -1) {
- if (main[1] === PX$8) {
- b = fixedSize = main[0];
- } else if (main[1] === PERCENT$9) {
- b = fixedSize = main[0] * 0.01 * (isDirectionRow ? w : h);
- } else if (main[1] === REM$8) {
- b = fixedSize = main[0] * this.root.computedStyle[FONT_SIZE$9];
- } else if (main[1] === VW$8) {
- b = fixedSize = main[0] * this.root.width * 0.01;
- } else if (main[1] === VH$8) {
- b = fixedSize = main[0] * this.root.height * 0.01;
- } else if (main[1] === VMAX$8) {
- b = fixedSize = main[0] * Math.max(this.root.width, this.root.height) * 0.01;
- } else if (main[1] === VMIN$8) {
- b = fixedSize = main[0] * Math.min(this.root.width, this.root.height) * 0.01;
- }
+ b = fixedSize = this.__calSize(main, isDirectionRow ? w : h);
} // 非固定尺寸的basis为auto时降级为content
else if (isAuto) {
isContent = true;
@@ -24648,7 +24716,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
min = Math.max(min, min2);
max = Math.max(max, max2);
}
- } else if (isDirectionRow) {
+ } else {
if (isRow) {
min += item.charWidth;
max += item.textWidth;
@@ -24744,6 +24812,8 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
}, {
key: "__layoutBlock",
value: function __layoutBlock(data, isAbs, isColumn) {
+ var _this2 = this;
+
var flowChildren = this.flowChildren,
currentStyle = this.currentStyle,
computedStyle = this.computedStyle;
@@ -24774,7 +24844,9 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
var textAlign = computedStyle[TEXT_ALIGN$2],
whiteSpace = computedStyle[WHITE_SPACE$2],
lineClamp = computedStyle[LINE_CLAMP$1],
- lineHeight = computedStyle[LINE_HEIGHT$4]; // 只有>=1的正整数才有效
+ lineHeight = computedStyle[LINE_HEIGHT$5],
+ overflow = computedStyle[OVERFLOW$3],
+ textOverflow = computedStyle[TEXT_OVERFLOW$3]; // 只有>=1的正整数才有效
lineClamp = lineClamp || 0;
var lineClampCount = 0; // 虚线管理一个block内部的LineBox列表,使得inline的元素可以中途衔接处理折行
@@ -24783,16 +24855,25 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
var lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseline(computedStyle)); // 因精度问题,统计宽度均从0开始累加每行,最后取最大值,仅在abs布局时isVirtual生效
var maxW = 0;
- var cw = 0; // 连续block(flex相同,下面都是)的上下margin合并值记录,合并时从列表中取
+ var cw = 0;
+ var lx = x; // 行首,考虑了mbp
+ // 连续block(flex相同,下面都是)的上下margin合并值记录,合并时从列表中取
var mergeMarginBottomList = [],
mergeMarginTopList = [];
var length = flowChildren.length;
+ var ignoreNextLine; // lineClamp超过后,后面的均忽略并置none,注意block内部行数统计是跨子block的
+
+ var ignoreNextWrap; // whiteSpace单行超过后,后面的均忽略并置none,注意这也是跨block的会被隔断重计
+
flowChildren.forEach(function (item, i) {
var isXom = item instanceof Xom$1 || item instanceof Component$1 && item.shadowRoot instanceof Xom$1;
var isInline = isXom && item.currentStyle[DISPLAY$5] === 'inline';
var isInlineBlock = isXom && ['inlineBlock', 'inline-block'].indexOf(item.currentStyle[DISPLAY$5]) > -1;
- var isReplaced = item.isReplaced; // 每次循环开始前,这次不是block的话,看之前遗留待合并margin,并重置
+
+ var isRealInline = isInline && item.__isRealInline();
+
+ var lastLineClampCount = lineClampCount; // 每次循环开始前,这次不是block的话,看之前遗留待合并margin,并重置
if (!isXom || isInline || isInlineBlock) {
if (mergeMarginBottomList.length && mergeMarginTopList.length) {
@@ -24812,114 +24893,169 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
// 比如2个inline前面占一半后面比一半多但还是会从一半开始然后第2行换行继续,但ib放不下则重开一行
// inline和ib能互相嵌套,形成的LineBox中则是TextBox和节点混合
if (isInlineBlock || isInline) {
- // x开头,不用考虑是否放得下直接放
- if (x === data.x || isInline && whiteSpace === 'nowrap') {
- item.__layout({
+ if (ignoreNextLine || ignoreNextWrap) {
+ item.__layoutNone();
+
+ return;
+ } // x开头或者nowrap单行的非block,不用考虑是否放得下直接放
+
+
+ if (x === lx || whiteSpace === 'nowrap') {
+ lineClampCount = item.__layout({
x: x,
y: y,
w: w,
h: h,
- lx: data.x,
+ lx: lx,
lineBoxManager: lineBoxManager,
// ib内部新生成会内部判断,这里不管统一传入
lineClamp: lineClamp,
lineClampCount: lineClampCount
- }, isAbs, isColumn); // inlineBlock的特殊之处,一旦w为auto且内部产生折行时,整个变成block独占一块区域,坐标计算和block一样
-
+ }, isAbs, isColumn); // inlineBlock的特殊之处,一旦w为auto且内部产生折行时,整个变成block独占一块区域,坐标计算和block一样,注意nowrap排除
if (item.__isIbFull) {
- x = data.x;
+ lineClampCount++;
+ }
+
+ if (item.__isIbFull && whiteSpace !== 'nowrap') {
+ lineBoxManager.addItem(item, true);
+ x = lx;
y += item.outerHeight;
lineBoxManager.setNotEnd();
} // inline和不折行的ib,其中ib需要手动存入当前lb中
else {
- (isInlineBlock || isReplaced) && lineBoxManager.addItem(item);
+ (isInlineBlock || !isRealInline) && lineBoxManager.addItem(item, false);
x = lineBoxManager.lastX;
y = lineBoxManager.lastY;
- } // abs统计宽度
+ } // 单行时inline在ellipsis会导致行数变化,否则判断坐标尺寸(恰好有点空剩余inline排不下),注意前提是非abs,其虚拟计算尺寸无视限制
+
+
+ if (!isAbs && overflow === 'hidden' && whiteSpace === 'nowrap' && (x - lx > w + 1e-10 || lineClampCount > lastLineClampCount)) {
+ ignoreNextWrap = true;
+ } else if (lineClamp && lineClampCount >= lineClamp) {
+ ignoreNextLine = true;
+ } // abs统计宽度,注意nowrap时累加
if (isAbs) {
- cw = item.outerWidth;
- maxW = Math.max(maxW, cw);
+ if (whiteSpace === 'nowrap') {
+ cw += item.outerWidth;
+ } else {
+ cw = item.outerWidth;
- if (item.__isIbFull) {
- maxW = Math.max(maxW, w);
+ if (lineClampCount > lastLineClampCount) {
+ cw = Math.max(cw, w);
+ }
}
+
+ maxW = Math.max(maxW, cw);
}
} else {
// 非开头先尝试是否放得下,内部判断了inline/ib,ib要考虑是否有width
- var fw = item.__tryLayInline(w + data.x - x, w); // 放得下继续,奇怪的精度问题,加上阈值
+ var fw = item.__tryLayInline(w + lx - x, w); // 放得下继续,奇怪的精度问题,加上阈值
if (fw >= -1e-10) {
- item.__layout({
+ lineClampCount = item.__layout({
x: x,
y: y,
w: w,
h: h,
- lx: data.x,
+ lx: lx,
lineBoxManager: lineBoxManager,
lineClamp: lineClamp,
lineClampCount: lineClampCount
}, isAbs, isColumn); // ib放得下要么内部没有折行,要么声明了width限制,都需手动存入当前lb
-
- (isInlineBlock || isReplaced) && lineBoxManager.addItem(item);
+ (isInlineBlock || !isRealInline) && lineBoxManager.addItem(item, false);
x = lineBoxManager.lastX;
y = lineBoxManager.lastY;
- } // 放不下处理之前的lineBox,并重新开头
+
+ if (lineClamp && lineClampCount >= lineClamp) {
+ ignoreNextLine = true;
+ }
+
+ if (isAbs) {
+ // ib和非换行inline累加
+ if (isInlineBlock || lineClampCount === lastLineClampCount) {
+ cw += item.outerWidth;
+ maxW = Math.max(maxW, cw);
+ } // inline换行时一定超过边界至少撑满w
+ else {
+ maxW = Math.max(maxW, w);
+ cw = x - lx;
+ maxW = Math.max(maxW, cw);
+ }
+ }
+ } // 放不下处理之前的lineBox,并考虑重新开头或截断
else {
lineClampCount++;
- x = data.x;
+ x = lx;
y = lineBoxManager.endY;
- lineBoxManager.setNewLine();
+ lineBoxManager.setNewLine(); // 超过行数,整个block共用计数器
+
+ if (lineClamp && lineClampCount >= lineClamp) {
+ item.__layoutNone();
+
+ ignoreNextLine = true;
+ var list = lineBoxManager.list;
+ var lineBox = list[list.length - 1];
+ backtrack(_this2, lineBoxManager, lineBox, w, 0);
+ return;
+ }
+
lineClampCount = item.__layout({
x: x,
y: y,
w: w,
h: h,
- lx: data.x,
+ lx: lx,
lineBoxManager: lineBoxManager,
lineClamp: lineClamp,
lineClampCount: lineClampCount
}, isAbs, isColumn); // 重新开头的ib和上面开头处一样逻辑
if (item.__isIbFull) {
- x = data.x;
+ lineBoxManager.addItem(item, false);
+ x = lx;
y += item.outerHeight;
lineBoxManager.setNotEnd();
+ lineClampCount++;
} // inline和不折行的ib,其中ib需要手动存入当前lb中
else {
- (isInlineBlock || isReplaced) && lineBoxManager.addItem(item);
+ (isInlineBlock || !isRealInline) && lineBoxManager.addItem(item, false);
x = lineBoxManager.lastX;
y = lineBoxManager.lastY;
}
+ if (lineClamp && lineClampCount >= lineClamp) {
+ ignoreNextLine = true;
+ }
+
if (isAbs) {
- maxW = Math.max(maxW, cw);
+ maxW = Math.max(maxW, cw); // 此处发生换行撑满
- if (item.__isIbFull) {
- maxW = Math.max(maxW, w);
- }
+ maxW = Math.max(maxW, w); // 新行重计
- cw = 0;
+ cw = item.outerWidth;
+ maxW = Math.max(maxW, cw);
}
}
-
- if (isAbs) {
- cw += item.outerWidth;
- maxW = Math.max(maxW, cw);
- }
}
} // block/flex先处理之前可能遗留的最后一行LineBox,然后递归时不传lineBoxManager,其内部生成新的
else {
- // 非开头,说明之前的text未换行,需要增加行数
- if (x !== data.x && flowChildren[i - 1] instanceof Text) {
+ ignoreNextWrap = false; // block出现的话只隔断单行,不影响多行计数器
+ // 非开头,说明之前的text/ib未换行,需要增加行数
+
+ if (x > lx) {
lineClampCount++;
}
- x = data.x;
+ if (lineClamp && lineClampCount >= lineClamp) {
+ ignoreNextLine = true;
+ }
+
+ x = lx;
if (lineBoxManager.isEnd) {
y = lineBoxManager.endY;
@@ -24932,10 +25068,10 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
y: y,
w: w,
h: h
- }, isAbs, isColumn);
+ }, isAbs, isColumn); // 自身无内容
- var isNone = item.computedStyle[DISPLAY$5] === 'none'; // 自身无内容
+ var isNone = item.currentStyle[DISPLAY$5] === 'none';
var isEmptyBlock;
if (!isNone && item.flowChildren && item.flowChildren.length === 0) {
@@ -24996,38 +25132,50 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
}
} // 文字和inline类似
else {
- // lineClamp作用域为block下的inline(同LineBox上下文)
- if (lineClamp && lineClampCount >= lineClamp) {
+ if (ignoreNextLine || ignoreNextWrap) {
+ item.__layoutNone();
+
return;
} // x开头,不用考虑是否放得下直接放
- if (x === data.x || whiteSpace === 'nowrap') {
+ if (x === lx || whiteSpace === 'nowrap') {
lineClampCount = item.__layout({
x: x,
y: y,
w: w,
h: h,
- lx: data.x,
+ lx: lx,
lineBoxManager: lineBoxManager,
lineClamp: lineClamp,
lineClampCount: lineClampCount
}, isAbs, isColumn);
x = lineBoxManager.lastX;
- y = lineBoxManager.lastY;
+ y = lineBoxManager.lastY; // 和inline很像,只是没有ib
+
+ if (!isAbs && overflow === 'hidden' && whiteSpace === 'nowrap' && (x - lx > w + 1e-10 || lineClampCount > lastLineClampCount)) {
+ ignoreNextWrap = true;
+ } else if (lineClamp && lineClampCount >= lineClamp) {
+ ignoreNextLine = true;
+ } // abs统计宽度,注意nowrap时累加
+
if (isAbs) {
- cw = item.width; // 发生换行情况,最大宽度要特殊计算,可能撑满容器,比如abs下文字换行,仅算内容宽度可能会缺少
+ if (whiteSpace === 'nowrap') {
+ cw += item.width;
+ } else {
+ cw = item.width;
- if (item.textWidth > w) {
- cw = Math.max(cw, w);
+ if (lineClampCount > lastLineClampCount) {
+ cw = Math.max(cw, w);
+ }
}
maxW = Math.max(maxW, cw);
}
} else {
// 非开头先尝试是否放得下
- var _fw = item.__tryLayInline(w - x + data.x); // 放得下继续
+ var _fw = item.__tryLayInline(w - x + lx); // 放得下继续
if (_fw >= -1e-10) {
@@ -25036,25 +25184,52 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
y: y,
w: w,
h: h,
- lx: data.x,
+ lx: lx,
lineBoxManager: lineBoxManager,
lineClamp: lineClamp,
lineClampCount: lineClampCount
}, isAbs, isColumn);
x = lineBoxManager.lastX;
y = lineBoxManager.lastY;
+
+ if (lineClamp && lineClampCount >= lineClamp) {
+ ignoreNextLine = true;
+ }
+
+ if (isAbs) {
+ if (lineClampCount === lastLineClampCount) {
+ cw += item.outerWidth;
+ maxW = Math.max(maxW, cw);
+ } // inline换行一定超过边界
+ else {
+ maxW = Math.max(maxW, w);
+ cw = x - lx;
+ maxW = Math.max(maxW, cw);
+ }
+ }
} // 放不下处理之前的lineBox,并重新开头
else {
lineClampCount++;
- x = data.x;
+ x = lx;
y = lineBoxManager.endY;
- lineBoxManager.setNewLine();
+ lineBoxManager.setNewLine(); // 和inline/ib一样
+
+ if (lineClamp && lineClampCount >= lineClamp) {
+ item.__layoutNone();
+
+ ignoreNextLine = true;
+ var _list = lineBoxManager.list;
+ var _lineBox = _list[_list.length - 1];
+ backtrack(_this2, lineBoxManager, _lineBox, w, 0);
+ return;
+ }
+
lineClampCount = item.__layout({
x: x,
y: y,
w: w,
h: h,
- lx: data.x,
+ lx: lx,
lineBoxManager: lineBoxManager,
lineClamp: lineClamp,
lineClampCount: lineClampCount
@@ -25062,17 +25237,18 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
x = lineBoxManager.lastX;
y = lineBoxManager.lastY;
+ if (lineClamp && lineClampCount >= lineClamp) {
+ ignoreNextLine = true;
+ }
+
if (isAbs) {
- maxW = Math.max(maxW, item.width); // 此处发生换行撑满
+ maxW = Math.max(maxW, cw); // 此处发生换行撑满
- maxW = Math.max(maxW, w);
- cw = 0;
- }
- }
+ maxW = Math.max(maxW, w); // 新行重计
- if (isAbs) {
- cw += item.width;
- maxW = Math.max(maxW, cw);
+ cw = item.outerWidth;
+ maxW = Math.max(maxW, cw);
+ }
}
}
}
@@ -25152,7 +25328,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
}, {
key: "__layoutFlex",
value: function __layoutFlex(data, isAbs, isColumn) {
- var _this2 = this;
+ var _this3 = this;
var flowChildren = this.flowChildren,
currentStyle = this.currentStyle,
@@ -25192,7 +25368,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
lineClamp = computedStyle[LINE_CLAMP$1],
flexWrap = computedStyle[FLEX_WRAP$1],
alignContent = computedStyle[ALIGN_CONTENT$1],
- lineHeight = computedStyle[LINE_HEIGHT$4],
+ lineHeight = computedStyle[LINE_HEIGHT$5],
textAlign = computedStyle[TEXT_ALIGN$2]; // 只有>=1的正整数才有效
lineClamp = lineClamp || 0;
@@ -25329,11 +25505,11 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
var length = item.length;
var end = offset + length;
- var _this2$__layoutFlexLi = _this2.__layoutFlexLine(clone, isDirectionRow, isAbs, isColumn, containerSize, fixedWidth, fixedHeight, lineClamp, lineClampCount, lineHeight, computedStyle, justifyContent, alignItems, orderChildren.slice(offset, end), item, textAlign, growList.slice(offset, end), shrinkList.slice(offset, end), basisList.slice(offset, end), hypotheticalList.slice(offset, end), minList.slice(offset, end)),
- _this2$__layoutFlexLi2 = _slicedToArray(_this2$__layoutFlexLi, 3),
- x1 = _this2$__layoutFlexLi2[0],
- y1 = _this2$__layoutFlexLi2[1],
- maxCross = _this2$__layoutFlexLi2[2]; // 下一行/列更新坐标
+ var _this3$__layoutFlexLi = _this3.__layoutFlexLine(clone, isDirectionRow, isAbs, isColumn, containerSize, fixedWidth, fixedHeight, lineClamp, lineClampCount, lineHeight, computedStyle, justifyContent, alignItems, orderChildren.slice(offset, end), item, textAlign, growList.slice(offset, end), shrinkList.slice(offset, end), basisList.slice(offset, end), hypotheticalList.slice(offset, end), minList.slice(offset, end)),
+ _this3$__layoutFlexLi2 = _slicedToArray(_this3$__layoutFlexLi, 3),
+ x1 = _this3$__layoutFlexLi2[0],
+ y1 = _this3$__layoutFlexLi2[1],
+ maxCross = _this3$__layoutFlexLi2[2]; // 下一行/列更新坐标
if (isDirectionRow) {
@@ -25528,7 +25704,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
maxCross += per;
}
- _this2.__crossAlign(item, alignItems, isDirectionRow, maxCross);
+ _this3.__crossAlign(item, alignItems, isDirectionRow, maxCross);
});
} else if (length) {
var maxCross = maxCrossList[0];
@@ -25559,7 +25735,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
}, {
key: "__layoutFlexLine",
value: function __layoutFlexLine(data, isDirectionRow, isAbs, isColumn, containerSize, fixedWidth, fixedHeight, lineClamp, lineClampCount, lineHeight, computedStyle, justifyContent, alignItems, orderChildren, flexLine, textAlign, growList, shrinkList, basisList, hypotheticalList, minList) {
- var _this3 = this;
+ var _this4 = this;
var x = data.x,
y = data.y,
@@ -25771,7 +25947,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
}
}
} else {
- var lineBoxManager = _this3.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseline(computedStyle));
+ var lineBoxManager = _this4.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseline(computedStyle));
lbmList.push(lineBoxManager);
item.__layout({
@@ -25807,23 +25983,23 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
} else if (justifyContent === 'center') {
var center = diff * 0.5;
- for (var _i2 = 0; _i2 < len; _i2++) {
- var _child = orderChildren[_i2];
+ for (var _i3 = 0; _i3 < len; _i3++) {
+ var _child = orderChildren[_i3];
isDirectionRow ? _child.__offsetX(center, true) : _child.__offsetY(center, true);
}
} else if (justifyContent === 'spaceBetween' || justifyContent === 'space-between') {
var between = diff / (len - 1);
- for (var _i3 = 1; _i3 < len; _i3++) {
- var _child2 = orderChildren[_i3];
- isDirectionRow ? _child2.__offsetX(between * _i3, true) : _child2.__offsetY(between * _i3, true);
+ for (var _i4 = 1; _i4 < len; _i4++) {
+ var _child2 = orderChildren[_i4];
+ isDirectionRow ? _child2.__offsetX(between * _i4, true) : _child2.__offsetY(between * _i4, true);
}
} else if (justifyContent === 'spaceAround' || justifyContent === 'space-around') {
var around = diff / (len + 1);
- for (var _i4 = 0; _i4 < len; _i4++) {
- var _child3 = orderChildren[_i4];
- isDirectionRow ? _child3.__offsetX(around * (_i4 + 1), true) : _child3.__offsetY(around * (_i4 + 1), true);
+ for (var _i5 = 0; _i5 < len; _i5++) {
+ var _child3 = orderChildren[_i5];
+ isDirectionRow ? _child3.__offsetX(around * (_i5 + 1), true) : _child3.__offsetY(around * (_i5 + 1), true);
}
}
}
@@ -25970,12 +26146,12 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
} else if (alignSelf === 'stretch') {
var _computedStyle3 = item.computedStyle,
width = item.currentStyle[WIDTH$5];
- var borderRightWidth = _computedStyle3[BORDER_RIGHT_WIDTH$4],
- borderLeftWidth = _computedStyle3[BORDER_LEFT_WIDTH$5],
- marginRight = _computedStyle3[MARGIN_RIGHT$3],
- marginLeft = _computedStyle3[MARGIN_LEFT$3],
- paddingRight = _computedStyle3[PADDING_RIGHT$3],
- paddingLeft = _computedStyle3[PADDING_LEFT$4];
+ var borderRightWidth = _computedStyle3[BORDER_RIGHT_WIDTH$5],
+ borderLeftWidth = _computedStyle3[BORDER_LEFT_WIDTH$6],
+ marginRight = _computedStyle3[MARGIN_RIGHT$4],
+ marginLeft = _computedStyle3[MARGIN_LEFT$4],
+ paddingRight = _computedStyle3[PADDING_RIGHT$4],
+ paddingLeft = _computedStyle3[PADDING_LEFT$5];
if (width[1] === AUTO$6) {
var _old2 = item.width;
@@ -26022,12 +26198,12 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
else {
var _computedStyle4 = item.computedStyle,
_width = item.currentStyle[WIDTH$5];
- var _borderRightWidth = _computedStyle4[BORDER_RIGHT_WIDTH$4],
- _borderLeftWidth = _computedStyle4[BORDER_LEFT_WIDTH$5],
- _marginRight = _computedStyle4[MARGIN_RIGHT$3],
- _marginLeft = _computedStyle4[MARGIN_LEFT$3],
- _paddingRight = _computedStyle4[PADDING_RIGHT$3],
- _paddingLeft = _computedStyle4[PADDING_LEFT$4];
+ var _borderRightWidth = _computedStyle4[BORDER_RIGHT_WIDTH$5],
+ _borderLeftWidth = _computedStyle4[BORDER_LEFT_WIDTH$6],
+ _marginRight = _computedStyle4[MARGIN_RIGHT$4],
+ _marginLeft = _computedStyle4[MARGIN_LEFT$4],
+ _paddingRight = _computedStyle4[PADDING_RIGHT$4],
+ _paddingLeft = _computedStyle4[PADDING_LEFT$5];
if (_width[1] === AUTO$6) {
var _old3 = item.width;
@@ -26080,7 +26256,6 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
h = _this$__preLayout3.h,
lx = _this$__preLayout3.lx,
lineBoxManager = _this$__preLayout3.lineBoxManager,
- nowrap = _this$__preLayout3.nowrap,
endSpace = _this$__preLayout3.endSpace,
selfEndSpace = _this$__preLayout3.selfEndSpace; // abs虚拟布局需预知width,固定可提前返回
@@ -26097,13 +26272,13 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
var textAlign = computedStyle[TEXT_ALIGN$2],
whiteSpace = computedStyle[WHITE_SPACE$2],
lineClamp = computedStyle[LINE_CLAMP$1],
- lineHeight = computedStyle[LINE_HEIGHT$4],
- marginLeft = computedStyle[MARGIN_LEFT$3],
- marginRight = computedStyle[MARGIN_RIGHT$3],
- borderLeftWidth = computedStyle[BORDER_LEFT_WIDTH$5],
- borderRightWidth = computedStyle[BORDER_RIGHT_WIDTH$4],
- paddingLeft = computedStyle[PADDING_LEFT$4],
- paddingRight = computedStyle[PADDING_RIGHT$3];
+ lineHeight = computedStyle[LINE_HEIGHT$5],
+ marginLeft = computedStyle[MARGIN_LEFT$4],
+ marginRight = computedStyle[MARGIN_RIGHT$4],
+ borderLeftWidth = computedStyle[BORDER_LEFT_WIDTH$6],
+ borderRightWidth = computedStyle[BORDER_RIGHT_WIDTH$5],
+ paddingLeft = computedStyle[PADDING_LEFT$5],
+ paddingRight = computedStyle[PADDING_RIGHT$4];
var lineClampCount = data.lineClampCount || 0;
if (isInline && !this.__isRealInline()) {
@@ -26140,34 +26315,60 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
if (isInline) {
contentBoxList = this.__contentBoxList = [];
lineBoxManager.pushContentBoxList(this);
+ } // ib的bp是自己,inline是最近的非inline
+
+
+ var bp = this;
+
+ while (bp.computedStyle[DISPLAY$5] === 'inline') {
+ bp = bp.domParent;
}
+ var _bp$computedStyle = bp.computedStyle,
+ overflow = _bp$computedStyle[OVERFLOW$3],
+ textOverflow = _bp$computedStyle[TEXT_OVERFLOW$3];
var isIbFull = false; // ib时不限定w情况下发生折行则撑满行,即便内容没有撑满边界
var length = flowChildren.length;
+ var ignoreNextLine = false; // lineClamp超过后,后面的均忽略并置none,注意ib内部自己统计类似block
+
+ var ignoreNextWrap = false; // whiteSpace单行超过后,后面的均忽略并置none,注意和block不一样不隔断
+
+ var hasAddEndSpace; // 最后一行生效,只加1次防重复
+
flowChildren.forEach(function (item, i) {
+ // 和block不太一样可以提前判断,因为不可能包含block隔断区域了
+ if (ignoreNextLine || ignoreNextWrap) {
+ item.__layoutNone();
+
+ return;
+ }
+
var isXom = item instanceof Xom$1 || item instanceof Component$1 && item.shadowRoot instanceof Xom$1;
var isInline2 = isXom && item.currentStyle[DISPLAY$5] === 'inline';
var isInlineBlock2 = isXom && ['inlineBlock', 'inline-block'].indexOf(item.currentStyle[DISPLAY$5]) > -1;
- var isRealInline = isXom && item.__isRealInline(); // 最后一个元素会产生最后一行,叠加父元素的尾部mpb
+ var isRealInline = isInline2 && item.__isRealInline(); // 最后一个元素会产生最后一行,叠加父元素的尾部mpb,注意只执行一次防止重复叠加
- var isEnd = isInline && i === length - 1;
+ var isEnd = isInline && !hasAddEndSpace && (whiteSpace === 'nowrap' || !isXom && i === length - 1 || lineClamp && i === length - 1 || lineClampCount === lineClamp - 1);
if (isEnd) {
+ hasAddEndSpace = true;
endSpace += selfEndSpace;
}
+ var lastLineClampCount = lineClampCount;
+
if (isXom) {
if (!isInline2 && !isInlineBlock2) {
item.currentStyle[DISPLAY$5] = item.computedStyle[DISPLAY$5] = 'inlineBlock';
isInlineBlock2 = true;
inject.warn('Inline can not contain block/flex');
- } // x开头,不用考虑是否放得下直接放,i为0强制不换行
+ } // x开头或者nowrap单行,不用考虑是否放得下直接放,因为有beginSpace所以要多判断i为0
- if (x === lx || !i || isInline2 && whiteSpace === 'nowrap') {
+ if (x === lx || !i || whiteSpace === 'nowrap') {
lineClampCount = item.__layout({
x: x,
y: y,
@@ -26178,23 +26379,34 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
endSpace: endSpace,
lineClamp: lineClamp,
lineClampCount: lineClampCount
- }, isAbs, isColumn); // inlineBlock的特殊之处,一旦w为auto且内部产生折行时,整个变成block独占一块区域,坐标计算和block一样
+ }, isAbs, isColumn); // 同block布局
if (item.__isIbFull) {
- isInlineBlock2 && w[1] === AUTO$6 && (isIbFull = true);
- lineBoxManager.addItem(item);
+ lineClampCount++;
+ }
+
+ if (item.__isIbFull && whiteSpace !== 'nowrap') {
+ w[1] === AUTO$6 && (isIbFull = true);
+ lineBoxManager.addItem(item, true);
x = lx;
y += item.outerHeight;
lineBoxManager.setNotEnd();
} // inline和不折行的ib,其中ib需要手动存入当前lb中,以计算宽度
else {
- (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item);
+ (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item, false);
x = lineBoxManager.lastX;
y = lineBoxManager.lastY;
}
+
+ if (!isAbs && overflow === 'hidden' && whiteSpace === 'nowrap' && (x - lx > w + 1e-10 || lineClampCount > lastLineClampCount)) {
+ ignoreNextWrap = true;
+ } else if (lineClamp && lineClampCount >= lineClamp) {
+ ignoreNextLine = true;
+ }
} else {
// 不换行继续排,换行非开头先尝试是否放得下,结尾要考虑mpb因此减去endSpace
- var fw = whiteSpace === 'nowrap' ? 0 : item.__tryLayInline(w - x + lx, w - (isEnd ? endSpace : 0)); // 放得下继续
+ var fw = item.__tryLayInline(w - x + lx - endSpace, w); // 放得下继续
+
if (fw >= -1e-10) {
lineClampCount = item.__layout({
@@ -26203,22 +26415,37 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
w: w,
h: h,
lx: lx,
- nowrap: whiteSpace === 'nowrap',
lineBoxManager: lineBoxManager,
endSpace: endSpace,
lineClamp: lineClamp,
lineClampCount: lineClampCount
- }, isAbs, isColumn); // ib放得下要么内部没有折行,要么声明了width限制,都需手动存入当前lb
+ }, isAbs, isColumn);
+
+ if (lineClamp && lineClampCount >= lineClamp) {
+ ignoreNextLine = true;
+ } // ib放得下要么内部没有折行,要么声明了width限制,都需手动存入当前lb
+
- (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item);
+ (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item, false);
x = lineBoxManager.lastX;
y = lineBoxManager.lastY;
} // 放不下处理之前的lineBox,并重新开头
else {
- isInline2 && lineClampCount++;
+ lineClampCount++;
x = lx;
y = lineBoxManager.endY;
- lineBoxManager.setNewLine();
+ lineBoxManager.setNewLine(); // 可能超行了,无需继续,并且进行回溯
+
+ if (lineClamp && lineClampCount >= lineClamp) {
+ item.__layoutNone();
+
+ ignoreNextLine = true;
+ var list = lineBoxManager.list;
+ var lineBox = list[list.length - 1];
+ backtrack(bp, lineBoxManager, lineBox, w, endSpace);
+ return;
+ }
+
lineClampCount = item.__layout({
x: x,
y: y,
@@ -26232,16 +26459,21 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
}, isAbs, isColumn); // 重新开头的ib和上面开头处一样逻辑
if (item.__isIbFull) {
- lineBoxManager.addItem(item);
+ lineBoxManager.addItem(item, true);
x = lx;
y += item.outerHeight;
lineBoxManager.setNotEnd();
+ lineClampCount++;
} // inline和不折行的ib,其中ib需要手动存入当前lb中
else {
- (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item);
+ (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item, false);
x = lineBoxManager.lastX;
y = lineBoxManager.lastY;
}
+
+ if (lineClamp && lineClampCount >= lineClamp) {
+ ignoreNextLine = true;
+ }
}
}
} // inline里的其它只有文本,可能开始紧跟着之前的x,也可能换行后从lx行头开始
@@ -26267,20 +26499,15 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
if (!isInline && lineBoxManager.size - n > 1 && width[1] === AUTO$6) {
isIbFull = true;
}
+
+ if (!isAbs && overflow === 'hidden' && whiteSpace === 'nowrap' && (x - lx > w + 1e-10 || lineClampCount > lastLineClampCount)) {
+ ignoreNextWrap = true;
+ } else if (lineClamp && lineClampCount >= lineClamp) {
+ ignoreNextLine = true;
+ }
} else {
// 非开头先尝试是否放得下,如果放得下再看是否end,加end且只有1个字时放不下要换行,否则可以放,换行由text内部做
- // 第一个Text且父元素声明了nowrap也强制不换行,非第一个则看本身whiteSpace声明
- var focusNoWrap = !i && nowrap || whiteSpace === 'nowrap';
-
- var _fw2 = focusNoWrap ? 0 : item.__tryLayInline(w + lx - x);
-
- if (!focusNoWrap && _fw2 >= 0 && isEnd && endSpace && item.content.length === 1) {
- var fw2 = _fw2 - endSpace;
-
- if (fw2 < 0) {
- _fw2 = fw2;
- }
- } // 放得下继续
+ var _fw2 = item.__tryLayInline(w + lx - x - endSpace); // 放得下继续
if (_fw2 >= -1e-10) {
@@ -26296,13 +26523,29 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
lineClampCount: lineClampCount
}, isAbs, isColumn);
x = lineBoxManager.lastX;
- y = lineBoxManager.lastY; // 这里ib放得下一定是要么没换行要么固定宽度,所以无需判断isIbFull
+ y = lineBoxManager.lastY;
+
+ if (lineClamp && lineClampCount >= lineClamp) {
+ ignoreNextLine = true;
+ } // 这里ib放得下一定是要么没换行要么固定宽度,所以无需判断isIbFull
+
} // 放不下处理之前的lineBox,并重新开头
else {
lineClampCount++;
x = lx;
y = lineBoxManager.endY;
- lineBoxManager.setNewLine();
+ lineBoxManager.setNewLine(); // 可能超行了,无需继续,并且进行回溯
+
+ if (lineClamp && lineClampCount >= lineClamp) {
+ item.__layoutNone();
+
+ ignoreNextLine = true;
+ var _list2 = lineBoxManager.list;
+ var _lineBox2 = _list2[_list2.length - 1];
+ backtrack(bp, lineBoxManager, _lineBox2, w, endSpace);
+ return;
+ }
+
lineClampCount = item.__layout({
x: x,
y: y,
@@ -26320,6 +26563,10 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
if (!isInline && lineBoxManager.size - n > 1 && width[1] === AUTO$6) {
isIbFull = true;
}
+
+ if (lineClamp && lineClampCount >= lineClamp) {
+ ignoreNextLine = true;
+ }
}
}
}
@@ -26339,9 +26586,9 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
if (!flowChildren.length) {
- var _marginLeft2 = computedStyle[MARGIN_LEFT$3],
- _paddingLeft2 = computedStyle[PADDING_LEFT$4],
- _borderLeftWidth2 = computedStyle[BORDER_LEFT_WIDTH$5];
+ var _marginLeft2 = computedStyle[MARGIN_LEFT$4],
+ _paddingLeft2 = computedStyle[PADDING_LEFT$5],
+ _borderLeftWidth2 = computedStyle[BORDER_LEFT_WIDTH$6];
lineBoxManager.addX(_marginLeft2 + _paddingLeft2 + _borderLeftWidth2);
} // 结束出栈contentBox,递归情况结束子inline获取contentBox,父inline继续
@@ -26385,7 +26632,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
} // inlineBlock新开上下文,但父级block遇到要处理换行
- return isInline ? lineClampCount : 0;
+ return lineClampCount;
}
/**
* inline的尺寸计算非常特殊,并非一个矩形区域,而是由字体行高结合节点下多个LineBox中的内容决定,
@@ -26405,19 +26652,25 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
computedStyle = this.computedStyle,
__ox = this.__ox,
__oy = this.__oy;
- var marginTop = computedStyle[MARGIN_TOP$1],
- marginRight = computedStyle[MARGIN_RIGHT$3],
+ var display = computedStyle[DISPLAY$5],
+ marginTop = computedStyle[MARGIN_TOP$1],
+ marginRight = computedStyle[MARGIN_RIGHT$4],
marginBottom = computedStyle[MARGIN_BOTTOM$1],
- marginLeft = computedStyle[MARGIN_LEFT$3],
+ marginLeft = computedStyle[MARGIN_LEFT$4],
paddingTop = computedStyle[PADDING_TOP$2],
- paddingRight = computedStyle[PADDING_RIGHT$3],
+ paddingRight = computedStyle[PADDING_RIGHT$4],
paddingBottom = computedStyle[PADDING_BOTTOM$2],
- paddingLeft = computedStyle[PADDING_LEFT$4],
+ paddingLeft = computedStyle[PADDING_LEFT$5],
borderTopWidth = computedStyle[BORDER_TOP_WIDTH$3],
- borderRightWidth = computedStyle[BORDER_RIGHT_WIDTH$4],
+ borderRightWidth = computedStyle[BORDER_RIGHT_WIDTH$5],
borderBottomWidth = computedStyle[BORDER_BOTTOM_WIDTH$3],
- borderLeftWidth = computedStyle[BORDER_LEFT_WIDTH$5],
- lineHeight = computedStyle[LINE_HEIGHT$4]; // x/clientX/offsetX/outerX
+ borderLeftWidth = computedStyle[BORDER_LEFT_WIDTH$6],
+ lineHeight = computedStyle[LINE_HEIGHT$5]; // 可能因为Ellipsis回溯变成none
+
+ if (display === 'none') {
+ return;
+ } // x/clientX/offsetX/outerX
+
var maxX, maxY, minX, minY, maxCX, maxCY, minCX, minCY, maxFX, maxFY, minFX, minFY, maxOX, maxOY, minOX, minOY;
var length = contentBoxList.length;
@@ -26549,7 +26802,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
}, {
key: "__layoutAbs",
value: function __layoutAbs(container, data, target) {
- var _this4 = this;
+ var _this5 = this;
var x = container.sx,
y = container.sy,
@@ -26561,10 +26814,10 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
absChildren = this.absChildren;
var display = computedStyle[DISPLAY$5],
borderTopWidth = computedStyle[BORDER_TOP_WIDTH$3],
- borderLeftWidth = computedStyle[BORDER_LEFT_WIDTH$5],
+ borderLeftWidth = computedStyle[BORDER_LEFT_WIDTH$6],
marginTop = computedStyle[MARGIN_TOP$1],
- marginLeft = computedStyle[MARGIN_LEFT$3],
- paddingLeft = computedStyle[PADDING_LEFT$4],
+ marginLeft = computedStyle[MARGIN_LEFT$4],
+ paddingLeft = computedStyle[PADDING_LEFT$5],
paddingTop = computedStyle[PADDING_TOP$2];
if (isDestroyed || display === 'none') {
@@ -26621,28 +26874,28 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
if (left[1] !== AUTO$6) {
fixedLeft = true;
- computedStyle[LEFT$1] = calAbsolute$1(currentStyle, 'left', left, clientWidth, _this4.root);
+ computedStyle[LEFT$1] = calAbsolute$1(currentStyle, 'left', left, clientWidth, _this5.root);
} else {
computedStyle[LEFT$1] = 'auto';
}
if (right[1] !== AUTO$6) {
fixedRight = true;
- computedStyle[RIGHT$1] = calAbsolute$1(currentStyle, 'right', right, clientWidth, _this4.root);
+ computedStyle[RIGHT$1] = calAbsolute$1(currentStyle, 'right', right, clientWidth, _this5.root);
} else {
computedStyle[RIGHT$1] = 'auto';
}
if (top[1] !== AUTO$6) {
fixedTop = true;
- computedStyle[TOP$3] = calAbsolute$1(currentStyle, 'top', top, clientHeight, _this4.root);
+ computedStyle[TOP$3] = calAbsolute$1(currentStyle, 'top', top, clientHeight, _this5.root);
} else {
computedStyle[TOP$3] = 'auto';
}
if (bottom[1] !== AUTO$6) {
fixedBottom = true;
- computedStyle[BOTTOM$3] = calAbsolute$1(currentStyle, 'bottom', bottom, clientHeight, _this4.root);
+ computedStyle[BOTTOM$3] = calAbsolute$1(currentStyle, 'bottom', bottom, clientHeight, _this5.root);
} else {
computedStyle[BOTTOM$3] = 'auto';
} // 优先级最高left+right,其次left+width,再次right+width,再次仅申明单个,最次全部auto
@@ -26655,28 +26908,28 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
x2 = x + computedStyle[LEFT$1];
if (width[1] !== AUTO$6) {
- w2 = calAbsFixedSize$1(width, clientWidth, _this4.root);
+ w2 = calAbsFixedSize$1(width, clientWidth, _this5.root);
}
} else if (fixedRight) {
if (width[1] !== AUTO$6) {
- w2 = calAbsFixedSize$1(width, clientWidth, _this4.root);
+ w2 = calAbsFixedSize$1(width, clientWidth, _this5.root);
} else {
onlyRight = true;
}
x2 = x + clientWidth - computedStyle[RIGHT$1] - (w2 || 0); // 右对齐有尺寸时还需减去margin/border/padding的
- x2 -= computedStyle[MARGIN_LEFT$3];
- x2 -= computedStyle[MARGIN_RIGHT$3];
- x2 -= computedStyle[PADDING_LEFT$4];
- x2 -= computedStyle[PADDING_RIGHT$3];
- x2 -= computedStyle[BORDER_LEFT_WIDTH$5];
- x2 -= computedStyle[BORDER_RIGHT_WIDTH$4];
+ x2 -= computedStyle[MARGIN_LEFT$4];
+ x2 -= computedStyle[MARGIN_RIGHT$4];
+ x2 -= computedStyle[PADDING_LEFT$5];
+ x2 -= computedStyle[PADDING_RIGHT$4];
+ x2 -= computedStyle[BORDER_LEFT_WIDTH$6];
+ x2 -= computedStyle[BORDER_RIGHT_WIDTH$5];
} else {
x2 = x + paddingLeft;
if (width[1] !== AUTO$6) {
- w2 = calAbsFixedSize$1(width, clientWidth, _this4.root);
+ w2 = calAbsFixedSize$1(width, clientWidth, _this5.root);
}
} // top/bottom/height优先级同上
@@ -26688,11 +26941,11 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
y2 = y + computedStyle[TOP$3];
if (height[1] !== AUTO$6) {
- h2 = calAbsFixedSize$1(height, clientHeight, _this4.root);
+ h2 = calAbsFixedSize$1(height, clientHeight, _this5.root);
}
} else if (fixedBottom) {
if (height[1] !== AUTO$6) {
- h2 = calAbsFixedSize$1(height, clientHeight, _this4.root);
+ h2 = calAbsFixedSize$1(height, clientHeight, _this5.root);
} else {
onlyBottom = true;
}
@@ -26712,7 +26965,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
while (prev) {
// 以前面的flow的最近的prev末尾为准
- if (prev instanceof Text || prev.computedStyle[POSITION$3] !== 'absolute') {
+ if (prev instanceof Text || prev.computedStyle[POSITION$4] !== 'absolute') {
y2 = prev.y + prev.outerHeight;
break;
}
@@ -26721,7 +26974,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
}
if (height[1] !== AUTO$6) {
- h2 = calAbsFixedSize$1(height, clientHeight, _this4.root);
+ h2 = calAbsFixedSize$1(height, clientHeight, _this5.root);
}
} // onlyRight时做的布局其实是以那个点位为left/top布局然后offset,limit要特殊计算,从本点向左侧为边界
@@ -26788,31 +27041,18 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
this.__execAr();
}
- /**
- * 布局前检查继承的样式以及统计字体测量信息
- * 首次检查为整树遍历,后续检查是节点自发局部检查,不再进入
- * @param renderMode
- * @param ctx
- * @param cb
- * @private
- */
-
- }, {
- key: "__computeMeasure",
- value: function __computeMeasure(renderMode, ctx, cb) {
- _get(_getPrototypeOf(Dom.prototype), "__computeMeasure", this).call(this, renderMode, ctx, cb); // 即便自己不需要计算,但children还要继续递归检查
-
-
- this.children.forEach(function (item) {
- item.__computeMeasure(renderMode, ctx, cb);
- });
- }
}, {
key: "render",
value: function render(renderMode, lv, ctx, cache, dx, dy) {
var res = _get(_getPrototypeOf(Dom.prototype), "render", this).call(this, renderMode, lv, ctx, cache, dx, dy);
- if (renderMode === mode.SVG) {
+ var ep = this.__ellipsis;
+
+ if (ep) {
+ ep.render(renderMode, lv, res.ctx, cache, dx, dy);
+ }
+
+ if (renderMode === SVG$3) {
this.virtualDom.type = 'dom';
}
@@ -26832,6 +27072,10 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
}
});
+ if (this.__ellipsis) {
+ this.__ellipsis.__destroy();
+ }
+
_get(_getPrototypeOf(Dom.prototype), "__destroy", this).call(this);
}
}, {
@@ -26857,7 +27101,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
// overflow:hidden时还需要判断是否超出范围外,如果是则无效
- if (computedStyle[OVERFLOW$2] === 'hidden' && !this.willResponseEvent(e, true)) {
+ if (computedStyle[OVERFLOW$3] === 'hidden' && !this.willResponseEvent(e, true)) {
return;
} // 找到对应的callback
@@ -26950,7 +27194,6 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
res[UPDATE_NODE$3] = vd;
res[UPDATE_FOCUS$2] = o$3.REFLOW;
res[UPDATE_ADD_DOM] = true;
- res[UPDATE_MEASURE$1] = true;
res[UPDATE_CONFIG$3] = vd.__config;
root.__addUpdate(vd, vd.__config, root, root.__config, res);
@@ -27010,7 +27253,6 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
res[UPDATE_NODE$3] = vd;
res[UPDATE_FOCUS$2] = o$3.REFLOW;
res[UPDATE_ADD_DOM] = true;
- res[UPDATE_MEASURE$1] = true;
res[UPDATE_CONFIG$3] = vd.__config;
root.__addUpdate(vd, vd.__config, root, root.__config, res);
@@ -27095,7 +27337,6 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
res[UPDATE_NODE$3] = vd;
res[UPDATE_FOCUS$2] = o$3.REFLOW;
res[UPDATE_ADD_DOM] = true;
- res[UPDATE_MEASURE$1] = true;
res[UPDATE_CONFIG$3] = vd.__config;
root.__addUpdate(vd, vd.__config, root, root.__config, res);
@@ -27180,7 +27421,6 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
res[UPDATE_NODE$3] = vd;
res[UPDATE_FOCUS$2] = o$3.REFLOW;
res[UPDATE_ADD_DOM] = true;
- res[UPDATE_MEASURE$1] = true;
res[UPDATE_CONFIG$3] = vd.__config;
root.__addUpdate(vd, vd.__config, root, root.__config, res);
@@ -27228,7 +27468,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
item = item.shadowRoot;
}
- return item instanceof Text || item.currentStyle[POSITION$3] !== 'absolute';
+ return item instanceof Text || item.currentStyle[POSITION$4] !== 'absolute';
});
}
}, {
@@ -27239,7 +27479,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
item = item.shadowRoot;
}
- return item instanceof Xom$1 && item.currentStyle[POSITION$3] === 'absolute';
+ return item instanceof Xom$1 && item.currentStyle[POSITION$4] === 'absolute';
});
}
}, {
@@ -27259,10 +27499,10 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
return this.offsetHeight;
}
- var _this$computedStyle = this.computedStyle,
- marginTop = _this$computedStyle[MARGIN_TOP$1],
- borderTopWidth = _this$computedStyle[BORDER_TOP_WIDTH$3],
- paddingTop = _this$computedStyle[PADDING_TOP$2];
+ var _this$computedStyle2 = this.computedStyle,
+ marginTop = _this$computedStyle2[MARGIN_TOP$1],
+ borderTopWidth = _this$computedStyle2[BORDER_TOP_WIDTH$3],
+ paddingTop = _this$computedStyle2[PADDING_TOP$2];
return marginTop + borderTopWidth + paddingTop + this.lineBoxManager.baseline;
}
}, {
@@ -27272,45 +27512,40 @@ var Dom$1 = /*#__PURE__*/function (_Xom) {
return this.offsetHeight;
}
- var _this$computedStyle2 = this.computedStyle,
- marginTop = _this$computedStyle2[MARGIN_TOP$1],
- borderTopWidth = _this$computedStyle2[BORDER_TOP_WIDTH$3],
- paddingTop = _this$computedStyle2[PADDING_TOP$2];
+ var _this$computedStyle3 = this.computedStyle,
+ marginTop = _this$computedStyle3[MARGIN_TOP$1],
+ borderTopWidth = _this$computedStyle3[BORDER_TOP_WIDTH$3],
+ paddingTop = _this$computedStyle3[PADDING_TOP$2];
return marginTop + borderTopWidth + paddingTop + this.lineBoxManager.firstBaseline;
}
- }, {
- key: "parentLineBox",
- get: function get() {
- return this.__parentLineBox;
- }
}]);
return Dom;
}(Xom$1);
-var _enums$STYLE_KEY$g = enums.STYLE_KEY,
- WIDTH$6 = _enums$STYLE_KEY$g.WIDTH,
- HEIGHT$6 = _enums$STYLE_KEY$g.HEIGHT,
- DISPLAY$6 = _enums$STYLE_KEY$g.DISPLAY,
- BORDER_TOP_WIDTH$4 = _enums$STYLE_KEY$g.BORDER_TOP_WIDTH,
- BORDER_RIGHT_WIDTH$5 = _enums$STYLE_KEY$g.BORDER_RIGHT_WIDTH,
- BORDER_LEFT_WIDTH$6 = _enums$STYLE_KEY$g.BORDER_LEFT_WIDTH,
- BORDER_BOTTOM_WIDTH$4 = _enums$STYLE_KEY$g.BORDER_BOTTOM_WIDTH,
- BORDER_TOP_LEFT_RADIUS$2 = _enums$STYLE_KEY$g.BORDER_TOP_LEFT_RADIUS,
- BORDER_TOP_RIGHT_RADIUS$2 = _enums$STYLE_KEY$g.BORDER_TOP_RIGHT_RADIUS,
- BORDER_BOTTOM_RIGHT_RADIUS$2 = _enums$STYLE_KEY$g.BORDER_BOTTOM_RIGHT_RADIUS,
- BORDER_BOTTOM_LEFT_RADIUS$2 = _enums$STYLE_KEY$g.BORDER_BOTTOM_LEFT_RADIUS,
- VISIBILITY$3 = _enums$STYLE_KEY$g.VISIBILITY,
- BACKGROUND_IMAGE$2 = _enums$STYLE_KEY$g.BACKGROUND_IMAGE,
- BACKGROUND_COLOR$2 = _enums$STYLE_KEY$g.BACKGROUND_COLOR,
- BOX_SHADOW$3 = _enums$STYLE_KEY$g.BOX_SHADOW,
- MIX_BLEND_MODE$1 = _enums$STYLE_KEY$g.MIX_BLEND_MODE,
- MARGIN_RIGHT$4 = _enums$STYLE_KEY$g.MARGIN_RIGHT,
- MARGIN_LEFT$4 = _enums$STYLE_KEY$g.MARGIN_LEFT,
- PADDING_RIGHT$4 = _enums$STYLE_KEY$g.PADDING_RIGHT,
- PADDING_LEFT$5 = _enums$STYLE_KEY$g.PADDING_LEFT,
- FONT_SIZE$a = _enums$STYLE_KEY$g.FONT_SIZE,
- FLEX_BASIS$3 = _enums$STYLE_KEY$g.FLEX_BASIS,
+var _enums$STYLE_KEY$h = enums.STYLE_KEY,
+ WIDTH$6 = _enums$STYLE_KEY$h.WIDTH,
+ HEIGHT$6 = _enums$STYLE_KEY$h.HEIGHT,
+ DISPLAY$6 = _enums$STYLE_KEY$h.DISPLAY,
+ BORDER_TOP_WIDTH$4 = _enums$STYLE_KEY$h.BORDER_TOP_WIDTH,
+ BORDER_RIGHT_WIDTH$6 = _enums$STYLE_KEY$h.BORDER_RIGHT_WIDTH,
+ BORDER_LEFT_WIDTH$7 = _enums$STYLE_KEY$h.BORDER_LEFT_WIDTH,
+ BORDER_BOTTOM_WIDTH$4 = _enums$STYLE_KEY$h.BORDER_BOTTOM_WIDTH,
+ BORDER_TOP_LEFT_RADIUS$2 = _enums$STYLE_KEY$h.BORDER_TOP_LEFT_RADIUS,
+ BORDER_TOP_RIGHT_RADIUS$2 = _enums$STYLE_KEY$h.BORDER_TOP_RIGHT_RADIUS,
+ BORDER_BOTTOM_RIGHT_RADIUS$2 = _enums$STYLE_KEY$h.BORDER_BOTTOM_RIGHT_RADIUS,
+ BORDER_BOTTOM_LEFT_RADIUS$2 = _enums$STYLE_KEY$h.BORDER_BOTTOM_LEFT_RADIUS,
+ VISIBILITY$3 = _enums$STYLE_KEY$h.VISIBILITY,
+ BACKGROUND_IMAGE$2 = _enums$STYLE_KEY$h.BACKGROUND_IMAGE,
+ BACKGROUND_COLOR$2 = _enums$STYLE_KEY$h.BACKGROUND_COLOR,
+ BOX_SHADOW$3 = _enums$STYLE_KEY$h.BOX_SHADOW,
+ MIX_BLEND_MODE$1 = _enums$STYLE_KEY$h.MIX_BLEND_MODE,
+ MARGIN_RIGHT$5 = _enums$STYLE_KEY$h.MARGIN_RIGHT,
+ MARGIN_LEFT$5 = _enums$STYLE_KEY$h.MARGIN_LEFT,
+ PADDING_RIGHT$5 = _enums$STYLE_KEY$h.PADDING_RIGHT,
+ PADDING_LEFT$6 = _enums$STYLE_KEY$h.PADDING_LEFT,
+ FONT_SIZE$b = _enums$STYLE_KEY$h.FONT_SIZE,
+ FLEX_BASIS$3 = _enums$STYLE_KEY$h.FLEX_BASIS,
_enums$UPDATE_KEY$4 = enums.UPDATE_KEY,
UPDATE_NODE$4 = _enums$UPDATE_KEY$4.UPDATE_NODE,
UPDATE_FOCUS$3 = _enums$UPDATE_KEY$4.UPDATE_FOCUS,
@@ -27329,7 +27564,7 @@ var AUTO$7 = o.AUTO,
VMIN$9 = o.VMIN,
RGBA$2 = o.RGBA;
var canvasPolygon$5 = painter.canvasPolygon,
- svgPolygon$6 = painter.svgPolygon;
+ svgPolygon$5 = painter.svgPolygon;
var isFunction$7 = util.isFunction;
var computeReflow$2 = css.computeReflow;
@@ -27371,8 +27606,8 @@ var Img$1 = /*#__PURE__*/function (_Dom) {
style[BACKGROUND_IMAGE$2] = currentStyle[BACKGROUND_IMAGE$2] = [null];
style[BACKGROUND_COLOR$2] = currentStyle[BACKGROUND_COLOR$2] = [[0, 0, 0, 0], RGBA$2];
style[BORDER_TOP_WIDTH$4] = currentStyle[BORDER_TOP_WIDTH$4] = [0, PX$9];
- style[BORDER_RIGHT_WIDTH$5] = currentStyle[BORDER_RIGHT_WIDTH$5] = [0, PX$9];
- style[BORDER_LEFT_WIDTH$6] = currentStyle[BORDER_LEFT_WIDTH$6] = [0, PX$9];
+ style[BORDER_RIGHT_WIDTH$6] = currentStyle[BORDER_RIGHT_WIDTH$6] = [0, PX$9];
+ style[BORDER_LEFT_WIDTH$7] = currentStyle[BORDER_LEFT_WIDTH$7] = [0, PX$9];
style[BORDER_BOTTOM_WIDTH$4] = currentStyle[BORDER_BOTTOM_WIDTH$4] = [0, PX$9];
style[BOX_SHADOW$3] = currentStyle[BOX_SHADOW$3] = null;
style[MIX_BLEND_MODE$1] = currentStyle[MIX_BLEND_MODE$1] = 'normal';
@@ -27628,7 +27863,7 @@ var Img$1 = /*#__PURE__*/function (_Dom) {
virtualDom.children = [loadImg.cache]; // 但是还是要校验是否有borderRadius变化,引发img的圆角遮罩
if (!virtualDom.cache && list) {
- var d = svgPolygon$6(list);
+ var d = svgPolygon$5(list);
var v = {
tagName: 'clipPath',
props: [],
@@ -27658,7 +27893,7 @@ var Img$1 = /*#__PURE__*/function (_Dom) {
var props = [['xlink:href', loadImg.error ? placeholder : loadImg.src], ['x', originX], ['y', originY], ['width', loadImg.width], ['height', loadImg.height]];
if (list) {
- var _d = svgPolygon$6(list);
+ var _d = svgPolygon$5(list);
var _v = {
tagName: 'clipPath',
@@ -27714,19 +27949,19 @@ var Img$1 = /*#__PURE__*/function (_Dom) {
var _this$currentStyle = this.currentStyle,
width = _this$currentStyle[WIDTH$6],
height = _this$currentStyle[HEIGHT$6],
- marginLeft = _this$currentStyle[MARGIN_LEFT$4],
- marginRight = _this$currentStyle[MARGIN_RIGHT$4],
- paddingLeft = _this$currentStyle[PADDING_LEFT$5],
- paddingRight = _this$currentStyle[PADDING_RIGHT$4],
- borderLeftWidth = _this$currentStyle[BORDER_LEFT_WIDTH$6],
- borderRightWidth = _this$currentStyle[BORDER_RIGHT_WIDTH$5];
+ marginLeft = _this$currentStyle[MARGIN_LEFT$5],
+ marginRight = _this$currentStyle[MARGIN_RIGHT$5],
+ paddingLeft = _this$currentStyle[PADDING_LEFT$6],
+ paddingRight = _this$currentStyle[PADDING_RIGHT$5],
+ borderLeftWidth = _this$currentStyle[BORDER_LEFT_WIDTH$7],
+ borderRightWidth = _this$currentStyle[BORDER_RIGHT_WIDTH$6];
if (width[1] === PX$9) {
w -= width[0];
} else if (width[1] === PERCENT$a) {
w -= total * width[0] * 0.01;
} else if (width[1] === REM$9) {
- w -= width[0] * this.root.computedStyle[FONT_SIZE$a];
+ w -= width[0] * this.root.computedStyle[FONT_SIZE$b];
} else if (width[1] === VW$9) {
w -= width[0] * this.root.width * 0.01;
} else if (width[1] === VH$9) {
@@ -27744,7 +27979,7 @@ var Img$1 = /*#__PURE__*/function (_Dom) {
} else if (height[1] === PERCENT$a) {
w -= loadImg.width * height[0] * total * 0.01 / loadImg.height;
} else if (height[1] === REM$9) {
- w -= loadImg.width * height[0] * this.root.computedStyle[FONT_SIZE$a] / loadImg.height;
+ w -= loadImg.width * height[0] * this.root.computedStyle[FONT_SIZE$b] / loadImg.height;
} else if (height[1] === VW$9) {
w -= loadImg.width * height[0] * this.root.width * 0.01 / loadImg.height;
} else if (height[1] === VH$9) {
@@ -27765,7 +28000,7 @@ var Img$1 = /*#__PURE__*/function (_Dom) {
} else if (marginLeft[1] === PERCENT$a) {
w -= marginLeft[0] * total * 0.01;
} else if (marginLeft[1] === REM$9) {
- w -= marginLeft[0] * this.root.computedStyle[FONT_SIZE$a];
+ w -= marginLeft[0] * this.root.computedStyle[FONT_SIZE$b];
} else if (marginLeft[1] === VW$9) {
w -= marginLeft[0] * this.root.width * 0.01;
} else if (marginLeft[1] === VH$9) {
@@ -27781,7 +28016,7 @@ var Img$1 = /*#__PURE__*/function (_Dom) {
} else if (paddingLeft[1] === PERCENT$a) {
w -= paddingLeft[0] * total * 0.01;
} else if (paddingLeft[1] === REM$9) {
- w -= paddingLeft[0] * this.root.computedStyle[FONT_SIZE$a];
+ w -= paddingLeft[0] * this.root.computedStyle[FONT_SIZE$b];
} else if (paddingLeft[1] === VW$9) {
w -= paddingLeft[0] * this.root.width * 0.01;
} else if (paddingLeft[1] === VH$9) {
@@ -27795,7 +28030,7 @@ var Img$1 = /*#__PURE__*/function (_Dom) {
if (borderLeftWidth[1] === PX$9) {
w -= borderLeftWidth[0];
} else if (borderLeftWidth[1] === REM$9) {
- w -= borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE$a];
+ w -= borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE$b];
} else if (borderLeftWidth[1] === VW$9) {
w -= borderLeftWidth[0] * this.root.width * 0.01;
} else if (borderLeftWidth[1] === VH$9) {
@@ -27811,7 +28046,7 @@ var Img$1 = /*#__PURE__*/function (_Dom) {
} else if (marginRight[1] === PERCENT$a) {
w -= marginRight[0] * total * 0.01;
} else if (marginRight[1] === REM$9) {
- w -= marginRight[0] * this.root.computedStyle[FONT_SIZE$a];
+ w -= marginRight[0] * this.root.computedStyle[FONT_SIZE$b];
} else if (marginRight[1] === VW$9) {
w -= marginRight[0] * this.root.width * 0.01;
} else if (marginRight[1] === VH$9) {
@@ -27827,7 +28062,7 @@ var Img$1 = /*#__PURE__*/function (_Dom) {
} else if (paddingRight[1] === PERCENT$a) {
w -= paddingRight[0] * total * 0.01;
} else if (paddingRight[1] === REM$9) {
- w -= paddingRight[0] * this.root.computedStyle[FONT_SIZE$a];
+ w -= paddingRight[0] * this.root.computedStyle[FONT_SIZE$b];
} else if (paddingRight[1] === VW$9) {
w -= paddingRight[0] * this.root.width * 0.01;
} else if (paddingRight[1] === VH$9) {
@@ -27841,7 +28076,7 @@ var Img$1 = /*#__PURE__*/function (_Dom) {
if (borderRightWidth[1] === PX$9) {
w -= borderRightWidth[0];
} else if (borderRightWidth[1] === REM$9) {
- w -= borderRightWidth[0] * this.root.computedStyle[FONT_SIZE$a];
+ w -= borderRightWidth[0] * this.root.computedStyle[FONT_SIZE$b];
} else if (borderRightWidth[1] === VW$9) {
w -= borderRightWidth[0] * this.root.width * 0.01;
} else if (borderRightWidth[1] === VH$9) {
@@ -27881,7 +28116,7 @@ var Img$1 = /*#__PURE__*/function (_Dom) {
} else if (flexBasis[1] === PERCENT$a) {
b = max = min = flexBasis[0] * 0.01 * (isDirectionRow ? w : h);
} else if (flexBasis[1] === REM$9) {
- b = max = min = flexBasis[0] * this.root.computedStyle[FONT_SIZE$a];
+ b = max = min = flexBasis[0] * this.root.computedStyle[FONT_SIZE$b];
} else if (flexBasis[1] === VW$9) {
b = max = min = flexBasis[0] * this.root.width * 0.01;
} else if (flexBasis[1] === VH$9) {
@@ -27897,7 +28132,7 @@ var Img$1 = /*#__PURE__*/function (_Dom) {
} else if (main[1] === PERCENT$a) {
b = max = min = main[0] * 0.01 * (isDirectionRow ? w : h);
} else if (main[1] === REM$9) {
- b = max = min = main[0] * this.root.computedStyle[FONT_SIZE$a];
+ b = max = min = main[0] * this.root.computedStyle[FONT_SIZE$b];
} else if (main[1] === VW$9) {
b = max = min = main[0] * this.root.width * 0.01;
} else if (main[1] === VH$9) {
@@ -27917,7 +28152,7 @@ var Img$1 = /*#__PURE__*/function (_Dom) {
} else if (cross[1] === PERCENT$a) {
cross = cross[0] * 0.01 * (isDirectionRow ? h : w);
} else if (cross[1] === REM$9) {
- cross = cross[0] * this.root.computedStyle[FONT_SIZE$a];
+ cross = cross[0] * this.root.computedStyle[FONT_SIZE$b];
} else if (cross[1] === VW$9) {
cross = cross[0] * this.root.width * 0.01;
} else if (cross[1] === VH$9) {
@@ -28201,27 +28436,27 @@ var Defs = /*#__PURE__*/function () {
return Defs;
}();
-var _enums$STYLE_KEY$h = enums.STYLE_KEY,
- MARGIN_RIGHT$5 = _enums$STYLE_KEY$h.MARGIN_RIGHT,
- MARGIN_LEFT$5 = _enums$STYLE_KEY$h.MARGIN_LEFT,
- PADDING_RIGHT$5 = _enums$STYLE_KEY$h.PADDING_RIGHT,
- PADDING_LEFT$6 = _enums$STYLE_KEY$h.PADDING_LEFT,
- WIDTH$7 = _enums$STYLE_KEY$h.WIDTH,
- HEIGHT$7 = _enums$STYLE_KEY$h.HEIGHT,
- BORDER_RIGHT_WIDTH$6 = _enums$STYLE_KEY$h.BORDER_RIGHT_WIDTH,
- BORDER_LEFT_WIDTH$7 = _enums$STYLE_KEY$h.BORDER_LEFT_WIDTH,
- FILL$1 = _enums$STYLE_KEY$h.FILL,
- STROKE$1 = _enums$STYLE_KEY$h.STROKE,
- STROKE_MITERLIMIT = _enums$STYLE_KEY$h.STROKE_MITERLIMIT,
- STROKE_WIDTH$1 = _enums$STYLE_KEY$h.STROKE_WIDTH,
- STROKE_LINECAP = _enums$STYLE_KEY$h.STROKE_LINECAP,
- STROKE_LINEJOIN = _enums$STYLE_KEY$h.STROKE_LINEJOIN,
- STROKE_DASHARRAY$1 = _enums$STYLE_KEY$h.STROKE_DASHARRAY,
- STROKE_DASHARRAY_STR = _enums$STYLE_KEY$h.STROKE_DASHARRAY_STR,
- FILL_RULE = _enums$STYLE_KEY$h.FILL_RULE,
- VISIBILITY$4 = _enums$STYLE_KEY$h.VISIBILITY,
- FONT_SIZE$b = _enums$STYLE_KEY$h.FONT_SIZE,
- FLEX_BASIS$4 = _enums$STYLE_KEY$h.FLEX_BASIS,
+var _enums$STYLE_KEY$i = enums.STYLE_KEY,
+ MARGIN_RIGHT$6 = _enums$STYLE_KEY$i.MARGIN_RIGHT,
+ MARGIN_LEFT$6 = _enums$STYLE_KEY$i.MARGIN_LEFT,
+ PADDING_RIGHT$6 = _enums$STYLE_KEY$i.PADDING_RIGHT,
+ PADDING_LEFT$7 = _enums$STYLE_KEY$i.PADDING_LEFT,
+ WIDTH$7 = _enums$STYLE_KEY$i.WIDTH,
+ HEIGHT$7 = _enums$STYLE_KEY$i.HEIGHT,
+ BORDER_RIGHT_WIDTH$7 = _enums$STYLE_KEY$i.BORDER_RIGHT_WIDTH,
+ BORDER_LEFT_WIDTH$8 = _enums$STYLE_KEY$i.BORDER_LEFT_WIDTH,
+ FILL$1 = _enums$STYLE_KEY$i.FILL,
+ STROKE$1 = _enums$STYLE_KEY$i.STROKE,
+ STROKE_MITERLIMIT = _enums$STYLE_KEY$i.STROKE_MITERLIMIT,
+ STROKE_WIDTH$1 = _enums$STYLE_KEY$i.STROKE_WIDTH,
+ STROKE_LINECAP = _enums$STYLE_KEY$i.STROKE_LINECAP,
+ STROKE_LINEJOIN = _enums$STYLE_KEY$i.STROKE_LINEJOIN,
+ STROKE_DASHARRAY$1 = _enums$STYLE_KEY$i.STROKE_DASHARRAY,
+ STROKE_DASHARRAY_STR = _enums$STYLE_KEY$i.STROKE_DASHARRAY_STR,
+ FILL_RULE = _enums$STYLE_KEY$i.FILL_RULE,
+ VISIBILITY$4 = _enums$STYLE_KEY$i.VISIBILITY,
+ FONT_SIZE$c = _enums$STYLE_KEY$i.FONT_SIZE,
+ FLEX_BASIS$4 = _enums$STYLE_KEY$i.FLEX_BASIS,
_enums$NODE_KEY$6 = enums.NODE_KEY,
NODE_CACHE_PROPS = _enums$NODE_KEY$6.NODE_CACHE_PROPS,
NODE_CURRENT_PROPS = _enums$NODE_KEY$6.NODE_CURRENT_PROPS,
@@ -28240,8 +28475,8 @@ var int2rgba$3 = util.int2rgba,
isNil$8 = util.isNil,
joinArr$3 = util.joinArr;
var canvasPolygon$6 = painter.canvasPolygon,
- svgPolygon$7 = painter.svgPolygon;
-var WEBGL$2 = mode.WEBGL;
+ svgPolygon$6 = painter.svgPolygon;
+var WEBGL$5 = mode.WEBGL;
var computeReflow$3 = css.computeReflow;
var REGISTER$1 = {};
@@ -28274,19 +28509,19 @@ var Geom$1 = /*#__PURE__*/function (_Xom) {
// 无children,直接以style的width为宽度,不定义则为0
var _this$currentStyle = this.currentStyle,
width = _this$currentStyle[WIDTH$7],
- marginLeft = _this$currentStyle[MARGIN_LEFT$5],
- marginRight = _this$currentStyle[MARGIN_RIGHT$5],
- paddingLeft = _this$currentStyle[PADDING_LEFT$6],
- paddingRight = _this$currentStyle[PADDING_RIGHT$5],
- borderLeftWidth = _this$currentStyle[BORDER_LEFT_WIDTH$7],
- borderRightWidth = _this$currentStyle[BORDER_RIGHT_WIDTH$6];
+ marginLeft = _this$currentStyle[MARGIN_LEFT$6],
+ marginRight = _this$currentStyle[MARGIN_RIGHT$6],
+ paddingLeft = _this$currentStyle[PADDING_LEFT$7],
+ paddingRight = _this$currentStyle[PADDING_RIGHT$6],
+ borderLeftWidth = _this$currentStyle[BORDER_LEFT_WIDTH$8],
+ borderRightWidth = _this$currentStyle[BORDER_RIGHT_WIDTH$7];
if (width[1] === PX$a) {
w -= width[0];
} else if (width[1] === PERCENT$b) {
w -= total * width[0] * 0.01;
} else if (width[1] === REM$a) {
- w -= width[0] * this.root.computedStyle[FONT_SIZE$b];
+ w -= width[0] * this.root.computedStyle[FONT_SIZE$c];
} else if (width[1] === VW$a) {
w -= width[0] * this.root.width * 0.01;
} else if (width[1] === VH$a) {
@@ -28303,7 +28538,7 @@ var Geom$1 = /*#__PURE__*/function (_Xom) {
} else if (marginLeft[1] === PERCENT$b) {
w -= marginLeft[0] * total * 0.01;
} else if (marginLeft[1] === REM$a) {
- w -= marginLeft[0] * this.root.computedStyle[FONT_SIZE$b];
+ w -= marginLeft[0] * this.root.computedStyle[FONT_SIZE$c];
} else if (marginLeft[1] === VW$a) {
w -= marginLeft[0] * this.root.width * 0.01;
} else if (marginLeft[1] === VH$a) {
@@ -28319,7 +28554,7 @@ var Geom$1 = /*#__PURE__*/function (_Xom) {
} else if (paddingLeft[1] === PERCENT$b) {
w -= paddingLeft[0] * total * 0.01;
} else if (paddingLeft[1] === REM$a) {
- w -= paddingLeft[0] * this.root.computedStyle[FONT_SIZE$b];
+ w -= paddingLeft[0] * this.root.computedStyle[FONT_SIZE$c];
} else if (paddingLeft[1] === VW$a) {
w -= paddingLeft[0] * this.root.width * 0.01;
} else if (paddingLeft[1] === VH$a) {
@@ -28333,7 +28568,7 @@ var Geom$1 = /*#__PURE__*/function (_Xom) {
if (borderLeftWidth[1] === PX$a) {
w -= borderLeftWidth[0];
} else if (borderLeftWidth[1] === REM$a) {
- w -= borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE$b];
+ w -= borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE$c];
} else if (borderLeftWidth[1] === VW$a) {
w -= borderLeftWidth[0] * this.root.width * 0.01;
} else if (borderLeftWidth[1] === VH$a) {
@@ -28349,7 +28584,7 @@ var Geom$1 = /*#__PURE__*/function (_Xom) {
} else if (marginRight[1] === PERCENT$b) {
w -= marginRight[0] * total * 0.01;
} else if (marginRight[1] === REM$a) {
- w -= marginRight[0] * this.root.computedStyle[FONT_SIZE$b];
+ w -= marginRight[0] * this.root.computedStyle[FONT_SIZE$c];
} else if (marginRight[1] === VW$a) {
w -= marginRight[0] * this.root.width * 0.01;
} else if (marginRight[1] === VH$a) {
@@ -28365,7 +28600,7 @@ var Geom$1 = /*#__PURE__*/function (_Xom) {
} else if (paddingRight[1] === PERCENT$b) {
w -= paddingRight[0] * total * 0.01;
} else if (paddingRight[1] === REM$a) {
- w -= paddingRight[0] * this.root.computedStyle[FONT_SIZE$b];
+ w -= paddingRight[0] * this.root.computedStyle[FONT_SIZE$c];
} else if (paddingRight[1] === VW$a) {
w -= paddingRight[0] * this.root.width * 0.01;
} else if (paddingRight[1] === VH$a) {
@@ -28379,7 +28614,7 @@ var Geom$1 = /*#__PURE__*/function (_Xom) {
if (borderRightWidth[1] === PX$a) {
w -= borderRightWidth[0];
} else if (borderRightWidth[1] === REM$a) {
- w -= borderRightWidth[0] * this.root.computedStyle[FONT_SIZE$b];
+ w -= borderRightWidth[0] * this.root.computedStyle[FONT_SIZE$c];
} else if (borderRightWidth[1] === VW$a) {
w -= borderRightWidth[0] * this.root.width * 0.01;
} else if (borderRightWidth[1] === VH$a) {
@@ -28417,7 +28652,7 @@ var Geom$1 = /*#__PURE__*/function (_Xom) {
} else if (flexBasis[1] === PERCENT$b) {
b = max = min = flexBasis[0] * 0.01 * (isDirectionRow ? w : h);
} else if (flexBasis[1] === REM$a) {
- b = max = min = flexBasis[0] * this.root.computedStyle[FONT_SIZE$b];
+ b = max = min = flexBasis[0] * this.root.computedStyle[FONT_SIZE$c];
} else if (flexBasis[1] === VW$a) {
b = max = min = flexBasis[0] * this.root.width * 0.01;
} else if (flexBasis[1] === VH$a) {
@@ -28433,7 +28668,7 @@ var Geom$1 = /*#__PURE__*/function (_Xom) {
} else if (main[1] === PERCENT$b) {
b = max = min = main[0] * 0.01 * (isDirectionRow ? w : h);
} else if (main[1] === REM$a) {
- b = max = min = main[0] * this.root.computedStyle[FONT_SIZE$b];
+ b = max = min = main[0] * this.root.computedStyle[FONT_SIZE$c];
} else if (main[1] === VW$a) {
b = max = min = main[0] * this.root.width * 0.01;
} else if (main[1] === VH$a) {
@@ -28517,7 +28752,7 @@ var Geom$1 = /*#__PURE__*/function (_Xom) {
} else if (item[1] === PERCENT$b) {
return item[0] * w * 0.01;
} else if (item[1] === REM$a) {
- return item[0] * _this2.root.computedStyle[FONT_SIZE$b];
+ return item[0] * _this2.root.computedStyle[FONT_SIZE$c];
} else if (item[1] === VW$a) {
return item[0] * _this2.root.width * 0.01;
} else if (item[1] === VH$a) {
@@ -28554,7 +28789,7 @@ var Geom$1 = /*#__PURE__*/function (_Xom) {
if (Array.isArray(v)) {
v.forEach(function (item) {
if (item && (item.k === 'linear' || item.k === 'radial' || item.k === 'conic')) {
- if (renderMode === WEBGL$2) {
+ if (renderMode === WEBGL$5) {
var cache = _this2.__config[NODE_CACHE$3];
x3 += cache.dx;
x4 += cache.dx;
@@ -28851,10 +29086,10 @@ var Geom$1 = /*#__PURE__*/function (_Xom) {
if (isMulti) {
list.forEach(function (item) {
- return d += svgPolygon$7(item);
+ return d += svgPolygon$6(item);
});
} else {
- d = svgPolygon$7(list);
+ d = svgPolygon$6(list);
}
var props = [['d', d]]; // 2个都没有常出现在多fill/stroke时,也有可能特殊单个故意这样写的
@@ -28984,10 +29219,10 @@ var Geom$1 = /*#__PURE__*/function (_Xom) {
if (isMulti) {
list.forEach(function (item) {
- return d += svgPolygon$7(item);
+ return d += svgPolygon$6(item);
});
} else {
- d = svgPolygon$7(list);
+ d = svgPolygon$6(list);
}
var props = [['d', d]];
@@ -29062,7 +29297,7 @@ var Geom$1 = /*#__PURE__*/function (_Xom) {
tagName: 'clipPath',
children: [{
tagName: 'path',
- props: [['d', svgPolygon$7(item)]]
+ props: [['d', svgPolygon$6(item)]]
}]
};
var clip = ctx.add(v);
@@ -29073,7 +29308,7 @@ var Geom$1 = /*#__PURE__*/function (_Xom) {
_this3.virtualDom.bb.push({
type: 'item',
tagName: 'path',
- props: [['d', svgPolygon$7(item[0])], ['fill', item[1]], ['clip-path', 'url(#' + clip + ')']]
+ props: [['d', svgPolygon$6(item[0])], ['fill', item[1]], ['clip-path', 'url(#' + clip + ')']]
});
});
});
@@ -29082,7 +29317,7 @@ var Geom$1 = /*#__PURE__*/function (_Xom) {
tagName: 'clipPath',
children: [{
tagName: 'path',
- props: [['d', svgPolygon$7(list)]]
+ props: [['d', svgPolygon$6(list)]]
}]
};
var clip = ctx.add(v);
@@ -29093,7 +29328,7 @@ var Geom$1 = /*#__PURE__*/function (_Xom) {
_this3.virtualDom.bb.push({
type: 'item',
tagName: 'path',
- props: [['d', svgPolygon$7(item[0])], ['fill', item[1]], ['clip-path', 'url(#' + clip + ')']]
+ props: [['d', svgPolygon$6(item[0])], ['fill', item[1]], ['clip-path', 'url(#' + clip + ')']]
});
});
}
@@ -30898,27 +31133,27 @@ var OFFSCREEN_OVERFLOW$1 = offscreen.OFFSCREEN_OVERFLOW,
OFFSCREEN_BLEND$1 = offscreen.OFFSCREEN_BLEND,
OFFSCREEN_MASK2$1 = offscreen.OFFSCREEN_MASK2,
applyOffscreen$1 = offscreen.applyOffscreen;
-var _enums$STYLE_KEY$i = enums.STYLE_KEY,
- DISPLAY$7 = _enums$STYLE_KEY$i.DISPLAY,
- OPACITY$5 = _enums$STYLE_KEY$i.OPACITY,
- VISIBILITY$5 = _enums$STYLE_KEY$i.VISIBILITY,
- FILTER$5 = _enums$STYLE_KEY$i.FILTER,
- OVERFLOW$3 = _enums$STYLE_KEY$i.OVERFLOW,
- MIX_BLEND_MODE$3 = _enums$STYLE_KEY$i.MIX_BLEND_MODE,
- FILL$2 = _enums$STYLE_KEY$i.FILL,
- TRANSFORM$4 = _enums$STYLE_KEY$i.TRANSFORM,
- TRANSFORM_ORIGIN$5 = _enums$STYLE_KEY$i.TRANSFORM_ORIGIN,
- PERSPECTIVE$4 = _enums$STYLE_KEY$i.PERSPECTIVE,
- PERSPECTIVE_ORIGIN$4 = _enums$STYLE_KEY$i.PERSPECTIVE_ORIGIN,
- PADDING_LEFT$7 = _enums$STYLE_KEY$i.PADDING_LEFT,
- PADDING_RIGHT$6 = _enums$STYLE_KEY$i.PADDING_RIGHT,
- PADDING_TOP$3 = _enums$STYLE_KEY$i.PADDING_TOP,
- PADDING_BOTTOM$3 = _enums$STYLE_KEY$i.PADDING_BOTTOM,
- BORDER_TOP_WIDTH$5 = _enums$STYLE_KEY$i.BORDER_TOP_WIDTH,
- BORDER_RIGHT_WIDTH$7 = _enums$STYLE_KEY$i.BORDER_RIGHT_WIDTH,
- BORDER_BOTTOM_WIDTH$5 = _enums$STYLE_KEY$i.BORDER_BOTTOM_WIDTH,
- BORDER_LEFT_WIDTH$8 = _enums$STYLE_KEY$i.BORDER_LEFT_WIDTH,
- MATRIX$4 = _enums$STYLE_KEY$i.MATRIX,
+var _enums$STYLE_KEY$j = enums.STYLE_KEY,
+ DISPLAY$7 = _enums$STYLE_KEY$j.DISPLAY,
+ OPACITY$5 = _enums$STYLE_KEY$j.OPACITY,
+ VISIBILITY$5 = _enums$STYLE_KEY$j.VISIBILITY,
+ FILTER$5 = _enums$STYLE_KEY$j.FILTER,
+ OVERFLOW$4 = _enums$STYLE_KEY$j.OVERFLOW,
+ MIX_BLEND_MODE$3 = _enums$STYLE_KEY$j.MIX_BLEND_MODE,
+ FILL$2 = _enums$STYLE_KEY$j.FILL,
+ TRANSFORM$4 = _enums$STYLE_KEY$j.TRANSFORM,
+ TRANSFORM_ORIGIN$5 = _enums$STYLE_KEY$j.TRANSFORM_ORIGIN,
+ PERSPECTIVE$4 = _enums$STYLE_KEY$j.PERSPECTIVE,
+ PERSPECTIVE_ORIGIN$4 = _enums$STYLE_KEY$j.PERSPECTIVE_ORIGIN,
+ PADDING_LEFT$8 = _enums$STYLE_KEY$j.PADDING_LEFT,
+ PADDING_RIGHT$7 = _enums$STYLE_KEY$j.PADDING_RIGHT,
+ PADDING_TOP$3 = _enums$STYLE_KEY$j.PADDING_TOP,
+ PADDING_BOTTOM$3 = _enums$STYLE_KEY$j.PADDING_BOTTOM,
+ BORDER_TOP_WIDTH$5 = _enums$STYLE_KEY$j.BORDER_TOP_WIDTH,
+ BORDER_RIGHT_WIDTH$8 = _enums$STYLE_KEY$j.BORDER_RIGHT_WIDTH,
+ BORDER_BOTTOM_WIDTH$5 = _enums$STYLE_KEY$j.BORDER_BOTTOM_WIDTH,
+ BORDER_LEFT_WIDTH$9 = _enums$STYLE_KEY$j.BORDER_LEFT_WIDTH,
+ MATRIX$4 = _enums$STYLE_KEY$j.MATRIX,
_enums$NODE_KEY$8 = enums.NODE_KEY,
NODE_CACHE$4 = _enums$NODE_KEY$8.NODE_CACHE,
NODE_CACHE_TOTAL$1 = _enums$NODE_KEY$8.NODE_CACHE_TOTAL,
@@ -30937,7 +31172,7 @@ var _enums$STYLE_KEY$i = enums.STYLE_KEY,
NODE_IS_MASK$2 = _enums$NODE_KEY$8.NODE_IS_MASK,
NODE_DOM_PARENT$5 = _enums$NODE_KEY$8.NODE_DOM_PARENT,
NODE_PERSPECTIVE_MATRIX$1 = _enums$NODE_KEY$8.NODE_PERSPECTIVE_MATRIX,
- NODE_VIRTUAL_DOM$2 = _enums$NODE_KEY$8.NODE_VIRTUAL_DOM,
+ NODE_VIRTUAL_DOM$3 = _enums$NODE_KEY$8.NODE_VIRTUAL_DOM,
NODE_CACHE_AS_BITMAP$1 = _enums$NODE_KEY$8.NODE_CACHE_AS_BITMAP,
NODE_STRUCT$4 = _enums$NODE_KEY$8.NODE_STRUCT,
_enums$STRUCT_KEY$2 = enums.STRUCT_KEY,
@@ -31482,7 +31717,7 @@ function genTotal(renderMode, node, config, index, lv, total, __structs, hasMask
} else {
if (_refreshLevel >= REPAINT$2) {
// 手动计算cacheStyle和根据border-box的坐标再渲染
- _node2.__calCache(renderMode, ctxTotal, _config[NODE_DOM_PARENT$5], _config[NODE_CACHE_STYLE$1], _config[NODE_CURRENT_STYLE$5], _computedStyle2, _node2.clientWidth, _node2.clientHeight, _node2.offsetWidth, _node2.offsetHeight, _computedStyle2[BORDER_TOP_WIDTH$5], _computedStyle2[BORDER_RIGHT_WIDTH$7], _computedStyle2[BORDER_BOTTOM_WIDTH$5], _computedStyle2[BORDER_LEFT_WIDTH$8], _computedStyle2[PADDING_TOP$3], _computedStyle2[PADDING_RIGHT$6], _computedStyle2[PADDING_BOTTOM$3], _computedStyle2[PADDING_LEFT$7], _node2.__sx1, _node2.__sx2, _node2.__sx3, _node2.__sx4, _node2.__sx5, _node2.__sx6, _node2.__sy1, _node2.__sy2, _node2.__sy3, _node2.__sy4, _node2.__sy5, _node2.__sy6);
+ _node2.__calCache(renderMode, ctxTotal, _config[NODE_DOM_PARENT$5], _config[NODE_CACHE_STYLE$1], _config[NODE_CURRENT_STYLE$5], _computedStyle2, _node2.clientWidth, _node2.clientHeight, _node2.offsetWidth, _node2.offsetHeight, _computedStyle2[BORDER_TOP_WIDTH$5], _computedStyle2[BORDER_RIGHT_WIDTH$8], _computedStyle2[BORDER_BOTTOM_WIDTH$5], _computedStyle2[BORDER_LEFT_WIDTH$9], _computedStyle2[PADDING_TOP$3], _computedStyle2[PADDING_RIGHT$7], _computedStyle2[PADDING_BOTTOM$3], _computedStyle2[PADDING_LEFT$8], _node2.__sx1, _node2.__sx2, _node2.__sx3, _node2.__sx4, _node2.__sx5, _node2.__sx6, _node2.__sy1, _node2.__sy2, _node2.__sy3, _node2.__sy4, _node2.__sy5, _node2.__sy6);
}
var res = _node2.render(renderMode, _refreshLevel, ctxTotal, _i2 === index ? LOCAL$1 : CHILD, dx, dy);
@@ -31580,7 +31815,7 @@ function genTotal(renderMode, node, config, index, lv, total, __structs, hasMask
if (cacheTotal && cacheTotal.available) {
- var overflow = computedStyle[OVERFLOW$3],
+ var overflow = computedStyle[OVERFLOW$4],
filter = computedStyle[FILTER$5];
var _target3 = cacheTotal;
@@ -31826,7 +32061,7 @@ function genTotal(renderMode, node, config, index, lv, total, __structs, hasMask
if (_refreshLevel3 >= REPAINT$2) {
// 手动计算cacheStyle和根据border-box的坐标再渲染
- _node3.__calCache(renderMode, ctx, _config2[NODE_DOM_PARENT$5], _config2[NODE_CACHE_STYLE$1], _config2[NODE_CURRENT_STYLE$5], _computedStyle3, _node3.clientWidth, _node3.clientHeight, _node3.offsetWidth, _node3.offsetHeight, _computedStyle3[BORDER_TOP_WIDTH$5], _computedStyle3[BORDER_RIGHT_WIDTH$7], _computedStyle3[BORDER_BOTTOM_WIDTH$5], _computedStyle3[BORDER_LEFT_WIDTH$8], _computedStyle3[PADDING_TOP$3], _computedStyle3[PADDING_RIGHT$6], _computedStyle3[PADDING_BOTTOM$3], _computedStyle3[PADDING_LEFT$7], _node3.__sx1, _node3.__sx2, _node3.__sx3, _node3.__sx4, _node3.__sx5, _node3.__sx6, _node3.__sy1, _node3.__sy2, _node3.__sy3, _node3.__sy4, _node3.__sy5, _node3.__sy6);
+ _node3.__calCache(renderMode, ctx, _config2[NODE_DOM_PARENT$5], _config2[NODE_CACHE_STYLE$1], _config2[NODE_CURRENT_STYLE$5], _computedStyle3, _node3.clientWidth, _node3.clientHeight, _node3.offsetWidth, _node3.offsetHeight, _computedStyle3[BORDER_TOP_WIDTH$5], _computedStyle3[BORDER_RIGHT_WIDTH$8], _computedStyle3[BORDER_BOTTOM_WIDTH$5], _computedStyle3[BORDER_LEFT_WIDTH$9], _computedStyle3[PADDING_TOP$3], _computedStyle3[PADDING_RIGHT$7], _computedStyle3[PADDING_BOTTOM$3], _computedStyle3[PADDING_LEFT$8], _node3.__sx1, _node3.__sx2, _node3.__sx3, _node3.__sx4, _node3.__sx5, _node3.__sx6, _node3.__sy1, _node3.__sy2, _node3.__sy3, _node3.__sy4, _node3.__sy5, _node3.__sy6);
}
var _res = _node3.render(renderMode, _refreshLevel3, ctx, CHILD, dx, dy);
@@ -32929,7 +33164,7 @@ function renderSvg(renderMode, ctx, root, isFirst) {
parentVd = vdList[lv - 1];
} else if (lv > lastLv) {
matrixList.push(lastConfig[NODE_MATRIX$3]);
- var vd = lastConfig[NODE_VIRTUAL_DOM$2];
+ var vd = lastConfig[NODE_VIRTUAL_DOM$3];
vdList.push(vd);
parentVd = vd;
}
@@ -32939,14 +33174,14 @@ function renderSvg(renderMode, ctx, root, isFirst) {
if (_refreshLevel4 < REPAINT$2 && !(_node6 instanceof Text)) {
__config[NODE_REFRESH_LV$1] = NONE$2;
- virtualDom = __config[NODE_VIRTUAL_DOM$2]; // total可以跳过所有孩子节点省略循环
+ virtualDom = __config[NODE_VIRTUAL_DOM$3]; // total可以跳过所有孩子节点省略循环
if (__cacheTotal && __cacheTotal.available) {
_i8 += _total11 || 0;
virtualDom.cache = true;
} else {
__cacheTotal && (__cacheTotal.available = true);
- virtualDom = __config[NODE_VIRTUAL_DOM$2] = _node6.__virtualDom = util.extend({}, virtualDom); // dom要清除children缓存,geom和img无需
+ virtualDom = __config[NODE_VIRTUAL_DOM$3] = _node6.__virtualDom = util.extend({}, virtualDom); // dom要清除children缓存,geom和img无需
if (_node6 instanceof Dom$1 && !(_node6 instanceof Img$1)) {
virtualDom.children = [];
@@ -33029,7 +33264,7 @@ function renderSvg(renderMode, ctx, root, isFirst) {
_node6.render(renderMode, _refreshLevel4, ctx, NA, 0, 0);
- virtualDom = __config[NODE_VIRTUAL_DOM$2]; // 渲染后更新取值
+ virtualDom = __config[NODE_VIRTUAL_DOM$3]; // 渲染后更新取值
display = computedStyle[DISPLAY$7];
@@ -33377,7 +33612,7 @@ function renderWebgl(renderMode, gl, root) {
var limitCache = __config[NODE_LIMIT_CACHE$2],
cacheAsBitmap = __config[NODE_CACHE_AS_BITMAP$1];
- var overflow = computedStyle[OVERFLOW$3],
+ var overflow = computedStyle[OVERFLOW$4],
filter = computedStyle[FILTER$5],
mixBlendMode = computedStyle[MIX_BLEND_MODE$3],
transform = computedStyle[TRANSFORM$4];
@@ -33765,7 +34000,7 @@ function renderCanvas(renderMode, ctx, root) {
computedStyle = __config[NODE_COMPUTED_STYLE$3];
if (refreshLevel >= REPAINT$2) {
- node.__calCache(renderMode, ctx, __config[NODE_DOM_PARENT$5], __config[NODE_CACHE_STYLE$1], __config[NODE_CURRENT_STYLE$5], computedStyle, node.clientWidth, node.clientHeight, node.offsetWidth, node.offsetHeight, computedStyle[BORDER_TOP_WIDTH$5], computedStyle[BORDER_RIGHT_WIDTH$7], computedStyle[BORDER_BOTTOM_WIDTH$5], computedStyle[BORDER_LEFT_WIDTH$8], computedStyle[PADDING_TOP$3], computedStyle[PADDING_RIGHT$6], computedStyle[PADDING_BOTTOM$3], computedStyle[PADDING_LEFT$7], node.__sx1, node.__sx2, node.__sx3, node.__sx4, node.__sx5, node.__sx6, node.__sy1, node.__sy2, node.__sy3, node.__sy4, node.__sy5, node.__sy6);
+ node.__calCache(renderMode, ctx, __config[NODE_DOM_PARENT$5], __config[NODE_CACHE_STYLE$1], __config[NODE_CURRENT_STYLE$5], computedStyle, node.clientWidth, node.clientHeight, node.offsetWidth, node.offsetHeight, computedStyle[BORDER_TOP_WIDTH$5], computedStyle[BORDER_RIGHT_WIDTH$8], computedStyle[BORDER_BOTTOM_WIDTH$5], computedStyle[BORDER_LEFT_WIDTH$9], computedStyle[PADDING_TOP$3], computedStyle[PADDING_RIGHT$7], computedStyle[PADDING_BOTTOM$3], computedStyle[PADDING_LEFT$8], node.__sx1, node.__sx2, node.__sx3, node.__sx4, node.__sx5, node.__sx6, node.__sy1, node.__sy2, node.__sy3, node.__sy4, node.__sy5, node.__sy6);
}
if (cacheAsBitmap) {
@@ -33983,11 +34218,19 @@ function renderCanvas(renderMode, ctx, root) {
if (offscreenHash.hasOwnProperty(_i11)) {
ctx = applyOffscreen$1(ctx, offscreenHash[_i11], width, height);
- } // render后判断可见状态,此时computedStyle才有值
+ } // render后判断可见状态,此时computedStyle才有值,none可以忽略渲染,但是可能会跳过offscreenHash预置的索引
if (display === 'none') {
- _i11 += (_total13 || 0) + countMaskNum(__structs, _i11 + (_total13 || 0) + 1, _hasMask6 || 0);
+ var add = (_total13 || 0) + countMaskNum(__structs, _i11 + (_total13 || 0) + 1, _hasMask6 || 0);
+
+ for (var _j17 = _i11 + 1; _j17 <= _i11 + add; _j17++) {
+ if (offscreenHash.hasOwnProperty(_j17)) {
+ ctx = applyOffscreen$1(ctx, offscreenHash[_j17], width, height);
+ }
+ }
+
+ _i11 += add;
}
}
}
@@ -34340,35 +34583,34 @@ var TexCache = /*#__PURE__*/function () {
}();
var _DIRECTION_HASH;
-var _enums$STYLE_KEY$j = enums.STYLE_KEY,
- TOP$4 = _enums$STYLE_KEY$j.TOP,
- RIGHT$2 = _enums$STYLE_KEY$j.RIGHT,
- BOTTOM$4 = _enums$STYLE_KEY$j.BOTTOM,
- LEFT$2 = _enums$STYLE_KEY$j.LEFT,
- POSITION$4 = _enums$STYLE_KEY$j.POSITION,
- DISPLAY$8 = _enums$STYLE_KEY$j.DISPLAY,
- VISIBILITY$6 = _enums$STYLE_KEY$j.VISIBILITY,
- COLOR$5 = _enums$STYLE_KEY$j.COLOR,
- WIDTH$8 = _enums$STYLE_KEY$j.WIDTH,
- HEIGHT$8 = _enums$STYLE_KEY$j.HEIGHT,
- Z_INDEX$4 = _enums$STYLE_KEY$j.Z_INDEX,
- MARGIN_TOP$2 = _enums$STYLE_KEY$j.MARGIN_TOP,
- MARGIN_LEFT$6 = _enums$STYLE_KEY$j.MARGIN_LEFT,
- MARGIN_BOTTOM$2 = _enums$STYLE_KEY$j.MARGIN_BOTTOM,
- PADDING_TOP$4 = _enums$STYLE_KEY$j.PADDING_TOP,
- PADDING_LEFT$8 = _enums$STYLE_KEY$j.PADDING_LEFT,
- PADDING_BOTTOM$4 = _enums$STYLE_KEY$j.PADDING_BOTTOM,
- BORDER_TOP_WIDTH$6 = _enums$STYLE_KEY$j.BORDER_TOP_WIDTH,
- BORDER_LEFT_WIDTH$9 = _enums$STYLE_KEY$j.BORDER_LEFT_WIDTH,
- BORDER_BOTTOM_WIDTH$6 = _enums$STYLE_KEY$j.BORDER_BOTTOM_WIDTH,
- POINTER_EVENTS$2 = _enums$STYLE_KEY$j.POINTER_EVENTS,
+var _enums$STYLE_KEY$k = enums.STYLE_KEY,
+ TOP$4 = _enums$STYLE_KEY$k.TOP,
+ RIGHT$2 = _enums$STYLE_KEY$k.RIGHT,
+ BOTTOM$4 = _enums$STYLE_KEY$k.BOTTOM,
+ LEFT$2 = _enums$STYLE_KEY$k.LEFT,
+ POSITION$5 = _enums$STYLE_KEY$k.POSITION,
+ DISPLAY$8 = _enums$STYLE_KEY$k.DISPLAY,
+ VISIBILITY$6 = _enums$STYLE_KEY$k.VISIBILITY,
+ COLOR$6 = _enums$STYLE_KEY$k.COLOR,
+ WIDTH$8 = _enums$STYLE_KEY$k.WIDTH,
+ HEIGHT$8 = _enums$STYLE_KEY$k.HEIGHT,
+ Z_INDEX$4 = _enums$STYLE_KEY$k.Z_INDEX,
+ MARGIN_TOP$2 = _enums$STYLE_KEY$k.MARGIN_TOP,
+ MARGIN_LEFT$7 = _enums$STYLE_KEY$k.MARGIN_LEFT,
+ MARGIN_BOTTOM$2 = _enums$STYLE_KEY$k.MARGIN_BOTTOM,
+ PADDING_TOP$4 = _enums$STYLE_KEY$k.PADDING_TOP,
+ PADDING_LEFT$9 = _enums$STYLE_KEY$k.PADDING_LEFT,
+ PADDING_BOTTOM$4 = _enums$STYLE_KEY$k.PADDING_BOTTOM,
+ BORDER_TOP_WIDTH$6 = _enums$STYLE_KEY$k.BORDER_TOP_WIDTH,
+ BORDER_LEFT_WIDTH$a = _enums$STYLE_KEY$k.BORDER_LEFT_WIDTH,
+ BORDER_BOTTOM_WIDTH$6 = _enums$STYLE_KEY$k.BORDER_BOTTOM_WIDTH,
+ POINTER_EVENTS$2 = _enums$STYLE_KEY$k.POINTER_EVENTS,
_enums$UPDATE_KEY$5 = enums.UPDATE_KEY,
UPDATE_NODE$5 = _enums$UPDATE_KEY$5.UPDATE_NODE,
UPDATE_STYLE$2 = _enums$UPDATE_KEY$5.UPDATE_STYLE,
UPDATE_KEYS$2 = _enums$UPDATE_KEY$5.UPDATE_KEYS,
UPDATE_COMPONENT = _enums$UPDATE_KEY$5.UPDATE_COMPONENT,
UPDATE_FOCUS$4 = _enums$UPDATE_KEY$5.UPDATE_FOCUS,
- UPDATE_MEASURE$2 = _enums$UPDATE_KEY$5.UPDATE_MEASURE,
UPDATE_OVERWRITE$1 = _enums$UPDATE_KEY$5.UPDATE_OVERWRITE,
UPDATE_LIST = _enums$UPDATE_KEY$5.UPDATE_LIST,
UPDATE_CONFIG$5 = _enums$UPDATE_KEY$5.UPDATE_CONFIG,
@@ -34405,7 +34647,7 @@ var isNil$9 = util.isNil,
var AUTO$8 = o.AUTO,
PX$b = o.PX,
PERCENT$c = o.PERCENT,
- INHERIT$5 = o.INHERIT;
+ INHERIT$4 = o.INHERIT;
var isRelativeOrAbsolute$2 = css.isRelativeOrAbsolute,
equalStyle$1 = css.equalStyle;
var contain$3 = o$3.contain,
@@ -34418,8 +34660,7 @@ var contain$3 = o$3.contain,
REFLOW$2 = o$3.REFLOW,
REBUILD = o$3.REBUILD;
var isIgnore = o$2.isIgnore,
- isGeom$2 = o$2.isGeom,
- isMeasure = o$2.isMeasure;
+ isGeom$2 = o$2.isGeom;
var ROOT_DOM_NAME = {
canvas: 'canvas',
svg: 'svg',
@@ -34552,7 +34793,7 @@ function setLAYOUT(node, hash, component, addDom) {
function checkInfluence(root, reflowHash, node, component, addDom) {
// add情况abs节点特殊对待不影响其它节点,不能判断display,因为inline会强制block
- if (addDom && node.currentStyle[POSITION$4] === 'absolute') {
+ if (addDom && node.currentStyle[POSITION$5] === 'absolute') {
return;
}
@@ -34572,7 +34813,7 @@ function checkInfluence(root, reflowHash, node, component, addDom) {
} // 遇到absolute跳出,设置其布局;如果absolute不变化普通处理,如果absolute发生变化,一定会存在于列表中,不用考虑
- if (target.currentStyle[POSITION$4] === 'absolute' || target.computedStyle[POSITION$4] === 'absolute') {
+ if (target.currentStyle[POSITION$5] === 'absolute' || target.computedStyle[POSITION$5] === 'absolute') {
setLAYOUT(target, reflowHash, component, addDom);
return;
}
@@ -34607,7 +34848,7 @@ function checkInfluence(root, reflowHash, node, component, addDom) {
} // 遇到absolute跳出,如果absolute不变化普通处理,如果absolute发生变化,一定会存在于列表中,不用考虑
- if (parent.currentStyle[POSITION$4] === 'absolute' || parent.computedStyle[POSITION$4] === 'absolute') {
+ if (parent.currentStyle[POSITION$5] === 'absolute' || parent.computedStyle[POSITION$5] === 'absolute') {
break;
} // 父固定宽高跳出
@@ -34632,7 +34873,7 @@ function checkInfluence(root, reflowHash, node, component, addDom) {
while (parent) {
// 无论新老absolute,不变化则设置,变化一定会出现在列表中
- if (parent.currentStyle[POSITION$4] === 'absolute' || parent.computedStyle[POSITION$4] === 'absolute') {
+ if (parent.currentStyle[POSITION$5] === 'absolute' || parent.computedStyle[POSITION$5] === 'absolute') {
if (parent === root) {
break;
} // 固定尺寸的不用设置,需要跳出循环
@@ -34678,13 +34919,12 @@ function checkInfluence(root, reflowHash, node, component, addDom) {
var uniqueUpdateId = 0;
-function parseUpdate(renderMode, root, target, reflowList, measureList, cacheHash, cacheList, zHash, zList) {
+function parseUpdate(renderMode, root, target, reflowList, cacheHash, cacheList, zHash, zList) {
var node = target[UPDATE_NODE$5],
style = target[UPDATE_STYLE$2],
overwrite = target[UPDATE_OVERWRITE$1],
focus = target[UPDATE_FOCUS$4],
component = target[UPDATE_COMPONENT],
- measure = target[UPDATE_MEASURE$2],
list = target[UPDATE_LIST],
keys = target[UPDATE_KEYS$2],
__config = target[UPDATE_CONFIG$5],
@@ -34743,7 +34983,6 @@ function parseUpdate(renderMode, root, target, reflowList, measureList, cacheHas
domParent = __config[NODE_DOM_PARENT$6],
isMask = __config[NODE_IS_MASK$3];
var lv = focus || NONE$3;
- var hasMeasure = measure;
var hasZ, hasVisibility, hasColor, hasDisplay; // component无需遍历直接赋值,img重新加载等情况没有样式更新
if (!component && style && keys) {
@@ -34767,7 +35006,7 @@ function parseUpdate(renderMode, root, target, reflowList, measureList, cacheHas
} else {
// TRBL变化只对relative/absolute起作用,其它忽视
if (DIRECTION_HASH.hasOwnProperty(k)) {
- var position = currentStyle[POSITION$4];
+ var position = currentStyle[POSITION$5];
if (position !== 'relative' && position !== 'absolute') {
delete style[k];
@@ -34778,12 +35017,7 @@ function parseUpdate(renderMode, root, target, reflowList, measureList, cacheHas
} // repaint细化等级,reflow在checkReflow()
- lv |= getLevel(k);
-
- if (isMeasure(k)) {
- hasMeasure = true;
- } // repaint置空,如果reflow会重新生成空的
-
+ lv |= getLevel(k); // repaint置空,如果reflow会重新生成空的
__cacheStyle[k] = undefined;
currentStyle[k] = v;
@@ -34796,7 +35030,7 @@ function parseUpdate(renderMode, root, target, reflowList, measureList, cacheHas
hasVisibility = true;
}
- if (k === COLOR$5) {
+ if (k === COLOR$6) {
hasColor = true;
}
}
@@ -34834,11 +35068,11 @@ function parseUpdate(renderMode, root, target, reflowList, measureList, cacheHas
var _need = void 0; // text的style指向parent,因此text一定变更
- if (hasVisibility && (_node instanceof Text || _currentStyle[VISIBILITY$6][1] === INHERIT$5)) {
+ if (hasVisibility && (_node instanceof Text || _currentStyle[VISIBILITY$6][1] === INHERIT$4)) {
_need = true;
}
- if (hasColor && (_node instanceof Text || _currentStyle[COLOR$5][1] === INHERIT$5)) {
+ if (hasColor && (_node instanceof Text || _currentStyle[COLOR$6][1] === INHERIT$4)) {
_need = true;
}
@@ -34879,7 +35113,7 @@ function parseUpdate(renderMode, root, target, reflowList, measureList, cacheHas
computedStyle[DISPLAY$8] = 'none';
return;
}
- } // reflow/repaint/measure相关的记录下来
+ } // reflow/repaint相关的记录下来
var isRp = !component && isRepaint(lv);
@@ -34907,11 +35141,7 @@ function parseUpdate(renderMode, root, target, reflowList, measureList, cacheHas
component: component,
addDom: addDom,
removeDom: removeDom
- }); // measure需要提前先处理
-
- if (hasMeasure) {
- measureList.push(node);
- }
+ });
} // 这里也需|运算,每次刷新会置0,但是如果父元素进行继承变更,会在此元素分析前更改,比如visibility,此时不能直接赋值
@@ -35289,15 +35519,10 @@ var Root = /*#__PURE__*/function (_Dom) {
if (isFirst) {
this.__checkRoot(renderMode, width, height);
-
- this.__computeMeasure(renderMode, ctx);
} // 非首次刷新如果没有更新则无需继续
else if (!this.__checkUpdate(renderMode, ctx, width, height)) {
return;
- } // 获取所有字体和大小测量,仅svg需要,canvas直接做
-
-
- inject.measureText();
+ }
this.__checkReflow(width, height);
@@ -35528,7 +35753,6 @@ var Root = /*#__PURE__*/function (_Dom) {
res[UPDATE_NODE$5] = sr;
res[UPDATE_STYLE$2] = sr.currentStyle;
res[UPDATE_FOCUS$4] = REFLOW$2;
- res[UPDATE_MEASURE$2] = true;
res[UPDATE_COMPONENT] = cp;
res[UPDATE_CONFIG$5] = sr.__config;
@@ -35637,8 +35861,8 @@ var Root = /*#__PURE__*/function (_Dom) {
} // 同理position不能为absolute
- if (currentStyle[POSITION$4] === 'absolute') {
- computedStyle[POSITION$4] = currentStyle[POSITION$4] = 'static';
+ if (currentStyle[POSITION$5] === 'absolute') {
+ computedStyle[POSITION$5] = currentStyle[POSITION$5] = 'static';
} // 根节点满宽高
@@ -35676,10 +35900,6 @@ var Root = /*#__PURE__*/function (_Dom) {
if (updateHash) {
if (o[UPDATE_FOCUS$4]) {
updateHash[UPDATE_FOCUS$4] |= o[UPDATE_FOCUS$4];
- }
-
- if (o[UPDATE_MEASURE$2]) {
- updateHash[UPDATE_MEASURE$2] = true;
} // 后续存在新建list上,需增加遍历逻辑
@@ -35701,10 +35921,6 @@ var Root = /*#__PURE__*/function (_Dom) {
if (o[UPDATE_FOCUS$4]) {
target[UPDATE_FOCUS$4] |= o[UPDATE_FOCUS$4];
- }
-
- if (o[UPDATE_MEASURE$2]) {
- target[UPDATE_MEASURE$2] = true;
} // 后续存在新建list上,需增加遍历逻辑
@@ -35728,7 +35944,6 @@ var Root = /*#__PURE__*/function (_Dom) {
key: "__checkUpdate",
value: function __checkUpdate(renderMode, ctx, width, height) {
var root = this;
- var measureList = [];
var reflowList = [];
var cacheHash = {};
var cacheList = [];
@@ -35742,7 +35957,7 @@ var Root = /*#__PURE__*/function (_Dom) {
if (updateRoot) {
root.__updateRoot = null;
- hasUpdate = parseUpdate(renderMode, root, updateRoot, reflowList, measureList, cacheHash, cacheList); // 此时做root检查,防止root出现继承等无效样式,或者发生resize()
+ hasUpdate = parseUpdate(renderMode, root, updateRoot, reflowList, cacheHash, cacheList); // 此时做root检查,防止root出现继承等无效样式,或者发生resize()
if (hasUpdate) {
root.__checkRoot(renderMode, width, height);
@@ -35753,7 +35968,7 @@ var Root = /*#__PURE__*/function (_Dom) {
var keys = Object.keys(updateHash);
for (var i = 0, len = keys.length; i < len; i++) {
- var t = parseUpdate(renderMode, root, updateHash[keys[i]], reflowList, measureList, cacheHash, cacheList, zHash, zList);
+ var t = parseUpdate(renderMode, root, updateHash[keys[i]], reflowList, cacheHash, cacheList, zHash, zList);
hasUpdate = hasUpdate || t;
} // 先做一部分reset避免下面measureList干扰,cacheList的是专门收集新增的额外节点
@@ -35771,66 +35986,6 @@ var Root = /*#__PURE__*/function (_Dom) {
item.__updateStruct(root.__structs);
}
- });
- /**
- * 遍历每项节点,计算测量信息,节点向上向下查找继承信息,如果parent也是继承,先计算parent的
- * 过程中可能会出现重复,因此节点上记录一个临时标防止重复递归
- */
-
- var measureHash = {};
- measureList.forEach(function (node) {
- var _node$__config = node.__config,
- __uniqueUpdateId = _node$__config[NODE_UNIQUE_UPDATE_ID],
- parent = _node$__config[NODE_DOM_PARENT$6]; // 在root下的component变更时root会进入,但其没有__uniqueUpdateId
-
- if (node !== root) {
- if (measureHash.hasOwnProperty(__uniqueUpdateId)) {
- return;
- }
-
- measureHash[__uniqueUpdateId] = true;
- }
-
- var last = node; // 检查measure的属性是否是inherit,在root下的component变更时root会进入,但其没有__uniqueUpdateId
- // 另外dom标识表明有dom变更强制进入
-
- var isInherit = node !== root && (updateHash[__uniqueUpdateId][UPDATE_ADD_DOM$1] || o$2.isMeasureInherit(updateHash[__uniqueUpdateId][UPDATE_STYLE$2])); // 是inherit,需要向上查找,从顶部向下递归计算继承信息
-
- if (isInherit) {
- while (parent && parent !== root) {
- var _parent = parent,
- _uniqueUpdateId = _parent.__config[NODE_UNIQUE_UPDATE_ID],
- currentStyle = _parent.currentStyle;
-
- var _isInherit = void 0;
-
- if (parent.__config.hasOwnProperty(NODE_UNIQUE_UPDATE_ID)) {
- var style = updateHash[_uniqueUpdateId][UPDATE_STYLE$2];
- measureHash[_uniqueUpdateId] = true;
- var temp = o$2.measureInheritList(style);
- _isInherit = !!temp.length;
- } else {
- _isInherit = o$2.isMeasureInherit(currentStyle);
- } // 如果parent有inherit存入列表且继续向上,否则跳出循环
-
-
- if (_isInherit) {
- last = parent;
- } else {
- break;
- } // 考虑component下的继续往上继承
-
-
- parent = parent.domParent;
- }
- } // 自顶向下查找inherit的,利用已有的方法+回调,当递归包含重复时标记防止重复
-
-
- last.__computeMeasure(renderMode, ctx, function (target) {
- if (target.__config.hasOwnProperty(NODE_UNIQUE_UPDATE_ID)) {
- measureHash[target.__config[NODE_UNIQUE_UPDATE_ID]] = true;
- }
- });
}); // 做完清空留待下次刷新重来
for (var _i3 = 0, _len2 = keys.length; _i3 < _len2; _i3++) {
@@ -35979,10 +36134,10 @@ var Root = /*#__PURE__*/function (_Dom) {
var cps = node.computedStyle,
cts = node.currentStyle;
var zIndex = cps[Z_INDEX$4],
- position = cps[POSITION$4],
+ position = cps[POSITION$5],
display = cps[DISPLAY$8];
var isLastAbs = position === 'absolute';
- var isNowAbs = cts[POSITION$4] === 'absolute';
+ var isNowAbs = cts[POSITION$5] === 'absolute';
var isLastNone = display === 'none';
var isNowNone = cts[DISPLAY$8] === 'none'; // none不可见布局无效可以无视
@@ -36008,7 +36163,7 @@ var Root = /*#__PURE__*/function (_Dom) {
var hasFlowPrev;
while (ref) {
- if (ref instanceof Text || ref.computedStyle[POSITION$4] !== 'absolute' && ref.computedStyle[DISPLAY$8] !== 'none') {
+ if (ref instanceof Text || ref.computedStyle[POSITION$5] !== 'absolute' && ref.computedStyle[DISPLAY$8] !== 'none') {
y = ref.y + ref.outerHeight;
hasFlowPrev = true;
break;
@@ -36023,7 +36178,7 @@ var Root = /*#__PURE__*/function (_Dom) {
y += computedStyle[MARGIN_TOP$2] + computedStyle[BORDER_TOP_WIDTH$6] + computedStyle[PADDING_TOP$4];
}
- x += computedStyle[MARGIN_LEFT$6] + computedStyle[BORDER_LEFT_WIDTH$9] + computedStyle[PADDING_LEFT$8];
+ x += computedStyle[MARGIN_LEFT$7] + computedStyle[BORDER_LEFT_WIDTH$a] + computedStyle[PADDING_LEFT$9];
} // 找到最上层容器,如果是组件的子节点,以sr为container,sr本身往上找
@@ -36076,7 +36231,7 @@ var Root = /*#__PURE__*/function (_Dom) {
diffI += _arr[1];
diffList.push(_arr);
- if (position !== cts[POSITION$4] && (position === 'static' || cts[POSITION$4] === 'static') || zIndex !== cts[Z_INDEX$4]) {
+ if (position !== cts[POSITION$5] && (position === 'static' || cts[POSITION$5] === 'static') || zIndex !== cts[Z_INDEX$4]) {
parent.__updateStruct(root.__structs);
if (_this5.renderMode === mode.SVG) {
@@ -36155,7 +36310,7 @@ var Root = /*#__PURE__*/function (_Dom) {
p = p.domParent;
computedStyle = p.computedStyle;
- if (computedStyle[POSITION$4] === 'relative') {
+ if (computedStyle[POSITION$5] === 'relative') {
var _p = p,
ox = _p.ox,
oy = _p.oy;
@@ -36173,7 +36328,7 @@ var Root = /*#__PURE__*/function (_Dom) {
var next = node.next;
while (next && !next.hasOwnProperty('__uniqueReflowId')) {
- if (next.computedStyle[POSITION$4] === 'absolute') {
+ if (next.computedStyle[POSITION$5] === 'absolute') {
next = next.next;
continue;
}
@@ -36193,7 +36348,7 @@ var Root = /*#__PURE__*/function (_Dom) {
var cs = target.computedStyle;
- if (cs[POSITION$4] !== 'absolute' && cs[DISPLAY$8] !== 'none') {
+ if (cs[POSITION$5] !== 'absolute' && cs[DISPLAY$8] !== 'none') {
target.__offsetY(_diff, true, REPAINT$3);
}
@@ -36227,7 +36382,7 @@ var Root = /*#__PURE__*/function (_Dom) {
diffI += _arr4[1];
diffList.push(_arr4);
- if (position !== cts[POSITION$4] && (position === 'static' || cts[POSITION$4] === 'static') || zIndex !== cts[Z_INDEX$4]) {
+ if (position !== cts[POSITION$5] && (position === 'static' || cts[POSITION$5] === 'static') || zIndex !== cts[Z_INDEX$4]) {
node.domParent.__updateStruct(root.__structs);
if (_this5.renderMode === mode.SVG) {
@@ -36364,7 +36519,7 @@ var Root = /*#__PURE__*/function (_Dom) {
var cs = parent.currentStyle;
var height = cs[HEIGHT$8];
- var isContainer = parent === root || parent.isShadowRoot || cs[POSITION$4] === 'absolute' || cs[POSITION$4] === 'relative';
+ var isContainer = parent === root || parent.isShadowRoot || cs[POSITION$5] === 'absolute' || cs[POSITION$5] === 'relative';
if (height[1] === AUTO$8 && lastChild) {
var oldH = parent.height + parent.computedStyle[PADDING_TOP$4];
@@ -36400,7 +36555,7 @@ var Root = /*#__PURE__*/function (_Dom) {
var _cs2 = _isXom && target.currentStyle;
- var isAbs = _isXom && _cs2[POSITION$4] === 'absolute';
+ var isAbs = _isXom && _cs2[POSITION$5] === 'absolute';
if (!isAbs) {
var y = target.y + target.outerHeight;
@@ -36439,7 +36594,7 @@ var Root = /*#__PURE__*/function (_Dom) {
var _cs3 = container.currentStyle;
- if (_cs3[POSITION$4] === 'absolute' || _cs3[POSITION$4] === 'relative') {
+ if (_cs3[POSITION$5] === 'absolute' || _cs3[POSITION$5] === 'relative') {
break;
}
@@ -36471,7 +36626,7 @@ var Root = /*#__PURE__*/function (_Dom) {
var _cs4 = container.currentStyle;
- if (_cs4[POSITION$4] === 'absolute' || _cs4[POSITION$4] === 'relative') {
+ if (_cs4[POSITION$5] === 'absolute' || _cs4[POSITION$5] === 'relative') {
break;
}
@@ -36510,7 +36665,7 @@ var Root = /*#__PURE__*/function (_Dom) {
var _cs5 = _isXom2 && _target.currentStyle;
- var _isAbs = _isXom2 && _cs5[POSITION$4] === 'absolute';
+ var _isAbs = _isXom2 && _cs5[POSITION$5] === 'absolute';
if (!_isAbs) {
var _y = _target.y + _target.outerHeight;
@@ -36572,15 +36727,6 @@ var Root = /*#__PURE__*/function (_Dom) {
reflow.clearUniqueReflowId(reflowHash);
}
- } // 特殊覆盖方法,不需要super()计算自己,因为无需第3个参数cb且自己是root
-
- }, {
- key: "__computeMeasure",
- value: function __computeMeasure(renderMode, ctx) {
- css.computeMeasure(this, true);
- this.children.forEach(function (item) {
- item.__computeMeasure(renderMode, ctx);
- });
} // 每个root拥有一个刷新hook,多个root塞到frame的__hookTask里
// frame在所有的帧刷新逻辑执行后检查hook列表,进行root刷新操作
@@ -36667,11 +36813,11 @@ var Root = /*#__PURE__*/function (_Dom) {
return Root;
}(Dom$1);
-var _enums$STYLE_KEY$k = enums.STYLE_KEY,
- STROKE_WIDTH$2 = _enums$STYLE_KEY$k.STROKE_WIDTH,
- BOX_SHADOW$4 = _enums$STYLE_KEY$k.BOX_SHADOW,
- FONT_SIZE$c = _enums$STYLE_KEY$k.FONT_SIZE,
- FILTER$7 = _enums$STYLE_KEY$k.FILTER;
+var _enums$STYLE_KEY$l = enums.STYLE_KEY,
+ STROKE_WIDTH$2 = _enums$STYLE_KEY$l.STROKE_WIDTH,
+ BOX_SHADOW$4 = _enums$STYLE_KEY$l.BOX_SHADOW,
+ FONT_SIZE$d = _enums$STYLE_KEY$l.FONT_SIZE,
+ FILTER$7 = _enums$STYLE_KEY$l.FILTER;
var isNil$a = util.isNil;
var REM$b = o.REM,
VW$b = o.VW,
@@ -37241,7 +37387,7 @@ var Line = /*#__PURE__*/function (_Geom) {
var half = 0;
strokeWidth.forEach(function (item) {
if (item[1] === REM$b) {
- half = Math.max(item[0] * root.computedStyle[FONT_SIZE$c], half);
+ half = Math.max(item[0] * root.computedStyle[FONT_SIZE$d], half);
} else if (item[1] === VW$b) {
half = Math.max(item[0] * root.width * 0.01, half);
} else if (item[1] === VH$b) {
@@ -37333,11 +37479,11 @@ var Line = /*#__PURE__*/function (_Geom) {
return Line;
}(Geom$1);
-var _enums$STYLE_KEY$l = enums.STYLE_KEY,
- STROKE_WIDTH$3 = _enums$STYLE_KEY$l.STROKE_WIDTH,
- BOX_SHADOW$5 = _enums$STYLE_KEY$l.BOX_SHADOW,
- FONT_SIZE$d = _enums$STYLE_KEY$l.FONT_SIZE,
- FILTER$8 = _enums$STYLE_KEY$l.FILTER;
+var _enums$STYLE_KEY$m = enums.STYLE_KEY,
+ STROKE_WIDTH$3 = _enums$STYLE_KEY$m.STROKE_WIDTH,
+ BOX_SHADOW$5 = _enums$STYLE_KEY$m.BOX_SHADOW,
+ FONT_SIZE$e = _enums$STYLE_KEY$m.FONT_SIZE,
+ FILTER$8 = _enums$STYLE_KEY$m.FILTER;
var isNil$b = util.isNil;
var REM$c = o.REM,
VW$c = o.VW,
@@ -37895,7 +38041,7 @@ var Polyline = /*#__PURE__*/function (_Geom) {
var half = 0;
strokeWidth.forEach(function (item) {
if (item[1] === REM$c) {
- half = Math.max(item[0] * root.computedStyle[FONT_SIZE$d], half);
+ half = Math.max(item[0] * root.computedStyle[FONT_SIZE$e], half);
} else if (item[1] === VW$c) {
half = Math.max(item[0] * root.width * 0.01, half);
} else if (item[1] === VH$c) {
@@ -38139,11 +38285,11 @@ var Polygon = /*#__PURE__*/function (_Polyline) {
return Polygon;
}(Polyline);
-var _enums$STYLE_KEY$m = enums.STYLE_KEY,
- STROKE_WIDTH$4 = _enums$STYLE_KEY$m.STROKE_WIDTH,
- BOX_SHADOW$6 = _enums$STYLE_KEY$m.BOX_SHADOW,
- FONT_SIZE$e = _enums$STYLE_KEY$m.FONT_SIZE,
- FILTER$9 = _enums$STYLE_KEY$m.FILTER;
+var _enums$STYLE_KEY$n = enums.STYLE_KEY,
+ STROKE_WIDTH$4 = _enums$STYLE_KEY$n.STROKE_WIDTH,
+ BOX_SHADOW$6 = _enums$STYLE_KEY$n.BOX_SHADOW,
+ FONT_SIZE$f = _enums$STYLE_KEY$n.FONT_SIZE,
+ FILTER$9 = _enums$STYLE_KEY$n.FILTER;
var isNil$c = util.isNil;
var sectorPoints$1 = geom.sectorPoints;
var REM$d = o.REM,
@@ -38560,7 +38706,7 @@ var Sector = /*#__PURE__*/function (_Geom) {
var half = 0;
strokeWidth.forEach(function (item) {
if (item[1] === REM$d) {
- half = Math.max(item[0] * root.computedStyle[FONT_SIZE$e], half);
+ half = Math.max(item[0] * root.computedStyle[FONT_SIZE$f], half);
} else if (item[1] === VW$d) {
half = Math.max(item[0] * root.width * 0.01, half);
} else if (item[1] === VH$d) {
@@ -38603,11 +38749,11 @@ var Sector = /*#__PURE__*/function (_Geom) {
return Sector;
}(Geom$1);
-var _enums$STYLE_KEY$n = enums.STYLE_KEY,
- STROKE_WIDTH$5 = _enums$STYLE_KEY$n.STROKE_WIDTH,
- BOX_SHADOW$7 = _enums$STYLE_KEY$n.BOX_SHADOW,
- FONT_SIZE$f = _enums$STYLE_KEY$n.FONT_SIZE,
- FILTER$a = _enums$STYLE_KEY$n.FILTER;
+var _enums$STYLE_KEY$o = enums.STYLE_KEY,
+ STROKE_WIDTH$5 = _enums$STYLE_KEY$o.STROKE_WIDTH,
+ BOX_SHADOW$7 = _enums$STYLE_KEY$o.BOX_SHADOW,
+ FONT_SIZE$g = _enums$STYLE_KEY$o.FONT_SIZE,
+ FILTER$a = _enums$STYLE_KEY$o.FILTER;
var isNil$d = util.isNil;
var REM$e = o.REM,
VW$e = o.VW,
@@ -38776,7 +38922,7 @@ var Rect = /*#__PURE__*/function (_Geom) {
var half = 0;
strokeWidth.forEach(function (item) {
if (item[1] === REM$e) {
- half = Math.max(item[0] * root.computedStyle[FONT_SIZE$f], half);
+ half = Math.max(item[0] * root.computedStyle[FONT_SIZE$g], half);
} else if (item[1] === VW$e) {
half = Math.max(item[0] * root.width * 0.01, half);
} else if (item[1] === VH$e) {
@@ -38815,11 +38961,11 @@ var Rect = /*#__PURE__*/function (_Geom) {
return Rect;
}(Geom$1);
-var _enums$STYLE_KEY$o = enums.STYLE_KEY,
- STROKE_WIDTH$6 = _enums$STYLE_KEY$o.STROKE_WIDTH,
- BOX_SHADOW$8 = _enums$STYLE_KEY$o.BOX_SHADOW,
- FONT_SIZE$g = _enums$STYLE_KEY$o.FONT_SIZE,
- FILTER$b = _enums$STYLE_KEY$o.FILTER;
+var _enums$STYLE_KEY$p = enums.STYLE_KEY,
+ STROKE_WIDTH$6 = _enums$STYLE_KEY$p.STROKE_WIDTH,
+ BOX_SHADOW$8 = _enums$STYLE_KEY$p.BOX_SHADOW,
+ FONT_SIZE$h = _enums$STYLE_KEY$p.FONT_SIZE,
+ FILTER$b = _enums$STYLE_KEY$p.FILTER;
var isNil$e = util.isNil;
var REM$f = o.REM,
VW$f = o.VW,
@@ -38950,7 +39096,7 @@ var Circle = /*#__PURE__*/function (_Geom) {
var half = 0;
strokeWidth.forEach(function (item) {
if (item[1] === REM$f) {
- half = Math.max(item[0] * root.computedStyle[FONT_SIZE$g], half);
+ half = Math.max(item[0] * root.computedStyle[FONT_SIZE$h], half);
} else if (item[1] === VW$f) {
half = Math.max(item[0] * root.width * 0.01, half);
} else if (item[1] === VH$f) {
@@ -38993,11 +39139,11 @@ var Circle = /*#__PURE__*/function (_Geom) {
return Circle;
}(Geom$1);
-var _enums$STYLE_KEY$p = enums.STYLE_KEY,
- STROKE_WIDTH$7 = _enums$STYLE_KEY$p.STROKE_WIDTH,
- BOX_SHADOW$9 = _enums$STYLE_KEY$p.BOX_SHADOW,
- FONT_SIZE$h = _enums$STYLE_KEY$p.FONT_SIZE,
- FILTER$c = _enums$STYLE_KEY$p.FILTER;
+var _enums$STYLE_KEY$q = enums.STYLE_KEY,
+ STROKE_WIDTH$7 = _enums$STYLE_KEY$q.STROKE_WIDTH,
+ BOX_SHADOW$9 = _enums$STYLE_KEY$q.BOX_SHADOW,
+ FONT_SIZE$i = _enums$STYLE_KEY$q.FONT_SIZE,
+ FILTER$c = _enums$STYLE_KEY$q.FILTER;
var isNil$f = util.isNil;
var REM$g = o.REM,
VW$g = o.VW,
@@ -39181,7 +39327,7 @@ var Ellipse = /*#__PURE__*/function (_Geom) {
var half = 0;
strokeWidth.forEach(function (item) {
if (item[1] === REM$g) {
- half = Math.max(item[0] * root.computedStyle[FONT_SIZE$h], half);
+ half = Math.max(item[0] * root.computedStyle[FONT_SIZE$i], half);
} else if (item[1] === VW$g) {
half = Math.max(item[0] * root.width * 0.01, half);
} else if (item[1] === VH$g) {
@@ -39777,7 +39923,7 @@ var o$4 = {
tagName = _json.tagName;
if (['canvas', 'svg', 'webgl'].indexOf(tagName) === -1) {
- throw new Error('Parse dom must be canvas/svg');
+ throw new Error('Parse dom must be canvas/svg/webgl');
} // parse直接(非递归)的动画记录
@@ -39871,20 +40017,19 @@ var o$4 = {
var a = list1.length,
b = list2.length,
c = list3.length;
+ var count = 0;
- if (a || b || c) {
- var count = 0;
-
- var cb = function cb() {
- if (count === a + b + c) {
- var res = o$4.parse(karas, json, dom, options);
+ var cb = function cb() {
+ if (count === a + b + c) {
+ var res = o$4.parse(karas, json, dom, options);
- if (options && util.isFunction(options.callback)) {
- options.callback(res);
- }
+ if (options && util.isFunction(options.callback)) {
+ options.callback(res);
}
- };
+ }
+ };
+ if (a || b || c) {
karas.inject.loadFont(list1, function () {
count += a;
cb();
@@ -39908,13 +40053,7 @@ var o$4 = {
cb();
});
} else {
- var res = o$4.parse(karas, json, dom, options);
-
- if (options && util.isFunction(options.callback)) {
- options.callback(res);
- }
-
- return res;
+ cb();
}
},
abbr: abbr$1
@@ -39943,7 +40082,7 @@ var refresh = {
Cache: Cache
};
-var version = "0.70.2";
+var version = "0.71.0";
Geom$1.register('$line', Line);
Geom$1.register('$polyline', Polyline);
@@ -39956,7 +40095,7 @@ var karas$1 = {
version: version,
render: function render(root, dom) {
if (!(root instanceof Root)) {
- throw new Error('Render dom must be canvas/svg');
+ throw new Error('Render dom must be canvas/svg/webgl');
}
if (dom) {
diff --git a/index.es.js.map b/index.es.js.map
index 545dc86db..f5a64c56f 100644
--- a/index.es.js.map
+++ b/index.es.js.map
@@ -1 +1 @@
-{"version":3,"file":"index.es.js","sources":["src/util/enums.js","src/node/Node.js","src/refresh/mode.js","src/style/unit.js","src/style/font.js","src/style/reg.js","src/math/matrix.js","src/math/vector.js","src/math/geom.js","src/math/gradient.js","src/util/painter.js","src/style/border.js","src/util/$$type.js","src/util/util.js","src/util/debug.js","src/node/textCache.js","src/gl/ca.js","src/gl/webgl.js","src/util/inject.js","src/style/gradient.js","src/style/reset.js","src/style/abbr.js","src/animate/key.js","src/refresh/change.js","src/style/css.js","src/node/TextBox.js","src/refresh/Page.js","src/math/tar.js","src/math/martinez.js","src/math/index.js","src/style/transform.js","src/math/blur.js","src/refresh/Cache.js","src/refresh/level.js","src/node/Text.js","src/util/flatten.js","src/util/builder.js","src/util/Event.js","src/node/Component.js","src/style/image.js","src/style/bg.js","src/animate/frame.js","src/animate/easing.js","src/animate/Animation.js","src/style/bs.js","src/style/mbm.js","src/node/inline.js","src/node/Xom.js","src/node/LineBox.js","src/node/LineBoxManager.js","src/node/tag.js","src/refresh/reflow.js","src/node/Dom.js","src/node/Img.js","src/node/Defs.js","src/node/geom/Geom.js","src/util/updater.js","src/util/diff.js","src/animate/Controller.js","src/refresh/offscreen.js","src/gl/MockPage.js","src/gl/MockCache.js","src/refresh/struct.js","src/gl/TexCache.js","src/node/Root.js","src/node/geom/Line.js","src/node/geom/Polyline.js","src/node/geom/Polygon.js","src/node/geom/Sector.js","src/node/geom/Rect.js","src/node/geom/Circle.js","src/node/geom/Ellipse.js","src/parser/abbr.js","src/parser/parse.js","src/parser/index.js","src/style/index.js","src/animate/index.js","src/refresh/index.js","src/index.js"],"sourcesContent":["const STYLE_KEY = {\n POSITION: 0,\n DISPLAY: 1,\n TOP: 2,\n RIGHT: 3,\n BOTTOM: 4,\n LEFT: 5,\n MARGIN_TOP: 6,\n MARGIN_RIGHT: 7,\n MARGIN_BOTTOM: 8,\n MARGIN_LEFT: 9,\n PADDING_TOP: 10,\n PADDING_RIGHT: 11,\n PADDING_BOTTOM: 12,\n PADDING_LEFT: 13,\n FONT_SIZE: 14,\n FONT_FAMILY: 15,\n COLOR: 16,\n FONT_STYLE: 17,\n FONT_WEIGHT: 18,\n LINE_HEIGHT: 19,\n BACKGROUND_IMAGE: 20,\n BACKGROUND_COLOR: 21,\n BACKGROUND_SIZE: 22,\n BACKGROUND_REPEAT: 23,\n BACKGROUND_POSITION_X: 24,\n BACKGROUND_POSITION_Y: 25,\n BORDER_TOP_WIDTH: 26,\n BORDER_RIGHT_WIDTH: 27,\n BORDER_BOTTOM_WIDTH: 28,\n BORDER_LEFT_WIDTH: 29,\n BORDER_TOP_COLOR: 30,\n BORDER_RIGHT_COLOR: 31,\n BORDER_BOTTOM_COLOR: 32,\n BORDER_LEFT_COLOR: 33,\n BORDER_TOP_STYLE: 34,\n BORDER_RIGHT_STYLE: 35,\n BORDER_BOTTOM_STYLE: 36,\n BORDER_LEFT_STYLE: 37,\n BORDER_TOP_LEFT_RADIUS: 38,\n BORDER_TOP_RIGHT_RADIUS: 39,\n BORDER_BOTTOM_RIGHT_RADIUS: 40,\n BORDER_BOTTOM_LEFT_RADIUS: 41,\n WIDTH: 42,\n HEIGHT: 43,\n FLEX_GROW: 44,\n FLEX_SHRINK: 45,\n FLEX_BASIS: 46,\n FLEX_DIRECTION: 47,\n JUSTIFY_CONTENT: 48,\n ALIGN_ITEMS: 49,\n ALIGN_SELF: 50,\n TEXT_ALIGN: 51,\n TRANSFORM_ORIGIN: 52,\n VISIBILITY: 53,\n OPACITY: 54,\n Z_INDEX: 55,\n TRANSFORM: 56,\n TRANSLATE_X: 57,\n TRANSLATE_Y: 58,\n TRANSLATE_Z: 59,\n SCALE_X: 60,\n SCALE_Y: 61,\n SCALE_Z: 62,\n SKEW_X: 63,\n SKEW_Y: 64,\n ROTATE_X: 65,\n ROTATE_Y: 66,\n ROTATE_Z: 67,\n ROTATE_3D: 68,\n PERSPECTIVE: 69,\n PERSPECTIVE_ORIGIN: 70,\n FILTER: 71,\n BOX_SHADOW: 72,\n POINTER_EVENTS: 73,\n OVERFLOW: 74,\n MIX_BLEND_MODE: 75,\n BACKGROUND_CLIP: 76,\n WHITE_SPACE: 77,\n TEXT_OVERFLOW: 78,\n LETTER_SPACING: 79,\n LINE_CLAMP: 80,\n ORDER: 81,\n FLEX_WRAP: 82,\n ALIGN_CONTENT: 83,\n TEXT_STROKE_WIDTH: 84,\n TEXT_STROKE_COLOR: 85,\n TEXT_STROKE_OVER: 86,\n // GEOM\n FILL: 87,\n STROKE: 88,\n STROKE_WIDTH: 89,\n STROKE_DASHARRAY: 90,\n STROKE_DASHARRAY_STR: 91,\n STROKE_LINECAP: 92,\n STROKE_LINEJOIN: 93,\n STROKE_MITERLIMIT: 94,\n FILL_RULE: 95,\n // 无此样式,仅cache或特殊情况需要\n MATRIX: 96,\n BORDER_TOP: 97,\n BORDER_RIGHT: 98,\n BORDER_BOTTOM: 99,\n BORDER_LEFT: 100,\n TRANSLATE_PATH: 101,\n};\n\nconst STYLE2LOWER_MAP = {};\nfunction style2Lower(s) {\n STYLE2LOWER_MAP[s] = STYLE2LOWER_MAP[s] || s.toLowerCase().replace(/_([a-z])/g, function($0, $1) {\n return $1.toUpperCase();\n });\n\n return STYLE2LOWER_MAP[s];\n}\n\nconst STYLE2UPPER_MAP = {};\nfunction style2Upper(s) {\n STYLE2UPPER_MAP[s] = STYLE2UPPER_MAP[s] || s.replace(/([a-z\\d_])([A-Z])/g, function($0, $1, $2) {\n return $1 + '_' + $2;\n }).toUpperCase();\n\n return STYLE2UPPER_MAP[s];\n}\n\nconst STYLE_R_KEY = {};\nconst STYLE_RV_KEY = {};\nconst STYLE_V_KEY = {};\nObject.keys(STYLE_KEY).forEach(k => {\n let k2 = STYLE_KEY[k];\n STYLE_R_KEY[k2] = k;\n let l = style2Lower(k);\n STYLE_RV_KEY[k2] = l;\n STYLE_V_KEY[l] = k2;\n});\n\n// Root的update过程使用\nconst UPDATE_KEY = {\n UPDATE_NODE: 0,\n UPDATE_STYLE: 1,\n UPDATE_FOCUS: 2,\n UPDATE_MEASURE: 3,\n UPDATE_COMPONENT: 4,\n UPDATE_OVERWRITE: 5,\n UPDATE_KEYS: 6,\n UPDATE_LIST: 7,\n UPDATE_CONFIG: 8,\n UPDATE_ADD_DOM: 9,\n UPDATE_REMOVE_DOM: 10,\n};\n\n// animation计算每帧使用\nconst KEY_FRAME_KEY = {\n FRAME_STYLE: 0,\n FRAME_TIME: 1,\n FRAME_EASING: 2,\n FRAME_TRANSITION: 3,\n};\n\n// 节点使用\nconst NODE_KEY = {\n NODE_DOM_PARENT: 0,\n NODE_OPACITY: 1,\n NODE_MATRIX: 2,\n NODE_MATRIX_EVENT: 3,\n NODE_CACHE: 4,\n NODE_CACHE_TOTAL: 5,\n NODE_CACHE_FILTER: 6,\n NODE_CACHE_MASK: 7,\n NODE_CACHE_OVERFLOW: 8,\n NODE_STRUCT: 9,\n NODE_TAG_NAME: 10,\n NODE_CURRENT_STYLE: 11,\n NODE_CURRENT_PROPS: 12,\n NODE_COMPUTED_STYLE: 13,\n NODE_CACHE_STYLE: 14,\n NODE_CACHE_PROPS: 15,\n NODE_LIMIT_CACHE: 16,\n NODE_IS_MASK: 17,\n NODE_IS_INLINE: 18,\n NODE_HAS_CONTENT: 19,\n NODE_REFRESH_LV: 20,\n NODE_IS_DESTROYED: 21,\n NODE_STYLE: 22,\n NODE_UPDATE_HASH: 23,\n NODE_UNIQUE_UPDATE_ID: 24,\n NODE_DEFS_CACHE: 25,\n NODE_PERSPECTIVE_MATRIX: 26,\n NODE_VIRTUAL_DOM: 27,\n NODE_CACHE_AS_BITMAP: 28,\n};\n\n// struct用\nconst STRUCT_KEY = {\n STRUCT_NODE: 0,\n STRUCT_INDEX: 1,\n STRUCT_CHILD_INDEX: 2,\n STRUCT_LV: 3,\n STRUCT_NUM: 4,\n STRUCT_TOTAL: 5,\n STRUCT_HAS_MASK: 6,\n};\n\nconst ANIMATE_KEY = {\n I_ASSIGNING: 0,\n I_IN_FPS: 1,\n I_IS_DELAY: 2,\n I_BEGIN: 3,\n I_END: 4,\n I_FINISHED: 5,\n I_NEXT_END: 6,\n I_FIRST_PLAY: 7,\n I_PLAY_CB: 8,\n I_TARGET: 9,\n I_ROOT: 10,\n I_FRAMES: 11,\n I_FRAMES_R: 12,\n I_CURRENT_TIME: 13,\n I_NEXT_TIME: 14,\n I_STYLE: 15,\n I_DURATION: 16,\n I_ITERATIONS: 17,\n I_FILL: 18,\n I_PLAYBACK_RATE: 19,\n I_PLAY_COUNT: 20,\n I_PLAY_STATE: 21,\n I_DESTROYED: 22,\n I_START_TIME: 23,\n I_FPS_TIME: 24,\n I_EASING: 25,\n I_ENTER_FRAME: 26,\n I_DELAY: 27,\n I_END_DELAY: 28,\n I_KEYS: 29,\n I_ORIGIN_STYLE: 30,\n I_CURRENT_FRAMES: 31,\n I_CURRENT_FRAME: 32,\n I_SPF_LIMIT: 33,\n I_FPS: 34,\n I_DIRECTION: 35,\n I_FIRST_ENTER: 36,\n I_STAY_BEGIN: 37,\n I_STAY_END: 38,\n I_IS2: 39,\n I_END_TIME: 40,\n I_NODE_CONFIG: 41,\n I_ROOT_CONFIG: 42,\n I_OUT_BEGIN_DELAY: 43,\n I_TIME_STAMP: 44,\n};\n\nexport default {\n STYLE_KEY, // 大写常量为k,数字为值\n STYLE_R_KEY, // 数字为k,大写常量为值\n STYLE_RV_KEY, // 数字为k,小写为值\n STYLE_V_KEY, // 小写为k,数字为值\n style2Lower,\n style2Upper,\n UPDATE_KEY,\n KEY_FRAME_KEY,\n NODE_KEY,\n STRUCT_KEY,\n ANIMATE_KEY,\n};\n","import enums from '../util/enums';\n\nconst {\n STRUCT_KEY: {\n STRUCT_NODE,\n STRUCT_INDEX,\n STRUCT_CHILD_INDEX,\n STRUCT_LV,\n },\n NODE_KEY: {\n NODE_IS_DESTROYED,\n NODE_STRUCT,\n },\n} = enums;\n\nclass Node {\n constructor() {\n this.__x = 0;\n this.__y = 0;\n this.__ox = 0; // relative造成的偏移量\n this.__oy = 0;\n this.__sx = 0;\n this.__sy = 0;\n this.__width = 0;\n this.__height = 0;\n this.__baseline = 0;\n this.__config = {};\n this.__prev = null;\n this.__next = null;\n this.__parent = null;\n this.__domParent = null;\n this.__root = null;\n this.__host = null;\n }\n\n __structure(i, lv, j) {\n return this.__config[NODE_STRUCT] = {\n [STRUCT_NODE]: this,\n [STRUCT_INDEX]: i,\n [STRUCT_CHILD_INDEX]: j,\n [STRUCT_LV]: lv,\n };\n }\n\n __modifyStruct(root, offset = 0) {\n let struct = this.__config[NODE_STRUCT];\n return [struct, 0];\n }\n\n __offsetX(diff, isLayout) {\n if(isLayout) {\n this.__x += diff;\n }\n else {\n this.__ox += diff;\n }\n this.__sx += diff;\n }\n\n __offsetY(diff, isLayout) {\n if(isLayout) {\n this.__y += diff;\n }\n else {\n this.__oy += diff;\n }\n this.__sy += diff;\n }\n\n __destroy() {\n this.__config[NODE_IS_DESTROYED] = true;\n }\n\n get x() {\n return this.__x;\n }\n\n get y() {\n return this.__y;\n }\n\n get ox() {\n return this.__ox;\n }\n\n get oy() {\n return this.__oy;\n }\n\n get sx() {\n return this.x + this.ox;\n }\n\n get sy() {\n return this.y + this.oy;\n }\n\n get width() {\n return this.__width;\n }\n\n get height() {\n return this.__height;\n }\n\n get outerWidth() {\n return this.__width;\n }\n\n get outerHeight() {\n return this.__height;\n }\n\n get prev() {\n return this.__prev;\n }\n\n get next() {\n return this.__next;\n }\n\n get parent() {\n return this.__parent;\n }\n\n get domParent() {\n return this.__domParent;\n }\n\n // canvas/svg根节点\n get root() {\n return this.__root;\n }\n\n // component根节点\n get host() {\n return this.__host;\n }\n\n // 考虑高阶组件在内的component根节点\n get hostRoot() {\n return this.__hostRoot;\n }\n\n get baseline() {\n return this.__baseline;\n }\n\n get virtualDom() {\n return this.__virtualDom;\n }\n\n get isDestroyed() {\n return this.__config[NODE_IS_DESTROYED];\n }\n\n get isReplaced() {\n return false;\n }\n}\n\nexport default Node;\n","export default {\n CANVAS: 0,\n SVG: 1,\n WEBGL: 2,\n};\n","let o = {\n AUTO: 0,\n PX: 1,\n PERCENT: 2,\n NUMBER: 3,\n INHERIT: 4,\n DEG: 5,\n STRING: 6,\n RGBA: 7,\n REM: 8,\n EM: 9,\n VW: 10,\n VH: 11,\n VMAX: 12,\n VMIN: 13,\n /**\n * 通用的格式化计算数值单位的方法,百分比/像素/REM/VW/auto和纯数字\n * @param v value\n * @returns 格式化好的[number, unit]\n */\n calUnit(v) {\n let n = parseFloat(v) || 0;\n if(/%$/.test(v)) {\n return [n, o.PERCENT];\n }\n else if(/px$/i.test(v)) {\n return [n, o.PX];\n }\n else if(/deg$/i.test(v)) {\n return [n, o.DEG];\n }\n else if(/rem$/i.test(v)) {\n return [n, o.REM];\n }\n else if(/vw$/i.test(v)) {\n return [n, o.VW];\n }\n else if(/vh$/i.test(v)) {\n return [n, o.VH];\n }\n else if(/em$/i.test(v)) {\n return [n, o.EM];\n }\n else if(/vw$/i.test(v)) {\n return [n, o.VW];\n }\n else if(/vh$/i.test(v)) {\n return [n, o.VH];\n }\n else if(/vmax$/i.test(v)) {\n return [n, o.VMAX];\n }\n else if(/vmin$/i.test(v)) {\n return [n, o.VMIN];\n }\n return [n, o.NUMBER];\n },\n};\n\nexport default o;\n","'use strict';\n\nlet o = {\n info: {\n arial: {\n lhr: 1.14990234375, // 默认line-height ratio,(67+1854+434)/2048\n // car: 1.1171875, // content-area ratio,(1854+434)/2048\n blr: 0.9052734375, // base-line ratio,1854/2048\n // mdr: 0.64599609375, // middle ratio,(1854-1062/2)/2048\n lgr: 0.03271484375, // line-gap ratio,67/2048,默认0\n // 个别字符误差,初次之外误差还有根据经验得的比例系数,https://github.com/karasjs/karas/issues/145\n padding: {\n 1: 1,\n f: 0.9,\n },\n },\n helvetica: {\n lhr: 1.14990234375, // (8+1900+447)/2048\n blr: 0.927734375, // 1900/2048\n lgr: 0.00390625, // 8/2048\n },\n verdana: {\n lhr: 1.21533203125, // (0+2059+430)/2048\n blr: 1.00537109375, // 2059/2048\n },\n tahoma: {\n lhr: 1.20703125, // (0+2049+423)/2048\n blr: 1.00048828125, // 2049/2048\n padding: {\n S: 1,\n T: 1,\n Z: 1,\n c: 1,\n f: 0.7,\n i: 1,\n l: 1,\n t: 0.9,\n },\n },\n georgia: {\n lhr: 1.13623046875, // (0+1878+449)/2048\n blr: 0.9169921875, // 1878/2048\n },\n 'courier new': {\n lhr: 1.1328125, // (0+1705+615)/2048\n blr: 0.83251953125, // 1705/2048\n },\n 'pingfang sc': {\n lhr: 1.4, // (0+1060+340)/1000\n blr: 1.06, // 1060/1000\n padding: {\n f: 0.5,\n },\n },\n simsun: {\n lhr: 1.4, // (0+1060+340)/1000\n blr: 1.06,\n padding: {\n f: 0.5,\n },\n },\n },\n support(fontFamily) {\n return this.info.hasOwnProperty(fontFamily);\n },\n register(name, info) {\n let { emSquare = 2048, ascent = 1854, descent = 434, lineGap = 0, padding = {} } = info || {};\n this.info[name.toLowerCase()] = {\n lhr: (ascent + descent + lineGap) / emSquare,\n blr: ascent / emSquare,\n padding,\n };\n },\n addPadding(name, padding) {\n Object.assign(this.info[name.toLowerCase()].padding, padding);\n },\n};\n\no.info['宋体'] = o.info.simsun;\no.info['pingfang'] = o.info['pingfang sc'];\n\nexport default o;\n","export default {\n position: /(([-+]?[\\d.]+[pxremvwhina%]*)|(left|top|right|bottom|center)){1,2}/ig,\n // tfo: /((-?[\\d.]+(px|%)?)|(left|top|right|bottom|center)){1,2}/ig,\n gradient: /\\b(\\w+)-?gradient\\((.+)\\)/i,\n img: /(?:\\burl\\((['\"]?)(.*?)\\1\\))|(?:\\b((data:)))/i,\n};\n","// 生成4*4单位矩阵\nfunction identity() {\n return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n}\n\n// 矩阵a*b,固定两个matrix都是长度16\nfunction multiply(a, b) {\n if(isE(a)) {\n return b;\n }\n if(isE(b)) {\n return a;\n }\n let c = [];\n for(let i = 0; i < 4; i++) {\n let a0 = a[i] || 0;\n let a1 = a[i + 4] || 0;\n let a2 = a[i + 8] || 0;\n let a3 = a[i + 12] || 0;\n c[i] = a0 * b[0] + a1 * b[1] + a2 * b[2] + a3 * b[3];\n c[i + 4] = a0 * b[4] + a1 * b[5] + a2 * b[6] + a3 * b[7];\n c[i + 8] = a0 * b[8] + a1 * b[9] + a2 * b[10] + a3 * b[11];\n c[i + 12] = a0 * b[12] + a1 * b[13] + a2 * b[14] + a3 * b[15];\n }\n return c;\n}\n\nfunction calPoint(point, m) {\n let [x, y, z, w] = point;\n if(w === undefined) {\n w = 1;\n }\n if(m && !isE(m)) {\n if(m.length === 16) {\n z = z || 0;\n let [a1, b1, c1, d1, a2, b2, c2, d2, a3, b3, c3, d3, a4, b4, c4, d4] = m;\n w *= x * d1 + y * d2 + z * d3 + d4;\n return [\n (x * a1 + y * a2 + z * a3 + a4),\n (x * b1 + y * b2 + z * b3 + b4),\n (x * c1 + y * c2 + z * c3 + c4),\n w\n ];\n }\n // 6位类型\n let [a, b, c, d, e, f] = m;\n return [a * x + c * y + e, b * x + d * y + f];\n }\n return [x, y, z, w];\n}\n\n/**\n * 初等行变换求3*3特定css的matrix方阵,一维6长度\n * https://blog.csdn.net/iloveas2014/article/details/82930946\n * @param m\n * @returns {number[]|*}\n */\nfunction inverse(m) {\n if(m.length === 16) {\n return inverse4(m);\n }\n let [a, b, c, d, e, f] = m;\n if(a === 1 && b === 0 && c === 0 && d === 1 && e === 0 && f === 0) {\n return m;\n }\n let divisor = a * d - b * c;\n if(divisor === 0) {\n return m;\n }\n return [d / divisor, -b / divisor, -c / divisor, a / divisor,\n (c * f - d * e) / divisor, (b * e - a * f) / divisor];\n}\n\n// 16位或者6位单位矩阵判断,空也认为是\nfunction isE(m) {\n if(!m || !m.length) {\n return true;\n }\n if(m.length === 16) {\n return m[0] === 1 && m[1] === 0 && m[2] === 0 && m[3] === 0\n && m[4] === 0 && m[5] === 1 && m[6] === 0 && m[7] === 0\n && m[8] === 0 && m[9] === 0 && m[10] === 1 && m[11] === 0\n && m[12] === 0 && m[13] === 0 && m[14] === 0 && m[15] === 1;\n }\n return m[0] === 1 && m[1] === 0 && m[2] === 0 && m[3] === 1 && m[4] === 0 && m[5] === 0;\n}\n\n/**\n * 求任意4*4矩阵的逆矩阵,行列式为 0 则返回单位矩阵兜底\n * 格式:matrix3d(a1, b1, c1, d1, a2, b2, c2, d2, a3, b3, c3, d3, a4, b4, c4, d4)\n * 参见: https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/matrix3d()\n * 对应:\n * [\n * a1,a2,a3,a4,\n * b1,b2,b3,b4,\n * c1,c2,c3,c4,\n * d1,d2,d3,d4,\n * ]\n *\n * 根据公式 A* = |A|A^-1 来计算\n * A* 表示矩阵 A 的伴随矩阵,A^-1 表示矩阵 A 的逆矩阵,|A| 表示行列式的值\n *\n * @returns {number[]}\n */\n\nfunction inverse4(s) {\n let inv = [];\n\n inv[0] = s[5] * s[10] * s[15] - s[5] * s[11] * s[14] - s[9] * s[6] * s[15]\n + s[9] * s[7] * s[14] + s[13] * s[6] * s[11] - s[13] * s[7] * s[10];\n inv[4] = -s[4] * s[10] * s[15] + s[4] * s[11] * s[14] + s[8] * s[6] * s[15]\n - s[8] * s[7] * s[14] - s[12] * s[6] * s[11] + s[12] * s[7] * s[10];\n inv[8] = s[4] * s[9] * s[15] - s[4] * s[11] * s[13] - s[8] * s[5] * s[15]\n + s[8] * s[7] * s[13] + s[12] * s[5] * s[11] - s[12] * s[7] * s[9];\n inv[12] = -s[4] * s[9] * s[14] + s[4] * s[10] * s[13] + s[8] * s[5] * s[14]\n - s[8] * s[6] * s[13] - s[12] * s[5] * s[10] + s[12] * s[6] * s[9];\n\n inv[1] = -s[1] * s[10] * s[15] + s[1] * s[11] * s[14] + s[9] * s[2] * s[15]\n - s[9] * s[3] * s[14] - s[13] * s[2] * s[11] + s[13] * s[3] * s[10];\n inv[5] = s[0] * s[10] * s[15] - s[0] * s[11] * s[14] - s[8] * s[2] * s[15]\n + s[8] * s[3] * s[14] + s[12] * s[2] * s[11] - s[12] * s[3] * s[10];\n inv[9] = -s[0] * s[9] * s[15] + s[0] * s[11] * s[13] + s[8] * s[1] * s[15]\n - s[8] * s[3] * s[13] - s[12] * s[1] * s[11] + s[12] * s[3] * s[9];\n inv[13] = s[0] * s[9] * s[14] - s[0] * s[10] * s[13] - s[8] * s[1] * s[14]\n + s[8] * s[2] * s[13] + s[12] * s[1] * s[10] - s[12] * s[2] * s[9];\n\n inv[2] = s[1] * s[6] * s[15] - s[1] * s[7] * s[14] - s[5] * s[2] * s[15]\n + s[5] * s[3] * s[14] + s[13] * s[2] * s[7] - s[13] * s[3] * s[6];\n inv[6] = -s[0] * s[6] * s[15] + s[0] * s[7] * s[14] + s[4] * s[2] * s[15]\n - s[4] * s[3] * s[14] - s[12] * s[2] * s[7] + s[12] * s[3] * s[6];\n inv[10] = s[0] * s[5] * s[15] - s[0] * s[7] * s[13] - s[4] * s[1] * s[15]\n + s[4] * s[3] * s[13] + s[12] * s[1] * s[7] - s[12] * s[3] * s[5];\n inv[14] = -s[0] * s[5] * s[14] + s[0] * s[6] * s[13] + s[4] * s[1] * s[14]\n - s[4] * s[2] * s[13] - s[12] * s[1] * s[6] + s[12] * s[2] * s[5];\n\n inv[3] = -s[1] * s[6] * s[11] + s[1] * s[7] * s[10] + s[5] * s[2] * s[11]\n - s[5] * s[3] * s[10] - s[9] * s[2] * s[7] + s[9] * s[3] * s[6];\n inv[7] = s[0] * s[6] * s[11] - s[0] * s[7] * s[10] - s[4] * s[2] * s[11]\n + s[4] * s[3] * s[10] + s[8] * s[2] * s[7] - s[8] * s[3] * s[6];\n inv[11] = -s[0] * s[5] * s[11] + s[0] * s[7] * s[9] + s[4] * s[1] * s[11]\n - s[4] * s[3] * s[9] - s[8] * s[1] * s[7] + s[8] * s[3] * s[5];\n inv[15] = s[0] * s[5] * s[10] - s[0] * s[6] * s[9] - s[4] * s[1] * s[10]\n + s[4] * s[2] * s[9] + s[8] * s[1] * s[6] - s[8] * s[2] * s[5];\n\n let det = s[0] * inv[0] + s[1] * inv[4] + s[2] * inv[8] + s[3] * inv[12];\n if (det === 0) {\n return identity();\n }\n\n det = 1 / det;\n let d = [];\n for (let i = 0; i < 16; i++) {\n d[i] = inv[i] * det;\n }\n return d;\n}\n\n// 将4*4的16长度矩阵转成css/canvas的6位标准使用,忽略transform3d\nfunction m2m6(m) {\n return [\n m[0],\n m[1],\n m[4],\n m[5],\n m[12],\n m[13],\n ];\n}\n\nfunction point2d(point) {\n let w = point[3];\n if(w && w !== 1) {\n point = point.slice(0, 2);\n point[0] /= w;\n point[1] /= w;\n }\n return point;\n}\n\nexport default {\n identity,\n multiply,\n calPoint,\n point2d,\n inverse,\n isE,\n m2m6,\n};\n","// 向量点乘积\nfunction dotProduct(x1, y1, x2, y2) {\n return x1 * x2 + y1 * y2;\n}\n\n// 向量叉乘积\nfunction crossProduct(x1, y1, x2, y2) {\n return x1 * y2 - x2 * y1;\n}\n\nexport default {\n dotProduct,\n crossProduct,\n};\n","import mx from './matrix';\nimport vector from './vector';\nimport enums from '../util/enums';\n\nconst H = 4 * (Math.sqrt(2) - 1) / 3;\nconst { crossProduct } = vector;\nconst { calPoint, isE } = mx;\nconst { STYLE_KEY: {\n WIDTH,\n HEIGHT,\n TRANSFORM_ORIGIN,\n} } = enums;\n\n/**\n * 圆弧拟合公式,根据角度求得3阶贝塞尔控制点比例长度,一般<=90,超过拆分\n * @param deg\n * @returns {number}\n */\nfunction h(deg) {\n deg *= 0.5;\n return 4 * ((1 - Math.cos(deg)) / Math.sin(deg)) / 3;\n}\n\n/**\n * 判断点是否在多边形内\n * @param x 点坐标\n * @param y\n * @param vertexes 多边形顶点坐标\n * @returns {boolean}\n */\nfunction pointInPolygon(x, y, vertexes) {\n // 先取最大最小值得一个外围矩形,在外边可快速判断false\n let [xmax, ymax] = vertexes[0];\n let [xmin, ymin] = vertexes[0];\n let len = vertexes.length;\n for(let i = 1; i < len; i++) {\n let [x, y] = vertexes[i];\n xmax = Math.max(xmax, x);\n ymax = Math.max(ymax, y);\n xmin = Math.min(xmin, x);\n ymin = Math.min(ymin, y);\n }\n if(x < xmin || y < ymin || x > xmax || y > ymax) {\n return false;\n }\n // 所有向量积均为非负数说明在多边形内或边上\n for(let i = 0, len = vertexes.length; i < len; i++) {\n let [x1, y1] = vertexes[i];\n let [x2, y2] = vertexes[(i + 1) % len];\n if(crossProduct(x2 - x1, y2 - y1, x - x1, y - y1) < 0) {\n return false;\n }\n }\n return true;\n}\n\n// 判断点是否在一个4边形内,比如事件发生是否在节点上\nfunction pointInQuadrilateral(x, y, x1, y1, x2, y2, x4, y4, x3, y3, matrix) {\n if(matrix && !isE(matrix)) {\n let w1, w2, w3, w4;\n [x1, y1,, w1] = calPoint([x1, y1], matrix);\n [x2, y2,, w2] = calPoint([x2, y2], matrix);\n [x3, y3,, w3] = calPoint([x3, y3], matrix);\n [x4, y4,, w4] = calPoint([x4, y4], matrix);\n if(w1 && w1 !== 1) {\n x1 /= w1;\n y1 /= w1;\n }\n if(w2 && w2 !== 1) {\n x2 /= w2;\n y2 /= w2;\n }\n if(w3 && w3 !== 1) {\n x3 /= w3;\n y3 /= w3;\n }\n if(w4 && w4 !== 1) {\n x4 /= w4;\n y4 /= w4;\n }\n return pointInPolygon(x, y, [\n [x1, y1],\n [x2, y2],\n [x4, y4],\n [x3, y3]\n ]);\n }\n else {\n return x >= x1 && y >= y1 && x <= x4 && y <= y4;\n }\n}\n\n/**\n * 余弦定理3边长求夹角\n * @param a\n * @param b\n * @param c\n */\nfunction angleBySide(a, b, c) {\n let theta = (Math.pow(b, 2) + Math.pow(c, 2) - Math.pow(a, 2)) / (2 * b * c);\n return Math.acos(theta);\n}\n\n/**\n * 余弦定理2边长和夹角求3边\n * @param alpha 弧度\n * @param a\n * @param b\n */\nfunction sideByAngle(alpha, a, b) {\n let cos = Math.cos(alpha);\n return Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2) - 2 * a * b * cos);\n}\n\n/**\n * 两点距离\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n */\nfunction pointsDistance(x1, y1, x2, y2) {\n return Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));\n}\n\n/**\n * 三角形内心\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n * @param x3\n * @param y3\n */\nfunction triangleIncentre(x1, y1, x2, y2, x3, y3) {\n let a = pointsDistance(x2, y2, x3, y3);\n let b = pointsDistance(x1, y1, x3, y3);\n let c = pointsDistance(x1, y1, x2, y2);\n return [\n (a * x1 + b * x2 + c * x3) / (a + b + c),\n (a * y1 + b * y2 + c * y3) / (a + b + c),\n ];\n}\n\n/**\n * 椭圆圆心和长短轴生成4个端点和控制点\n */\nfunction ellipsePoints(x, y, a, b = a) {\n let ox = a * H;\n let oy = b === a ? ox : b * H;\n return [\n [x - a, y],\n [x - a, y - oy, x - ox, y - b, x, y - b],\n [x + ox, y - b, x + a, y - oy, x + a, y],\n [x + a, y + oy, x + ox, y + b, x, y + b],\n [x - ox, y + b, x - a, y + oy, x - a, y],\n ];\n}\n\n/**\n * 扇形圆心和半径起始角度生成4个端点和控制点\n * 分为4个象限进行拟合,0、1、2、3\n */\nfunction sectorPoints(x, y, r, begin, end) {\n if(begin > end) {\n [begin, end] = [end, begin];\n }\n if(begin === end) {\n return [];\n }\n let list = [];\n let b = Math.floor(begin / 90);\n let e = Math.floor(end / 90);\n // 同象限直接算\n if(b === e || (e - b) === 1 && end % 90 === 0) {\n let h2 = h(d2r(Math.abs(begin - end)));\n let d = h2 * r;\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let alpha = Math.atan(d / r);\n if(b < 90) {\n // 第1个交点\n let rx = Math.sin(d2r(begin)) * r;\n let ry = Math.cos(d2r(begin)) * r;\n let p1 = [x + rx, y - ry];\n // 第1个控制点\n let deg = alpha + d2r(begin);\n rx = Math.sin(deg) * c;\n ry = Math.cos(deg) * c;\n let p2 = [x + rx, y - ry];\n // 第2个交点\n rx = Math.sin(d2r(end)) * r;\n ry = Math.cos(d2r(end)) * r;\n let p4 = [x + rx, y - ry];\n // 第2个控制点\n deg = d2r(end) - alpha;\n rx = Math.sin(deg) * c;\n ry = Math.cos(deg) * c;\n let p3 = [x + rx, y - ry];\n list.push(p1);\n list.push(p2.concat(p3).concat(p4));\n }\n else if(b < 180) {\n // 第1个交点\n let rx = Math.cos(d2r(begin - 90)) * r;\n let ry = Math.sin(d2r(begin - 90)) * r;\n let p1 = [x + rx, y + ry];\n // 第1个控制点\n let deg = alpha + d2r(begin - 90);\n rx = Math.cos(deg) * c;\n ry = Math.sin(deg) * c;\n let p2 = [x + rx, y + ry];\n // 第2个交点\n rx = Math.cos(d2r(end - 90)) * r;\n ry = Math.sin(d2r(end - 90)) * r;\n let p4 = [x + rx, y + ry];\n // 第2个控制点\n deg = d2r(end - 90) - alpha;\n rx = Math.cos(deg) * c;\n ry = Math.sin(deg) * c;\n let p3 = [x + rx, y + ry];\n list.push(p1);\n list.push(p2.concat(p3).concat(p4));\n }\n else if(b < 270) {\n // 第1个交点\n let rx = Math.sin(d2r(begin - 180)) * r;\n let ry = Math.cos(d2r(begin - 180)) * r;\n let p1 = [x - rx, y + ry];\n // 第1个控制点\n let deg = alpha + d2r(begin - 180);\n rx = Math.sin(deg) * c;\n ry = Math.cos(deg) * c;\n let p2 = [x - rx, y + ry];\n // 第2个交点\n rx = Math.sin(d2r(end - 180)) * r;\n ry = Math.cos(d2r(end - 180)) * r;\n let p4 = [x - rx, y + ry];\n // 第2个控制点\n deg = d2r(end - 180) - alpha;\n rx = Math.sin(deg) * c;\n ry = Math.cos(deg) * c;\n let p3 = [x - rx, y + ry];\n list.push(p1);\n list.push(p2.concat(p3).concat(p4));\n }\n else {\n // 第1个交点\n let rx = Math.cos(d2r(begin - 270)) * r;\n let ry = Math.sin(d2r(begin - 270)) * r;\n let p1 = [x - rx, y + ry];\n // 第1个控制点\n let deg = alpha + d2r(begin - 270);\n rx = Math.cos(deg) * c;\n ry = Math.sin(deg) * c;\n let p2 = [x - rx, y + ry];\n // 第2个交点\n rx = Math.cos(d2r(end - 270)) * r;\n ry = Math.sin(d2r(end - 270)) * r;\n let p4 = [x - rx, y + ry];\n // 第2个控制点\n deg = d2r(end - 270) - alpha;\n rx = Math.cos(deg) * c;\n ry = Math.sin(deg) * c;\n let p3 = [x - rx, y + ry];\n list.push(p1);\n list.push(p2.concat(p3).concat(p4));\n }\n }\n // 跨象限循环算\n else {\n let i = b;\n let temp = [];\n for(; i <= e; i++) {\n if(i === 0) {\n let res = sectorPoints(x, y, r, begin, 90);\n temp.push(res);\n }\n else if(i === 1) {\n // 防止90~90这种情况,但如果begin和end都是90时又要显示\n if(b === i || end > 90) {\n let res = sectorPoints(x, y, r, begin < 90 ? 90 : begin, end > 180 ? 180 : end);\n temp.push(res);\n }\n }\n else if(i === 2) {\n // 防止180~180这种情况,但如果begin和end都是90时又要显示\n if(b === i || end > 180) {\n let res = sectorPoints(x, y, r, begin < 180 ? 180 : begin, end > 270 ? 270 : end);\n temp.push(res);\n }\n }\n else if(i === 3) {\n // 防止180~180这种情况,但如果begin和end都是90时又要显示\n if(b === i || end > 270) {\n let res = sectorPoints(x, y, r, begin < 270 ? 270 : begin, end);\n temp.push(res);\n }\n }\n }\n // 去掉重复的首尾扇弧点\n list = temp[0];\n for(let i = 1, len = temp.length; i < len; i++) {\n list.push(temp[i][1]);\n }\n }\n return list;\n}\n\n/**\n * 获取2个矩形重叠区域,如不重叠返回null\n * @param a\n * @param b\n */\nfunction getRectsIntersection(a, b) {\n if(!isRectsOverlap(a, b)) {\n return null;\n }\n let [ax1, ay1, ax4, ay4] = a;\n let [bx1, by1, bx4, by4] = b;\n return [\n Math.max(ax1, bx1),\n Math.max(ay1, by1),\n Math.min(ax4, bx4),\n Math.min(ay4, by4),\n ];\n}\n\n/**\n * 2个矩形是否重叠\n * @param a\n * @param b\n */\nfunction isRectsOverlap(a, b) {\n let [ax1, ay1, ax4, ay4] = a;\n let [bx1, by1, bx4, by4] = b;\n if(ax1 >= bx4 || ay1 >= by4 || bx1 >= ax4 || by1 >= ay4) {\n return false;\n }\n return true;\n}\n\n/**\n * 2个矩形是否包含,a包含b\n * @param a\n * @param b\n */\nfunction isRectsInside(a, b) {\n let [ax1, ay1, ax4, ay4] = a;\n let [bx1, by1, bx4, by4] = b;\n if(ax1 <= bx1 && ay1 <= by1 && ax4 >= bx4 && ay4 >= by4) {\n return true;\n }\n return false;\n}\n\nfunction calCoordsInNode(px, py, node) {\n let { matrix = [1, 0, 0, 1, 0, 0], computedStyle = {} } = node;\n let { [WIDTH]: width, [HEIGHT]: height, [TRANSFORM_ORIGIN]: [ox, oy] = [width * 0.5, height * 0.5] } = computedStyle;\n [px, py] = calPoint([px * width - ox, py * height - oy], matrix);\n return [px + ox, py + oy];\n}\n\nfunction calPercentInNode(x, y, node) {\n let { computedStyle: { [WIDTH]: width, [HEIGHT]: height, [TRANSFORM_ORIGIN]: [ox, oy] } } = node;\n // 先求无旋转时右下角相对于原点的角度ds\n let ds = Math.atan((height - oy) / (width - ox));\n let [x1, y1] = calCoordsInNode(1, 1, node);\n let d1;\n let deg;\n // 根据旋转后的坐标,分4个象限,求旋转后的右下角相对于原点的角度d1,得出偏移角度deg,分顺逆时针[-180, 180]\n if(x1 >= ox && y1 >= oy) {\n if(ox === x1) {\n d1 = -Math.atan(Infinity);\n }\n else {\n d1 = Math.atan((y1 - oy) / (x1 - ox));\n }\n deg = d1 - ds;\n }\n else if(x1 >= ox && y1 < oy) {\n if(ox === x1) {\n d1 = -Math.atan(Infinity);\n }\n else {\n d1 = Math.atan((oy - y1) / (x1 - ox));\n }\n deg = d1 + ds;\n }\n else if(x1 < ox && y1 >= oy) {\n d1 = Math.atan((y1 - oy) / (ox - x1));\n deg = d1 - ds;\n }\n else if(x1 < ox && y1 < oy) {\n d1 = Math.atan((y1 - oy) / (x1 - ox));\n if(ds >= d1) {\n deg = d1 + Math.PI - ds;\n }\n else {\n deg = Math.PI - d1 + ds;\n deg = -deg;\n }\n }\n else {\n deg = 0;\n }\n // 目标点到原点的边长不会变\n let dt = Math.sqrt(Math.pow(x - ox, 2) + Math.pow(y - oy, 2));\n // 分4个象限,先求目标点到原点的角度d2,再偏移deg后求得原始坐标\n let d2;\n if(x >= ox && y >= oy) {\n if(ox === x) {\n d2 = -Math.atan(Infinity);\n }\n else {\n d2 = Math.atan((y - oy) / (x - ox));\n }\n }\n else if(x >= ox && y < oy) {\n if(ox === x) {\n d2 = -Math.atan(Infinity);\n }\n else {\n d2 = -Math.atan((y - oy) / (ox - x));\n }\n }\n else if(x < ox && y >= oy) {\n d2 = Math.PI - Math.atan((y - oy) / (ox - x));\n }\n else {\n d2 = Math.atan((y - oy) / (x - ox)) - Math.PI;\n }\n d2 -= deg;\n if(d2 > Math.PI) {\n d2 -= Math.PI;\n return [\n (ox - dt * Math.cos(d2)) / width,\n (oy - dt * Math.sin(d2)) / height,\n ];\n }\n if(d2 > Math.PI * 0.5) {\n d2 = Math.PI - d2;\n return [\n (ox - dt * Math.cos(d2)) / width,\n (oy + dt * Math.sin(d2)) / height,\n ];\n }\n if(d2 >= 0) {\n return [\n (ox + dt * Math.cos(d2)) / width,\n (oy + dt * Math.sin(d2)) / height,\n ];\n }\n if(d2 >= -Math.PI * 0.5) {\n d2 = -d2;\n return [\n (ox + dt * Math.cos(d2)) / width,\n (oy - dt * Math.sin(d2)) / height,\n ];\n }\n if(d2 >= -Math.PI) {\n d2 = Math.PI + d2;\n return [\n (ox - dt * Math.cos(d2)) / width,\n (oy - dt * Math.sin(d2)) / height,\n ];\n }\n d2 = -Math.PI - d2;\n return [\n (ox - dt * Math.cos(d2)) / width,\n (oy + dt * Math.sin(d2)) / height,\n ];\n}\n\nfunction d2r(n) {\n return n * Math.PI / 180;\n}\n\nfunction r2d(n) {\n return n * 180 / Math.PI;\n}\n\n/**\n * 二阶贝塞尔曲线范围框\n * @param x0\n * @param y0\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n * @returns {number[]}\n * https://www.iquilezles.org/www/articles/bezierbbox/bezierbbox.htm\n */\nfunction bboxBezier2(x0, y0, x1, y1, x2, y2) {\n let minX = Math.min(x0, x2);\n let minY = Math.min(y0, y2);\n let maxX = Math.max(x0, x2);\n let maxY = Math.max(y0, y2);\n // 控制点位于边界内部时,边界就是范围框,否则计算导数获取极值\n if(x1 < minX || y1 < minY || x1 > maxX || y1 > maxY) {\n let tx = (x0 - x1) / (x0 - 2 * x1 + x2);\n let ty = (y0 - y1) / (y0 - 2 * y1 + y2);\n let sx = 1 - tx;\n let sy = 1 - ty;\n let qx = sx * sx * x0 + 2 * sx * tx * x1 + tx * tx * x2;\n let qy = sy * sy * y0 + 2 * sy * ty * y1 + ty * ty * y2;\n minX = Math.min(minX, qx);\n minY = Math.min(minY, qy);\n maxX = Math.min(maxX, qx);\n maxY = Math.min(maxY, qy);\n }\n return [minX, minY, maxX, maxY];\n}\n\n/**\n * 同上三阶的\n */\nfunction bboxBezier3(x0, y0, x1, y1, x2, y2, x3, y3) {\n let minX = Math.min(x0, x3);\n let minY = Math.min(y0, y3);\n let maxX = Math.max(x0, x3);\n let maxY = Math.max(y0, y3);\n if(x1 < minX || y1 < minY || x1 > maxX || y1 > maxY || x2 < minX || y2 < minY || x2 > maxX || y2 > maxY) {\n let cx = -x0 + x1;\n let cy = -y0 + y1;\n let bx = x0 - 2 * x1 + x2;\n let by = y0 - 2 * y1 + y2;\n let ax = -x0 + 3 * x1 - 3 * x2 + x3;\n let ay = -y0 + 3 * y1 - 3 * y2 + y3;\n let hx = bx * bx - ax * cx;\n let hy = by * by - ay * cy;\n if(hx > 0) {\n hx = Math.sqrt(hx);\n let t = (-bx - hx) / ax;\n if(t > 0 && t < 1) {\n let s = 1 - t;\n let q = s * s * s * x0 + 3 * s * s * t * x1 + 3 * s * t * t * x2 + t * t * t * x3;\n minX = Math.min(minX, q);\n maxX = Math.max(maxX, q);\n }\n t = (-bx + hx) / ax;\n if(t > 0 && t < 1) {\n let s = 1 - t;\n let q = s * s * s * x0 + 3 * s * s * t * x1 + 3 * s * t * t * x2 + t * t * t * x3;\n minX = Math.min(minX, q);\n maxX = Math.max(maxX, q);\n }\n }\n if(hy > 0) {\n hy = Math.sqrt(hy);\n let t = (-by - hy) / ay;\n if(t > 0 && t < 1) {\n let s = 1 - t;\n let q = s * s * s * y0 + 3 * s * s * t * y1 + 3 * s * t * t * y2 + t * t * t * y3;\n minY = Math.min(minY, q);\n maxY = Math.max(maxY, q);\n }\n t = (-by + hy) / ay;\n if(t > 0 && t < 1) {\n let s = 1 - t;\n let q = s * s * s * y0 + 3 * s * s * t * y1 + 3 * s * t * t * y2 + t * t * t * y3;\n minY = Math.min(minY, q);\n maxY = Math.max(maxY, q);\n }\n }\n }\n return [minX, minY, maxX, maxY];\n}\n\nfunction bboxBezier(x0, y0, x1, y1, x2, y2, x3, y3) {\n if(arguments.length === 4) {\n return [x0, y0, x1, y1];\n }\n if(arguments.length === 6) {\n return bboxBezier2(x0, y0, x1, y1, x2, y2);\n }\n if(arguments.length === 8) {\n return bboxBezier3(x0, y0, x1, y1, x2, y2, x3, y3);\n }\n}\n\n/**\n * 范数 or 模\n */\nfunction norm(v) {\n let order = v.length;\n let sum = v.reduce((a, b) => Math.pow(a, order) + Math.pow(b, order));\n return Math.pow(sum, 1 / order);\n}\n\nfunction simpson38(derivativeFunc, l, r) {\n let f = derivativeFunc;\n let middleL = (2 * l + r) / 3;\n let middleR = (l + 2 * r) / 3;\n return (f(l) + 3 * f(middleL) + 3 * f(middleR) + f(r)) * (r - l) / 8;\n}\n\n/**\n * bezier 曲线的长度\n * @param derivativeFunc 微分函数\n * @param l 左点\n * @param r 右点\n * @param eps 精度\n * @return {*} number\n */\nfunction adaptiveSimpson38(derivativeFunc, l, r, eps = 0.001) {\n let f = derivativeFunc;\n let mid = (l + r) / 2;\n let st = simpson38(f, l, r);\n let sl = simpson38(f, l, mid);\n let sr = simpson38(f, mid, r);\n let ans = sl + sr - st;\n if(Math.abs(ans) <= 15 * eps) {\n return sl + sr + ans / 15;\n }\n return adaptiveSimpson38(f, l, mid, eps / 2) + adaptiveSimpson38(f, mid, r, eps / 2);\n}\n\n/**\n * bezier 曲线的长度\n * @param points 曲线的起止点 和 控制点\n * @param order 阶次, 2 和 3\n * @param startT 计算长度的起点,满足 0 <= startT <= endT <= 1\n * @param endT 计算长度的终点\n * @return {*} number\n */\nfunction bezierLength(points, order, startT = 0, endT = 1) {\n let derivativeFunc = t => norm(at(t, points, order));\n return adaptiveSimpson38(derivativeFunc, startT, endT);\n}\n\n/**\n * 3 阶 bezier 曲线的 order 阶导数在 t 位置时候的 (x, y) 的值\n */\nfunction at3(t, points, order = 1) {\n let [p0, p1, p2, p3] = points;\n let [x0, y0] = p0;\n let [x1, y1] = p1;\n let [x2, y2] = p2;\n let [x3, y3] = p3;\n let x = 0;\n let y = 0;\n if(order === 0) {\n x = Math.pow((1 - t), 3) * x0 + 3 * t * Math.pow((1 - t), 2) * x1 + 3 * (1 - t) * Math.pow(t, 2) * x2 + Math.pow(t, 3) * x3;\n y = Math.pow((1 - t), 3) * y0 + 3 * t * Math.pow((1 - t), 2) * y1 + 3 * (1 - t) * Math.pow(t, 2) * y2 + Math.pow(t, 3) * y3;\n }\n else if(order === 1) {\n x = 3 * ((1 - t) * (1 - t) * (x1 - x0) + 2 * (1 - t) * t * (x2 - x1) + t * t * (x3 - x2));\n y = 3 * ((1 - t) * (1 - t) * (y1 - y0) + 2 * (1 - t) * t * (y2 - y1) + t * t * (y3 - y2));\n }\n else if(order === 2) {\n x = 6 * (x2 - 2 * x1 + x0) * (1 - t) + 6 * (x3 - 2 * x2 + x1) * t;\n y = 6 * (y2 - 2 * y1 + y0) * (1 - t) + 6 * (y3 - 2 * y2 + y1) * t;\n }\n else if(order === 3) {\n x = 6 * (x3 - 3 * x2 + 3 * x1 - x0);\n y = 6 * (y3 - 3 * y2 + 3 * y1 - y0);\n }\n else {\n // 3阶导数就是常数了,大于3阶的都是0\n x = 0;\n y = 0;\n }\n return [x, y];\n}\n\n/**\n * 2 阶 bezier 曲线的 order 阶导数在 t 位置时候的 (x, y) 的值\n */\nfunction at2(t, points, order = 1) {\n let [p0, p1, p2] = points;\n let [x0, y0] = p0;\n let [x1, y1] = p1;\n let [x2, y2] = p2;\n let x = 0;\n let y = 0;\n if(order === 0) {\n x = Math.pow((1 - t), 2) * x0 + 2 * t * (1 - t) * x1 + Math.pow(t, 2) * x2;\n y = Math.pow((1 - t), 2) * y0 + 2 * t * (1 - t) * y1 + Math.pow(t, 2) * y2;\n }\n else if(order === 1) {\n x = 2 * (1 - t) * (x1 - x0) + 2 * t * (x2 - x1);\n y = 2 * (1 - t) * (y1 - y0) + 2 * t * (y2 - y1);\n }\n else if(order === 2) {\n x = 2 * (x2 - 2 * x1 + x0);\n y = 2 * (y2 - 2 * y1 + y0);\n }\n else {\n x = 0;\n y = 0;\n }\n return [x, y];\n}\n\nfunction at(t, points, bezierOrder, derivativeOrder = 1) {\n if(bezierOrder === 2) {\n return at2(t, points, derivativeOrder);\n }\n else if(bezierOrder === 3) {\n return at3(t, points, derivativeOrder);\n }\n}\n\nfunction pointAtBezier(points, order, percent, maxIteration, eps) {\n let length = bezierLength(points, order, 0, 1);\n return pointAtBezierWithLength(points, order, length, percent, maxIteration, eps);\n}\n\nfunction pointAtBezierWithLength(points, order, length, percent = 1, maxIteration = 20, eps = 0.001) {\n let derivativeFunc = t => norm(at(t, points, order));\n let targetLen = length * percent;\n let approachLen = length;\n let approachT = percent;\n let preApproachT = approachT;\n for(let i = 0; i < maxIteration; i++) {\n approachLen = simpson38(derivativeFunc, 0, approachT);\n let d = approachLen - targetLen;\n if(Math.abs(d) < eps) {\n break;\n }\n // Newton 法\n let derivative1 = norm(at(approachT, points, order, 1)); // 1 阶导数\n let derivative2 = norm(at(approachT, points, order, 2)); // 2 阶导数\n let numerator = d * derivative1;\n let denominator = d * derivative2 + derivative1 * derivative1;\n approachT = approachT - numerator / denominator;\n if(Math.abs(approachT - preApproachT) < eps) {\n break;\n }\n else {\n preApproachT = approachT;\n }\n }\n return at(approachT, points, order, 0);\n}\n\nfunction sliceBezier(points, t) {\n let [[x1, y1], [x2, y2], [x3, y3], p4] = points;\n let x12 = (x2 - x1) * t + x1;\n let y12 = (y2 - y1) * t + y1;\n let x23 = (x3 - x2) * t + x2;\n let y23 = (y3 - y2) * t + y2;\n let x123 = (x23 - x12) * t + x12;\n let y123 = (y23 - y12) * t + y12;\n if(points.length === 4) {\n let [x4, y4] = p4;\n let x34 = (x4 - x3) * t + x3;\n let y34 = (y4 - y3) * t + y3;\n let x234 = (x34 - x23) * t + x23;\n let y234 = (y34 - y23) * t + y23;\n let x1234 = (x234 - x123) * t + x123;\n let y1234 = (y234 - y123) * t + y123;\n return [[x1, y1], [x12, y12], [x123, y123], [x1234, y1234]];\n }\n else if(points.length === 3) {\n return [[x1, y1], [x12, y12], [x123, y123]];\n }\n}\n\nfunction sliceBezier2Both(points, start = 0, end = 1) {\n start = Math.max(start, 0);\n end = Math.min(end, 1);\n if(start === 0 && end === 1) {\n return points;\n }\n if(end < 1) {\n points = sliceBezier(points, end);\n }\n if(start > 0) {\n if(end < 1) {\n start = start / end;\n }\n points = sliceBezier(points.reverse(), (1 - start)).reverse();\n }\n return points;\n}\n\nfunction pointOnCircle(x, y, r, deg) {\n if(deg >= 270) {\n deg -= 270;\n deg = d2r(deg);\n return [\n x - Math.cos(deg) * r,\n y - Math.sin(deg) * r,\n ];\n }\n else if(deg >= 180) {\n deg -= 180;\n deg = d2r(deg);\n return [\n x - Math.sin(deg) * r,\n y + Math.cos(deg) * r,\n ];\n }\n else if(deg >= 90) {\n deg -= 90;\n deg = d2r(deg);\n return [\n x + Math.cos(deg) * r,\n y + Math.sin(deg) * r,\n ];\n }\n else {\n deg = d2r(deg);\n return [\n x + Math.sin(deg) * r,\n y - Math.cos(deg) * r,\n ];\n }\n}\n\nexport default {\n pointInPolygon,\n pointInQuadrilateral,\n d2r,\n r2d,\n // 贝塞尔曲线模拟1/4圆弧比例\n H,\n // <90任意角度贝塞尔曲线拟合圆弧的比例公式\n h,\n angleBySide,\n sideByAngle,\n pointsDistance,\n triangleIncentre,\n ellipsePoints,\n sectorPoints,\n getRectsIntersection,\n isRectsOverlap,\n isRectsInside,\n calCoordsInNode,\n calPercentInNode,\n bboxBezier,\n bezierLength,\n pointAtBezier,\n pointAtBezierWithLength,\n sliceBezier,\n sliceBezier2Both,\n pointOnCircle,\n};\n","/**\n * @typedef {Object} gradientStatement\n * @property {Array} color - 颜色rgba,0~255,如 [0, 255, 0, 255]\n * @property {number} angle - 角度,0~2 * Math.PI,(originX, originY) 为原点,垂直向上为0\n */\n\n/**\n * 获取渐变图像像素数组\n * @param {number} originX - 渐变中心x坐标(相对图片左上角(0,0)的值,可在图片外,下同)\n * @param {number} originY - 渐变中心y坐标\n * @param {number} width - 图片宽度\n * @param {number} height - 图片高度\n * @param {Array} stop - 渐变声明列表\n * @param data - canvas的imgData.data\n * @returns {Array} 图像像素数组,每4个元素(rgba)构成一个像素点\n * @example\n // 矩形宽度为200*200,此时坐标为0~199,渐变中心为中点时,应传入99.5,可消除零点问题\n // 若渐变中心在某一整数轴上,就会引入零点问题,此时零点取y轴正半轴的色值,要消除这个问题,可以对渐变中心增加一个偏移量,使其不为整数\n let w = 200;\n let h = 200;\n let ctx = document.getElementById('example').getContext('2d');\n let imgData = ctx.getImageData(0,0, w, h);\n let data = getConicGradientImage(99.5, 99.5, w, h, [{\n color: [0,0,0,255],\n angle: 0,\n } ,{\n color: [255,0,0,255],\n angle: 2 * Math.PI,\n }]);\n for (let i = 0; i < imgData.data.length; i++) {\n imgData.data[i] = data[i];\n }\n ctx.putImageData(imgData, 0, 0);\n */\nfunction getConicGradientImage(\n originX,\n originY,\n width,\n height,\n stop,\n data\n) {\n if(stop.length < 2) {\n throw new Error(\n 'Conic gradient should recieve at least 2 gradient statements (start line and end line).'\n );\n }\n\n width = Math.floor(width);\n height = Math.floor(height);\n\n /**\n * 根据坐标获取角度\n * @param {number} x - x坐标,左上角为原点\n * @param {number} y - y坐标,左上角为原点\n * @returns {number} angle - 角度,0~2 * Math.PI,(originX, originY) 为原点,垂直向上为0\n */\n let getAngle = (x, y) => {\n // 此函数注释内的x、y轴基于 (originX, originY)\n // 计算相对 (originX, originY) 的坐标(dx, dy)\n let dx = x - originX;\n let dy = originY - y;\n // 在y轴上\n if(dx === 0) {\n return dy < 0\n ? // y轴负半轴,\n 1 * Math.PI\n : // y轴正半轴,因此,(originX, originY) 的angle视作0\n 0;\n }\n // 在x轴上\n if(dy === 0) {\n return dx < 0\n ? // x轴负半轴\n 1.5 * Math.PI\n : // x轴正半轴\n 0.5 * Math.PI;\n }\n let atan = Math.atan(dy / dx);\n /**\n * 2 | 1\n * -----|-----\n * 3 | 4\n */\n // 第一象限,atan > 0\n // 第四象限,atan < 0\n if(dx > 0) {\n return 0.5 * Math.PI - atan;\n }\n // 第二象限,atan < 0\n // 第三象限,atan > 0\n if(dx < 0) {\n return 1.5 * Math.PI - atan;\n }\n };\n\n let increasingList = stop.map(item => ({\n color: item[0],\n angle: item[1] * Math.PI * 2,\n }));\n\n for(let y = 0; y < height; y++) {\n for(let x = 0; x < width; x++) {\n // step 1. 找到当前点坐标相对 (originX, originY) 的角度\n let angle = getAngle(x, y);\n // step 2. 找到当前点坐标对应的渐变区间\n let j;\n for(j = 0; j < increasingList.length && increasingList[j].angle <= angle; j++) {\n }\n let start = increasingList[j - 1];\n let end = increasingList[j];\n if(!(start && end)) {\n // step 2-1. 不在渐变区间里\n continue;\n }\n // step 3. 计算色值并填充\n let factor = (angle - start.angle) / (end.angle - start.angle);\n let color = end.color.map(\n (v, idx) => factor * (v - start.color[idx]) + start.color[idx]\n );\n let i = (x + y * width) * 4;\n data[i] = color[0];\n data[i+1] = color[1];\n data[i+2] = color[2];\n data[i+3] = Math.min(255, color[3] * 255);\n }\n }\n return data;\n}\n\nexport default {\n getConicGradientImage,\n};\n","function canvasPolygon(ctx, list, dx = 0, dy = 0) {\n if(!list || !list.length) {\n return;\n }\n let start = -1;\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(Array.isArray(item) && item.length) {\n start = i;\n break;\n }\n }\n if(start === -1) {\n return;\n }\n ctx.moveTo(list[start][0] + dx, list[start][1] + dy);\n for(let i = start + 1, len = list.length; i < len; i++) {\n let item = list[i];\n if(!Array.isArray(item)) {\n continue;\n }\n if(item.length === 2) {\n ctx.lineTo(item[0] + dx, item[1] + dy);\n }\n else if(item.length === 4) {\n ctx.quadraticCurveTo(item[0] + dx, item[1] + dy, item[2] + dx, item[3] + dy);\n }\n else if(item.length === 6) {\n ctx.bezierCurveTo(item[0] + dx, item[1] + dy, item[2] + dx, item[3] + dy, item[4] + dx, item[5] + dy);\n }\n }\n}\n\nfunction svgPolygon(list) {\n if(!list || !list.length) {\n return '';\n }\n let start = -1;\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(Array.isArray(item) && item.length) {\n start = i;\n break;\n }\n }\n if(start === -1) {\n return '';\n }\n let s = 'M' + list[start][0] + ',' + list[start][1];\n for(let i = start + 1, len = list.length; i < len; i++) {\n let item = list[i];\n if(!Array.isArray(item)) {\n continue;\n }\n if(item.length === 2) {\n s += 'L' + item[0] + ',' + item[1];\n }\n else if(item.length === 4) {\n s += 'Q' + item[0] + ',' + item[1] + ' ' + item[2] + ',' + item[3];\n }\n else if(item.length === 6) {\n s += 'C' + item[0] + ',' + item[1] + ' ' + item[2] + ',' + item[3] + ' ' + item[4] + ',' + item[5];\n }\n }\n return s;\n}\n\nfunction canvasLine(ctx, x1, y1, x2, y2, controlA, controlB, num, dx = 0, dy = 0) {\n ctx.moveTo(x1 + dx, y1 + dy);\n if(num === 3) {\n ctx.bezierCurveTo(controlA[0] + dx, controlA[1] + dy, controlB[0] + dx, controlB[1], x2 + dx, y2 + dy);\n return 2;\n }\n else if(num === 2) {\n ctx.quadraticCurveTo(controlB[0] + dx, controlB[1] + dy, x2 + dx, y2 + dy);\n return 2;\n }\n else if(num === 1) {\n ctx.quadraticCurveTo(controlA[0] + dx, controlA[1] + dy, x2 + dx, y2 + dy);\n return 2;\n }\n else {\n ctx.lineTo(x2 + dx, y2 + dy);\n return 1;\n }\n}\n\nfunction svgLine(x1, y1, x2, y2, controlA, controlB, num) {\n if(num === 3) {\n return 'M' + x1 + ',' + y1\n + 'C' + controlA[0] + ',' + controlA[1] + ' ' + controlB[0] + ',' + controlB[1]\n + ' ' + x2 + ',' + y2;\n }\n else if(num === 2) {\n return 'M' + x1 + ',' + y1\n + 'Q' + controlB[0] + ',' + controlB[1]\n + ' ' + x2 + ',' + y2;\n }\n else if(num === 1) {\n return 'M' + x1 + ',' + y1\n + 'Q' + controlA[0] + ',' + controlA[1]\n + ' ' + x2 + ',' + y2;\n }\n else {\n return 'M' + x1 + ',' + y1 + 'L' + x2 + ',' + y2;\n }\n}\n\nfunction canvasFilter(filter) {\n let s = '';\n filter.forEach(item => {\n let [k, v] = item;\n if(k === 'blur') {\n s += `blur(${v}px)`;\n }\n else if(k === 'hue-rotate') {\n s += `hue-rotate(${v}deg)`;\n }\n else if(k === 'saturate' || k === 'brightness' || k === 'grayscale' || k === 'contrast' || k === 'sepia' || k === 'invert') {\n s += `${k}(${v}%)`;\n }\n });\n return s;\n}\n\nexport default {\n canvasPolygon,\n svgPolygon,\n canvasLine,\n svgLine,\n canvasFilter,\n svgFilter: canvasFilter,\n};\n","import geom from '../math/geom';\nimport mode from '../refresh/mode';\nimport painter from '../util/painter';\nimport enums from '../util/enums';\nimport unit from './unit';\n\nconst { H } = geom;\nconst { PX, PERCENT, REM, VW, VH, VMAX, VMIN } = unit;\nconst { canvasPolygon, svgPolygon } = painter;\nconst {\n STYLE_KEY: {\n BORDER_LEFT_WIDTH,\n BORDER_TOP_WIDTH,\n BORDER_BOTTOM_WIDTH,\n PADDING_LEFT,\n PADDING_BOTTOM,\n PADDING_TOP,\n BORDER_TOP_LEFT_RADIUS,\n BORDER_TOP_RIGHT_RADIUS,\n BORDER_BOTTOM_LEFT_RADIUS,\n BORDER_BOTTOM_RIGHT_RADIUS,\n FONT_SIZE,\n },\n} = enums;\n\n/* 获取合适的虚线实体空白宽度ps/pd和数量n\n * 总长total,start边长bs,end边长be,内容长w,\n * 实体长范围[smin,smax],空白长范围[dmin,dmax]\n */\nfunction calFitDashed(total, bs, be, w, smin, smax, dmin, dmax) {\n let n = 1;\n let ps = 1;\n let pd = 1;\n // 从最大实体空白长开始尝试\n outer:\n for(let i = smax; i >= smin; i--) {\n for(let j = dmax; j >= dmin; j--) {\n // 已知实体空白长度,n实体和n-1空白组成total,计算获取n数量\n let per = i + j;\n let num = Math.floor((total + j) / per);\n let k = j;\n // 可能除不尽,此时扩展空白长\n if(num * per < j + total) {\n let free = total - num * i;\n k = free / (num - 1);\n if(k > dmax) {\n continue;\n }\n }\n per = i + k;\n // bs比实体大才有效,因为小的话必定和第一个实体完整相连\n if(bs > 1 && bs > i) {\n let mo = bs % per;\n if(mo > i) {\n continue;\n }\n if(be > 1) {\n let mo = (bs + w) % per;\n if(mo > i) {\n continue;\n }\n }\n }\n if(be > 1) {\n let mo = (bs + w) % per;\n if(mo > i) {\n continue;\n }\n }\n if(num > 0) {\n n = num;\n ps = i;\n pd = k;\n }\n break outer;\n }\n }\n return {\n n,\n ps,\n pd,\n };\n}\n\n// dashed时n个实线和n-1虚线默认以3:1宽度组成,dotted则是n和n以1:1组成\nfunction calDashed(style, m1, m2, m3, m4, bw) {\n let total = m4 - m1;\n let w = m3 - m2;\n let bs = m2 - m1;\n let be = m4 - m3;\n if(style === 'dotted') {\n return calFitDashed(total, bs, be, w, bw, bw, Math.max(1, bw * 0.25), bw * 2);\n }\n else {\n let { n, ps, pd } = calFitDashed(total, bs, be, w, bw, bw * 3, Math.max(1, bw * 0.25), bw * 2);\n if(n === 1) {\n return calFitDashed(total, bs, be, w, bw, bw, Math.max(1, bw * 0.25), bw * 2);\n }\n // 降级为dotted\n return { n, ps, pd };\n }\n}\n\n// 获取边框分割为几块的坐标,虚线分割为若干四边形、三边型、五边形\n// 三边形重复内外边交点形成四边形,五边形进行切割形成2个四边形\n// direction为上右下左0123\nfunction calPoints(borderWidth, borderStyle, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, direction, beginRadius, endRadius) {\n let points = [];\n if(borderStyle === 'none') {\n return points;\n }\n if(['dashed', 'dotted'].indexOf(borderStyle) > -1) {\n // 寻找一个合适的虚线线段长度和之间空白边距长度\n let { n, ps, pd } = (direction === 0 || direction === 2)\n ? calDashed(borderStyle, x1, x2, x3, x4, borderWidth)\n : calDashed(borderStyle, y1, y2, y3, y4, borderWidth);\n if(n > 1) {\n for(let i = 0; i < n; i++) {\n // 最后一个可能没有到底,延长之\n let isLast = i === n - 1;\n let main1;\n let main2;\n let cross1;\n let cross2;\n if(direction === 0 || direction === 2) {\n main1 = i ? (x1 + ps * i + pd * i) : x1;\n }\n else {\n main1 = i ? (y1 + ps * i + pd * i) : y1;\n }\n main2 = main1 + ps;\n if(direction === 0) {\n // 整个和borderLeft重叠\n if(main2 <= x2) {\n if(isLast) {\n points.push([\n [x1, y1],\n [x4, y1],\n [x3, y2],\n [x2, y2]\n ]);\n }\n else {\n cross1 = y1 + (main1 - x1) * Math.tan(deg1);\n cross2 = y1 + (main2 - x1) * Math.tan(deg1);\n points.push([\n [main1, y1],\n [main2, y1],\n [main2, cross2],\n [main1, cross1]\n ]);\n }\n }\n // 整个和borderRight重叠\n else if(main1 >= x3) {\n cross1 = y1 + (x4 - main1) * Math.tan(deg2);\n cross2 = y1 + (x4 - main2) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [main1, y1],\n [x4, y1],\n [x4, y1],\n [main1, cross1]\n ]);\n }\n else {\n points.push([\n [main1, y1],\n [main2, y1],\n [main2, cross2],\n [main1, cross1]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross1 = y1 + (main1 - x1) * Math.tan(deg1);\n points.push([\n [main1, y1],\n [x2, y1],\n [x2, y2],\n [main1, cross1]\n ]);\n if(isLast) {\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x2, y2]\n ]);\n }\n else {\n // 下部分和borderRight重叠\n if(main2 > x3) {\n cross2 = y1 + (x4 - main2) * Math.tan(deg2);\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n points.push([\n [x3, y1],\n [main2, y1],\n [main2, cross2],\n [x3, y2]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x2, y1],\n [main2, y1],\n [main2, y2],\n [x2, y2]\n ]);\n }\n }\n }\n // 下部分和borderRight重叠\n else if(main2 > x3) {\n cross1 = y1 + (x4 - main2) * Math.tan(deg2);\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross2 = y1 + (main1 - x1) * Math.tan(deg1);\n points.push([\n [main1, y1],\n [x2, y1],\n [x2, y2],\n [main1, cross2]\n ]);\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n if(isLast) {\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x3, y2]\n ]);\n }\n else {\n points.push([\n [x3, y1],\n [main2, y1],\n [main2, cross1],\n [x3, y2]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [main1, y1],\n [x3, y1],\n [x3, y2],\n [main1, y2]\n ]);\n if(isLast) {\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x3, y2]\n ]);\n }\n else {\n points.push([\n [x3, y1],\n [main2, y1],\n [main2, cross1],\n [x3, y2]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [main1, y1],\n [x4, y1],\n [x3, y2],\n [main1, y2]\n ]);\n }\n else {\n points.push([\n [main1, y1],\n [main2, y1],\n [main2, y2],\n [main1, y2]\n ]);\n }\n }\n }\n }\n else if(direction === 1) {\n // 整个和borderTop重叠\n if(main2 <= y2) {\n if(isLast) {\n points.push([\n [x3, y2],\n [x4, y1],\n [x4, y4],\n [x3, y3]\n ]);\n }\n else {\n cross1 = x4 - (main1 - y1) * Math.tan(deg1);\n cross2 = x4 - (main2 - y1) * Math.tan(deg1);\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, main2],\n [cross2, main2],\n ]);\n }\n }\n // 整个和borderBottom重叠\n else if(main1 >= y3) {\n cross1 = x3 + (main1 - y3) * Math.tan(deg2);\n cross2 = x3 + (main2 - y3) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, y4],\n [x4, y4]\n ]);\n }\n else {\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, main2],\n [cross2, main2]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross1 = x3 + (y2 - main1) * Math.tan(deg1);\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, y2],\n [x3, y2]\n ]);\n if(isLast) {\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, y4],\n [x4, y4]\n ]);\n }\n else {\n // 下部分和borderBottom重叠\n if(main2 > y3) {\n cross2 = x3 + (main2 - y3) * Math.tan(deg2);\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, main2],\n [cross2, main2]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, main2],\n [x3, main2]\n ]);\n }\n }\n }\n // 下部分和borderBottom重叠\n else if(main2 > y3) {\n cross1 = x3 + (main2 - y3) * Math.tan(deg2);\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross2 = x3 + (y2 - main1) * Math.tan(deg1);\n points.push([\n [cross2, main1],\n [x4, main1],\n [x4, y2],\n [x3, y2]\n ]);\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, x4],\n [x4, x4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, main2],\n [cross1, main2]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [x3, main1],\n [x4, main1],\n [x4, y3],\n [x3, y3]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, y4],\n [x4, y4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, main2],\n [cross1, main2]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [x3, main1],\n [x4, main1],\n [x4, y4],\n [x3, y3]\n ]);\n }\n else {\n points.push([\n [x3, main1],\n [x4, main1],\n [x4, main2],\n [x3, main2]\n ]);\n }\n }\n }\n }\n else if(direction === 2) {\n // 整个和borderLeft重叠\n if(main2 <= x2) {\n if(isLast) {\n points.push([\n [x1, y4],\n [x2, y3],\n [x3, y3],\n [x4, y4]\n ]);\n }\n else {\n cross1 = y4 - (main1 - x1) * Math.tan(deg1);\n cross2 = y4 - (main2 - x1) * Math.tan(deg1);\n points.push([\n [main1, cross1],\n [main2, cross2],\n [main2, y4],\n [main1, y4]\n ]);\n }\n }\n // 整个和borderRight重叠\n else if(main1 >= x3) {\n cross1 = y4 - (x4 - main1) * Math.tan(deg2);\n cross2 = y4 - (x4 - main2) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [main1, cross1],\n [x4, y4],\n [x4, y4],\n [main1, y4]\n ]);\n }\n else {\n points.push([\n [main1, cross1],\n [main2, cross2],\n [main2, y4],\n [main1, y4]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross1 = y4 - (main1 - x1) * Math.tan(deg1);\n points.push([\n [main1, cross1],\n [x2, y3],\n [x2, y4],\n [main1, y4]\n ]);\n if(isLast) {\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n else {\n // 下部分和borderRight重叠\n if(main2 > x3) {\n cross2 = y4 - (main2 - x3) * Math.tan(deg2);\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n points.push([\n [x3, y3],\n [main2, cross2],\n [main2, y4],\n [x3, y4]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x2, y3],\n [main2, y3],\n [main2, y4],\n [x2, y4]\n ]);\n }\n }\n }\n // 下部分和borderRight重叠\n else if(main2 > x3) {\n cross1 = y4 - (x4 - main2) * Math.tan(deg2);\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross2 = y4 - (main1 - x3) * Math.tan(deg1);\n points.push([\n [main1, cross2],\n [x2, y3],\n [x2, y4],\n [main1, y4]\n ]);\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [main2, cross1],\n [main2, y4],\n [x3, y4]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [main1, y3],\n [x3, y3],\n [x3, y4],\n [main1, y4]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [main2, cross1],\n [main2, y4],\n [x3, y4]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [main1, y3],\n [x3, y3],\n [x4, y4],\n [main1, y4]\n ]);\n }\n else {\n points.push([\n [main1, y3],\n [main2, y3],\n [main2, y4],\n [main1, y4]\n ]);\n }\n }\n }\n }\n else if(direction === 3) {\n // 整个和borderTop重叠\n if(main2 <= y2) {\n if(isLast) {\n points.push([\n [x1, y1],\n [x2, y2],\n [x2, y3],\n [x1, y4]\n ]);\n }\n else {\n cross1 = x1 + (main1 - y1) * Math.tan(deg1);\n cross2 = x1 + (main2 - y1) * Math.tan(deg1);\n points.push([\n [x1, main1],\n [cross1, main1],\n [cross2, main2],\n [x1, main2]\n ]);\n }\n }\n // 整个和borderBottom重叠\n else if(main1 >= y3) {\n cross1 = x1 + (y4 - main1) * Math.tan(deg2);\n cross2 = x1 + (y4 - main2) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [x1, main1],\n [cross1, main1],\n [x1, y4],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, main1],\n [cross1, main1],\n [cross2, main2],\n [x1, main2]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross1 = x1 + (main1 - y1) * Math.tan(deg1);\n points.push([\n [x1, main1],\n [cross1, main1],\n [x2, y2],\n [x1, y2]\n ]);\n if(isLast) {\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4],\n ]);\n }\n else {\n // 下部分和borderBottom重叠\n if(main2 > y3) {\n cross2 = x1 + (y4 - main2) * Math.tan(deg2);\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n points.push([\n [x1, y3],\n [x2, y3],\n [cross2, main2],\n [x1, main2]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, main2],\n [x1, main2]\n ]);\n }\n }\n }\n // 下部分和borderBottom重叠\n else if(main2 > y3) {\n cross1 = x1 + (y4 - main2) * Math.tan(deg2);\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross2 = x1 + (main1 - y1) * Math.tan(deg1);\n points.push([\n [x1, main1],\n [cross2, main1],\n [x2, y2],\n [x1, y1]\n ]);\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n if(isLast) {\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, y3],\n [x2, y3],\n [cross1, main2],\n [x1, main2]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [x1, main1],\n [x2, main1],\n [x2, y3],\n [x1, y3]\n ]);\n if(isLast) {\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, y3],\n [x2, y3],\n [cross1, main2],\n [x1, main2]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [x1, main1],\n [x2, main1],\n [x2, y3],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, main1],\n [x2, main1],\n [x2, main2],\n [x1, main2]\n ]);\n }\n }\n }\n }\n }\n if(direction === 0) {\n return calTopRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 1) {\n return calRightRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 2) {\n return calBottomRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 3) {\n return calLeftRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n }\n }\n // 兜底返回实线\n if(direction === 0) {\n if(x2 > x1) {\n points.push([\n [x1, y1],\n [x2, y1],\n [x2, y2],\n [x1, y1]\n ]);\n }\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n if(x4 > x3) {\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x3, y2]\n ]);\n }\n return calTopRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 1) {\n if(y2 > y1) {\n points.push([\n [x4, y1],\n [x4, y1],\n [x4, y2],\n [x3, y2]\n ]);\n }\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n if(y4 > y3) {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, y4],\n [x4, y4]\n ]);\n }\n return calRightRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 2) {\n if(x2 > x1) {\n points.push([\n [x1, y4],\n [x2, y3],\n [x2, y4],\n [x1, y4]\n ]);\n }\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n if(x4 > x3) {\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n return calBottomRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 3) {\n if(y2 > y1) {\n points.push([\n [x1, y1],\n [x1, y1],\n [x2, y2],\n [x1, y2]\n ]);\n }\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n if(y4 > y3) {\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4]\n ]);\n }\n return calLeftRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n}\n\nfunction calTopRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,左圆角、右圆角、中间矩形,3个区域2个坐标;当左右圆角相接时中间矩形为0即中间2个坐标相等\n let oxl = x2 + brx - (x2 - x1);\n let oxr = x3 - erx + (x4 - x3);\n // 先拆分,当一块四边形跨越左右圆角和中间非圆角时被拆为3份,只跨一边圆角拆2份,不跨不处理\n // 也有可能左右圆角相接,跨越的只分为左右2份\n // 最终左圆角内的存入begin,右圆角内的存入end,中间center\n let beginList = [];\n let centerList = [];\n let endList = [];\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在左圆角\n if(points[1][0] < oxl) {\n beginList.push(points);\n }\n // 全在右圆角\n else if(points[0][0] > oxr) {\n endList.push(points);\n }\n // 跨越左右圆角\n else if(points[1][0] > oxr && points[0][0] < oxl) {\n let ya = oxl < x2 ? (y1 + Math.tan(deg1) * (oxl - x1)) : y2;\n let yb = oxr > x3 ? (y1 + Math.tan(deg2) * (x4 - oxr)) : y2;\n beginList.push([\n points[0],\n [oxl, y1],\n [oxl, ya],\n points[3]\n ]);\n if(oxl < oxr) {\n if(oxl > x2 && oxr < x3) {\n centerList.push([\n [oxl, y1],\n [oxr, y1],\n [oxr, y2],\n [oxl, y2],\n ]);\n }\n else if(oxl > x2) {\n centerList.push([\n [oxl, y1],\n [x3, y1],\n [x3, y2],\n [oxl, y2],\n ]);\n centerList.push([\n [x3, y1],\n [oxr, y1],\n [oxr, yb],\n [x3, y2]\n ]);\n }\n else if(oxr < x3) {\n centerList.push([\n [oxl, y1],\n [x2, y1],\n [x2, y2],\n [oxl, ya]\n ]);\n centerList.push([\n [x2, y1],\n [oxr, y1],\n [oxr, y2],\n [x2, y2],\n ]);\n }\n else {\n centerList.push([\n [oxl, y1],\n [x2, y1],\n [x2, y2],\n [oxl, ya]\n ]);\n centerList.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2],\n ]);\n centerList.push([\n [x3, y1],\n [oxr, y1],\n [oxr, yb],\n [x3, y2]\n ]);\n }\n }\n endList.push([\n [oxr, y1],\n points[1],\n points[2],\n [oxr, yb]\n ]);\n }\n // 跨越右圆角\n else if(points[1][0] > oxr) {\n let y = oxr > x3 ? (y1 + Math.tan(deg2) * (x4 - oxr)) : y2;\n centerList.push([\n points[0],\n [oxr, y1],\n [oxr, y],\n points[3]\n ]);\n endList.push([\n [oxr, y1],\n points[1],\n points[2],\n [oxr, y]\n ]);\n }\n // 跨越左圆角\n else if(points[0][0] < oxl) {\n let y = oxl < x2 ? (y1 + Math.tan(deg1) * (oxl - x1)) : y2;\n beginList.push([\n points[0],\n [oxl, y1],\n [oxl, y],\n points[3]\n ]);\n centerList.push([\n [oxl, y1],\n points[1],\n points[2],\n [oxl, y],\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = brx > (x2 - x1) && borderWidth < bry;\n // 算这个角度是为了头部和上条边相交线的延长线\n let crossDeg = Math.atan((x2 - x1) / (y2 - y1));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oyl = y1 + bry;\n let rx2 = brx - (x2 - x1);\n let ry2 = bry - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierTopLeft(beginList[0][0], beginList[0][1], oxl, oyl, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierTopLeft(beginList[0][3], beginList[0][2], oxl, oyl, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierTopLeft(points[0], points[1], oxl, oyl, sx1, ry1);\n if(needInner) {\n controls2 = calBezierTopLeft(points[3], points[2], oxl, oyl, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 0);\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 0);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n });\n }\n let endLength = endList.length;\n if(endLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = erx > (x4 - x3) && borderWidth < ery;\n // 算这个角度是为了最后和下条边相交线的延长线\n let crossDeg = Math.atan((x4 - x3) / (y2 - y1));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oyr = y1 + ery;\n let rx2 = erx - (x4 - x3);\n let ry2 = ery - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierTopRight(endList[endLength - 1][0], endList[endLength - 1][1], oxr, oyr, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierTopRight(endList[endLength - 1][3], endList[endLength - 1][2], oxr, oyr, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierTopRight(points[0], points[1], oxr, oyr, sx1, ry1);\n if(needInner) {\n controls2 = calBezierTopRight(points[3], points[2], oxr, oyr, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 1);\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 1);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierTopLeft(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = -p1x + ox;\n let dsx1 = dx1 * sx;\n let dx2 = -p2x + ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (oy - p2y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox - Math.sin(deg2) * r / sx;\n let cpy2 = oy - Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n // 最初的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox - Math.cos(alpha) * r / sx;\n cpy1 = oy - Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (oy - p1y));\n cpx1 = ox - Math.sin(deg1) * r / sx;\n cpy1 = oy - Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(p1x, p1y, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(p2x, p2y, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calBezierTopRight(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (oy - p1y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox + Math.sin(deg1) * r / sx;\n let cpy1 = oy - Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n // 最后的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox + Math.cos(alpha) * r / sx;\n cpy2 = oy - Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (oy - p2y));\n cpx2 = ox + Math.sin(deg2) * r / sx;\n cpy2 = oy - Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calRightRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,上圆角、下圆角、中间矩形,3个区域2个坐标;当上下圆角相接时中间矩形为0即中间2个坐标相等\n let oyt = y2 + bry - (y2 - y1);\n let oyb = y3 - ery + (y4 - y3);\n let beginList = [];\n let centerList = [];\n let endList = [];\n // 同borderTop拆分\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在上圆角\n if(points[2][1] < oyt) {\n beginList.push(points);\n }\n // 全在下圆角\n else if(points[1][1] > oyb) {\n endList.push(points);\n }\n // 跨越上下圆角\n else if(points[2][1] > oyb && points[1][1] < oyt) {\n let xa = oyt < y2 ? (x3 + Math.tan(deg2) * (y2 - oyt)) : x3;\n let xb = oyb > y3 ? (x3 + Math.tan(deg1) * (oyb - y3)) : x3;\n beginList.push([\n points[0],\n points[1],\n [x4, oyt],\n [xa, oyt]\n ]);\n if(oyt < oyb) {\n if(oyb < y3 && oyt > y2) {\n centerList.push([\n [x3, oyt],\n [x4, oyt],\n [x4, oyb],\n [x3, oyb]\n ]);\n }\n else if(oyt > y2) {\n centerList.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3],\n ]);\n centerList.push([\n [x3, y3],\n [x4, y3],\n [x4, oyb],\n [xb, oyb],\n ]);\n }\n else if(oyb < y3) {\n centerList.push([\n [xa, oyt],\n [x4, oyt],\n [x4, y2],\n [x3, y2],\n ]);\n centerList.push([\n [x3, y2],\n [x4, y2],\n [x4, oyb],\n [x3, oyb],\n ]);\n }\n else {\n centerList.push([\n [xa, oyt],\n [x4, oyt],\n [x4, y2],\n [x3, y2],\n ]);\n centerList.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3],\n ]);\n centerList.push([\n [x3, y3],\n [x4, y3],\n [x4, oyb],\n [xb, oyb],\n ]);\n }\n }\n endList.push([\n [xb, oyb],\n [x4, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越下圆角\n else if(points[2][1] > oyb) {\n let x = oyb > y3 ? (x3 + Math.tan(deg1) * (oyb - y3)) : x3;\n centerList.push([\n points[0],\n points[1],\n [x4, oyb],\n [x, oyb]\n ]);\n endList.push([\n [x, oyb],\n [x4, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越上圆角\n else if(points[1][1] < oyt) {\n let x = oyt < y2 ? (x3 + Math.tan(deg2) * (y2 - oyt)) : x3;\n beginList.push([\n points[0],\n points[1],\n [x4, oyt],\n [x, oyt]\n ]);\n centerList.push([\n [x, oyt],\n [x4, oyt],\n points[2],\n points[3]\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n let needInner = bry > (y2 - y1) && borderWidth < brx;\n let crossDeg = Math.atan((x4 - x3) / (y2 - y1));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oxt = x4 - brx;\n let rx2 = brx - (x4 - x3);\n let ry2 = bry - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierRightTop(beginList[0][1], beginList[0][2], oxt, oyt, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierRightTop(beginList[0][0], beginList[0][3], oxt, oyt, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierRightTop(points[1], points[2], oxt, oyt, sx1, ry1);\n if(needInner) {\n controls2 = calBezierRightTop(points[0], points[3], oxt, oyt, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 2);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 2);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[2] = points[3];\n points[3] = points[0];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n let endLength = endList.length;\n if(endLength) {\n let needInner = ery > (y4 - y3) && borderWidth < erx;\n let crossDeg = Math.atan((x4 - x3) / (y4 - y3));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oxb = x4 - erx;\n let rx2 = erx - (x4 - x3);\n let ry2 = ery - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierRightBottom(endList[endLength - 1][1], endList[endLength - 1][2], oxb, oyb, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierRightBottom(endList[endLength - 1][0], endList[endLength - 1][3], oxb, oyb, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierRightBottom(points[1], points[2], oxb, oyb, sx1, ry1);\n if(needInner) {\n controls2 = calBezierRightBottom(points[0], points[3], oxb, oyb, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 3);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 3);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[2] = points[3];\n points[3] = points[0];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierRightTop(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (oy - p2y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox + Math.sin(deg2) * r / sx;\n let cpy2 = oy - Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox + Math.cos(alpha) * r / sx;\n cpy1 = oy - Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (oy - p1y));\n cpx1 = ox + Math.sin(deg1) * r / sx;\n cpy1 = oy - Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#000';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\nfunction calBezierRightBottom(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (p1y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox + Math.sin(deg1) * r / sx;\n let cpy1 = oy + Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox + Math.cos(alpha) * r / sx;\n cpy2 = oy + Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (p2y - oy));\n cpx2 = ox + Math.sin(deg2) * r / sx;\n cpy2 = oy + Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\nfunction calBottomRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,左圆角、右圆角、中间矩形,3个区域2个坐标;当左右圆角相接时中间矩形为0即中间2个坐标相等\n let oxl = x2 + brx - (x2 - x1);\n let oxr = x3 - erx + (x4 - x3);\n // 先拆分,当一块四边形跨越左右圆角和中间非圆角时被拆为3份,只跨一边圆角拆2份,不跨不处理\n // 也有可能左右圆角相接,跨越的只分为左右2份\n // 最终左圆角内的存入begin,右圆角内的存入end,中间center\n let beginList = [];\n let centerList = [];\n let endList = [];\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在左圆角\n if(points[2][0] < oxl) {\n beginList.push(points);\n }\n // 全在右圆角\n else if(points[3][0] > oxr) {\n endList.push(points);\n }\n // 跨越左右圆角\n else if(points[2][0] > oxr && points[3][0] < oxl) {\n let ya = oxl < x2 ? (y4 - Math.tan(deg1) * (oxl - x1)) : y2;\n let yb = oxr > x3 ? (y4 - Math.tan(deg2) * (x4 - oxr)) : y3;\n beginList.push([\n points[0],\n [oxl, ya],\n [oxl, y4],\n points[3]\n ]);\n if(oxl < oxr) {\n if(oxl > x2 && oxr < x3) {\n centerList.push([\n [oxl, y3],\n [oxr, y3],\n [oxr, y4],\n [oxl, y4],\n ]);\n }\n else if(oxl > x2) {\n centerList.push([\n [oxl, y3],\n [x3, y3],\n [x3, y4],\n [oxl, y4],\n ]);\n centerList.push([\n [x3, y3],\n [oxr, yb],\n [oxr, y4],\n [x3, y4]\n ]);\n }\n else if(oxr < x3) {\n centerList.push([\n [oxl, ya],\n [x2, y3],\n [x2, y4],\n [oxl, y4]\n ]);\n centerList.push([\n [x2, y3],\n [oxr, y3],\n [oxr, y4],\n [x2, y4],\n ]);\n }\n else {\n centerList.push([\n [oxl, ya],\n [x2, y3],\n [x2, y4],\n [oxl, y4]\n ]);\n centerList.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4],\n ]);\n centerList.push([\n [x3, y3],\n [oxr, yb],\n [oxr, y4],\n [x3, y4]\n ]);\n }\n }\n endList.push([\n [oxr, yb],\n points[1],\n points[2],\n [oxr, y4]\n ]);\n }\n // 跨越右圆角\n else if(points[2][0] > oxr) {\n let y = oxr > x3 ? (y4 - Math.tan(deg2) * (x4 - oxr)) : y3;\n centerList.push([\n points[0],\n [oxr, y],\n [oxr, y4],\n points[3]\n ]);\n endList.push([\n [oxr, y],\n points[1],\n points[2],\n [oxr, y4]\n ]);\n }\n // 跨越左圆角\n else if(points[3][0] < oxl) {\n let y = oxl < x2 ? (y4 - Math.tan(deg1) * (oxl - x1)) : y3;\n beginList.push([\n points[0],\n [oxl, y],\n [oxl, y4],\n points[3]\n ]);\n centerList.push([\n [oxl, y],\n points[1],\n points[2],\n [oxl, y4],\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = brx > (x2 - x1) && borderWidth < bry;\n // 算这个角度是为了头部和上条边相交线的延长线\n let crossDeg = Math.atan((x2 - x1) / (y4 - y3));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oyl = y4 - bry;\n let rx2 = brx - (x2 - x1);\n let ry2 = bry - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierBottomLeft(beginList[0][3], beginList[0][2], oxl, oyl, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierBottomLeft(beginList[0][0], beginList[0][1], oxl, oyl, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierBottomLeft(points[3], points[2], oxl, oyl, sx1, ry1);\n if(needInner) {\n controls2 = calBezierBottomLeft(points[0], points[1], oxl, oyl, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 4);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 4);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n else {\n points[2] = points[1];\n points[3] = points[0];\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n });\n }\n let endLength = endList.length;\n if(endLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = erx > (x4 - x3) && borderWidth < ery;\n // 算这个角度是为了最后和下条边相交线的延长线\n let crossDeg = Math.atan((x4 - x3) / (y4 - y3));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oyr = y4 - ery;\n let rx2 = erx - (x4 - x3);\n let ry2 = ery - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierBottomRight(endList[endLength - 1][3], endList[endLength - 1][2], oxr, oyr, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierBottomRight(endList[endLength - 1][0], endList[endLength - 1][1], oxr, oyr, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierBottomRight(points[3], points[2], oxr, oyr, sx1, ry1);\n if(needInner) {\n controls2 = calBezierBottomRight(points[0], points[1], oxr, oyr, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 5);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 5);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n else {\n points[2] = points[1];\n points[3] = points[0];\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierBottomLeft(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = -p1x + ox;\n let dsx1 = dx1 * sx;\n let dx2 = -p2x + ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (p2y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox - Math.sin(deg2) * r / sx;\n let cpy2 = oy + Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n // 最初的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox - Math.cos(alpha) * r / sx;\n cpy1 = oy + Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (p1y - oy));\n cpx1 = ox - Math.sin(deg1) * r / sx;\n cpy1 = oy + Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calBezierBottomRight(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (p1y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox + Math.sin(deg1) * r / sx;\n let cpy1 = oy + Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n // 最后的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox + Math.cos(alpha) * r / sx;\n cpy2 = oy + Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (p2y - oy));\n cpx2 = ox + Math.sin(deg2) * r / sx;\n cpy2 = oy + Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calLeftRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,上圆角、下圆角、中间矩形,3个区域2个坐标;当上下圆角相接时中间矩形为0即中间2个坐标相等\n let oyt = y2 + bry - (y2 - y1);\n let oyb = y3 - ery + (y4 - y3);\n let beginList = [];\n let centerList = [];\n let endList = [];\n // 同borderTop拆分\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在上圆角\n if(points[3][1] < oyt) {\n beginList.push(points);\n }\n // 全在下圆角\n else if(points[0][1] > oyb) {\n endList.push(points);\n }\n // 跨越上下圆角\n else if(points[3][1] > oyb && points[0][1] < oyt) {\n let xa = oyt < y2 ? (x2 - Math.tan(deg2) * (y2 - oyt)) : x2;\n let xb = oyb > y3 ? (x2 - Math.tan(deg1) * (oyb - y3)) : x2;\n beginList.push([\n points[0],\n points[1],\n [xa, oyt],\n [x1, oyt]\n ]);\n if(oyt < oyb) {\n if(oyb < y3 && oyt > y2) {\n centerList.push([\n [x1, oyt],\n [x2, oyt],\n [x2, oyb],\n [x1, oyb]\n ]);\n }\n else if(oyt > y2) {\n centerList.push([\n [x1, oyt],\n [x2, oyt],\n [x2, y3],\n [x1, y3],\n ]);\n centerList.push([\n [x1, y3],\n [x2, y3],\n [xb, oyb],\n [x1, oyb],\n ]);\n }\n else if(oyb < y3) {\n centerList.push([\n [x1, oyt],\n [xa, oyt],\n [x2, y2],\n [x1, y2],\n ]);\n centerList.push([\n [x1, y2],\n [x2, y2],\n [x2, oyb],\n [x1, oyb],\n ]);\n }\n else {\n centerList.push([\n [x1, oyt],\n [xa, oyt],\n [x2, y2],\n [x1, y2],\n ]);\n centerList.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3],\n ]);\n centerList.push([\n [x1, y3],\n [x2, y3],\n [xb, oyb],\n [x1, oyb],\n ]);\n }\n }\n endList.push([\n [x1, oyb],\n [xb, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越下圆角\n else if(points[3][1] > oyb) {\n let x = oyb > y3 ? (x2 - Math.tan(deg1) * (oyb - y3)) : x2;\n centerList.push([\n points[0],\n points[1],\n [x, oyb],\n [x1, oyb]\n ]);\n endList.push([\n [x1, oyb],\n [x, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越上圆角\n else if(points[1][1] < oyt) {\n let x = oyt < y2 ? (x2 - Math.tan(deg2) * (y2 - oyt)) : x2;\n beginList.push([\n points[0],\n points[1],\n [x, oyt],\n [x1, oyt]\n ]);\n centerList.push([\n [x1, oyt],\n [x, oyt],\n points[2],\n points[3]\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n let needInner = bry > (y2 - y1) && borderWidth < brx;\n let crossDeg = Math.atan((x2 - x1) / (y2 - y1));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oxt = x1 + brx;\n let rx2 = brx - (x2 - x1);\n let ry2 = bry - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierLeftTop(beginList[0][0], beginList[0][3], oxt, oyt, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierLeftTop(beginList[0][1], beginList[0][2], oxt, oyt, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierLeftTop(points[0], points[3], oxt, oyt, sx1, ry1);\n if(needInner) {\n controls2 = calBezierLeftTop(points[1], points[2], oxt, oyt, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 6);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 6);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[3] = points[1];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n let endLength = endList.length;\n if(endLength) {\n let needInner = ery > (y4 - y3) && borderWidth < erx;\n let crossDeg = Math.atan((x2 - x1) / (y4 - y3));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oxb = x1 + erx;\n let rx2 = erx - (x2 - x1);\n let ry2 = ery - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierLeftBottom(endList[endLength - 1][0], endList[endLength - 1][3], oxb, oyb, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierLeftBottom(endList[endLength - 1][1], endList[endLength - 1][2], oxb, oyb, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierLeftBottom(points[0], points[3], oxb, oyb, sx1, ry1);\n if(needInner) {\n controls2 = calBezierLeftBottom(points[1], points[2], oxb, oyb, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 7);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 7);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[3] = points[1];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierLeftTop(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = ox - p1x;\n let dsx1 = dx1 * sx;\n let dx2 = ox - p2x;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (oy - p2y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox - Math.sin(deg2) * r / sx;\n let cpy2 = oy - Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox - Math.cos(alpha) * r / sx;\n cpy1 = oy - Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (oy - p1y));\n cpx1 = ox - Math.sin(deg1) * r / sx;\n cpy1 = oy - Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#000';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\nfunction calBezierLeftBottom(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = ox - p1x;\n let dsx1 = dx1 * sx;\n let dx2 = ox - p2x;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (p1y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox - Math.sin(deg1) * r / sx;\n let cpy1 = oy + Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox - Math.cos(alpha) * r / sx;\n cpy2 = oy + Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (p2y - oy));\n cpx2 = ox - Math.sin(deg2) * r / sx;\n cpy2 = oy + Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\n/**\n * 简单计算椭圆的圆化坐标控制点,视作重合位置,外面判断backgroundClip并调整坐标\n * @param x 起始x\n * @param y 起始y\n * @param w 宽\n * @param h 高\n * @param btlr borderTopLeftRadius\n * @param btrr borderTopRightRadius\n * @param bbrr borderBottomRightRadius\n * @param bblr borderBottomLeftRadius\n * @returns {[]} 多边形的顶点和曲线控制点\n */\nfunction calRadius(x, y, w, h, btlr, btrr, bbrr, bblr) {\n let need;\n let [btlx, btly] = btlr;\n let [btrx, btry] = btrr;\n let [bbrx, bbry] = bbrr;\n let [bblx, bbly] = bblr;\n btlx = Math.max(btlx, 0);\n btly = Math.max(btly, 0);\n btrx = Math.max(btrx, 0);\n btry = Math.max(btry, 0);\n bbrx = Math.max(bbrx, 0);\n bbry = Math.max(bbry, 0);\n bblx = Math.max(bblx, 0);\n bbly = Math.max(bbly, 0);\n // 圆角必须x/y都>0才有效,否则视为不绘制\n if(btlx > 0 && btly > 0 || btrx > 0 && btry > 0 || bbrx > 0 && bbry > 0 || bblx > 0 && bbly > 0) {\n need = true;\n }\n if(need) {\n let list = [];\n if(btlx > 0 && btly > 0) {\n list.push([x, y + btly]);\n list.push([x, y + (btly) * (1 - H), x + btlx * (1 - H), y, x + btlx, y]);\n }\n else {\n list.push([x, y]);\n }\n if(btrx > 0 && btry > 0) {\n list.push([x + w - btrx, y]);\n list.push([x + w - btrx * (1 - H), y, x + w, y + btry * (1 - H), x + w, y + btry]);\n }\n else {\n list.push([x + w, y]);\n }\n if(bbrx > 0 && bbry > 0) {\n list.push([x + w, y + h - bbry]);\n list.push([x + w, y + h - bbry * (1 - H), x + w - bbrx * (1 - H), y + h, x + w - bbrx, y + h]);\n }\n else {\n list.push([x + w, y + h]);\n }\n if(bblx > 0 && bbly > 0) {\n list.push([x + bblx, y + h]);\n list.push([x + bblx * (1 - H), y + h, x, y + h - bbly * (1 - H), x, y + h - bbly]);\n }\n else {\n list.push([x, y + h]);\n }\n return list;\n }\n}\n\nfunction limit(points, x, y, direction) {\n if(direction === 0) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n else if(direction === 1) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n else if(direction === 2) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 3) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n else if(direction === 4) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 5) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 6) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 7) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n}\n\nconst BR_KS = [BORDER_TOP_LEFT_RADIUS, BORDER_TOP_RIGHT_RADIUS, BORDER_BOTTOM_RIGHT_RADIUS, BORDER_BOTTOM_LEFT_RADIUS];\nfunction calBorderRadius(w, h, currentStyle, computedStyle, root) {\n let noRadius = true;\n BR_KS.forEach(k => {\n computedStyle[k] = currentStyle[k].map((item, i) => {\n if(item[0] > 0) {\n noRadius = false;\n }\n else {\n return 0;\n }\n if(item[1] === PX) {\n return Math.max(0, item[0]);\n }\n else if(item[1] === PERCENT) {\n return Math.max(0, item[0] * (i ? h : w) * 0.01);\n }\n else if(item[1] === REM) {\n return Math.max(0, item[0] * root.computedStyle[FONT_SIZE]);\n }\n else if(item[1] === VW) {\n return Math.max(0, item[0] * root.width * 0.01);\n }\n else if(item[1] === VH) {\n return Math.max(0, item[0] * root.height * 0.01);\n }\n else if(item[1] === VMAX) {\n return Math.max(0, item[0] * Math.max(root.width, root.height) * 0.01);\n }\n else if(item[1] === VMIN) {\n return Math.max(0, item[0] * Math.min(root.width, root.height) * 0.01);\n }\n return 0;\n });\n });\n // 优化提前跳出\n if(noRadius) {\n return;\n }\n // radius限制,相交的2个之和不能超过边长,如果2个都超过中点取中点,只有1个超过取交点,这包含了单个不能超过总长的逻辑\n BR_KS.forEach((k, i) => {\n let j = i % 2 === 0 ? 0 : 1;\n let target = j ? h : w;\n let prev = computedStyle[k];\n let next = computedStyle[BR_KS[(i + 1) % 4]];\n // 相加超过边长则是相交\n if(prev[j] + next[j] > target) {\n let half = target * 0.5;\n // 都超过一半中点取中点\n if(prev[j] >= half && next[j] >= half) {\n prev[j] = next[j] = half;\n }\n // 仅1个超过中点,因相交用总长减去另一方即可\n else if(prev[j] > half) {\n prev[j] = target - next[j];\n }\n else if(next[j] > half) {\n next[j] = target - prev[j];\n }\n }\n });\n}\n\nfunction calBorderRadiusInline(contentBoxList, currentStyle, computedStyle) {\n let first, last;\n if(contentBoxList.length) {\n first = contentBoxList[0];\n last = contentBoxList[contentBoxList.length - 1]\n }\n // 先看first的左侧\n let w = first ? first.outerWidth : 0, h = first ? first.outerHeight : 0;\n w += computedStyle[BORDER_LEFT_WIDTH] + computedStyle[PADDING_LEFT];\n h += computedStyle[BORDER_TOP_WIDTH] + computedStyle[BORDER_BOTTOM_WIDTH]\n + computedStyle[PADDING_TOP] + computedStyle[PADDING_BOTTOM];\n [BORDER_TOP_LEFT_RADIUS, BORDER_BOTTOM_LEFT_RADIUS].forEach(k => {\n computedStyle[k] = currentStyle[k].map((item, i) => {\n let v;\n if(item[1] === PX) {\n v = Math.max(0, item[0]);\n v = Math.min(i ? h : w, v);\n }\n else {\n v = Math.max(0, item[0] * (i ? h : w) * 0.01);\n v = Math.min(i ? h : w, v);\n }\n return v;\n });\n });\n // 再看end的右侧\n w = last ? last.outerWidth : 0;\n h = last ? last.outerHeight : 0;\n [BORDER_TOP_RIGHT_RADIUS, BORDER_BOTTOM_RIGHT_RADIUS].forEach(k => {\n computedStyle[k] = currentStyle[k].map((item, i) => {\n let v;\n if(item[1] === PX) {\n v = Math.max(0, item[0]);\n v = Math.min(i ? h : w, v);\n }\n else {\n v = Math.max(0, item[0] * (i ? h : w) * 0.01);\n v = Math.min(i ? h : w, v);\n }\n return v;\n });\n });\n}\n\nfunction renderBorder(xom, renderMode, ctx, points, color, dx, dy) {\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n ctx.beginPath();\n if(ctx.fillStyle !== color) {\n ctx.fillStyle = color;\n }\n points.forEach(point => {\n canvasPolygon(ctx, point, dx, dy);\n });\n ctx.fill();\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n let s = '';\n points.forEach(point => {\n s += svgPolygon(point);\n });\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', s],\n ['fill', color],\n ],\n });\n }\n}\n\nexport default {\n calPoints,\n calRadius,\n calBorderRadius,\n calBorderRadiusInline,\n renderBorder,\n};\n","// 类型为引用防止json仿造\nconst TYPE_VD = Symbol('Dom');\nconst TYPE_GM = Symbol('Geom');\nconst TYPE_CP = Symbol('Component');\n\nexport default {\n TYPE_VD,\n TYPE_GM,\n TYPE_CP,\n};\n","import $$type from './$$type';\nimport mx from '../math/matrix';\n\nlet toString = {}.toString;\nfunction isType(type) {\n return function(obj) {\n return toString.call(obj) === '[object ' + type + ']';\n }\n}\n\nlet isObject = isType('Object');\nlet isString = isType('String');\nlet isFunction = isType('Function');\nlet isNumber = isType('Number');\nlet isBoolean = isType('Boolean');\nlet isDate = isType('Date');\n\nlet hasOwn = {}.hasOwnProperty;\nlet fnToString = hasOwn.toString;\nlet ObjectFunctionString = fnToString.call(Object);\n\nfunction isNil(v) {\n return v === undefined || v === null;\n}\n\nfunction joinSourceArray(arr) {\n let res = '';\n for(let i = 0, len = arr.length; i < len; i++) {\n let item = arr[i];\n if(Array.isArray(item)) {\n res += joinSourceArray(item);\n }\n else {\n res += stringify(item);\n }\n }\n return res;\n}\n\nfunction stringify(s) {\n if(isNil(s)) {\n return '';\n }\n return s.toString();\n}\n\nfunction encodeHtml(s, prop) {\n if(prop) {\n return s.replace(/\"/g, '"');\n }\n return s.replace(/&/g, '&').replace(/';\n vd.defs.forEach(item => {\n s += joinDef(item);\n });\n s += '';\n vd.bb.forEach(item => {\n s += joinVd(item);\n });\n s += '';\n (vd.children || []).forEach(item => {\n if(item.isMask) {\n return;\n }\n s += joinVd(item);\n });\n s += '';\n return s;\n}\n\n// 普通元素\nfunction joinVd(vd) {\n if(vd.type === 'item' || vd.type === 'img') {\n let s = '';\n (vd.props || []).forEach(item => {\n s += ' ' + item[0] + '=\"' + item[1] + '\"';\n });\n if(vd.tagName === 'text') {\n return '' + vd.content + '';\n }\n return '<' + vd.tagName + s + '/>';\n }\n else if(vd.type === 'text') {\n let s = ``;\n // text有许多lineBox\n (vd.children || []).forEach(item => {\n s += joinVd(item);\n });\n return '' + s + '';\n }\n else if(vd.type === 'dom' || vd.type === 'geom') {\n let s = '';\n vd.bb.forEach(item => {\n s += joinVd(item);\n });\n s += '';\n (vd.children || []).forEach(item => {\n if(item.isMask) {\n return;\n }\n s += joinVd(item);\n });\n s += '';\n let { opacity, transform, visibility, mask, overflow, filter, mixBlendMode } = vd;\n return '' + s + '';\n }\n}\n\nfunction joinDef(def) {\n let s = '<' + def.tagName + ' id=\"' + def.uuid + '\"';\n if(def.tagName === 'mask' || def.tagName === 'clipPath') {\n // s += ' maskUnits=\"userSpaceOnUse\"';\n }\n else if(def.tagName === 'filter') {\n // s += ' filterUnits=\"userSpaceOnUse\"';\n }\n else {\n s += ' gradientUnits=\"userSpaceOnUse\"';\n }\n (def.props || []).forEach(item => {\n s += ' ' + item[0] + '=\"' + item[1] + '\"';\n });\n s += '>';\n (def.children || []).forEach(item => {\n s += joinItem(item);\n });\n s += '' + def.tagName + '>';\n return s;\n}\n\nfunction joinItem(item) {\n let s = '<' + item.tagName;\n (item.props || []).forEach(item => {\n s += ' ' + item[0] + '=\"' + item[1] + '\"';\n });\n s += '>' + item.tagName + '>';\n return s;\n}\n\nfunction rgba2int(color) {\n if(Array.isArray(color)) {\n return color;\n }\n let res = [];\n if(!color || color === 'transparent') {\n res = [0, 0, 0, 0];\n }\n else if(color.charAt(0) === '#') {\n color = color.slice(1);\n if(color.length === 3) {\n res.push(parseInt(color.charAt(0) + color.charAt(0), 16));\n res.push(parseInt(color.charAt(1) + color.charAt(1), 16));\n res.push(parseInt(color.charAt(2) + color.charAt(2), 16));\n res[3] = 1;\n }\n else if(color.length === 6) {\n res.push(parseInt(color.slice(0, 2), 16));\n res.push(parseInt(color.slice(2, 4), 16));\n res.push(parseInt(color.slice(4), 16));\n res[3] = 1;\n }\n else if(color.length === 8) {\n res.push(parseInt(color.slice(0, 2), 16));\n res.push(parseInt(color.slice(2, 4), 16));\n res.push(parseInt(color.slice(4, 6), 16));\n res.push(parseInt(color.slice(6), 16) / 255);\n }\n else {\n res[0] = res[1] = res[2] = 0;\n res[3] = 1;\n }\n }\n else {\n let c = color.match(/rgba?\\s*\\(\\s*([\\d.]+)\\s*,\\s*([\\d.]+)\\s*,\\s*([\\d.]+)(?:\\s*,\\s*([\\d.]+))?\\s*\\)/i);\n if(c) {\n res = [parseInt(c[1]), parseInt(c[2]), parseInt(c[3])];\n if(!isNil(c[4])) {\n res[3] = parseFloat(c[4]);\n }\n else {\n res[3] = 1;\n }\n }\n else {\n res = [0, 0, 0, 0];\n }\n }\n return res;\n}\n\nfunction int2rgba(color) {\n if(Array.isArray(color)) {\n if(color.length === 4) {\n color = color.map((c, i) => i === 3 ? c : Math.floor(Math.max(0, c)));\n return 'rgba(' + joinArr(color, ',') + ')';\n }\n else if(color.length === 3) {\n color = color.map(c => Math.floor(c));\n return 'rgba(' + joinArr(color, ',') + ',1)';\n }\n }\n return color || 'rgba(0,0,0,0)';\n}\n\nfunction int2invert(color) {\n if(Array.isArray(color)) {\n color = color.slice(0);\n color[0] = 255 - color[0];\n color[1] = 255 - color[1];\n color[2] = 255 - color[2];\n if(color.length === 4) {\n return 'rgba(' + joinArr(color, ',') + ')';\n }\n else if(color.length === 3) {\n return 'rgba(' + joinArr(color, ',') + ',1)';\n }\n }\n return 'rgba(0,0,0,0)';\n}\n\nfunction arr2hash(arr) {\n let hash = {};\n for(let i = 0, len = arr.length; i < len; i++) {\n let item = arr[i];\n if(Array.isArray(item)) {\n hash[item[0]] = item[1];\n }\n else {\n for(let list = Object.keys(item), j = list.length - 1; j >= 0; j--) {\n let k = list[j];\n hash[k] = item[k];\n }\n }\n }\n return hash;\n}\n\nfunction hash2arr(hash) {\n if(Array.isArray(hash)) {\n return hash;\n }\n let arr = [];\n for(let list = Object.keys(hash), i = 0, len = list.length; i < len; i++) {\n let k = list[i];\n arr.push([k, hash[k]]);\n }\n return arr;\n}\n\nfunction clone(obj) {\n if(isNil(obj) || typeof obj !== 'object') {\n return obj;\n }\n // parse递归会出现内部先返回解析好的json,外部parse不能clone\n if(obj.$$type === $$type.TYPE_VD\n || obj.$$type === $$type.TYPE_GM\n || obj.$$type === $$type.TYPE_CP) {\n return obj;\n }\n if(util.isDate(obj)) {\n return new Date(obj);\n }\n if(!isPlainObject(obj) && !Array.isArray(obj)) {\n return obj;\n }\n let n = Array.isArray(obj) ? [] : {};\n Object.keys(obj).forEach(i => {\n n[i] = clone(obj[i]);\n });\n return n;\n}\n\n/**\n * 简化的arr对比,arr中只有arr和其它类型,其它类型对比值或引用,arr递归\n * @param a\n * @param b\n * @returns {boolean}\n */\nfunction equalArr(a, b) {\n if(!a || !b) {\n return a === b;\n }\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n let ai = a[i];\n let bi = b[i];\n let isArrayA = Array.isArray(ai);\n let isArrayB = Array.isArray(bi);\n if(isArrayA && isArrayB) {\n if(!equalArr(ai, bi)) {\n return false;\n }\n }\n else if(isArrayA || isArrayB) {\n return false;\n }\n else if(ai !== bi) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * 深度对比对象\n * @param a\n * @param b\n * @returns {boolean}\n */\nfunction equal(a, b) {\n if(a === b) {\n return true;\n }\n if(isObject(a) && isObject(b)) {\n let hash = {};\n for(let i = 0, arr = Object.keys(a), len = arr.length; i < len; i++) {\n let k = arr[i];\n if(!b.hasOwnProperty(k) || !equal(a[k], b[k])) {\n return false;\n }\n hash[k] = true;\n }\n // a没有b有则false\n for(let i = 0, arr = Object.keys(b), len = arr.length; i < len; i++) {\n let k = arr[i];\n if(!hash.hasOwnProperty(k)) {\n return false;\n }\n }\n }\n else if(isDate(a) && isDate(b)) {\n return a.getTime() === b.getTime();\n }\n else if(Array.isArray(a) && Array.isArray(b)) {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n if(!equal(a[i], b[i])) {\n return false;\n }\n }\n }\n else {\n return a === b;\n }\n return true;\n}\n\nfunction extend(target, source, keys) {\n if(source === null || typeof source !== 'object') {\n return target;\n }\n if(!keys) {\n keys = Object.keys(source);\n }\n let i = 0;\n let len = keys.length;\n while(i < len) {\n let k = keys[i];\n target[k] = source[k];\n i++;\n }\n return target;\n}\n\nfunction joinArr(arr, split) {\n let s = arr.length ? arr[0] : '';\n for(let i = 1, len = arr.length; i < len; i++) {\n s += split + arr[i];\n }\n return s;\n}\n\nfunction extendAnimate(ovd, nvd) {\n let list = nvd.__animationList = ovd.animationList.splice(0);\n list.forEach(item => {\n item.__setTarget(nvd);\n // 事件队列的缘故,可能动画本帧刚执行过,然后再继承,就会缺失,需再次赋值一遍;也有可能停留最后\n if(item.assigning || item.finished && item.__stayEnd()) {\n item.assignCurrentStyle();\n }\n });\n // 帧动画继承\n nvd.__frameAnimateList = ovd.__frameAnimateList.splice(0);\n}\n\nfunction transformBbox(bbox, matrix, dx = 0, dy = 0) {\n if(matrix && !mx.isE(matrix)) {\n let [x1, y1, x2, y2] = bbox;\n // 可能因filter的原因扩展范围\n if(dx) {\n x1 -= dx;\n x2 += dx;\n }\n if(dy) {\n y1 -= dy;\n y2 += dy;\n }\n let list = [x2, y1, x1, y2, x2, y2];\n let w;\n [x1, y1, , w] = mx.calPoint([x1, y1], matrix);\n if(w && w !== 1) {\n x1 /= w;\n y1 /= w;\n }\n let xa = x1, ya = y1, xb = x1, yb = y1;\n for(let i = 0; i < 6; i += 2) {\n let x = list[i], y = list[i + 1];\n [x, y, , w] = mx.calPoint([x, y], matrix);\n if(w && w !== 1) {\n x /= w;\n y /= w;\n }\n xa = Math.min(xa, x);\n xb = Math.max(xb, x);\n ya = Math.min(ya, y);\n yb = Math.max(yb, y);\n }\n bbox = [xa, ya, xb, yb];\n }\n else if(dx || dy) {\n bbox = bbox.slice(0);\n bbox[0] -= dx;\n bbox[1] -= dy;\n bbox[2] += dx;\n bbox[3] += dy;\n }\n return bbox;\n}\n\nfunction isPlainObject(obj) {\n if(!obj || toString.call(obj) !== '[object Object]') {\n return false;\n }\n let proto = Object.getPrototypeOf(obj);\n if(!proto) {\n return true;\n }\n let Ctor = hasOwn.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor === 'function' && fnToString.call(Ctor) === ObjectFunctionString;\n}\n\nfunction assignMatrix(t, v) {\n t[0] = v[0];\n t[1] = v[1];\n t[2] = v[2];\n t[3] = v[3];\n t[4] = v[4];\n t[5] = v[5];\n t[6] = v[6];\n t[7] = v[7];\n t[8] = v[8];\n t[9] = v[9];\n t[10] = v[10];\n t[11] = v[11];\n t[12] = v[12];\n t[13] = v[13];\n t[14] = v[14];\n t[15] = v[15];\n return t;\n}\n\nlet util = {\n isObject,\n isString,\n isFunction,\n isNumber,\n isBoolean,\n isDate,\n isNil,\n isPrimitive(v) {\n return util.isNil(v) || util.isBoolean(v) || util.isString(v) || util.isNumber(v);\n },\n // css中常用undefined/null表示auto本身\n isAuto(v) {\n return isNil(v) || v === 'auto';\n },\n isPlainObject,\n stringify,\n joinSourceArray(arr) {\n return joinSourceArray(arr);\n },\n encodeHtml,\n joinVirtualDom,\n joinVd,\n joinDef,\n rgba2int,\n int2rgba,\n int2invert,\n arr2hash,\n hash2arr,\n clone,\n equalArr,\n equal,\n extend,\n joinArr,\n extendAnimate,\n transformBbox,\n assignMatrix,\n};\n\nexport default util;\n","export default {\n flag: false,\n};\n","export default {\n list: [], // 每次渲染前的更新后,等待测量的文字对象列表\n data: {}, // Text中存入的特殊等待测量的信息,字体+字号+粗细为key\n charWidth: {}, // key的文字宽度hash\n padding: {}, // key的文字宽度偏移,少量字体的少量文字有\n ELLIPSIS: '…',\n};\n","export default {\n alpha: true,\n antialias: true,\n premultipliedAlpha: true,\n preserveDrawingBuffer: true,\n // depth: true,\n // stencil: true,\n};\n","import mx from '../math/matrix';\n\nconst calPoint = mx.calPoint;\n\n/**\n * 初始化 shader\n * @param gl GL context\n * @param vshader vertex shader (string)\n * @param fshader fragment shader (string)\n * @return program, if the program object was created and successfully made current\n */\nfunction initShaders(gl, vshader, fshader) {\n let program = createProgram(gl, vshader, fshader);\n if(!program) {\n throw new Error('Failed to create program');\n }\n\n // 要开启透明度,用以绘制透明的图形\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);\n return program;\n}\n\n/**\n * Create the linked program object\n * @param gl GL context\n * @param vshader a vertex shader program (string)\n * @param fshader a fragment shader program (string)\n * @return created program object, or null if the creation has failed\n */\nfunction createProgram(gl, vshader, fshader) {\n // Create shader object\n let vertexShader = loadShader(gl, gl.VERTEX_SHADER, vshader);\n let fragmentShader = loadShader(gl, gl.FRAGMENT_SHADER, fshader);\n if(!vertexShader || !fragmentShader) {\n return null;\n }\n\n // Create a program object\n let program = gl.createProgram();\n if(!program) {\n return null;\n }\n program.vertexShader = vertexShader;\n program.fragmentShader = fragmentShader;\n\n // Attach the shader objects\n gl.attachShader(program, vertexShader);\n gl.attachShader(program, fragmentShader);\n\n // Link the program object\n gl.linkProgram(program);\n\n // Check the result of linking\n let linked = gl.getProgramParameter(program, gl.LINK_STATUS);\n if(!linked) {\n let error = gl.getProgramInfoLog(program);\n gl.deleteProgram(program);\n gl.deleteShader(fragmentShader);\n gl.deleteShader(vertexShader);\n throw new Error('Failed to link program: ' + error);\n }\n return program;\n}\n\n/**\n * Create a shader object\n * @param gl GL context\n * @param type the type of the shader object to be created\n * @param source shader program (string)\n * @return created shader object, or null if the creation has failed.\n */\nexport function loadShader(gl, type, source) {\n // Create shader object\n let shader = gl.createShader(type);\n if(shader == null) {\n throw new Error('unable to create shader');\n }\n\n // Set the shader program\n gl.shaderSource(shader, source);\n\n // Compile the shader\n gl.compileShader(shader);\n\n // Check the result of compilation\n let compiled = gl.getShaderParameter(shader, gl.COMPILE_STATUS);\n if(!compiled) {\n let error = gl.getShaderInfoLog(shader);\n gl.deleteShader(shader);\n throw new Error('Failed to compile shader: ' + error);\n }\n\n return shader;\n}\n\nfunction convertCoords2Gl([x, y, z, w], cx, cy, revertY) {\n if(z === undefined) {\n z = 0;\n }\n if(w === undefined) {\n w = 1;\n }\n if(w && w !== 1) {\n x /= w;\n y /= w;\n z /= w;\n }\n if(x === cx) {\n x = 0;\n }\n else {\n x = (x - cx) / cx;\n }\n if(y === cy) {\n y = 0;\n }\n else {\n y = (y - cy) / cy;\n if(revertY) {\n y = -y;\n }\n }\n return [x * w, y * w, z * w, w];\n}\n\nfunction createTexture(gl, tex, n, width, height) {\n let texture = gl.createTexture();\n bindTexture(gl, texture, n);\n // gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, -1);\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n // 传入高宽时是绑定fbo,且tex一定为null\n if(width && height) {\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, tex);\n }\n // 普通将canvas对象作为纹理\n else {\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, tex);\n }\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n return texture;\n}\n\nfunction bindTexture(gl, texture, n) {\n gl.activeTexture(gl['TEXTURE' + n]);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n}\n\n/**\n * texCache集满纹理上传占用最多可用纹理单元后,进行批量顺序绘制\n * 将所有dom的矩形顶点(经过transform变换后的)、贴图坐标、透明度存入3个buffer中,\n * 然后相同纹理单元的形成一批,设置uniform的纹理单元号进行绘制,如此循环\n * @param gl\n * @param list\n * @param hash\n * @param cx\n * @param cy\n * @param revertY\n */\nfunction drawTextureCache(gl, list, hash, cx, cy, revertY) {\n let vtPoint = [], vtTex = [], vtOpacity = [];\n let lastChannel; // 上一个dom的单元号\n let record = [0]; // [num, channel]每一批的数量和单元号记录\n let stack = [record]; // 所有批的数据记录集合\n list.forEach((item, i) => {\n let [cache, opacity, matrix, dx, dy] = item;\n if(i) {\n let channel = hash[cache.page.uuid];\n // 和上一个单元号不同时,生成新的批次记录\n if(lastChannel !== channel) {\n lastChannel = channel;\n record = [0, lastChannel];\n stack.push(record);\n }\n }\n else {\n lastChannel = hash[cache.page.uuid];\n record[1] = lastChannel;\n }\n let { x, y, width, height, page, bbox } = cache;\n // 计算顶点坐标和纹理坐标,转换[0,1]对应关系\n let bx = bbox[0], by = bbox[1];\n let [xa, ya] = [bx + (dx || 0), by + height + (dy || 0)];\n let [xb, yb] = [bx + width + (dx || 0), by + (dy || 0)];\n let [x1, y1, , w1] = calPoint([xa, ya], matrix);\n let [x2, y2, , w2] = calPoint([xb, ya], matrix);\n let [x3, y3, , w3] = calPoint([xb, yb], matrix);\n let [x4, y4, , w4] = calPoint([xa, yb], matrix);\n [x1, y1] = convertCoords2Gl([x1, y1, 0, w1], cx, cy, revertY);\n [x2, y2] = convertCoords2Gl([x2, y2, 0, w2], cx, cy, revertY);\n [x3, y3] = convertCoords2Gl([x3, y3, 0, w3], cx, cy, revertY);\n [x4, y4] = convertCoords2Gl([x4, y4, 0, w4], cx, cy, revertY);\n vtPoint.push(x1, y1, 0, w1, x4, y4, 0, w4, x2, y2, 0, w2, x4, y4, 0, w4, x2, y2, 0, w2, x3, y3, 0, w3);\n let tx1 = x / page.width, ty1 = (y + height) / page.height;\n let tx2 = (x + width) / page.width, ty2 = y / page.height;\n vtTex.push(tx1, ty1, tx1, ty2, tx2, ty1, tx1, ty2, tx2, ty1, tx2, ty2);\n vtOpacity.push(opacity, opacity, opacity, opacity, opacity, opacity);\n record[0]++;\n });\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vtPoint), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(gl.program, 'a_position');\n gl.vertexAttribPointer(a_position, 4, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vtTex), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(gl.program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // opacity buffer\n let opacityBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, opacityBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vtOpacity), gl.STATIC_DRAW);\n let a_opacity = gl.getAttribLocation(gl.program, 'a_opacity');\n gl.vertexAttribPointer(a_opacity, 1, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_opacity);\n // 纹理单元\n let u_texture = gl.getUniformLocation(gl.program, 'u_texture');\n let count = 0;\n // 循环按批次渲染\n stack.forEach(record => {\n let [num, channel] = record;\n gl.uniform1i(u_texture, channel);\n num *= 6;\n gl.drawArrays(gl.TRIANGLES, count, num);\n count += num;\n });\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.deleteBuffer(opacityBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n gl.disableVertexAttribArray(a_opacity);\n}\n\n/**\n * https://www.w3.org/TR/2018/WD-filter-effects-1-20181218/#feGaussianBlurElement\n * 根据cacheTotal生成cacheFilter,按照css规范的优化方法执行3次,避免卷积核扩大3倍性能慢\n * x/y方向分开执行,加速性能,计算次数由d*d变为d+d,d为卷积核大小\n * spread由d和sigma计算得出,d由sigma计算得出,sigma即css的blur()参数\n * 规范的优化方法对d的值分奇偶优化,这里再次简化,d一定是奇数,即卷积核大小\n * i和j为total和filter的纹理单元,3次执行(x/y合起来算1次)需互换单元,来回执行源和结果\n * 由total变为filter时cache会各方向上扩展spread的大小到width/height\n * 因此第一次绘制时坐标非1,后面则固定1\n * @param gl\n * @param program\n * @param frameBuffer\n * @param texCache\n * @param tex1 初次绘制目标纹理\n * @param tex2 初次绘制源纹理\n * @param i 初次绘制目标纹理单元\n * @param j 初次绘制源纹理单元\n * @param width\n * @param height\n * @param cx\n * @param cy\n * @param spread\n * @param d\n * @param sigma\n */\nfunction drawBlur(gl, program, frameBuffer, texCache, tex1, tex2, i, j, width, height, cx, cy, spread, d, sigma) {\n // 第一次将total绘制到blur上,此时尺寸存在spread差值,因此不加模糊防止坐标计算问题,仅作为扩展纹理尺寸\n let [x1, y2] = convertCoords2Gl([spread, height - spread], cx, cy);\n let [x2, y1] = convertCoords2Gl([width - spread, spread], cx, cy);\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n x1, y1,\n x1, y2,\n x2, y1,\n x1, y2,\n x2, y1,\n x2, y2,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(program, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n 0, 0,\n 0, 1,\n 1, 0,\n 0, 1,\n 1, 0,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // direction全0,即无模糊,此时只是进行扩展尺寸操作,还没到模糊所以传0\n let u_direction = gl.getUniformLocation(program, 'u_direction');\n gl.uniform2f(u_direction, 0, 0);\n // 纹理单元\n let u_texture = gl.getUniformLocation(program, 'u_texture');\n gl.uniform1i(u_texture, j);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n // fbo绑定切换纹理对象和单元索引,同时注意不能向源纹理绘制,因为源是cacheTotal,需要重新生成一个,y方向再来一次\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n /**\n * 反复执行共3次,坐标等均不变,只是切换fbo绑定对象和纹理单元\n * 注意max和ratio的设置,当是100尺寸的正方形时,传给direction的始终为1\n * 当正方形<100时,direction相应地要扩大相对于100的倍数,反之则缩小,如此为了取相邻点坐标时是+-1\n * 当非正方形时,长轴一端为基准值不变,短的要二次扩大比例倍数\n */\n let max = 100 / Math.max(width, height);\n let ratio = width / height;\n let recycle = []; // 3次过程中新生成的中间纹理需要回收\n for(let k = 0; k < 3; k++) {\n let tex3 = createTexture(gl, null, j, width, height);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex3, 0);\n if(width >= height) {\n gl.uniform2f(u_direction, max, 0);\n }\n else {\n gl.uniform2f(u_direction, max * ratio, 0);\n }\n gl.uniform1i(u_texture, i);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n recycle.push(tex1);\n let tex4 = createTexture(gl, null, i, width, height);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex4, 0);\n if(width >= height) {\n gl.uniform2f(u_direction, 0, max * ratio);\n }\n else {\n gl.uniform2f(u_direction, 0, max);\n }\n gl.uniform1i(u_texture, j);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n tex1 = tex4;\n recycle.push(tex3);\n }\n // 回收\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n recycle.forEach(item => gl.deleteTexture(item));\n return tex1;\n}\n\nfunction drawCm(gl, program, i, m) {\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(program, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n 0, 0,\n 0, 1,\n 1, 0,\n 0, 1,\n 1, 0,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // 纹理单元\n let u_texture = gl.getUniformLocation(program, 'u_texture');\n gl.uniform1i(u_texture, i);\n // matrix\n let u_m = gl.getUniformLocation(program, 'u_m');\n gl.uniform1fv(u_m, new Float32Array(m));\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n // 回收\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n}\n\n/**\n * 根据total/filter生成overflow\n * @param gl\n * @param i 输入纹理单元\n * @param dx 二者偏移值\n * @param dy\n * @param width 最终大小\n * @param height\n * @param w 输入纹理大小\n * @param h\n */\nfunction drawOverflow(gl, i, dx, dy, width, height, w, h) {\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(gl.programOverflow, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer,原本大小width/height,使用其中的w/h\n let x1 = dx / w, y1 = dy / h, x2 = (width + dx) / w, y2 = (height + dy) /h;\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n x1, y1,\n x1, y2,\n x2, y1,\n x1, y2,\n x2, y1,\n x2, y2,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(gl.programOverflow, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // 纹理单元\n let u_texture = gl.getUniformLocation(gl.programOverflow, 'u_texture');\n gl.uniform1i(u_texture, i);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n gl.deleteBuffer(pointBuffer);\n}\n\nfunction drawMask(gl, i, j, program) {\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(program, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n 0, 0,\n 0, 1,\n 1, 0,\n 0, 1,\n 1, 0,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // 纹理单元\n let u_texture1 = gl.getUniformLocation(program, 'u_texture1');\n gl.uniform1i(u_texture1, j);\n let u_texture2 = gl.getUniformLocation(program, 'u_texture2');\n gl.uniform1i(u_texture2, i);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n}\n\nfunction drawMbm(gl, program, i, j, W, H) {\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(program, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n 0, 0,\n 0, 1,\n 1, 0,\n 0, 1,\n 1, 0,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // 纹理单元\n let u_texture1 = gl.getUniformLocation(program, 'u_texture1');\n gl.uniform1i(u_texture1, i);\n let u_texture2 = gl.getUniformLocation(program, 'u_texture2');\n gl.uniform1i(u_texture2, j);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n}\n\nexport default {\n initShaders,\n createTexture,\n bindTexture,\n drawTextureCache,\n drawBlur,\n drawOverflow,\n drawMask,\n drawMbm,\n drawCm,\n};\n","import util from './util';\nimport debug from './debug';\nimport textCache from '../node/textCache';\nimport font from '../style/font';\nimport ca from '../gl/ca';\nimport webgl from '../gl/webgl';\n\nconst SPF = 1000 / 60;\n\nconst CANVAS = {};\nconst WEBGL = {};\nconst CANVAS_LIST = [];\nconst WEBGL_LIST = [];\nconst SUPPORT_OFFSCREEN_CANVAS = typeof OffscreenCanvas === 'function' && util.isFunction(OffscreenCanvas.prototype.getContext);\n\nlet defaultFontFamilyData;\n\nfunction cache(key, width, height, hash, message) {\n let o;\n if(!key) {\n let target = hash === CANVAS ? CANVAS_LIST : WEBGL_LIST;\n if(target.length) {\n o = target.pop();\n }\n else {\n o = !debug.flag && SUPPORT_OFFSCREEN_CANVAS ? new OffscreenCanvas(width, height) : document.createElement('canvas');\n }\n }\n else if(!hash[key]) {\n o = hash[key] = !debug.flag && SUPPORT_OFFSCREEN_CANVAS ? new OffscreenCanvas(width, height) : document.createElement('canvas');\n }\n else {\n o = hash[key];\n }\n o.width = width;\n o.height = height;\n if(debug.flag) {\n o.style.width = width + 'px';\n o.style.height = height + 'px';\n o.setAttribute('type', hash === CANVAS ? 'canvas' : 'webgl');\n if(key) {\n o.setAttribute('key', key);\n }\n if(message) {\n o.setAttribute('message', message);\n }\n document.body.appendChild(o);\n }\n let ctx;\n if(hash === CANVAS) {\n ctx = o.getContext('2d');\n }\n else {\n ctx = o.getContext('webgl', ca) || o.getContext('experimental-webgl', ca);\n }\n return {\n canvas: o,\n ctx,\n draw() {\n // 空函数,仅对小程序提供hook特殊处理,flush缓冲\n },\n enabled: true,\n available: true,\n release() {\n if(!key && this.available) {\n if(hash === CANVAS) {\n CANVAS_LIST.push(this.canvas);\n }\n else {\n WEBGL_LIST.push(this.canvas);\n }\n }\n this.available = false;\n },\n };\n}\n\nfunction cacheCanvas(key, width, height, message) {\n return cache(key, width, height, CANVAS, message);\n}\n\nfunction cacheWebgl(key, width, height, message) {\n return cache(key, width, height, WEBGL, message);\n}\n\nconst IMG = {};\nconst INIT = 0;\nconst LOADING = 1;\nconst LOADED = 2;\nconst FONT = {};\nconst COMPONENT = {};\n\nlet inject = {\n measureText() {\n let { list, data } = textCache;\n let html = '';\n let keys = [];\n let lengths = [];\n let chars = [];\n Object.keys(data).forEach(key => {\n let { ff, fs, fw, s } = data[key];\n if(s) {\n keys.push(key);\n lengths.push(s.length);\n let inline = `position:absolute;font-family:${ff};font-size:${fs}px;font-weight:${fw}`;\n for(let i = 0, len = s.length; i < len; i++) {\n let char = s.charAt(i);\n chars.push(char);\n html += `${char.replace(/, '<').replace(' ', ' ')}`;\n }\n data[key].s = '';\n }\n });\n if(!html) {\n return;\n }\n let div = document.createElement('div');\n div.style.position = 'absolute';\n div.style.left = '99999px';\n div.style.top = '-99999px';\n div.style.visibility = 'hidden';\n document.body.appendChild(div);\n div.innerHTML = html;\n let cns = div.childNodes;\n let { charWidth } = textCache;\n let count = 0, index = 0, key;\n for(let i = 0, len = cns.length; i < len; i++) {\n let node = cns[i];\n if(count === 0) {\n key = keys[index];\n }\n if(++count === lengths[index]) {\n index++;\n count = 0;\n }\n let char = chars[i];\n // clientWidth只返回ceil整数,精度必须用getComputedStyle\n let css = window.getComputedStyle(node, null);\n charWidth[key][char] = parseFloat(css.width);\n }\n list.forEach(text => text.__measureCb());\n textCache.list = [];\n textCache.data = {};\n if(!debug.flag) {\n document.body.removeChild(div);\n }\n },\n measureTextSync(key, ff, fs, fw, char) {\n let inline = `position:absolute;font-family:${ff};font-size:${fs}px;font-weight:${fw}`;\n let html = `${char}${char}${char}`;\n let div = document.createElement('div');\n div.style.position = 'absolute';\n div.style.left = '99999px';\n div.style.top = '-99999px';\n div.style.visibility = 'hidden';\n document.body.appendChild(div);\n div.innerHTML = html;\n let cns = div.childNodes;\n let w1 = parseFloat(window.getComputedStyle(cns[0], null).width);\n let w2 = parseFloat(window.getComputedStyle(cns[1], null).width);\n return w1 * 2 - w2;\n },\n IMG,\n INIT,\n LOADED,\n LOADING,\n measureImg(url, cb) {\n if(Array.isArray(url)) {\n if(!url.length) {\n return cb();\n }\n let count = 0;\n let len = url.length;\n let list = [];\n url.forEach((item, i) => {\n inject.measureImg(item, function(cache) {\n list[i] = cache;\n if(++count === len) {\n cb(list);\n }\n });\n });\n return;\n }\n else if(!url || !util.isString(url)) {\n inject.error('Measure img invalid: ' + url);\n cb && cb({\n state: LOADED,\n success: false,\n url,\n });\n return;\n }\n let cache = IMG[url] = IMG[url] || {\n state: INIT,\n task: [],\n };\n if(cache.state === LOADED) {\n cb && cb(cache);\n }\n else if(cache.state === LOADING) {\n cb && cache.task.push(cb);\n }\n else {\n cache.state = LOADING;\n cb && cache.task.push(cb);\n let img = new Image();\n img.onload = function() {\n cache.state = LOADED;\n cache.success = true;\n cache.width = img.width;\n cache.height = img.height;\n cache.source = img;\n cache.url = url;\n let list = cache.task.splice(0);\n list.forEach(cb => cb(cache));\n };\n img.onerror = function(e) {\n cache.state = LOADED;\n cache.success = false;\n cache.url = url;\n let list = cache.task.splice(0);\n list.forEach(cb => cb(cache));\n };\n if(url.substr(0, 5) !== 'data:') {\n let host = /^(?:\\w+:)?\\/\\/([^/:]+)/.exec(url);\n if(host) {\n if(typeof location === 'undefined' || location.hostname !== host[1]) {\n img.crossOrigin = 'anonymous';\n }\n }\n }\n img.src = url;\n if(debug.flag && typeof document !== 'undefined') {\n document.body.appendChild(img);\n }\n }\n },\n warn(s) {\n console.warn(s);\n },\n error(s) {\n console.error(s);\n },\n requestAnimationFrame(cb) {\n if(!cb) {\n return;\n }\n let res;\n if(typeof requestAnimationFrame !== 'undefined') {\n inject.requestAnimationFrame = requestAnimationFrame.bind(window);\n res = requestAnimationFrame(cb);\n }\n else {\n res = setTimeout(cb, SPF);\n inject.requestAnimationFrame = function(cb) {\n return setTimeout(cb, SPF);\n };\n }\n return res;\n },\n cancelAnimationFrame(id) {\n let res;\n if(typeof cancelAnimationFrame !== 'undefined') {\n inject.cancelAnimationFrame = cancelAnimationFrame.bind(window);\n res = cancelAnimationFrame(id);\n }\n else {\n res = clearTimeout(id);\n inject.cancelAnimationFrame = function(id) {\n return clearTimeout(id);\n };\n }\n return res;\n },\n now() {\n if(typeof performance !== 'undefined') {\n inject.now = function() {\n return Math.floor(performance.now());\n };\n return Math.floor(performance.now());\n }\n inject.now = Date.now.bind(Date);\n return Date.now();\n },\n hasCacheCanvas(key) {\n return key && CANVAS.hasOwnProperty(key);\n },\n getCacheCanvas(width, height, key, message) {\n return cacheCanvas(key, width, height, message);\n },\n releaseCacheCanvas(o) {\n CANVAS_LIST.push(o);\n },\n delCacheCanvas(key) {\n key && delete CANVAS[key];\n },\n hasCacheWebgl(key) {\n return key && WEBGL.hasOwnProperty(key);\n },\n getCacheWebgl(width, height, key, message) {\n return cacheWebgl(key, width, height, message);\n },\n releaseCacheWebgl(o) {\n WEBGL_LIST.push(o);\n },\n delCacheWebgl(key) {\n key && delete WEBGL[key];\n },\n isDom(o) {\n if(o) {\n if(util.isString(o)) {\n return true;\n }\n if(typeof window !== 'undefined' && window.Element && (o instanceof window.Element)) {\n return true;\n }\n if(typeof window !== 'undefined' && window.OffscreenCanvas && (o instanceof window.OffscreenCanvas)) {\n return true;\n }\n // worker\n if(typeof self !== 'undefined' && self.OffscreenCanvas && (o instanceof self.OffscreenCanvas)) {\n return true;\n }\n if(util.isFunction(o.getElementsByTagName)) {\n return true;\n }\n }\n return false;\n },\n isWebGLTexture(o) {\n if(o && typeof WebGLTexture !== 'undefined') {\n return o instanceof WebGLTexture;\n }\n },\n checkSupportFontFamily(ff) {\n ff = ff.toLowerCase();\n // 强制arial兜底\n if(ff === 'arial' || ff === 'serif' || ff === 'sans-serif' || ff === 'sansserif') {\n return true;\n }\n if(!font.info.hasOwnProperty(ff)) {\n return false;\n }\n if(font.info[ff].hasOwnProperty('checked')) {\n return font.info[ff].checked;\n }\n let canvas = inject.getCacheCanvas(16, 16, '__$$CHECK_SUPPORT_FONT_FAMILY$$__');\n let context = canvas.ctx;\n context.textAlign = 'center';\n context.fillStyle = '#000';\n context.textBaseline = 'middle';\n if(!defaultFontFamilyData) {\n context.clearRect(0, 0, 16, 16);\n context.font = '16px arial';\n context.fillText('a', 8, 8);\n canvas.draw();\n defaultFontFamilyData = context.getImageData(0, 0, 16, 16).data;\n }\n context.clearRect(0, 0, 16, 16);\n context.font = '16px ' + ff;\n context.fillText('a', 8, 8);\n canvas.draw();\n let data = context.getImageData(0, 0, 16, 16).data;\n for(let i = 0, len = data.length; i < len; i++) {\n if(defaultFontFamilyData[i] !== data[i]) {\n return font.info[ff].checked = true;\n }\n }\n return font.info[ff].checked = false;\n },\n loadFont(fontFamily, url, cb) {\n if(util.isFunction(url)) {\n cb = url;\n url = fontFamily;\n }\n if(Array.isArray(url)) {\n if(!url.length) {\n return cb();\n }\n let count = 0;\n let len = url.length;\n let list = [];\n url.forEach((item, i) => {\n inject.loadFont(item.fontFamily, item.url, function(cache) {\n list[i] = cache;\n if(++count === len) {\n cb(list);\n }\n });\n });\n return;\n }\n else if(!url || !util.isString(url)) {\n inject.error('Load font invalid: ' + url);\n cb && cb({\n state: LOADED,\n success: false,\n url,\n });\n return;\n }\n if(!fontFamily) {\n fontFamily = url;\n }\n let cache = FONT[url] = FONT[url] || {\n state: INIT,\n task: [],\n };\n if(cache.state === LOADED) {\n cb && cb(cache);\n }\n else if(cache.state === LOADING) {\n cb && cache.task.push(cb);\n }\n else {\n cache.state = LOADING;\n cb && cache.task.push(cb);\n if(!/url\\(/.test(url)) {\n url = `url(${url})`;\n }\n let f = new FontFace(fontFamily, url);\n f.load().then(function() {\n document.fonts.add(f);\n cache.state = LOADED;\n cache.success = true;\n cache.url = url;\n let list = cache.task.splice(0);\n list.forEach(cb => cb(cache));\n }).catch(function() {\n cache.state = LOADED;\n cache.success = false;\n cache.url = url;\n let list = cache.task.splice(0);\n list.forEach(cb => cb(cache));\n });\n }\n },\n loadComponent(url, cb) {\n if(Array.isArray(url)) {\n if(!url.length) {\n return cb();\n }\n let count = 0;\n let len = url.length;\n let list = [];\n url.forEach((item, i) => {\n inject.loadComponent(item, function(cache) {\n list[i] = cache;\n if(++count === len) {\n cb(list);\n }\n });\n });\n return;\n }\n else if(!url || !util.isString(url)) {\n inject.error('Load component invalid: ' + url);\n cb && cb({\n state: LOADED,\n success: false,\n url,\n });\n return;\n }\n let cache = COMPONENT[url] = COMPONENT[url] || {\n state: INIT,\n task: [],\n };\n if(cache.state === LOADED) {\n cb && cb(cache);\n }\n else if(cache.state === LOADING) {\n cb && cache.task.push(cb);\n }\n else {\n cache.state = LOADING;\n cb && cache.task.push(cb);\n let script = document.createElement('script');\n script.src = url;\n script.async = true;\n script.onload = function() {\n cache.state = LOADED;\n cache.success = true;\n cache.url = url;\n let list = cache.task.splice(0);\n list.forEach(cb => cb(cache));\n document.head.removeChild(script);\n };\n script.onerror = function() {\n cache.state = LOADED;\n cache.success = false;\n cache.url = url;\n let list = cache.task.splice(0);\n list.forEach(cb => cb(cache));\n document.head.removeChild(script);\n };\n document.head.appendChild(script);\n }\n },\n};\n\nexport default inject;\n","import unit from './unit';\nimport reg from './reg';\nimport geom from '../math/geom';\nimport vector from '../math/vector';\nimport mx from '../math/matrix';\nimport gradient from '../math/gradient';\nimport border from './border';\nimport mode from '../refresh/mode';\nimport util from '../util/util';\nimport painter from '../util/painter';\nimport enums from '../util/enums';\nimport inject from '../util/inject';\n\nconst { rgba2int, isNil } = util;\nconst { PX, PERCENT, DEG, NUMBER, REM, VW, VH, VMAX, VMIN, calUnit } = unit;\nconst { d2r } = geom;\nconst { canvasPolygon, svgPolygon } = painter;\nconst {\n STYLE_KEY: {\n FONT_SIZE,\n },\n NODE_KEY: {\n NODE_DEFS_CACHE,\n },\n} = enums;\n\nfunction getLinearDeg(v) {\n let deg = 180;\n if(v === 'to top') {\n deg = 0;\n }\n else if(v === 'to top right') {\n deg = 45;\n }\n else if(v === 'to right') {\n deg = 90;\n }\n else if(v === 'to bottom right') {\n deg = 135;\n }\n else if(v === 'to bottom') {\n }\n else if(v === 'to bottom left') {\n deg = 225;\n }\n else if(v === 'to left') {\n deg = 270;\n }\n else if(v === 'to top left') {\n deg = 315;\n }\n // 数字角度,没有的话取默认角度\n else {\n let match = /([-+]?[\\d.]+)deg/.exec(v);\n if(match) {\n deg = parseFloat(match[1]);\n }\n }\n return deg % 360;\n}\n\nfunction getRadialPosition(data) {\n if(/^[-+]?[\\d.]/.test(data)) {\n let v = calUnit(data);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n return v;\n }\n else {\n return [\n {\n top: 0,\n left: 0,\n center: 50,\n right: 100,\n bottom: 100,\n }[data] || 50,\n PERCENT,\n ];\n }\n}\n\n// 获取color-stop区间范围,去除无用值\nfunction getColorStop(v, length, root) {\n let list = [];\n let firstColor = v[0][0];\n // 先把已经声明距离的换算成[0,1]以数组形式存入,未声明的原样存入\n for(let i = 0, len = v.length; i < len; i++) {\n let item = v[i];\n // 考虑是否声明了位置\n if(item.length > 1) {\n let p = item[1];\n if(p[1] === PERCENT) {\n list.push([item[0], p[0] * 0.01]);\n }\n else if(p[1] === REM) {\n list.push([item[0], p[0] * root.computedStyle[FONT_SIZE] / length]);\n }\n else if(p[1] === VW) {\n list.push([item[0], p[0] * root.width / length]);\n }\n else if(p[1] === VH) {\n list.push([item[0], p[0] * root.height / length]);\n }\n else if(p[1] === VMAX) {\n list.push([item[0], p[0] * Math.max(root.width, root.height) / length]);\n }\n else if(p[1] === VMIN) {\n list.push([item[0], p[0] * Math.min(root.width, root.height) / length]);\n }\n else {\n list.push([item[0], p[0] / length]);\n }\n }\n else {\n list.push([item[0]]);\n }\n }\n if(list.length === 1) {\n list.push(util.clone(list[0]));\n }\n // 首尾不声明默认为[0, 1]\n if(list[0].length === 1) {\n list[0].push(0);\n }\n if(list.length > 1) {\n let i = list.length - 1;\n if(list[i].length === 1) {\n list[i].push(1);\n }\n }\n // 找到未声明位置的,需区间计算,找到连续的未声明的,前后的区间平分\n let start = list[0][1];\n for(let i = 1, len = list.length; i < len - 1; i++) {\n let item = list[i];\n if(item.length > 1) {\n start = item[1];\n }\n else {\n let j = i + 1;\n let end = list[list.length - 1][1];\n for(; j < len - 1; j++) {\n let item = list[j];\n if(item.length > 1) {\n end = item[1];\n break;\n }\n }\n let num = j - i + 1;\n let per = (end - start) / num;\n for(let k = i; k < j; k++) {\n let item = list[k];\n item.push(start + per * (k + 1 - i));\n }\n i = j;\n }\n }\n // 每个不能小于前面的,canvas/svg不能兼容这种情况,需处理\n for(let i = 1, len = list.length; i < len; i++) {\n let item = list[i];\n let prev = list[i - 1];\n if(item[1] < prev[1]) {\n item[1] = prev[1];\n }\n }\n // 0之前的和1之后的要过滤掉\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(item[1] > 1) {\n list.splice(i);\n let prev = list[i - 1];\n if(prev && prev[1] < 1) {\n let dr = item[0][0] - prev[0][0];\n let dg = item[0][1] - prev[0][1];\n let db = item[0][2] - prev[0][2];\n let da = item[0][3] - prev[0][3];\n let p = (1 - prev[1]) / (item[1] - prev[1]);\n list.push([\n [\n item[0][0] + dr * p,\n item[0][1] + dg * p,\n item[0][2] + db * p,\n item[0][3] + da * p,\n ],\n 1],\n );\n }\n break;\n }\n }\n for(let i = list.length - 1; i >= 0; i--) {\n let item = list[i];\n if(item[1] < 0) {\n list.splice(0, i + 1);\n let next = list[i];\n if(next && next[1] > 0) {\n let dr = next[0][0] - item[0][0];\n let dg = next[0][1] - item[0][1];\n let db = next[0][2] - item[0][2];\n let da = next[0][3] - item[0][3];\n let p = (-item[1]) / (next[1] - item[1]);\n list.unshift([\n [\n item[0][0] + dr * p,\n item[0][1] + dg * p,\n item[0][2] + db * p,\n item[0][3] + da * p,\n ],\n 0],\n );\n }\n break;\n }\n }\n // 可能存在超限情况,如在使用px单位超过len或 {\n // item[0] = int2rgba(item[0]);\n if(item[1] < 0) {\n item[1] = 0;\n }\n else if(item[1] > 1) {\n item[1] = 1;\n }\n });\n // 都超限时,第一个颜色兜底\n if(!list.length) {\n list.push([firstColor, 0]);\n }\n return list;\n}\n\n// 根据角度和圆心获取渐变的4个点坐标\nfunction calLinearCoords(deg, length, cx, cy) {\n let x0;\n let y0;\n let x1;\n let y1;\n if(deg >= 270) {\n let r = d2r(360 - deg);\n x0 = cx + Math.sin(r) * length;\n y0 = cy + Math.cos(r) * length;\n x1 = cx - Math.sin(r) * length;\n y1 = cy - Math.cos(r) * length;\n }\n else if(deg >= 180) {\n let r = d2r(deg - 180);\n x0 = cx + Math.sin(r) * length;\n y0 = cy - Math.cos(r) * length;\n x1 = cx - Math.sin(r) * length;\n y1 = cy + Math.cos(r) * length;\n }\n else if(deg >= 90) {\n let r = d2r(180 - deg);\n x0 = cx - Math.sin(r) * length;\n y0 = cy - Math.cos(r) * length;\n x1 = cx + Math.sin(r) * length;\n y1 = cy + Math.cos(r) * length;\n }\n else {\n let r = d2r(deg);\n x0 = cx - Math.sin(r) * length;\n y0 = cy + Math.cos(r) * length;\n x1 = cx + Math.sin(r) * length;\n y1 = cy - Math.cos(r) * length;\n }\n return [x0, y0, x1, y1];\n}\n\nfunction calCircleCentre(position, x1, y1, iw, ih, root) {\n let cx, cy;\n let positionX = position[0], positionY = position[1];\n if(positionX[1] === PERCENT) {\n cx = x1 + positionX[0] * iw * 0.01;\n }\n else if(positionX[1] === REM) {\n cx = x1 + positionX[0] * root.computedStyle[FONT_SIZE];\n }\n else if(positionX[1] === VW) {\n cx = x1 + positionX[0] * root.width * 0.01;\n }\n else if(positionX[1] === VH) {\n cx = x1 + positionX[0] * root.height * 0.01;\n }\n else if(positionX[1] === VMAX) {\n cx = x1 + positionX[0] * Math.max(root.width, root.height) * 0.01;\n }\n else if(positionX[1] === VMIN) {\n cx = x1 + positionX[0] * Math.min(root.width, root.height) * 0.01;\n }\n else {\n cx = x1 + positionX[0];\n }\n if(positionY[1] === PERCENT) {\n cy = y1 + positionY[0] * ih * 0.01;\n }\n else if(positionY[1] === REM) {\n cy = y1 + positionY[0] * root.computedStyle[FONT_SIZE];\n }\n else if(positionY[1] === VW) {\n cy = y1 + positionY[0] * root.width * 0.01;\n }\n else if(positionY[1] === VH) {\n cy = y1 + positionY[0] * root.height * 0.01;\n }\n else if(positionY[1] === VH) {\n cy = y1 + positionY[0] * Math.max(root.width, root.height) * 0.01;\n }\n else if(positionY[1] === VH) {\n cy = y1 + positionY[0] * Math.min(root.width, root.height) * 0.01;\n }\n else {\n cy = y1 + positionY[0];\n }\n return [cx, cy];\n}\n\n// 获取径向渐变圆心半径\nfunction calRadialRadius(shape, size, position, iw, ih, x1, y1, x2, y2, root) {\n let cx, cy, xl, yl, r, tx, ty, d = 0;\n // 扩展的from to ratio格式,圆心、长轴坐标、短轴缩放比\n if(Array.isArray(size)) {\n cx = x1 + size[0] * iw;\n cy = y1 + size[1] * ih;\n tx = x1 + size[4] * iw;\n ty = y1 + size[5] * ih;\n if(size[6] <= 0) {\n r = Math.min(Math.abs(cx - x1), Math.min(Math.abs(cy - y1), Math.min(Math.abs(cy - y2), Math.min(Math.abs(cx - y2)))));\n }\n else {\n xl = Math.sqrt(Math.pow((size[2] - size[0]) * iw, 2) + Math.pow((size[3] - size[1]) * ih, 2));\n yl = xl * size[6];\n r = Math.max(xl, yl);\n // 看旋转\n if(xl !== yl) {\n if(size[2] >= size[0]) {\n if(size[3] >= size[1]) {\n d = Math.asin((size[3] - size[1]) * ih / xl);\n }\n else {\n d = -Math.asin((size[1] - size[3]) * ih / xl);\n }\n }\n else {\n if(size[3] >= size[1]) {\n d = d2r(180) - Math.asin((size[3] - size[1]) * ih / xl);\n }\n else {\n d = Math.asin((size[1] - size[3]) * ih / xl) - d2r(180);\n }\n }\n }\n }\n }\n else {\n // 默认椭圆a是水平轴,b是垂直轴\n [cx, cy] = calCircleCentre(position, x1, y1, iw, ih, root);\n tx = cx;\n ty = cy;\n let ratio = 1;\n if(size === 'closest-corner' && shape === 'circle') {\n if(cx <= x1 || cx >= x2 || cy <= y1 || cy >= y2) {\n r = Math.min(Math.abs(cx - x1), Math.min(Math.abs(cy - y1), Math.min(Math.abs(cy - y2), Math.min(Math.abs(cx - y2)))));\n }\n else {\n if(cx < x1 + iw * 0.5) {\n xl = cx - x1;\n }\n else {\n xl = x2 - cx;\n }\n if(cy < y1 + ih * 0.5) {\n yl = cy - y1;\n }\n else {\n yl = y2 - cy;\n }\n r = Math.sqrt(Math.pow(xl, 2) + Math.pow(yl, 2));\n }\n }\n else if(size === 'closest-side' || size === 'closest-corner') {\n // 在边外特殊情况只有end颜色填充\n if(cx <= x1 || cx >= x2 || cy <= y1 || cy >= y2) {\n r = Math.min(Math.abs(cx - x1), Math.min(Math.abs(cy - y1), Math.min(Math.abs(cy - y2), Math.min(Math.abs(cx - y2)))));\n }\n else {\n let ratio = 1;\n if(cx < x1 + iw * 0.5) {\n xl = cx - x1;\n }\n else {\n xl = x2 - cx;\n }\n if(cy < y1 + ih * 0.5) {\n yl = cy - y1;\n }\n else {\n yl = y2 - cy;\n }\n r = Math.min(xl, yl);\n // css的角和边有对应关系,即边扩展倍数,计算为固定值\n if(size === 'closest-corner') {\n ratio = Math.sqrt(2);\n }\n xl *= ratio;\n yl *= ratio;\n r *= ratio;\n }\n }\n else {\n if(cx <= x1) {\n xl = x1 - cx + iw;\n }\n else if(cx >= x2) {\n xl = cx - x2 + iw;\n }\n else if(cx < x1 + iw * 0.5) {\n xl = x2 - cx;\n }\n else {\n xl = cx - x1;\n }\n if(cy <= y1) {\n yl = y1 - cy + ih;\n }\n else if(cy >= y2) {\n yl = cy - y2 + ih;\n }\n else if(cy < y1 + ih * 0.5) {\n yl = y2 - cy;\n }\n else {\n yl = cy - y1;\n }\n r = Math.max(xl, yl);\n if(size !== 'farthest-side') {\n ratio = Math.sqrt(2);\n }\n xl *= ratio;\n yl *= ratio;\n r *= ratio;\n }\n }\n if(shape === 'circle') {\n xl = yl = r;\n }\n return [cx, cy, r, xl, yl, tx, ty, d];\n}\n\nfunction parseGradient(s) {\n let gradient = reg.gradient.exec(s);\n if(gradient) {\n let o = {\n k: gradient[1],\n };\n if(o.k === 'linear') {\n let deg = /([-+]?[\\d.]+deg)|(to\\s+[toprighbml]+)/i.exec(gradient[2]);\n if(deg) {\n o.d = getLinearDeg(deg[0].toLowerCase());\n }\n // 扩展支持从a点到b点相对坐标,而不是css角度,sketch等ui软件中用此格式\n else {\n let points = /([-+]?[\\d.]+)\\s+([-+]?[\\d.]+)\\s+([-+]?[\\d.]+)\\s+([-+]?[\\d.]+)/.exec(gradient[2]);\n if(points) {\n o.d = [parseFloat(points[1]), parseFloat(points[2]), parseFloat(points[3]), parseFloat(points[4])];\n }\n else {\n o.d = 180;\n }\n }\n }\n else if(o.k === 'radial') {\n o.s = gradient[2].indexOf('circle') > -1 ? 'circle' : 'ellipse';\n let size = /(closest|farthest)-(side|corner)/i.exec(gradient[2]);\n if(size) {\n o.z = size[0].toLowerCase();\n }\n // 扩展支持从a点到b点相对坐标,而不是size,sketch等ui软件中用此格式\n else {\n let points = /([-+]?[\\d.]+)\\s+([-+]?[\\d.]+)\\s+([-+]?[\\d.]+)\\s+([-+]?[\\d.]+)(?:\\s+([-+]?[\\d.]+))?(?:\\s+([-+]?[\\d.]+))?(?:\\s+([-+]?[\\d.]+))?/.exec(gradient[2]);\n if(points) {\n o.z = [parseFloat(points[1]), parseFloat(points[2]), parseFloat(points[3]), parseFloat(points[4])];\n let i5 = !isNil(points[5]), i6 = !isNil(points[6]), i7 = !isNil(points[7]);\n // 重载,567是偏移x/y和ratio,都可省略即不偏移和半径1,只有5是ratio,只有56是x/y\n if(i5 && i6 && i7) {\n o.z.push(parseFloat(points[5]));\n o.z.push(parseFloat(points[6]));\n o.z.push(parseFloat(points[7]));\n }\n else if(i5 && i6) {\n o.z.push(parseFloat(points[5]));\n o.z.push(parseFloat(points[6]));\n o.z.push(1);\n }\n else if(i5) {\n o.z.push(o.z[0]);\n o.z.push(o.z[1]);\n o.z.push(parseFloat(points[5]));\n }\n else {\n o.z.push(o.z[0]);\n o.z.push(o.z[1])\n o.z.push(1);\n }\n }\n else {\n o.z = 'farthest-corner';\n }\n }\n let position = /at\\s+((?:[-+]?[\\d.]+[pxremvwhina%]*)|(?:left|top|right|bottom|center))(?:\\s+((?:[-+]?[\\d.]+[pxremvwhina%]*)|(?:left|top|right|bottom|center)))?/i.exec(gradient[2]);\n if(position) {\n let x = getRadialPosition(position[1]);\n let y = position[2] ? getRadialPosition(position[2]) : x;\n o.p = [x, y];\n }\n else {\n o.p = [[50, PERCENT], [50, PERCENT]];\n }\n }\n else if(o.k === 'conic') {\n let deg = /([-+]?[\\d.]+deg)/i.exec(gradient[2]);\n if(deg) {\n o.d = parseFloat(deg[0]) % 360;\n }\n else {\n o.d = 0;\n }\n let position = /at\\s+((?:[-+]?[\\d.]+[pxremvwhina%]*)|(?:left|top|right|bottom|center))(?:\\s+((?:[-+]?[\\d.]+[pxremvwhina%]*)|(?:left|top|right|bottom|center)))?/i.exec(gradient[2]);\n if(position) {\n let x = getRadialPosition(position[1]);\n let y = position[2] ? getRadialPosition(position[2]) : x;\n o.p = [x, y];\n }\n else {\n o.p = [[50, PERCENT], [50, PERCENT]];\n }\n }\n let v = gradient[2].match(/(([-+]?[\\d.]+[pxremvwhina%]+)?\\s*((#[0-9a-f]{3,8})|(rgba?\\s*\\(.+?\\)))\\s*([-+]?[\\d.]+[pxremvwhina%]+)?)|(transparent)/ig) || [];\n o.v = v.map(item => {\n let color = /(?:#[0-9a-f]{3,8})|(?:rgba?\\s*\\(.+?\\))|(?:transparent)/i.exec(item);\n let arr = [rgba2int(color[0])];\n let percent = /[-+]?[\\d.]+[pxremvwhina%]+/.exec(item);\n if(percent) {\n let v = calUnit(percent[0]);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n arr[1] = v;\n }\n return arr;\n });\n return o;\n }\n}\n\nfunction getLinear(v, d, ox, oy, cx, cy, w, h, root, dx = 0, dy = 0) {\n ox += dx;\n oy += dy;\n cx += dx;\n cy += dy;\n // d为数组是2个坐标点,数字是css标准角度\n let x1, y1, x2, y2, stop;\n if(Array.isArray(d)) {\n x1 = ox + d[0] * w;\n y1 = oy + d[1] * h;\n x2 = ox + d[2] * w;\n y2 = oy + d[3] * h;\n let total = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));\n stop = getColorStop(v, total);\n }\n else {\n while(d >= 360) {\n d -= 360;\n }\n while(d < 0) {\n d += 360;\n }\n // 根据角度求直线上2点,设置半径为长宽最大值,这样一定在矩形外,看做一个向量A\n let len = Math.max(w, h);\n let coords = calLinearCoords(d, len, cx, cy, w, h);\n len *= 2;\n // start和4个顶点的向量在A上的投影长度\n let l1 = vector.dotProduct(ox - coords[0], oy - coords[1], coords[2] - coords[0], coords[3] - coords[1]) / len;\n let l2 = vector.dotProduct(ox + w - coords[0], oy - coords[1], coords[2] - coords[0], coords[3] - coords[1]) / len;\n let l3 = vector.dotProduct(ox + w - coords[0], oy + h - coords[1], coords[2] - coords[0], coords[3] - coords[1]) / len;\n let l4 = vector.dotProduct(ox - coords[0], oy + h - coords[1], coords[2] - coords[0], coords[3] - coords[1]) / len;\n // 最小和最大值为0~100%\n let min = l1, max = l1;\n min = Math.min(min, Math.min(l2, Math.min(l3, l4)));\n max = Math.max(max, Math.max(l2, Math.max(l3, l4)));\n // 求得0和100%的长度和坐标\n let total = max - min;\n let r1 = min / len;\n let dx = coords[2] - coords[0];\n let dy = coords[3] - coords[1];\n x1 = coords[0] + dx * r1;\n y1 = coords[1] + dy * r1;\n x2 = coords[2] - dx * r1;\n y2 = coords[3] - dy * r1;\n stop = getColorStop(v, total, root);\n }\n return {\n x1,\n y1,\n x2,\n y2,\n stop,\n };\n}\n\nfunction getRadial(v, shape, size, position, x1, y1, x2, y2, root) {\n let w = x2 - x1;\n let h = y2 - y1;\n let [cx, cy, r, xl, yl, tx, ty, d] = calRadialRadius(shape, size, position, w, h, x1, y1, x2, y2, root);\n // 圆形取最小值,椭圆根据最小圆进行transform,椭圆其中一边轴和r一样,另一边则大小缩放可能\n let matrix, scx = 1, scy = 1;\n if(xl !== yl || d) {\n matrix = [1, 0, 0, 1, 0, 0];\n if(d) {\n let sin = Math.sin(d);\n let cos = Math.cos(d);\n matrix = [cos, sin, 0, 0, -sin, cos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n }\n if(xl !== r) {\n scx = xl / r;\n let m = [scx, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n matrix = mx.multiply(matrix, m);\n }\n if(yl !== r) {\n scy = yl / r;\n let m = [1, 0, 0, 0, 0, scy, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n matrix = mx.multiply(matrix, m);\n }\n }\n let stop = getColorStop(v, r, root);\n return {\n cx,\n cy,\n tx,\n ty,\n r,\n stop,\n scx,\n scy,\n matrix,\n d,\n };\n}\n\nfunction getConic(v, d, p, x1, y1, x2, y2, ratio, root) {\n let [cx, cy, r, deg] = calConicRadius(v, d, p, x1, y1, x2, y2, root);\n let stop = getColorStop(v, 1, root);\n r <<= 1; // 锥形半径*2,这样分割画圆时保证一定会填满原有矩形\n r *= ratio; // 矢量图形比较特殊,有可能超限,传入个倍数扩大半径\n return {\n cx,\n cy,\n w: x2 - x1,\n h: y2 - y1,\n r,\n deg,\n stop,\n };\n}\n\nfunction calConicRadius(v, deg, position, x1, y1, x2, y2, root) {\n let iw = x2 - x1;\n let ih = y2 - y1;\n let [cx, cy] = calCircleCentre(position, x1, y1, iw, ih, root);\n let r, a, b;\n if(cx >= x1 + iw * 0.5) {\n a = cx - x1;\n }\n else {\n a = x2 - cx;\n }\n if(cy >= y1 + ih * 0.5) {\n b = cy - y1;\n }\n else {\n b = y2 - cy;\n }\n r = Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2));\n return [cx, cy, r, deg];\n}\n\nfunction renderConic(xom, renderMode, ctx, res, x, y, w, h, btlr, btrr, bbrr, bblr, isInline) {\n // border-radius使用三次贝塞尔曲线模拟1/4圆角,误差在[0, 0.000273]之间\n let list = border.calRadius(x, y, w, h, btlr, btrr, bbrr, bblr);\n if(!list) {\n list = [\n [x, y],\n [x + w, y],\n [x + w, y + h],\n [x, y + h],\n [x, y],\n ];\n }\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n let offscreen = inject.getCacheCanvas(w, h, '__$$CONIC_GRADIENT$$__');\n let imgData = offscreen.ctx.getImageData(0,0, w, h);\n gradient.getConicGradientImage(res.cx - x, res.cy - y, res.w, res.h, res.stop, imgData.data);\n offscreen.ctx.putImageData(imgData, 0, 0);\n ctx.save();\n ctx.beginPath();\n canvasPolygon(ctx, list);\n ctx.clip();\n ctx.closePath();\n ctx.drawImage(offscreen.canvas, x, y);\n ctx.restore();\n offscreen.ctx.clearRect(0, 0, w, h);\n }\n else if(renderMode === mode.SVG) {\n if(isInline) {\n let v = {\n tagName: 'symbol',\n props: [],\n children: [],\n };\n xom.__config[NODE_DEFS_CACHE].push(v);\n res.forEach(item => {\n v.children.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon(item[0])],\n ['fill', item[1]],\n ],\n });\n });\n return ctx.add(v);\n }\n else {\n let v = {\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(list)],\n ],\n }],\n };\n xom.__config[NODE_DEFS_CACHE].push(v);\n let clip = ctx.add(v);\n res.forEach(item => {\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon(item[0])],\n ['fill', item[1]],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n });\n }\n }\n}\n\nexport default {\n parseGradient,\n getLinear,\n getRadial,\n getConic,\n renderConic,\n};\n","const DOM = {\n position: 'static',\n display: 'block',\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n left: 'auto',\n marginTop: 0,\n marginRight: 0,\n marginBottom: 0,\n marginLeft: 0,\n paddingTop: 0,\n paddingRight: 0,\n paddingBottom: 0,\n paddingLeft: 0,\n fontSize: 'inherit',\n fontFamily: 'inherit',\n color: 'inherit',\n fontStyle: 'inherit',\n fontWeight: 'inherit',\n lineHeight: 'inherit',\n backgroundImage: null,\n backgroundColor: 'transparent',\n backgroundSize: 'auto',\n backgroundRepeat: 'repeat',\n backgroundPositionX: 0,\n backgroundPositionY: 0,\n backgroundClip: 'borderBox',\n borderTopWidth: 0,\n borderRightWidth: 0,\n borderBottomWidth: 0,\n borderLeftWidth: 0,\n borderTopColor: 'transparent',\n borderRightColor: 'transparent',\n borderBottomColor: 'transparent',\n borderLeftColor: 'transparent',\n borderTopStyle: 'none',\n borderRightStyle: 'none',\n borderBottomStyle: 'none',\n borderLeftStyle: 'none',\n borderTopLeftRadius: 0,\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n borderBottomLeftRadius: 0,\n width: 'auto',\n height: 'auto',\n flexGrow: 0,\n flexShrink: 1,\n flexBasis: 'auto',\n flexDirection: 'row',\n flexWrap: 'nowrap',\n order: 0,\n justifyContent: 'flexStart',\n alignItems: 'stretch',\n alignSelf: 'auto',\n alignContent: 'stretch',\n textAlign: 'inherit',\n letterSpacing: 'inherit',\n transformOrigin: 'center',\n visibility: 'inherit',\n opacity: 1,\n zIndex: 0,\n transform: null,\n translateX: 0,\n translateY: 0,\n translateZ: 0,\n scaleX: 1,\n scaleY: 1,\n scaleZ: 1,\n skewX: 0,\n skewY: 0,\n rotateX: 0,\n rotateY: 0,\n rotateZ: 0,\n rotate3d: '0, 0, 0, 0',\n perspective: 0,\n perspectiveOrigin: 'center',\n filter: null,\n boxShadow: null,\n pointerEvents: 'inherit',\n overflow: 'visible',\n mixBlendMode: 'normal',\n whiteSpace: 'inherit',\n textOverflow: 'clip',\n lineClamp: 0,\n textStrokeWidth: 'inherit',\n textStrokeColor: 'inherit',\n textStrokeOver: 'inherit',\n};\n\nconst GEOM = {\n fill: 'transparent',\n stroke: '#000',\n strokeWidth: 1,\n strokeDasharray: '',\n strokeLinecap: 'butt',\n strokeLinejoin: 'miter',\n strokeMiterlimit: 4,\n fillRule: 'nonzero',\n};\n\nlet DOM_ENTRY_SET = [];\nlet DOM_KEY_SET = [];\nObject.keys(DOM).forEach(k => {\n DOM_KEY_SET.push(k);\n let v = DOM[k];\n DOM_ENTRY_SET.push({\n k,\n v,\n });\n});\n\nlet GEOM_ENTRY_SET = [];\nlet GEOM_KEY_SET = [];\nObject.keys(GEOM).forEach(k => {\n GEOM_KEY_SET.push(k);\n let v = GEOM[k];\n GEOM_ENTRY_SET.push({\n k,\n v,\n });\n});\n\nlet INHERIT = {\n fontFamily: 'arial',\n fontSize: 16,\n fontWeight: 400,\n fontStyle: 'normal',\n color: '#000',\n textAlign: 'left',\n visibility: 'visible',\n pointerEvents: 'auto',\n textStrokeColor: '#000',\n textStrokeWidth: 1,\n textStrokeOver: 'none',\n};\n\nlet INHERIT_KEY_SET = [];\nObject.keys(INHERIT).forEach(k => {\n INHERIT_KEY_SET.push(k);\n});\n\nexport default {\n DOM,\n GEOM,\n isValid(i) {\n return DOM.hasOwnProperty(i) || GEOM.hasOwnProperty(i);\n },\n DOM_KEY_SET,\n GEOM_KEY_SET,\n DOM_ENTRY_SET,\n GEOM_ENTRY_SET,\n INHERIT,\n INHERIT_KEY_SET,\n};\n","import reg from './reg';\nimport util from '../util/util';\n\nlet { isNil } = util;\n\nfunction parseFlex(style, grow, shrink, basis) {\n if(isNil(style.flexGrow)) {\n style.flexGrow = grow || 0;\n }\n if(isNil(style.flexShrink)) {\n style.flexShrink = shrink || 0;\n }\n if(isNil(style.flexBasis)) {\n style.flexBasis = basis || 0;\n }\n}\n\nfunction parseMarginPadding(style, key, list) {\n let temp = style[key];\n if(!isNil(temp)) {\n let match = temp.toString().match(/([-+]?[\\d.]+[pxremvwhina%]*)|(auto)/ig);\n if(match) {\n if(match.length === 1) {\n match[3] = match[2] = match[1] = match[0];\n }\n else if(match.length === 2) {\n match[2] = match[0];\n match[3] = match[1];\n }\n else if(match.length === 3) {\n match[3] = match[1];\n }\n list.forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = match[i];\n }\n });\n }\n }\n}\n\nfunction parseOneBorder(style, k) {\n let v = style[k];\n if(isNil(v)) {\n return;\n }\n // 后面会统一格式化处理\n if(isNil(style[k + 'Width'])) {\n let w = /\\b[\\d.]+[pxremvwhina%]*\\b/i.exec(v);\n style[k + 'Width'] = w ? w[0] : 0;\n }\n if(isNil(style[k + 'Style'])) {\n let s = /\\b(solid|dashed|dotted)\\b/i.exec(v);\n style[k + 'Style'] = s ? s[1] : 'solid';\n }\n if(isNil(style[k + 'Color'])) {\n let c = /#[0-9a-f]{3,8}/i.exec(v);\n if(c && [4, 7, 9].indexOf(c[0].length) > -1) {\n style[k + 'Color'] = c[0];\n }\n else if(/\\btransparent\\b/i.test(v)) {\n style[k + 'Color'] = 'transparent';\n }\n else {\n c = /rgba?\\s*\\(.+\\)/i.exec(v);\n style[k + 'Color'] = c ? c[0] : 'transparent';\n }\n }\n}\n\nexport default {\n margin: ['marginTop', 'marginRight', 'marginBottom', 'marginLeft'],\n padding: ['paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft'],\n border: ['borderTop', 'borderRight', 'borderBottom', 'borderLeft'],\n borderTop: ['borderTopWidth', 'borderTopStyle', 'borderTopColor'],\n borderRight: ['borderRightWidth', 'borderRightStyle', 'borderRightColor'],\n borderBottom: ['borderBottomWidth', 'borderBottomStyle', 'borderBottomColor'],\n borderLeft: ['borderLeftWidth', 'borderLeftStyle', 'borderLeftColor'],\n borderWidth: ['borderTopWidth', 'borderRightWidth', 'borderBottomWidth', 'borderLeftWidth'],\n borderColor: ['borderTopColor', 'borderRightColor', 'borderBottomColor', 'borderLeftColor'],\n borderStyle: ['borderTopStyle', 'borderRightStyle', 'borderBottomStyle', 'borderLeftStyle'],\n borderRadius: ['borderTopLeftRadius', 'borderTopRightRadius', 'borderBottomRightRadius', 'borderBottomLeftRadius'],\n background: ['backgroundColor', 'backgroundImage', 'backgroundRepeat', 'backgroundPosition'],\n backgroundPosition: ['backgroundPositionX', 'backgroundPositionY'],\n flex: ['flexGrow', 'flexShrink', 'flexBasis'],\n translate: ['translateX', 'translateY'],\n translate3d: ['translateX', 'translateY', 'translateY'],\n scale: ['scaleX', 'scaleY'],\n scale3d: ['scaleX', 'scaleY', 'scaleZ'],\n rotate: ['rotateZ'],\n skew: ['skewX', 'skewY'],\n textStroke: ['textStrokeWidth', 'textStrokeColor', 'textStrokeOver'],\n\n toFull(style, k) {\n let v = style[k];\n if(k === 'background') {\n // bg缩写多个时有color则必须是最后一个\n if(Array.isArray(v)) {\n let length = v.length;\n if(isNil(style.backgroundColor)) {\n let bgc = /^\\s*((transparent)|(#[0-9a-f]{3,8})|(rgba?\\s*\\(.+?\\)))/i.exec(v[length - 1]);\n if(bgc) {\n style.backgroundColor = bgc[0];\n v = v.slice(0, length - 1);\n }\n }\n let bgi = [];\n let bgr = [];\n let bgp = [];\n v.forEach(item => {\n if(isNil(style.backgroundImage)) {\n let gd = reg.gradient.exec(item);\n if(gd) {\n bgi.push(gd[0]);\n item = item.replace(gd[0], '');\n }\n else {\n let img = reg.img.exec(v);\n if(img) {\n bgi.push(img[0]);\n item = item.replace(img[0], '');\n }\n }\n }\n if(isNil(style.backgroundRepeat)) {\n let repeat = /(no-?)?repeat(-?[xy])?/i.exec(item);\n if(repeat) {\n bgr.push(repeat[0].toLowerCase());\n }\n }\n if(isNil(style.backgroundPosition)) {\n let position = item.match(reg.position);\n if(position) {\n bgp.push(position.join(' '));\n }\n }\n });\n if(bgi.length) {\n style.backgroundImage = bgi;\n }\n if(bgr.length) {\n style.backgroundRepeat = bgr;\n }\n if(bgp.length) {\n style.backgroundPosition = bgp;\n this.toFull(style, 'backgroundPosition');\n }\n }\n else {\n if(isNil(style.backgroundImage)) {\n let gd = reg.gradient.exec(v);\n if(gd) {\n style.backgroundImage = gd[0];\n v = v.replace(gd[0], '');\n }\n else {\n let img = reg.img.exec(v);\n if(img) {\n style.backgroundImage = img[0];\n v = v.replace(img[0], '');\n }\n }\n }\n if(isNil(style.backgroundRepeat)) {\n let repeat = /(no-?)?repeat(-?[xy])?/i.exec(v);\n if(repeat) {\n style.backgroundRepeat = repeat[0].toLowerCase();\n }\n }\n if(isNil(style.backgroundColor)) {\n let bgc = /^(transparent)|(#[0-9a-f]{3,8})|(rgba?\\s*\\(.+?\\))/i.exec(v);\n if(bgc) {\n style.backgroundColor = bgc[0];\n v = v.replace(bgc[0], '');\n }\n }\n if(isNil(style.backgroundPosition)) {\n let position = v.match(reg.position);\n if(position) {\n style.backgroundPosition = position.join(' ');\n this.toFull(style, 'backgroundPosition');\n }\n }\n }\n }\n else if(k === 'flex') {\n if(v === 'none') {\n parseFlex(style, 0, 0, 'auto');\n }\n else if(v === 'auto') {\n parseFlex(style, 1, 1, 'auto');\n }\n else if(/^[\\d.]+\\s+[\\d.]+\\s+(auto|none|content)/.test(v) || /^[\\d.]+\\s+[\\d.]+\\s+[\\d.]+[pxremvwhina%]*/.test(v)) {\n let arr = v.split(/\\s+/);\n parseFlex(style, parseFloat(arr[0]), parseFloat(arr[1]), arr[2]);\n }\n else if(/^[\\d.]+\\s+[\\d.]+$/.test(v)) {\n let arr = v.split(/\\s+/);\n parseFlex(style, parseFloat(arr[0]), parseFloat(arr[1]), 0);\n }\n else if(/^[\\d.]+\\s+[\\d.]+[pxremvwhina%]+/.test(v)) {\n let arr = v.split(/\\s+/);\n parseFlex(style, parseFloat(arr[0]), 1, arr[1]);\n }\n else if(/^[\\d.]+$/.test(v)) {\n parseFlex(style, parseFloat(v), 1, 0);\n }\n else if(/^[\\d.]+[pxremvwhina%]+/i.test(v)) {\n parseFlex(style, 1, 1, v);\n }\n else {\n parseFlex(style, 0, 1, 'auto');\n }\n }\n else if(k === 'flexFlow') {\n v = v.toString().split(/\\s+/);\n if(v.length) {\n if(isNil(style.flexDirection)) {\n }\n style.flexDirection = v[0];\n if(v.length > 1) {\n style.flexWrap = v[1];\n }\n }\n }\n else if(k === 'borderRadius') {\n // borderRadius缩写很特殊,/分隔x/y,然后上右下左4个\n v = v.toString().split('/');\n if(v.length === 1) {\n v[1] = v[0];\n }\n for(let i = 0; i < 2; i++) {\n let item = v[i].toString().split(/\\s+/);\n if(item.length === 0) {\n v[i] = [0, 0, 0, 0];\n }\n else if(item.length === 1) {\n v[i] = [item[0], item[0], item[0], item[0]];\n }\n else if(item.length === 2) {\n v[i] = [item[0], item[1], item[0], item[1]];\n }\n else if(item.length === 3) {\n v[i] = [item[0], item[1], item[2], item[1]];\n }\n else {\n v[i] = item.slice(0, 4);\n }\n }\n this[k].forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = v[0][i] + ' ' + v[1][i];\n }\n });\n }\n else if(k === 'backgroundPosition') {\n if(!Array.isArray(v)) {\n v = [v];\n }\n let isEmpty = this[k].map(k2 => isNil(style[k2]));\n v.forEach(v2 => {\n v2 = v2.toString().split(/\\s+/);\n if(v2.length === 1) {\n v2[1] = '50%';\n }\n this[k].forEach((k2, i) => {\n if(isEmpty[i]) {\n style[k2] = style[k2] || [];\n style[k2].push(v2[i]);\n }\n });\n });\n }\n else if(['translate', 'scale', 'skew'].indexOf(k) > -1) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[1] = arr[0];\n }\n this[k].forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = arr[i];\n }\n });\n }\n else if(['translate3d', 'scale3d'].indexOf(k) > -1) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[2] = arr[1] = arr[0];\n }\n else if(arr.length === 2) {\n arr[2] = k === 'scale3d' ? 1 : 0;\n }\n this[k].forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = arr[i];\n }\n });\n }\n else if(k === 'margin' || k === 'padding') {\n parseMarginPadding(style, k, this[k]);\n }\n else if(/^border((Top)|(Right)|(Bottom)|(Left))$/.test(k)) {\n parseOneBorder(style, k);\n }\n else if(k === 'textStroke') {\n let w = /(?:^|\\s)([-+]?[\\d.]+[pxremvwhina%]*)/.exec(v);\n if(w) {\n style.textStrokeWidth = w[1];\n }\n let c = /(transparent)|(#[0-9a-f]{3,8})|(rgba?\\s*\\(.+?\\))/i.exec(v);\n if(c) {\n style.textStrokeColor = c[0];\n }\n if(/\\bfill\\b/i.test(v)) {\n style.textStrokeOver = 'fill';\n }\n else {\n style.textStrokeOver = 'none';\n }\n }\n else if(this[k]) {\n this[k].forEach(k => {\n if(isNil(style[k])) {\n style[k] = v;\n }\n });\n }\n return style;\n }\n};\n","import enums from '../util/enums';\n\nconst { STYLE_KEY } = enums;\n\nconst KEY_COLOR = [\n [STYLE_KEY.BACKGROUND_COLOR],\n [STYLE_KEY.BORDER_BOTTOM_COLOR],\n [STYLE_KEY.BORDER_LEFT_COLOR],\n [STYLE_KEY.BORDER_RIGHT_COLOR],\n [STYLE_KEY.BORDER_TOP_COLOR],\n [STYLE_KEY.COLOR],\n [STYLE_KEY.TEXT_STROKE_COLOR],\n];\n\nconst KEY_LENGTH = [\n [STYLE_KEY.FONT_SIZE],\n [STYLE_KEY.BORDER_BOTTOM_WIDTH],\n [STYLE_KEY.BORDER_LEFT_WIDTH],\n [STYLE_KEY.BORDER_RIGHT_WIDTH],\n [STYLE_KEY.BORDER_TOP_WIDTH],\n [STYLE_KEY.LEFT],\n [STYLE_KEY.TOP],\n [STYLE_KEY.RIGHT],\n [STYLE_KEY.BOTTOM],\n [STYLE_KEY.FLEX_BASIS],\n [STYLE_KEY.WIDTH],\n [STYLE_KEY.HEIGHT],\n [STYLE_KEY.LINE_HEIGHT],\n [STYLE_KEY.MARGIN_BOTTOM],\n [STYLE_KEY.MARGIN_LEFT],\n [STYLE_KEY.MARGIN_TOP],\n [STYLE_KEY.MARGIN_RIGHT],\n [STYLE_KEY.PADDING_TOP],\n [STYLE_KEY.PADDING_RIGHT],\n [STYLE_KEY.PADDING_BOTTOM],\n [STYLE_KEY.PADDING_LEFT],\n [STYLE_KEY.STROKE_WIDTH],\n [STYLE_KEY.STROKE_MITERLIMIT],\n [STYLE_KEY.LETTER_SPACING],\n [STYLE_KEY.PERSPECTIVE],\n [STYLE_KEY.TEXT_STROKE_WIDTH],\n];\n\nconst KEY_GRADIENT = [\n [STYLE_KEY.BACKGROUND_IMAGE],\n [STYLE_KEY.FILL],\n [STYLE_KEY.STROKE],\n];\n\nconst KEY_RADIUS = [\n [STYLE_KEY.BORDER_TOP_LEFT_RADIUS],\n [STYLE_KEY.BORDER_TOP_RIGHT_RADIUS],\n [STYLE_KEY.BORDER_BOTTOM_RIGHT_RADIUS],\n [STYLE_KEY.BORDER_BOTTOM_LEFT_RADIUS],\n];\n\nconst COLOR_HASH = {};\nKEY_COLOR.forEach(k => {\n COLOR_HASH[k] = true;\n});\n\nconst LENGTH_HASH = {};\nKEY_LENGTH.forEach(k => {\n LENGTH_HASH[k] = true;\n});\n\nconst RADIUS_HASH = {};\nKEY_RADIUS.forEach(k => {\n RADIUS_HASH[k] = true;\n});\n\nconst GRADIENT_HASH = {};\nKEY_GRADIENT.forEach(k => {\n GRADIENT_HASH[k] = true;\n});\n\nconst GRADIENT_TYPE = {\n linear: true,\n radial: true,\n conic: true,\n};\n\nconst KEY_EXPAND = [\n [STYLE_KEY.TRANSLATE_X],\n [STYLE_KEY.TRANSLATE_Y],\n [STYLE_KEY.TRANSLATE_Z],\n [STYLE_KEY.SKEW_X],\n [STYLE_KEY.SKEW_Y],\n [STYLE_KEY.SCALE_X],\n [STYLE_KEY.SCALE_Y],\n [STYLE_KEY.SCALE_Z],\n [STYLE_KEY.ROTATE_X],\n [STYLE_KEY.ROTATE_Y],\n [STYLE_KEY.ROTATE_Z],\n];\n\nconst EXPAND_HASH = {};\nKEY_EXPAND.forEach(k => {\n EXPAND_HASH[k] = true;\n});\n\nexport default {\n KEY_COLOR,\n KEY_EXPAND,\n KEY_GRADIENT,\n KEY_LENGTH,\n KEY_RADIUS,\n COLOR_HASH,\n EXPAND_HASH,\n GRADIENT_HASH,\n LENGTH_HASH,\n RADIUS_HASH,\n GRADIENT_TYPE,\n};\n","import reset from '../style/reset';\nimport unit from '../style/unit';\nimport enums from '../util/enums';\n\nconst { DOM: RESET_DOM, GEOM: RESET_GEOM } = reset;\nconst { INHERIT } = unit;\nconst { STYLE_KEY } = enums;\n\nconst GEOM = {};\nconst GEOM_KEY_SET = [];\nconst IGNORE = {\n [STYLE_KEY.POINTER_EVENTS]: true,\n};\nconst REPAINT = {\n [STYLE_KEY.TRANSFORM]: true,\n [STYLE_KEY.TRANSLATE_X]: true,\n [STYLE_KEY.TRANSLATE_Y]: true,\n [STYLE_KEY.SKEW_X]: true,\n [STYLE_KEY.SKEW_Y]: true,\n [STYLE_KEY.SCALE_X]: true,\n [STYLE_KEY.SCALE_Y]: true,\n [STYLE_KEY.ROTATE_Z]: true,\n [STYLE_KEY.COLOR]: true,\n [STYLE_KEY.FONT_STYLE]: true,\n [STYLE_KEY.STROKE_WIDTH]: true,\n [STYLE_KEY.FILL]: true,\n [STYLE_KEY.STROKE_DASHARRAY]: true,\n [STYLE_KEY.STROKE_LINECAP]: true,\n [STYLE_KEY.STROKE_LINEJOIN]: true,\n [STYLE_KEY.STROKE_MITERLIMIT]: true,\n [STYLE_KEY.BACKGROUND_COLOR]: true,\n [STYLE_KEY.BACKGROUND_IMAGE]: true,\n [STYLE_KEY.BACKGROUND_POSITION_X]: true,\n [STYLE_KEY.BACKGROUND_POSITION_Y]: true,\n [STYLE_KEY.BACKGROUND_REPEAT]: true,\n [STYLE_KEY.BACKGROUND_SIZE]: true,\n [STYLE_KEY.STROKE]: true,\n [STYLE_KEY.BORDER_BOTTOM_COLOR]: true,\n [STYLE_KEY.BORDER_LEFT_COLOR]: true,\n [STYLE_KEY.BORDER_RIGHT_COLOR]: true,\n [STYLE_KEY.BORDER_TOP_COLOR]: true,\n [STYLE_KEY.BORDER_TOP_LEFT_RADIUS]: true,\n [STYLE_KEY.BORDER_TOP_RIGHT_RADIUS]: true,\n [STYLE_KEY.BORDER_BOTTOM_RIGHT_RADIUS]: true,\n [STYLE_KEY.BORDER_BOTTOM_LEFT_RADIUS]: true,\n [STYLE_KEY.VISIBILITY]: true,\n [STYLE_KEY.OPACITY]: true,\n [STYLE_KEY.Z_INDEX]: true,\n [STYLE_KEY.FILTER]: true,\n [STYLE_KEY.BOX_SHADOW]: true,\n [STYLE_KEY.OVERFLOW]: true,\n [STYLE_KEY.BACKGROUND_CLIP]: true,\n [STYLE_KEY.TEXT_STROKE_WIDTH]: true,\n [STYLE_KEY.TEXT_STROKE_COLOR]: true,\n [STYLE_KEY.TEXT_STROKE_OVER]: true,\n};\nconst MEASURE = {\n [STYLE_KEY.FONT_SIZE]: true,\n [STYLE_KEY.FONT_WEIGHT]: true,\n [STYLE_KEY.FONT_FAMILY]: true,\n};\n\nlet o = {\n GEOM,\n GEOM_KEY_SET,\n IGNORE,\n REPAINT,\n MEASURE,\n addGeom(tagName, ks, cb) {\n if(Array.isArray(ks)) {\n ks.forEach(k => {\n o.addGeom(tagName, k, cb);\n });\n }\n else if(ks) {\n if(!GEOM.hasOwnProperty(ks)) {\n GEOM_KEY_SET.push(ks);\n }\n let hash = GEOM[ks] = GEOM[ks] || {};\n hash[tagName] = cb || true;\n }\n },\n isIgnore(k) {\n return IGNORE.hasOwnProperty(k);\n },\n isGeom(tagName, k) {\n return tagName && k && GEOM.hasOwnProperty(k) && GEOM[k].hasOwnProperty(tagName);\n },\n isRepaint(k, tagName) {\n return REPAINT.hasOwnProperty(k) || o.isGeom(tagName, k);\n },\n isMeasure(k) {\n return MEASURE.hasOwnProperty(k);\n },\n isValid(tagName, k) {\n if(!k) {\n return false;\n }\n if(RESET_DOM.hasOwnProperty(k)) {\n return true;\n }\n // geom的fill等矢量才有的样式\n if(tagName.charAt(0) === '$' && RESET_GEOM.hasOwnProperty(k)) {\n return true;\n }\n if(GEOM.hasOwnProperty(k)) {\n return GEOM[k].hasOwnProperty(tagName);\n }\n if(k === 'translatePath') {\n return true;\n }\n return false;\n },\n};\n\nlet MEASURE_KEY_SET = o.MEASURE_KEY_SET = Object.keys(MEASURE).map(i => parseInt(i));\nlet len = MEASURE_KEY_SET.length;\no.isMeasureInherit = function(target) {\n if(target) {\n for(let i = 0; i < len; i++) {\n let k = MEASURE_KEY_SET[i];\n if(target.hasOwnProperty(k) && target[k][1] === INHERIT) {\n return true;\n }\n }\n }\n return false;\n};\no.measureInheritList = function(target) {\n let list = [];\n for(let i = 0; i < len; i++) {\n let k = MEASURE_KEY_SET[i];\n if(target.hasOwnProperty(k) && target[k][1] === INHERIT) {\n list.push(k);\n }\n }\n return list;\n};\n\no.addGeom('$line', ['x1', 'y1', 'x2', 'y2', 'controlA', 'controlB', 'start', 'end']);\no.addGeom('$circle', ['r']);\no.addGeom('$ellipse', ['rx', 'ry']);\no.addGeom('$rect', ['rx', 'ry']);\no.addGeom('$sector', ['begin', 'end', 'edge', 'closure']);\no.addGeom('$polyline', ['points', 'controls', 'start', 'end']);\no.addGeom('$polygon', ['points', 'controls', 'start', 'end', 'booleanOperations']);\n\nexport default o;\n","import unit from './unit';\nimport font from './font';\nimport gradient from './gradient';\nimport reg from './reg';\nimport reset from './reset';\nimport abbr from './abbr';\nimport enums from '../util/enums';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport key from '../animate/key';\nimport change from '../refresh/change';\n\nconst { STYLE_KEY, STYLE_RV_KEY, style2Upper, STYLE_KEY: {\n POSITION,\n WIDTH,\n HEIGHT,\n TRANSLATE_X,\n TRANSLATE_Y,\n TRANSLATE_Z,\n SCALE_X,\n SCALE_Y,\n SCALE_Z,\n SKEW_X,\n SKEW_Y,\n ROTATE_X,\n ROTATE_Y,\n ROTATE_Z,\n ROTATE_3D,\n PERSPECTIVE,\n PERSPECTIVE_ORIGIN,\n TRANSFORM,\n TRANSFORM_ORIGIN,\n BACKGROUND_IMAGE,\n BACKGROUND_COLOR,\n BACKGROUND_POSITION_X,\n BACKGROUND_POSITION_Y,\n BACKGROUND_SIZE,\n OPACITY,\n Z_INDEX,\n COLOR,\n FONT_SIZE,\n FONT_FAMILY,\n FONT_WEIGHT,\n FONT_STYLE,\n LINE_HEIGHT,\n TEXT_ALIGN,\n FILTER,\n VISIBILITY,\n BOX_SHADOW,\n POINTER_EVENTS,\n FILL,\n STROKE,\n STROKE_WIDTH,\n STROKE_DASHARRAY,\n BORDER_TOP_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_LEFT_WIDTH,\n DISPLAY,\n FLEX_DIRECTION,\n FLEX_GROW,\n FLEX_SHRINK,\n FLEX_BASIS,\n JUSTIFY_CONTENT,\n ALIGN_SELF,\n ALIGN_ITEMS,\n MATRIX,\n LETTER_SPACING,\n BACKGROUND_CLIP,\n WHITE_SPACE,\n TEXT_OVERFLOW,\n LINE_CLAMP,\n ORDER,\n FLEX_WRAP,\n ALIGN_CONTENT,\n TRANSLATE_PATH,\n TEXT_STROKE_COLOR,\n TEXT_STROKE_WIDTH,\n TEXT_STROKE_OVER,\n} } = enums;\nconst { AUTO, PX, PERCENT, NUMBER, INHERIT, DEG, RGBA, STRING, REM, VW, VH, VMAX, VMIN, calUnit } = unit;\nconst { isNil, rgba2int, equalArr } = util;\nconst { MEASURE_KEY_SET, isGeom, GEOM, GEOM_KEY_SET } = change;\n\nconst {\n COLOR_HASH,\n LENGTH_HASH,\n RADIUS_HASH,\n GRADIENT_HASH,\n EXPAND_HASH,\n GRADIENT_TYPE,\n} = key;\n\nconst TRANSFORM_HASH = {\n translateX: TRANSLATE_X,\n translateY: TRANSLATE_Y,\n translateZ: TRANSLATE_Z,\n scaleX: SCALE_X,\n scaleY: SCALE_Y,\n scaleZ: SCALE_Z,\n skewX: SKEW_X,\n skewY: SKEW_Y,\n rotateX: ROTATE_X,\n rotateY: ROTATE_Y,\n rotateZ: ROTATE_Z,\n rotate: ROTATE_Z,\n};\n\nfunction compatibleTransform(k, arr) {\n if(k === SCALE_X || k === SCALE_Y || k === SCALE_Z) {\n arr[1] = NUMBER;\n }\n else if(k === TRANSLATE_X || k === TRANSLATE_Y || k === TRANSLATE_Z) {\n if(arr[1] === NUMBER) {\n arr[1] = PX;\n }\n }\n else if(k === PERSPECTIVE) {\n if([NUMBER, PERCENT, DEG].indexOf(arr[1]) > -1) {\n arr[1] = PX;\n }\n }\n else {\n if(arr[1] === NUMBER) {\n arr[1] = DEG;\n }\n }\n}\n\n/**\n * 将传入的手写style标准化,并且用reset默认值覆盖其中为空的\n * @param style 手写的style样式\n * @param reset 默认样式,可选\n * @returns Object 标准化的枚举数组结构样式\n */\nfunction normalize(style, reset = []) {\n if(!util.isObject(style)) {\n return {};\n }\n let res = {};\n // style只有单层无需深度clone\n style = util.extend({}, style);\n // 缩写提前处理,因为reset里没有缩写\n let temp = style.border;\n if(temp) {\n abbr.toFull(style, 'border');\n }\n ['borderTop', 'borderRight', 'borderBottom', 'borderLeft'].forEach(k => {\n abbr.toFull(style, k);\n });\n temp = style.borderWidth;\n if(temp) {\n abbr.toFull(style, 'borderWidth');\n }\n temp = style.borderColor;\n if(temp) {\n abbr.toFull(style, 'borderColor');\n }\n temp = style.borderStyle;\n if(temp) {\n abbr.toFull(style, 'borderStyle');\n }\n temp = style.borderRadius;\n if(temp) {\n abbr.toFull(style, 'borderRadius');\n }\n temp = style.background;\n // 处理渐变背景缩写\n if(temp) {\n abbr.toFull(style, 'background');\n }\n // 背景位置\n temp = style.backgroundPosition;\n if(!isNil(temp)) {\n abbr.toFull(style, 'backgroundPosition');\n }\n // flex\n temp = style.flex;\n if(temp) {\n abbr.toFull(style, 'flex');\n }\n // flex-flow\n temp = style.flexFlow;\n if(temp) {\n abbr.toFull(style, 'flexFlow');\n }\n temp = style.margin;\n if(!isNil(temp)) {\n abbr.toFull(style, 'margin');\n }\n temp = style.padding;\n if(!isNil(temp)) {\n abbr.toFull(style, 'padding');\n }\n temp = style.textStroke;\n if(temp) {\n abbr.toFull(style, 'textStroke');\n }\n temp = style.rotate3d;\n if(temp) {\n abbr.toFull(style, 'rotate3d');\n }\n // 扩展css,将transform几个值拆分为独立的css为动画准备,同时不能使用transform\n ['translate', 'scale', 'skew', 'translate3d', 'scale3d', 'rotate'].forEach(k => {\n temp = style[k];\n if(!isNil(temp)) {\n abbr.toFull(style, k);\n }\n });\n // 扩展的不能和transform混用,给出警告\n [\n 'translateX',\n 'translateY',\n 'translateZ',\n 'scaleX',\n 'scaleY',\n 'scaleZ',\n 'skewX',\n 'skewY',\n 'rotateX',\n 'rotateY',\n 'rotateZ',\n 'rotate3d',\n ].forEach(k => {\n let v = style[k];\n if(v !== undefined && style.transform) {\n inject.warn(`Can not use expand style \"${k}\" with transform`);\n }\n });\n // 默认reset,根据传入不同,当style为空时覆盖\n reset.forEach(item => {\n let { k, v } = item;\n if(isNil(style[k])) {\n style[k] = v;\n }\n });\n // 背景图\n temp = style.backgroundImage;\n if(temp !== undefined) {\n if(!temp) {\n res[BACKGROUND_IMAGE] = [null];\n }\n else if(Array.isArray(temp)) {\n res[BACKGROUND_IMAGE] = temp.map(item => {\n if(!item) {\n return null;\n }\n if(reg.gradient.test(item)) {\n return gradient.parseGradient(item);\n }\n if(reg.img.test(item)) {\n return reg.img.exec(item)[2];\n }\n return null;\n });\n }\n // 区分是渐变色还是图\n else if(reg.gradient.test(temp)) {\n res[BACKGROUND_IMAGE] = [gradient.parseGradient(temp)];\n }\n else if(reg.img.test(temp)) {\n res[BACKGROUND_IMAGE] = [reg.img.exec(temp)[2]];\n }\n else {\n res[BACKGROUND_IMAGE] = [null];\n }\n }\n temp = style.backgroundColor;\n if(temp !== undefined) {\n temp = temp || 'transparent';\n // 先赋值默认透明,后续操作有合法值覆盖\n let bgc = /^#[0-9a-f]{3,8}/i.exec(temp);\n if(bgc && [4, 7, 9].indexOf(bgc[0].length) > -1) {\n res[BACKGROUND_COLOR] = [rgba2int(bgc[0]), RGBA];\n }\n else {\n bgc = /rgba?\\s*\\(.+\\)/i.exec(temp);\n res[BACKGROUND_COLOR] = [rgba2int(bgc ? bgc[0] : [0, 0, 0, 0]), RGBA];\n }\n }\n ['backgroundPositionX', 'backgroundPositionY'].forEach((k, i) => {\n temp = style[k];\n if(temp !== undefined) {\n temp = temp || 0;\n k = i ? BACKGROUND_POSITION_Y : BACKGROUND_POSITION_X;\n if(!Array.isArray(temp)) {\n temp = [temp];\n }\n res[k] = temp.map(item => {\n if(/^[-+]?[\\d.]/.test(item)) {\n let v = calUnit(item);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n return v;\n }\n else {\n return [\n {\n top: 0,\n left: 0,\n center: 50,\n right: 100,\n bottom: 100,\n }[item] || 0,\n PERCENT,\n ];\n }\n });\n }\n });\n // 背景尺寸\n temp = style.backgroundSize;\n if(temp !== undefined) {\n if(!Array.isArray(temp)) {\n temp = [temp];\n }\n res[BACKGROUND_SIZE] = temp.map(item => {\n if(!item) {\n return [\n [0, AUTO],\n [0, AUTO],\n ];\n }\n let match = item.toString().match(/\\b(?:([-+]?[\\d.]+[pxremvwhina%]*)|(contain|cover|auto))/ig);\n if(match) {\n if(match.length === 1) {\n if(match[0] === 'contain' || match[0] === 'cover') {\n match[1] = match[0];\n }\n else {\n match[1] = 'auto';\n }\n }\n let v = [];\n for(let i = 0; i < 2; i++) {\n let item = match[i];\n if(/^[-+]?[\\d.]/.test(item)) {\n let n = calUnit(item);\n if([NUMBER, DEG].indexOf(n[1]) > -1) {\n n[1] = PX;\n }\n v.push(n);\n }\n else if(item === 'contain' || item === 'cover') {\n v.push([item, STRING]);\n }\n else {\n v.push([0, AUTO]);\n }\n }\n return v;\n }\n else {\n return [\n [0, AUTO],\n [0, AUTO],\n ];\n }\n });\n }\n // border-color\n ['Top', 'Right', 'Bottom', 'Left'].forEach(k => {\n k = 'border' + k + 'Color';\n let v = style[k];\n if(v !== undefined) {\n res[STYLE_KEY[style2Upper(k)]] = [rgba2int(v || 'transparent'), RGBA];\n }\n });\n // border-radius\n ['TopLeft', 'TopRight', 'BottomRight', 'BottomLeft'].forEach(k => {\n k = 'border' + k + 'Radius';\n let v = style[k];\n if(v !== undefined) {\n v = v || 0;\n let arr = v.toString().split(/\\s+/);\n if(arr.length === 1) {\n arr[1] = arr[0];\n }\n for(let i = 0; i < 2; i++) {\n let item = arr[i];\n if(/^[-+]?[\\d.]/.test(item)) {\n let n = calUnit(item);\n if([NUMBER, DEG].indexOf(n[1]) > -1) {\n n[1] = PX;\n }\n if(n[0] < 0) {\n n[0] = 0;\n }\n arr[i] = n;\n }\n else {\n arr[i] = [0, PX];\n }\n }\n res[STYLE_KEY[style2Upper(k)]] = arr;\n }\n });\n temp = style.transform;\n if(temp === null) {\n res[TRANSFORM] = null;\n }\n else if(temp !== undefined) {\n let transform = res[TRANSFORM] = [];\n let match = (temp || '').toString().match(/\\w+\\(.+?\\)/g);\n if(match) {\n match.forEach(item => {\n let i = item.indexOf('(');\n let k = item.slice(0, i);\n let v = item.slice(i + 1, item.length - 1);\n if(k === 'matrix') {\n let arr = v.toString().split(/\\s*,\\s*/);\n arr = arr.map(item => parseFloat(item));\n if(arr.length > 6) {\n arr = arr.slice(0, 6);\n }\n if(arr.length === 6) {\n transform.push([MATRIX, [\n arr[0], arr[1], 0, 0, arr[2], arr[3], 0, 0, 0, 0, 1, 0, arr[4], arr[5], 0, 1,\n ]]);\n }\n }\n else if(k === 'matrix3d') {\n let arr = v.toString().split(/\\s*,\\s*/);\n arr = arr.map(item => parseFloat(item));\n if(arr.length > 16) {\n arr = arr.slice(0, 16);\n }\n if(arr.length === 16) {\n transform.push([MATRIX, arr]);\n }\n }\n else if(k === 'perspective') {\n let arr = calUnit(v);\n if(arr[0] < 0) {\n arr[0] = 0;\n }\n compatibleTransform(PERSPECTIVE, arr);\n transform.push([PERSPECTIVE, arr]);\n }\n else if(k === 'rotate3d') {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 4) {\n let deg = calUnit(arr[3]);\n compatibleTransform(ROTATE_3D, deg);\n arr[0] = parseFloat(arr[0].replace('(', ''));\n arr[1] = parseFloat(arr[1]);\n arr[2] = parseFloat(arr[2]);\n arr[3] = deg;\n transform.push([ROTATE_3D, arr]);\n }\n }\n else if(TRANSFORM_HASH.hasOwnProperty(k)) {\n let k2 = TRANSFORM_HASH[k];\n let arr = calUnit(v);\n compatibleTransform(k2, arr);\n transform.push([k2, arr]);\n }\n else if({ translate: true, scale: true, skew: true }.hasOwnProperty(k)) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[1] = k === 'scale' ? arr[0] : [0];\n }\n if(arr.length === 2) {\n let k1 = STYLE_KEY[style2Upper(k + 'X')];\n let k2 = STYLE_KEY[style2Upper(k + 'Y')];\n let arr1 = calUnit(arr[0]);\n let arr2 = calUnit(arr[1]);\n compatibleTransform(k1, arr1);\n compatibleTransform(k2, arr2);\n transform.push([k1, arr1]);\n transform.push([k2, arr2]);\n }\n }\n else if({ translate3d: true, scale3d: true }.hasOwnProperty(k)) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[1] = k === 'scale3d' ? [1] : [0];\n arr[2] = k === 'scale3d' ? [1] : [0];\n }\n else if(arr.length === 2) {\n arr[2] = k === 'scale3d' ? [1] : [0];\n }\n if(arr.length === 3) {\n let k1 = STYLE_KEY[style2Upper(k + 'X')];\n let k2 = STYLE_KEY[style2Upper(k + 'Y')];\n let k3 = STYLE_KEY[style2Upper(k + 'Z')];\n let arr1 = calUnit(arr[0]);\n let arr2 = calUnit(arr[1]);\n let arr3 = calUnit(arr[2]);\n compatibleTransform(k1, arr1);\n compatibleTransform(k2, arr2);\n compatibleTransform(k3, arr3);\n transform.push([k1, arr1]);\n transform.push([k2, arr2]);\n transform.push([k3, arr3]);\n }\n }\n });\n }\n }\n temp = style.perspective;\n if(temp !== undefined) {\n let arr = calUnit(temp || 0);\n if(arr[0] < 0) {\n arr[0] = 0;\n }\n compatibleTransform(PERSPECTIVE, arr);\n res[PERSPECTIVE] = arr;\n }\n ['perspectiveOrigin', 'transformOrigin'].forEach(k => {\n temp = style[k];\n if(temp !== undefined) {\n if(temp === null) {\n temp = '';\n }\n let arr = res[STYLE_KEY[style2Upper(k)]] = [];\n let match = temp.toString().match(reg.position);\n if(match) {\n if(match.length === 1) {\n match[1] = match[0];\n }\n for(let i = 0; i < 2; i++) {\n let item = match[i];\n if(/^[-+]?[\\d.]/.test(item)) {\n let n = calUnit(item);\n if([NUMBER, DEG].indexOf(n[1]) > -1) {\n n[1] = PX;\n }\n arr.push(n);\n }\n else {\n arr.push([\n {\n top: 0,\n left: 0,\n center: 50,\n right: 100,\n bottom: 100,\n }[item],\n PERCENT,\n ]);\n // 不规范的写法变默认值50%\n if(isNil(arr[i][0])) {\n arr[i][0] = 50;\n }\n }\n }\n }\n else {\n arr.push([50, PERCENT]);\n arr.push([50, PERCENT]);\n }\n }\n });\n [\n 'translateX',\n 'translateY',\n 'translateZ',\n 'scaleX',\n 'scaleY',\n 'scaleZ',\n 'skewX',\n 'skewY',\n 'rotateX',\n 'rotateY',\n 'rotateZ',\n 'rotate',\n ].forEach(k => {\n let v = style[k];\n if(v === undefined) {\n return;\n }\n if(v === null) {\n if(k.indexOf('scale') === 0) {\n v = 1;\n }\n else {\n v = 0;\n }\n }\n let k2 = TRANSFORM_HASH[k];\n let n = calUnit(v);\n // 没有单位或默认值处理单位\n compatibleTransform(k2, n);\n res[k2] = n;\n });\n temp = style.rotate3d;\n if(temp !== undefined) {\n let arr = (temp || '').toString().split(/\\s*,\\s*/);\n if(arr.length === 4) {\n let deg = calUnit(arr[3]);\n compatibleTransform(ROTATE_3D, deg);\n arr[0] = parseFloat(arr[0].replace('(', ''));\n arr[1] = parseFloat(arr[1]);\n arr[2] = parseFloat(arr[2]);\n arr[3] = deg;\n }\n res[ROTATE_3D] = arr;\n }\n temp = style.opacity;\n if(temp !== undefined) {\n if(temp === null) {\n temp = 1;\n }\n temp = parseFloat(temp);\n if(!isNaN(temp)) {\n temp = Math.max(temp, 0);\n temp = Math.min(temp, 1);\n res[OPACITY] = temp;\n }\n else {\n res[OPACITY] = 1;\n }\n }\n temp = style.zIndex;\n if(temp !== undefined) {\n res[Z_INDEX] = parseInt(temp) || 0;\n }\n // 转化不同单位值为对象标准化,不写单位的变成number单位转化为px\n [\n 'marginTop',\n 'marginRight',\n 'marginBottom',\n 'marginLeft',\n 'paddingTop',\n 'paddingRight',\n 'paddingBottom',\n 'paddingLeft',\n 'borderTopWidth',\n 'borderRightWidth',\n 'borderBottomWidth',\n 'borderLeftWidth',\n 'top',\n 'right',\n 'bottom',\n 'left',\n 'width',\n 'height',\n ].forEach(k => {\n let v = style[k];\n if(v === undefined) {\n return;\n }\n if(v === 'auto') {\n v = [0, AUTO];\n }\n else {\n v = calUnit(v || 0);\n // 无单位视为px\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n }\n let k2 = STYLE_KEY[style2Upper(k)];\n res[k2] = v;\n // 限制padding/border为正数\n if({\n paddingTop: true,\n paddingRight: true,\n paddingBottom: true,\n paddingLeft: true,\n borderTopWidth: true,\n borderRightWidth: true,\n borderBottomWidth: true,\n borderLeftWidth: true,\n width: true,\n height: true,\n }.hasOwnProperty(k) && v[0] < 0) {\n v[0] = 0;\n }\n });\n temp = style.flexBasis;\n if(temp !== undefined) {\n if(temp === 'content') {\n res[FLEX_BASIS] = [temp, STRING];\n }\n else if(/^[\\d.]/.test(temp)) {\n let v = res[FLEX_BASIS] = calUnit(temp);\n v[0] = Math.max(v[0], 0);\n // 无单位视为px\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n }\n else {\n res[FLEX_BASIS] = [0, AUTO];\n }\n }\n temp = style.order;\n if(temp !== undefined) {\n res[ORDER] = parseInt(temp) || 0;\n }\n temp = style.color;\n if(temp !== undefined) {\n if(temp === 'inherit') {\n res[COLOR] = [[], INHERIT];\n }\n else {\n res[COLOR] = [rgba2int(temp), RGBA];\n }\n }\n temp = style.textStrokeColor;\n if(temp !== undefined) {\n if(temp === 'inherit') {\n res[TEXT_STROKE_COLOR] = [[], INHERIT];\n }\n else {\n res[TEXT_STROKE_COLOR] = [rgba2int(temp), RGBA];\n }\n }\n temp = style.fontSize;\n if(temp !== undefined) {\n if(temp === 'inherit') {\n res[FONT_SIZE] = [0, INHERIT];\n }\n else {\n let v = calUnit(temp);\n // fontSize不能为负数,否则为继承\n if(v < 0) {\n res[FONT_SIZE] = [0, INHERIT];\n }\n else {\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n res[FONT_SIZE] = v;\n }\n }\n }\n temp = style.textStrokeWidth;\n if(temp !== undefined) {\n if(temp === 'inherit') {\n res[TEXT_STROKE_WIDTH] = [0, INHERIT];\n }\n else {\n let v = calUnit(temp);\n // textStrokeWidth不能为负数,否则为继承\n if(v < 0) {\n res[TEXT_STROKE_WIDTH] = [0, INHERIT];\n }\n else {\n if([NUMBER, DEG, PERCENT].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n res[TEXT_STROKE_WIDTH] = v;\n }\n }\n }\n temp = style.textStrokeOver;\n if(temp !== undefined) {\n if(temp === null || temp === 'inherit') {\n res[TEXT_STROKE_OVER] = [0, INHERIT];\n }\n else {\n let v = temp.toString();\n if(v !== 'none' && v !== 'fill') {\n v = 'none';\n }\n res[TEXT_STROKE_OVER] = [v, STRING];\n }\n }\n temp = style.fontWeight;\n if(temp !== undefined) {\n if(temp === 'bold') {\n res[FONT_WEIGHT] = [700, NUMBER];\n }\n else if(temp === 'normal') {\n res[FONT_WEIGHT] = [400, NUMBER];\n }\n else if(temp === 'lighter') {\n res[FONT_WEIGHT] = [200, NUMBER];\n }\n else if(temp === 'inherit') {\n res[FONT_WEIGHT] = [0, INHERIT];\n }\n else {\n res[FONT_WEIGHT] = [Math.max(0, parseInt(temp)) || 400, NUMBER];\n }\n }\n temp = style.fontStyle;\n if(temp !== undefined) {\n if(temp === null || temp === 'inherit') {\n res[FONT_STYLE] = [0, INHERIT];\n }\n else {\n res[FONT_STYLE] = [temp, STRING];\n }\n }\n temp = style.fontFamily;\n if(temp !== undefined) {\n if(temp === null || temp === 'inherit') {\n res[FONT_FAMILY] = [0, INHERIT];\n }\n else {\n // 统一文字声明格式\n res[FONT_FAMILY] = [temp.toString().toLowerCase().replace(/['\"]/, '').replace(/\\s*,\\s*/g, ','), STRING];\n }\n }\n temp = style.textAlign;\n if(temp !== undefined) {\n if(temp === null || temp === 'inherit') {\n res[TEXT_ALIGN] = [0, INHERIT];\n }\n else {\n res[TEXT_ALIGN] = [temp, STRING];\n }\n }\n temp = style.lineHeight;\n if(temp !== undefined) {\n if(temp === 'inherit') {\n res[LINE_HEIGHT] = [0, INHERIT];\n }\n else if(temp === 'normal') {\n res[LINE_HEIGHT] = [0, AUTO];\n }\n // lineHeight默认数字,想要px必须强制带单位\n else if(/^[\\d.]+/i.test(temp)) {\n let v = calUnit(temp);\n if([DEG].indexOf(v[1]) > -1) {\n v[1] = NUMBER;\n }\n res[LINE_HEIGHT] = v;\n }\n else {\n let n = Math.max(0, parseFloat(temp)) || 'normal';\n // 非法数字\n if(n === 'normal') {\n res[LINE_HEIGHT] = [null, AUTO];\n }\n else {\n res[LINE_HEIGHT] = [n, NUMBER];\n }\n }\n }\n temp = style.letterSpacing;\n if(temp !== undefined) {\n if(temp === null || temp === 'inherit') {\n res[LETTER_SPACING] = [0, INHERIT];\n }\n else if(temp === 'normal') {\n res[LETTER_SPACING] = [0, PX];\n }\n else if(/^[-+]?[\\d.]/.test(temp)) {\n let v = calUnit(temp);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n res[LETTER_SPACING] = v;\n }\n else {\n res[LETTER_SPACING] = [parseFloat(temp) || 0, PX];\n }\n }\n temp = style.whiteSpace;\n if(temp !== undefined) {\n if(temp === null || temp === 'inherit') {\n res[WHITE_SPACE] = [0, INHERIT];\n }\n else {\n res[WHITE_SPACE] = [temp, STRING];\n }\n }\n temp = style.lineClamp;\n if(temp !== undefined) {\n temp = parseInt(temp) || 0;\n res[LINE_CLAMP] = Math.max(0, temp);\n }\n // fill和stroke为渐变时特殊处理,fillRule无需处理字符串\n temp = style.fill;\n if(temp !== undefined) {\n if(!temp) {\n res[FILL] = ['none'];\n }\n else if(Array.isArray(temp)) {\n if(temp.length) {\n res[FILL] = temp.map(item => {\n if(!item) {\n return 'none';\n }\n else if(reg.gradient.test(item)) {\n return gradient.parseGradient(item);\n }\n else {\n return rgba2int(item);\n }\n });\n }\n else {\n res[FILL] = ['none'];\n }\n }\n else if(reg.gradient.test(temp)) {\n res[FILL] = [gradient.parseGradient(temp)];\n }\n else {\n res[FILL] = [rgba2int(temp)];\n }\n }\n temp = style.stroke;\n if(temp !== undefined) {\n if(!temp) {\n res[STROKE] = ['none'];\n }\n else if(Array.isArray(temp)) {\n if(temp.length) {\n res[STROKE] = temp.map(item => {\n if(!item) {\n return 'none';\n }\n else if(reg.gradient.test(item)) {\n return gradient.parseGradient(item);\n }\n else {\n return rgba2int(item);\n }\n });\n }\n else {\n res[STROKE] = ['none'];\n }\n }\n else if(reg.gradient.test(temp)) {\n res[STROKE] = [gradient.parseGradient(temp)];\n }\n else {\n res[STROKE] = [rgba2int(temp)];\n }\n }\n temp = style.strokeWidth;\n if(temp !== undefined) {\n if(!Array.isArray(temp)) {\n temp = [temp];\n }\n res[STROKE_WIDTH] = temp.map(item => {\n let v = calUnit(item);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n v[0] = Math.max(v[0], 0);\n return v;\n });\n }\n temp = style.strokeDasharray;\n if(temp !== undefined) {\n if(Array.isArray(temp)) {\n res[STROKE_DASHARRAY] = temp.map(item => {\n let match = (item || '').toString().match(/[\\d.]+/g);\n if(match) {\n match = match.map(item => parseFloat(item));\n if(match.length % 2 === 1) {\n match.push(match[match.length - 1]);\n }\n return match;\n }\n return [];\n });\n }\n else {\n let match = (temp || '').toString().match(/[\\d.]+/g);\n if(match) {\n match = match.map(item => parseFloat(item));\n if(match.length % 2 === 1) {\n match.push(match[match.length - 1]);\n }\n res[STROKE_DASHARRAY] = [match];\n }\n else {\n res[STROKE_DASHARRAY] = [[]];\n }\n }\n }\n temp = style.filter;\n if(temp !== undefined) {\n let match = (temp || '').toString().match(/\\b[\\w-]+\\s*\\(\\s*[-+]?[\\d.]+\\s*[pxremvwhdg%]*\\s*\\)\\s*/ig);\n let f = null;\n if(match) {\n f = [];\n match.forEach(item => {\n let m2 = /([\\w-]+)\\s*\\(\\s*([-+]?[\\d.]+\\s*[pxremvwhdg%]*)\\s*\\)\\s*/i.exec(item);\n if(m2) {\n let k = m2[1].toLowerCase(), v = calUnit(m2[2]);\n if(k === 'blur') {\n if(v[0] <= 0 || [DEG, PERCENT].indexOf(v[1]) > -1) {\n return;\n }\n if(v[1] === NUMBER) {\n v[1] = PX;\n }\n f.push([k, v]);\n }\n else if(k === 'hue-rotate') {\n if([NUMBER, DEG].indexOf(v[1]) === -1) {\n return;\n }\n v[1] = DEG;\n f.push([k, v]);\n }\n else if(k === 'saturate' || k === 'brightness' || k === 'grayscale' || k === 'contrast' || k === 'sepia' || k === 'invert') {\n if([NUMBER, PERCENT].indexOf(v[1]) === -1) {\n return;\n }\n v[0] = Math.max(v[0], 0);\n v[1] = PERCENT;\n f.push([k, v]);\n }\n }\n });\n }\n res[FILTER] = f;\n }\n temp = style.visibility;\n if(temp !== undefined) {\n if(temp === null || temp === 'inherit') {\n res[VISIBILITY] = [0, INHERIT];\n }\n else {\n res[VISIBILITY] = [temp, STRING];\n }\n }\n temp = style.pointerEvents;\n if(temp !== undefined) {\n if(temp === null || temp === 'inherit') {\n res[POINTER_EVENTS] = [0, INHERIT];\n }\n else {\n res[POINTER_EVENTS] = [temp, STRING];\n }\n }\n temp = style.boxShadow;\n if(temp !== undefined) {\n let bs = null;\n let match = (temp || '').match(/([-+]?[\\d.]+[pxremvwhina%]*)\\s*([-+]?[\\d.]+[pxremvwhina%]*)\\s*([-+]?[\\d.]+[pxremvwhina%]*\\s*)?([-+]?[\\d.]+[pxremvwhina%]*\\s*)?(((transparent)|(#[0-9a-f]{3,8})|(rgba?\\(.+?\\)))\\s*)?(inset|outset)?\\s*,?/ig);\n if(match) {\n match.forEach(item => {\n let boxShadow = /([-+]?[\\d.]+[pxremvwhina%]*)\\s*([-+]?[\\d.]+[pxremvwhina%]*)\\s*([-+]?[\\d.]+[pxremvwhina%]*\\s*)?([-+]?[\\d.]+[pxremvwhina%]*\\s*)?(?:((?:transparent)|(?:#[0-9a-f]{3,8})|(?:rgba?\\(.+\\)))\\s*)?(inset|outset)?/i.exec(item);\n if(boxShadow) {\n bs = bs || [];\n let res = [];\n // v,h,blur,spread,color,inset\n for(let i = 0; i < 4; i++) {\n let v = calUnit(boxShadow[i + 1]);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n // x/y可以负,blur和spread不行\n if(i > 1 && v[0] < 0) {\n v = 0;\n }\n res.push(v);\n }\n res.push(rgba2int(boxShadow[5]));\n res.push(boxShadow[6] || 'outset');\n bs.push(res);\n }\n });\n }\n res[BOX_SHADOW] = bs;\n }\n // 直接赋值的string类型\n [\n 'position',\n 'display',\n 'flexDirection',\n 'flexWrap',\n 'justifyContent',\n 'alignItems',\n 'alignSelf',\n 'alignContent',\n 'overflow',\n 'mixBlendMode',\n 'borderTopStyle',\n 'borderRightStyle',\n 'borderBottomStyle',\n 'borderLeftStyle',\n 'backgroundClip',\n 'textOverflow',\n ].forEach(k => {\n if(style.hasOwnProperty(k)) {\n res[STYLE_KEY[style2Upper(k)]] = style[k];\n }\n });\n // 直接赋值的number类型\n [\n 'flexGrow',\n 'flexShrink',\n ].forEach(k => {\n if(style.hasOwnProperty(k)) {\n res[STYLE_KEY[style2Upper(k)]] = Math.max(parseFloat(style[k]) || 0, 0);\n }\n });\n temp = style.zIndex;\n if(temp !== undefined) {\n res[Z_INDEX] = parseFloat(temp) || 0;\n }\n // 这些支持多个的用数组表示\n [\n 'backgroundRepeat',\n 'strokeLinecap',\n 'strokeLinejoin',\n 'strokeMiterlimit',\n 'fillRule',\n ].forEach(k => {\n if(style.hasOwnProperty(k)) {\n let v = style[k];\n res[STYLE_KEY[style2Upper(k)]] = Array.isArray(v) ? v : [v];\n }\n });\n GEOM_KEY_SET.forEach(k => {\n if(style.hasOwnProperty(k)) {\n res[k] = style[k];\n }\n });\n return res;\n}\n\n/**\n * 第一次和REFLOW等级下,刷新前首先执行,生成computedStyle\n * 影响文字测量的只有字体和大小和重量,需要提前处理\n * 继承相关的计算\n * @param node 对象节点\n * @param isRoot 是否是根节点,无继承需使用默认值\n */\nfunction computeMeasure(node, isRoot) {\n let { currentStyle, computedStyle, domParent } = node;\n let parentComputedStyle = !isRoot && domParent.computedStyle;\n MEASURE_KEY_SET.forEach(k => {\n let v = currentStyle[k];\n // ff特殊处理\n if(k === FONT_FAMILY) {\n if(v[1] === INHERIT) {\n computedStyle[k] = getFontFamily(isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : parentComputedStyle[k]);\n }\n else {\n computedStyle[k] = getFontFamily(v[0]);\n }\n }\n else if(v[1] === INHERIT) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : parentComputedStyle[k];\n }\n // 只有fontSize会有%\n else if(v[1] === PERCENT) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (parentComputedStyle[k] * v[0] * 0.01);\n }\n else if(v[1] === REM) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (node.root.computedStyle[FONT_SIZE] * v[0]);\n }\n else if(v[1] === VW) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (node.root.width * 0.01 * v[0]);\n }\n else if(v[1] === VH) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (node.root.height * 0.01 * v[0]);\n }\n else if(v[1] === VMAX) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (Math.max(node.root.width, node.root.height) * 0.01 * v[0]);\n }\n else if(v[1] === VMIN) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (Math.min(node.root.width, node.root.height) * 0.01 * v[0]);\n }\n else {\n computedStyle[k] = v[0];\n }\n });\n}\n\n/**\n * 每次布局前需要计算的reflow相关的computedStyle,每次布局只计算一次,布局完后清除缓存标\n * @param node 对象节点\n */\nfunction computeReflow(node) {\n if(node.__hasComputeReflow) {\n return;\n }\n node.__hasComputeReflow = true;\n let { currentStyle, computedStyle, domParent: parent, root } = node;\n let rem = root.computedStyle[FONT_SIZE];\n let isRoot = !parent;\n let parentComputedStyle = parent && parent.computedStyle;\n [\n BORDER_TOP_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_LEFT_WIDTH,\n ].forEach(k => {\n // border-width不支持百分比\n let item = currentStyle[k];\n if(item[1] === PX) {\n computedStyle[k] = item[0];\n }\n else if(item[1] === REM) {\n computedStyle[k] = item[0] * rem;\n }\n else if(item[1] === VW) {\n computedStyle[k] = item[0] * root.width * 0.01;\n }\n else if(item[1] === VH) {\n computedStyle[k] = item[0] * root.height * 0.01;\n }\n else if(item[1] === VMAX) {\n computedStyle[k] = item[0] * Math.max(root.width, root.height) * 0.01;\n }\n else if(item[1] === VMIN) {\n computedStyle[k] = item[0] * Math.min(root.width, root.height) * 0.01;\n }\n else {\n computedStyle[k] = 0;\n }\n });\n [\n POSITION,\n DISPLAY,\n FLEX_DIRECTION,\n JUSTIFY_CONTENT,\n ALIGN_ITEMS,\n ALIGN_SELF,\n FLEX_GROW,\n FLEX_SHRINK,\n LINE_CLAMP,\n ORDER,\n FLEX_WRAP,\n ALIGN_CONTENT,\n ].forEach(k => {\n computedStyle[k] = currentStyle[k];\n });\n // 匿名块对象\n if(computedStyle[POSITION] === 'absolute' || parentComputedStyle && parentComputedStyle[DISPLAY] === 'flex') {\n if(['block', 'flex'].indexOf(computedStyle[DISPLAY]) === -1) {\n computedStyle[DISPLAY] = 'block';\n }\n }\n let textAlign = currentStyle[TEXT_ALIGN];\n if(textAlign[1] === INHERIT) {\n computedStyle[TEXT_ALIGN] = isRoot ? 'left' : parentComputedStyle[TEXT_ALIGN];\n }\n else {\n computedStyle[TEXT_ALIGN] = textAlign[0];\n }\n let fontSize = computedStyle[FONT_SIZE];\n let lineHeight = currentStyle[LINE_HEIGHT];\n // lineHeight继承很特殊,数字和normal不同于普通单位\n if(lineHeight[1] === INHERIT) {\n if(isRoot) {\n computedStyle[LINE_HEIGHT] = calNormalLineHeight(computedStyle);\n }\n else {\n let p = parent;\n let ph;\n while(p) {\n ph = p.currentStyle[LINE_HEIGHT];\n if(ph[1] !== INHERIT) {\n break;\n }\n p = p.domParent;\n }\n // 到root还是inherit或normal,或者中途遇到了normal,使用normal\n if([AUTO, INHERIT].indexOf(ph[1]) > -1) {\n computedStyle[LINE_HEIGHT] = calNormalLineHeight(computedStyle);\n }\n // 数字继承\n else if(ph[1] === NUMBER) {\n computedStyle[LINE_HEIGHT] = Math.max(ph[0], 0) * fontSize;\n }\n // 单位继承\n else {\n computedStyle[LINE_HEIGHT] = parentComputedStyle[LINE_HEIGHT];\n }\n }\n }\n // 防止为0\n else if(lineHeight[1] === PX) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0], 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === PERCENT) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * fontSize * 0.01, 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === REM) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * rem, 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === VW) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * root.width * 0.01, 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === VH) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * root.height * 0.01, 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === VMAX) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * Math.max(root.width, root.height) * 0.01, 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === VMIN) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * Math.min(root.width, root.height) * 0.01, 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === NUMBER) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0], 0) * fontSize || calNormalLineHeight(computedStyle);\n }\n // normal或auto\n else {\n computedStyle[LINE_HEIGHT] = calNormalLineHeight(computedStyle);\n }\n let letterSpacing = currentStyle[LETTER_SPACING];\n if(letterSpacing[1] === INHERIT) {\n computedStyle[LETTER_SPACING] = isRoot ? 0 : parentComputedStyle[LETTER_SPACING];\n }\n else if(letterSpacing[1] === PERCENT) {\n computedStyle[LETTER_SPACING] = fontSize * 0.01 * letterSpacing[0];\n }\n else if(letterSpacing[1] === REM) {\n computedStyle[LETTER_SPACING] = rem * letterSpacing[0];\n }\n else if(letterSpacing[1] === VW) {\n computedStyle[LETTER_SPACING] = root.width * 0.01 * letterSpacing[0];\n }\n else if(letterSpacing[1] === VH) {\n computedStyle[LETTER_SPACING] = root.height * 0.01 * letterSpacing[0];\n }\n else if(letterSpacing[1] === VMAX) {\n computedStyle[LETTER_SPACING] = Math.max(root.width, root.height) * 0.01 * letterSpacing[0];\n }\n else if(letterSpacing[1] === VMIN) {\n computedStyle[LETTER_SPACING] = Math.min(root.width, root.height) * 0.01 * letterSpacing[0];\n }\n else {\n computedStyle[LETTER_SPACING] = letterSpacing[0];\n }\n //whiteSpace\n let whiteSpace = currentStyle[WHITE_SPACE];\n if(whiteSpace[1] === INHERIT) {\n computedStyle[WHITE_SPACE] = isRoot ? 'normal' : parentComputedStyle[WHITE_SPACE];\n }\n else {\n computedStyle[WHITE_SPACE] = whiteSpace[0];\n }\n}\n\nfunction setFontStyle(style) {\n let fontSize = style[FONT_SIZE] || 0;\n let fontFamily = style[FONT_FAMILY] || 'arial';\n if(/\\s/.test(fontFamily)) {\n fontFamily = '\"' + fontFamily.replace(/\"/g, '\\\\\"') + '\"';\n }\n return (style[FONT_STYLE] || 'normal') + ' ' + (style[FONT_WEIGHT] || '400') + ' '\n + fontSize + 'px/' + fontSize + 'px ' + fontFamily;\n}\n\nfunction getFontFamily(str) {\n let ff = str.split(',');\n let f = 'arial';\n for(let i = 0, len = ff.length; i < len; i++) {\n if(font.support(ff[i])) {\n f = ff[i];\n break;\n }\n }\n return f;\n}\n\nfunction getBaseline(style) {\n let fontSize = style[FONT_SIZE];\n let ff = getFontFamily(style[FONT_FAMILY]);\n let normal = fontSize * (font.info[ff] || font.info.arial).lhr;\n return (style[LINE_HEIGHT] - normal) * 0.5 + fontSize * (font.info[ff] || font.info.arial).blr;\n}\n\nfunction calNormalLineHeight(style) {\n let ff = getFontFamily(style[FONT_FAMILY]);\n return style[FONT_SIZE] * (font.info[ff] || font.info.arial).lhr;\n}\n\nfunction calRelativePercent(n, parent, k) {\n n *= 0.01;\n while(parent) {\n let style = parent.currentStyle[k];\n if(style[1] === AUTO) {\n if(k === WIDTH) {\n parent = parent.domParent;\n }\n else {\n break;\n }\n }\n else if(style[1] === PX) {\n return n * style[0];\n }\n else if(style[1] === PERCENT) {\n n *= style[0] * 0.01;\n parent = parent.domParent;\n }\n else if(style[1] === REM) {\n return n * style[0] * parent.root.computedStyle[FONT_SIZE];\n }\n else if(style[1] === VW) {\n return n * style[0] * parent.root.width * 0.01;\n }\n else if(style[1] === VH) {\n return n * style[0] * parent.root.height * 0.01;\n }\n else if(style[1] === VMAX) {\n return n * style[0] * Math.max(parent.root.width, parent.root.height) * 0.01;\n }\n else if(style[1] === VMIN) {\n return n * style[0] * Math.min(parent.root.width, parent.root.height) * 0.01;\n }\n }\n return n;\n}\n\nfunction calRelative(currentStyle, k, v, parent, isWidth) {\n if(v[1] === AUTO) {\n v = 0;\n }\n else if([PX, NUMBER].indexOf(v[1]) > -1) {\n v = v[0];\n }\n else if(v[1] === PERCENT) {\n if(isWidth) {\n v = calRelativePercent(v[0], parent, WIDTH);\n }\n else {\n v = calRelativePercent(v[0], parent, HEIGHT);\n }\n }\n else if(v[1] === REM) {\n v = v[0] * parent.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * parent.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * parent.root.height * 0.01;\n }\n else if(v[1] === VMAX) {\n v = v[0] * Math.max(parent.root.width, parent.root.height) * 0.01;\n }\n else if(v[1] === VMIN) {\n v = v[0] * Math.min(parent.root.width, parent.root.height) * 0.01;\n }\n return v;\n}\n\nfunction calAbsolute(currentStyle, k, v, size, root) {\n if(v[1] === AUTO) {\n v = 0;\n }\n else if([PX, NUMBER, DEG, RGBA, STRING].indexOf(v[1]) > -1) {\n v = v[0];\n }\n else if(v[1] === PERCENT) {\n v = v[0] * size * 0.01;\n }\n else if(v[1] === REM) {\n v = v[0] * root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * root.height * 0.01;\n }\n else if(v[1] === VMAX) {\n v = v[0] * Math.max(root.width, root.height) * 0.01;\n }\n else if(v[1] === VMIN) {\n v = v[0] * Math.min(root.width, root.height) * 0.01;\n }\n return v;\n}\n\nfunction equalStyle(k, a, b, target) {\n if(!a || !b) {\n return a === b;\n }\n if(k === TRANSFORM) {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n let oa = a[i];\n let ob = b[i];\n if(oa[0] !== ob[0]) {\n return false;\n }\n // translate/matrix等都是数组\n if(!equalArr(oa[1], ob[1])) {\n return false;\n }\n }\n return true;\n }\n if(k === FILTER) {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n if(!equalArr(a[i], b[i])) {\n return false;\n }\n }\n }\n if(k === BACKGROUND_SIZE) {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n let aa = a[i], bb = b[i];\n if(aa[0][0] !== bb[0][0] || aa[0][1] !== bb[0][1] || aa[1][0] !== bb[1][0] || aa[1][1] !== bb[1][1]) {\n return false;\n }\n }\n return true;\n }\n if(k === TRANSFORM_ORIGIN || RADIUS_HASH.hasOwnProperty(k)) {\n return a[0][0] === b[0][0] && a[0][1] === b[0][1]\n && a[1][0] === b[1][0] && a[1][1] === b[1][1];\n }\n if(k === BACKGROUND_POSITION_X || k === BACKGROUND_POSITION_Y\n || LENGTH_HASH.hasOwnProperty(k) || EXPAND_HASH.hasOwnProperty(k)) {\n return a[0] === b[0] && a[1] === b[1];\n }\n if(k === BOX_SHADOW) {\n return equalArr(a, b);\n }\n if(COLOR_HASH.hasOwnProperty(k)) {\n return a[1] === b[1] && equalArr(a[0], b[0]);\n }\n if(GRADIENT_HASH.hasOwnProperty(k) && a.k === b.k && GRADIENT_TYPE.hasOwnProperty(a.k)) {\n let av = a.v;\n let bv = b.v;\n if(a.d !== b.d || av.length !== bv.length) {\n return false;\n }\n for(let i = 0, len = av.length; i < len; i++) {\n let ai = av[i];\n let bi = bv[i];\n if(ai.length !== bi.length) {\n return false;\n }\n for(let j = 0; j < 4; j++) {\n if(ai[0][j] !== bi[0][j]) {\n return false;\n }\n }\n if(ai.length > 1) {\n if(ai[1][0] !== bi[1][0] || ai[1][1] !== bi[1][1]) {\n return false;\n }\n }\n }\n return true;\n }\n // multi都是纯值数组,equalArr本身即递归,非multi根据类型判断\n if(isGeom(target.tagName, k) && (target.isMulti || Array.isArray(a) && Array.isArray(b))) {\n return equalArr(a, b);\n }\n return a === b;\n}\n\nfunction isRelativeOrAbsolute(node) {\n let position = node.currentStyle[POSITION];\n return position === 'relative' || position === 'absolute';\n}\n\nconst VALUE = {\n [POSITION]: true,\n [DISPLAY]: true,\n [STYLE_KEY.BACKGROUND_REPEAT]: true,\n [FLEX_DIRECTION]: true,\n [FLEX_GROW]: true,\n [FLEX_SHRINK]: true,\n [FLEX_WRAP]: true,\n [JUSTIFY_CONTENT]: true,\n [ALIGN_ITEMS]: true,\n [ALIGN_SELF]: true,\n [STYLE_KEY.OVERFLOW]: true,\n [STYLE_KEY.MIX_BLEND_MODE]: true,\n [STYLE_KEY.STROKE_LINECAP]: true,\n [STYLE_KEY.STROKE_LINEJOIN]: true,\n [STYLE_KEY.STROKE_MITERLIMIT]: true,\n [STYLE_KEY.FILL_RULE]: true,\n [OPACITY]: true,\n [Z_INDEX]: true,\n [BACKGROUND_CLIP]: true,\n [TEXT_OVERFLOW]: true,\n [LINE_CLAMP]: true,\n};\n// 仅1维数组\nconst ARRAY_0 = {\n [COLOR]: true,\n [TEXT_STROKE_COLOR]: true,\n [BACKGROUND_COLOR]: true,\n [STYLE_KEY.BORDER_TOP_COLOR]: true,\n [STYLE_KEY.BORDER_RIGHT_COLOR]: true,\n [STYLE_KEY.BORDER_BOTTOM_COLOR]: true,\n [STYLE_KEY.BORDER_LEFT_COLOR]: true,\n};\n// 仅2维数组且只有2个值\nconst ARRAY_0_1 = {\n [STYLE_KEY.BORDER_TOP_LEFT_RADIUS]: true,\n [STYLE_KEY.BORDER_TOP_RIGHT_RADIUS]: true,\n [STYLE_KEY.BORDER_BOTTOM_RIGHT_RADIUS]: true,\n [STYLE_KEY.BORDER_BOTTOM_LEFT_RADIUS]: true,\n [TRANSFORM_ORIGIN]: true,\n [PERSPECTIVE_ORIGIN]: true,\n};\nfunction cloneStyle(style, keys) {\n if(!keys) {\n keys = Object.keys(style).map(i => {\n if(!GEOM.hasOwnProperty(i)) {\n i = parseInt(i);\n }\n return i;\n });\n }\n let res = {};\n for(let i = 0, len = keys.length; i < len; i++) {\n let k = keys[i];\n let v = style[k];\n // 渐变特殊处理\n if(k === BACKGROUND_IMAGE) {\n res[k] = v.map(item => {\n // 可能为null\n if(item && item.k) {\n return util.clone(item);\n }\n else {\n return item;\n }\n });\n }\n else if(k === FILL || k === STROKE) {\n res[k] = v.map(item => {\n // 渐变\n // 可能非法为空\n if(item && item.k) {\n return util.clone(item);\n }\n // 颜色\n else {\n return item.slice(0);\n }\n });\n }\n else if(k === TRANSFORM || k === FILTER) {\n if(v) {\n let n = v.slice(0);\n for(let i = 0, len = n.length; i < len; i++) {\n n[i] = n[i].slice(0);\n n[i][1] = n[i][1].slice(0);\n }\n res[k] = n;\n }\n }\n else if(k === BOX_SHADOW) {\n if(v) {\n v = v.map(item => {\n let n = item.slice(0);\n n[4] = n[4].slice(0);\n return n;\n });\n res[k] = v;\n }\n }\n else if(k === TRANSLATE_PATH) {\n if(v) {\n res[k] = v.map(item => item.slice(0));\n }\n }\n // position等直接值类型赋值\n else if(VALUE.hasOwnProperty(k)) {\n res[k] = v;\n }\n // geom自定义属性\n else if(GEOM.hasOwnProperty(k)) {\n res[k] = util.clone(v);\n }\n // 其余皆是数组或空,默认是一维数组只需slice即可\n else if(v) {\n let n = res[k] = v.slice(0);\n // 特殊引用里数组某项再次clone\n if(k === BACKGROUND_POSITION_X || k === BACKGROUND_POSITION_Y) {\n for(let i = 0, len = n.length; i < len; i++) {\n n[i] = n[i].slice(0);\n }\n }\n else if(k === BACKGROUND_SIZE) {\n for(let i = 0, len = n.length; i < len; i++) {\n n[i] = n[i].slice(0);\n n[i][0] = n[i][0].slice(0);\n n[i][1] = n[i][1].slice(0);\n }\n }\n else if(ARRAY_0.hasOwnProperty(k)) {\n n[0] = n[0].slice(0);\n }\n else if(ARRAY_0_1.hasOwnProperty(k)) {\n n[0] = n[0].slice(0);\n n[1] = n[1].slice(0);\n }\n else if(k === TRANSFORM) {\n for(let i = 0, len = n.length; i < len; i++) {\n n[i] = n[i].slice(0);\n }\n }\n else if(k === ROTATE_3D) {\n n[3] = n[3].slice(0);\n }\n }\n }\n return res;\n}\n\nfunction calAbsFixedSize(value, size, root) {\n if(value[1] === PX) {\n return value[0];\n }\n else if(value[1] === PERCENT) {\n return value[0] * 0.01 * size;\n }\n else if(value[1] === REM) {\n return value[0] * root.computedStyle[FONT_SIZE];\n }\n else if(value[1] === VW) {\n return value[0] * root.width * 0.01;\n }\n else if(value[1] === VH) {\n return value[0] * root.height * 0.01;\n }\n else if(value[1] === VMAX) {\n return value[0] * Math.max(root.width, root.height) * 0.01;\n }\n else if(value[1] === VMIN) {\n return value[0] * Math.min(root.width, root.height) * 0.01;\n }\n return 0;\n}\n\nexport default {\n normalize,\n computeMeasure,\n computeReflow,\n setFontStyle,\n getFontFamily,\n getBaseline,\n calRelative,\n calAbsolute,\n calAbsFixedSize,\n equalStyle,\n isRelativeOrAbsolute,\n cloneStyle,\n};\n","import mode from '../refresh/mode';\nimport css from '../style/css';\nimport enums from '../util/enums';\nimport util from '../util/util';\n\nconst { STYLE_KEY: {\n COLOR,\n FONT_WEIGHT,\n FONT_FAMILY,\n FONT_SIZE,\n FONT_STYLE,\n LETTER_SPACING,\n TEXT_STROKE_COLOR,\n TEXT_STROKE_WIDTH,\n TEXT_STROKE_OVER,\n} } = enums;\n\n/**\n * 表示一行文本的类,保存它的位置、内容、从属信息,在布局阶段生成,并在渲染阶段被Text调用render()\n * 关系上直属于Text类,一个Text类可能因为换行原因导致有多个TextBox,一行内容中也可能有不同Text从而不同TextBox\n * 另外本类还会被LineBoxManager添加到LineBox里,LineBox为一行中的inline/文本组合,之间需要进行垂直对齐\n * 在textOverflow为ellipsis时,可能会收到后面节点的向前回退(后面不足放下…),使得省略号发生在本节点\n */\nclass TextBox {\n constructor(parent, index, x, y, w, h, content, wList) {\n this.__parent = parent;\n this.__index = index;\n this.__x = x;\n this.__y = y;\n this.__width = w;\n this.__height = h;\n this.__content = content;\n this.__wList = wList;\n this.__virtualDom = {};\n }\n\n /**\n * 渲染阶段被Text类调用,多行Text会有多个TextBox,内容被分拆开\n * @param renderMode\n * @param ctx\n * @param computedStyle\n * @param cacheStyle Text父节点Dom的缓存样式,相比computedStyle可以直接用,比如color被缓存为style字符串\n * @param dx\n * @param dy\n */\n render(renderMode, ctx, computedStyle, cacheStyle, dx, dy) {\n let { content, x, y, parent, wList, width } = this;\n let { ox, oy } = parent;\n y += css.getBaseline(computedStyle);\n x += ox + dx;\n y += oy + dy;\n this.__endX = x + width;\n this.__endY = y;\n let {\n [LETTER_SPACING]: letterSpacing,\n [TEXT_STROKE_WIDTH]: textStrokeWidth,\n [TEXT_STROKE_COLOR]: textStrokeColor,\n } = computedStyle;\n let i = 0, length = content.length;\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n let overFill = computedStyle[TEXT_STROKE_OVER] === 'fill';\n if(letterSpacing) {\n for(; i < length; i++) {\n if(overFill) {\n ctx.fillText(content.charAt(i), x, y);\n }\n if(textStrokeWidth && (textStrokeColor[3] > 0 || textStrokeColor.length === 3)) {\n ctx.strokeText(content.charAt(i), x, y);\n }\n if(!overFill) {\n ctx.fillText(content.charAt(i), x, y);\n }\n x += wList[i] + letterSpacing;\n }\n }\n else {\n if(overFill) {\n ctx.fillText(content, x, y);\n }\n if(textStrokeWidth && (textStrokeColor[3] > 0 || textStrokeColor.length === 3)) {\n ctx.strokeText(content, x, y);\n }\n if(!overFill) {\n ctx.fillText(content, x, y);\n }\n }\n }\n else if(renderMode === mode.SVG) {\n let props = [\n ['x', x],\n ['y', y],\n ['fill', cacheStyle[COLOR]],\n ['font-family', computedStyle[FONT_FAMILY]],\n ['font-weight', computedStyle[FONT_WEIGHT]],\n ['font-style', computedStyle[FONT_STYLE]],\n ['font-size', computedStyle[FONT_SIZE] + 'px'],\n ];\n // svg无法定义stroke的over\n if(textStrokeWidth && (textStrokeColor[3] > 0 || textStrokeColor.length === 3)) {\n props.push(['stroke', cacheStyle[TEXT_STROKE_COLOR]]);\n props.push(['stroke-width', computedStyle[TEXT_STROKE_WIDTH]]);\n }\n if(letterSpacing) {\n props.push(['letter-spacing', letterSpacing]);\n }\n this.__virtualDom = {\n type: 'item',\n tagName: 'text',\n props,\n content: util.encodeHtml(content),\n };\n }\n }\n\n __offsetX(diff) {\n this.__x += diff;\n }\n\n __offsetY(diff) {\n this.__y += diff;\n }\n\n get x() {\n return this.__x;\n }\n\n get y() {\n return this.__y;\n }\n\n get endX() {\n return this.__endX;\n }\n\n get endY() {\n return this.__endY;\n }\n\n get width() {\n return this.__width;\n }\n\n get outerWidth() {\n return this.__width;\n }\n\n get height() {\n return this.__height;\n }\n\n get outerHeight() {\n return this.__height;\n }\n\n get content() {\n return this.__content;\n }\n\n get baseline() {\n return this.parent.baseline;\n }\n\n get virtualDom() {\n return this.__virtualDom;\n }\n\n get parent() {\n return this.__parent;\n }\n\n get parentLineBox() {\n return this.__parentLineBox;\n }\n\n get wList() {\n return this.__wList;\n }\n\n get isReplaced() {\n return false;\n }\n}\n\nexport default TextBox;\n","import inject from '../util/inject';\n\nlet SIZE = [8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192];\nlet NUMBER = [128, 64, 32, 16, 8, 4, 2, 1, 1, 1, 1];\nlet MAX = SIZE[SIZE.length - 1];\nconst HASH_CANVAS = {};\n\nlet uuid = 0;\n\nclass Page {\n constructor(size, number) {\n this.__size = size;\n this.__number = number;\n this.__free = this.__total = number * number;\n size *= number;\n this.__width = size;\n this.__height = size;\n let offscreen = this.__canvas = inject.getCacheCanvas(size, size, null, number);\n if(offscreen) {\n this.__offscreen = offscreen;\n }\n // 1/0标识n*n个单元格是否空闲可用,一维数组表示\n this.__grid = [];\n for(let i = 0; i < this.__total; i++) {\n this.__grid.push(1);\n }\n this.__uuid = uuid++;\n // webgl贴图缓存使用,一旦更新则标识记录,绑定某号纹理单元查看变化才更新贴图\n this.__update = false;\n this.time = 0;\n }\n\n add() {\n let { number, grid } = this;\n for(let i = 0; i < number; i++) {\n for(let j = 0; j < number; j++) {\n let index = i * number + j;\n if(grid[index]) {\n grid[index] = 0;\n this.__free--;\n return index;\n }\n }\n }\n // 理论不可能进入,除非bug\n throw new Error('Can not find free page');\n }\n\n del(pos) {\n if(!this.grid[pos]) {\n this.grid[pos] = 1;\n this.__free++;\n }\n }\n\n getCoords(pos) {\n let { size, number } = this;\n let x = pos % number;\n let y = Math.floor(pos / number);\n return [x * size, y * size];\n }\n\n get uuid() {\n return this.__uuid;\n }\n\n get size() {\n return this.__size;\n }\n\n get width() {\n return this.__width;\n }\n\n get height() {\n return this.__height;\n }\n\n get number() {\n return this.__number;\n }\n\n get total() {\n return this.__total;\n }\n\n get free() {\n return this.__free;\n }\n\n get grid() {\n return this.__grid;\n }\n\n get offscreen() {\n return this.__offscreen;\n }\n\n get canvas() {\n return this.offscreen.canvas;\n }\n\n get ctx() {\n return this.offscreen.ctx;\n }\n\n get update() {\n return this.__update;\n }\n\n set update(v) {\n this.__update = v;\n }\n\n static getInstance(size) {\n if(size > MAX) {\n return;\n }\n let s = SIZE[0];\n let n = NUMBER[0];\n // 使用刚好满足的尺寸\n for(let i = 0, len = SIZE.length; i < len; i++) {\n s = SIZE[i];\n n = NUMBER[i];\n if(SIZE[i] >= size) {\n break;\n }\n }\n let list = HASH_CANVAS[s] = HASH_CANVAS[s] || [];\n // 从hash列表中尝试取可用的一页,找不到就生成新的页\n let page;\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(item.free) {\n page = item;\n break;\n }\n }\n if(!page) {\n page = new Page(s, n);\n if(!page.offscreen) {\n inject.error('Can not create off-screen for page');\n return;\n }\n list.push(page);\n }\n let pos = page.add();\n return { page, pos };\n }\n\n static set CONFIG(v) {\n if(!v || !Array.isArray(v.SIZE) || !Array.isArray(v.NUMBER)) {\n return;\n }\n SIZE = v.SIZE;\n NUMBER = v.NUMBER;\n MAX = SIZE[SIZE.length - 1];\n }\n\n static get CONFIG() {\n return {\n SIZE,\n NUMBER,\n };\n }\n\n static get MAX() {\n return MAX;\n }\n\n static genUuid() {\n return uuid++;\n }\n}\n\nexport default Page;\n","import matrix from './matrix';\nimport geom from './geom';\n\n// 一条边相对于自己开始点的x向量角度,即从x到此边旋转,0~180和-180~0,需要判断象限\nfunction calDeg(x1, y1, x2, y2) {\n let dx = x2 - x1;\n let dy = y2 - y1;\n let atan = Math.atan(Math.abs(dy) / Math.abs(dx));\n // 2象限\n if(dx < 0 && dy >= 0) {\n return Math.PI - atan;\n }\n // 3象限\n if(dx < 0 && dy < 0) {\n return atan - Math.PI;\n }\n // 1象限\n if(dx >= 0 && dy >= 0) {\n return atan;\n }\n // 4象限,顺时针正好\n return -atan;\n}\n\nfunction rotate(theta) {\n let sin = Math.sin(theta);\n let cos = Math.cos(theta);\n let t = matrix.identity();\n t[0] = t[5] = cos;\n t[1] = sin;\n t[4] = -sin;\n return t;\n}\n\n/**\n * 确保3个点中,a点在三角形左上方,b/c在右方,同时ab到ac要顺时针旋转\n * @param points\n */\nfunction pointIndex(points) {\n let [x1, y1, x2, y2, x3, y3] = points;\n let index = [0, 1, 2];\n // 将a点放入最左\n if(x2 < x1 && x2 < x3) {\n [x1, y1, x2, y2] = [x2, y2, x1, y1];\n index[0] = 1;\n index[1] = 0;\n }\n else if(x3 < x2 && x3 < x1) {\n [x1, y1, x3, y3] = [x3, y3, x1, y1];\n index[0] = 2;\n index[2] = 0;\n }\n // 有可能出现2个并列的情况,判断取上面那个\n if(x1 === x2) {\n if(y1 > y2) {\n [x1, y1, x2, y2] = [x2, y2, x1, y1];\n let t = index[0];\n index[0] = index[1];\n index[1] = t;\n }\n }\n else if(x1 === x3) {\n if(y1 > y3) {\n [x1, y1, x3, y3] = [x3, y3, x1, y1];\n let t = index[0];\n index[0] = index[2];\n index[2] = t;\n }\n }\n // ab到ac要顺时针旋转,即2个向量夹角为正,用向量叉乘判断正负\n let cross = (x2 - x1) * (y3 - y1) - (x3 - x1) * (y2 - y1);\n if(cross < 0) {\n [x2, y2, x3, y3] = [x3, y3, x2, y2];\n let t = index[1];\n index[1] = index[2];\n index[2] = t;\n }\n return [x1, y1, x2, y2, x3, y3, index];\n}\n\n/**\n * 第2个点根据第一个点的交换顺序交换\n * @param points\n * @param index\n * @returns {[]}\n */\nfunction pointByIndex(points, index) {\n let res = [];\n for(let i = 0, len = index.length; i < len; i++) {\n let j = index[i];\n res.push(points[j * 2]);\n res.push(points[j * 2 + 1]);\n }\n return res;\n}\n\n/**\n * 确保3个点中,a点在三角形左上方,b/c在右方,同时ab到ac要顺时针旋转\n * @param source 源3个点\n * @param target 目标3个点\n * @returns 交换顺序后的点坐标\n */\nfunction exchangeOrder(source, target) {\n let [sx1, sy1, sx2, sy2, sx3, sy3, index] = pointIndex(source);\n let [tx1, ty1, tx2, ty2, tx3, ty3] = pointByIndex(target, index);\n return [\n [sx1, sy1, sx2, sy2, sx3, sy3],\n [tx1, ty1, tx2, ty2, tx3, ty3]\n ];\n}\n\n/**\n * 存在一种情况,变换结果使得三角形镜像相反了,即顶点a越过bc线,判断是否溢出\n * @param source\n * @param target\n * @returns {boolean}是否溢出\n */\nfunction isOverflow(source, target) {\n let [sx1, sy1, sx2, sy2, sx3, sy3] = source;\n let [tx1, ty1, tx2, ty2, tx3, ty3] = target;\n let cross1 = (sx2 - sx1) * (sy3 - sy1) - (sx3 - sx1) * (sy2 - sy1);\n let cross2 = (tx2 - tx1) * (ty3 - ty1) - (tx3 - tx1) * (ty2 - ty1);\n return cross1 > 0 && cross2 < 0 || cross1 < 0 && cross2 > 0;\n}\n\nfunction transform(source, target) {\n let [sx1, sy1, sx2, sy2, sx3, sy3] = source;\n let [tx1, ty1, tx2, ty2, tx3, ty3] = target;\n // 记录翻转\n let overflow = isOverflow(source, target);\n // 第0步,将源三角第1个a点移到原点\n let m = matrix.identity();\n m[12] = -sx1;\n m[13] = -sy1;\n let t;\n // 第1步,以第1条边ab为基准,将其贴合x轴上,为后续倾斜不干扰做准备\n let theta = calDeg(sx1, sy1, sx2, sy2);\n if(theta !== 0) {\n t = rotate(-theta);\n m = matrix.multiply(t, m);\n }\n // 第2步,以第1条边AB为基准,缩放x轴ab至目标相同长度,可与4步合并\n let ls = geom.pointsDistance(sx1, sy1, sx2, sy2);\n let lt = geom.pointsDistance(tx1, ty1, tx2, ty2);\n // if(ls !== lt) {\n // let scale = lt / ls;\n // t = matrix.identity();\n // t[0] = scale;\n // m = matrix.multiply(t, m);\n // }\n // 第3步,缩放y,先将目标三角形旋转到x轴平行,再变换坐标计算\n let n = matrix.identity();\n n[12] = -tx1;\n n[13] = -ty1;\n theta = calDeg(tx1, ty1, tx2, ty2);\n // 记录下这个旋转角度,后面源三角形要反向旋转\n let alpha = theta;\n if(theta !== 0) {\n t = rotate(-theta);\n n = matrix.multiply(t, n);\n }\n // 目标三角反向旋转至x轴后的坐标\n // 源三角目前的第3点坐标y值即为长度,因为a点在原点0无需减去\n let ls2 = Math.abs(matrix.calPoint([sx3, sy3], m)[1]);\n let lt2 = Math.abs(matrix.calPoint([tx3, ty3], n)[1]);\n // 缩放y\n // if(ls2 !== lt2) {\n // let scale = lt / ls;\n // t = matrix.identity();\n // t[3] = scale;\n // m = matrix.multiply(t, m);\n // }\n if(ls !== lt || ls2 !== lt2) {\n t = matrix.identity();\n if(ls !== lt) {\n t[0] = lt / ls;\n }\n if(ls2 !== lt2) {\n t[5] = lt2 / ls2;\n }\n m = matrix.multiply(t, m);\n }\n // 第4步,x轴倾斜,用余弦定理求目前a和A的夹角\n n = m;\n let [ax1, ay1] = matrix.calPoint([sx1, sy1], n);\n let [ax2, ay2] = matrix.calPoint([sx2, sy2], n);\n let [ax3, ay3] = matrix.calPoint([sx3, sy3], n);\n let ab = geom.pointsDistance(ax1, ay1, ax2, ay2);\n let ac = geom.pointsDistance(ax1, ay1, ax3, ay3);\n let bc = geom.pointsDistance(ax3, ay3, ax2, ay2);\n let AB = geom.pointsDistance(tx1, ty1, tx2, ty2);\n let AC = geom.pointsDistance(tx1, ty1, tx3, ty3);\n let BC = geom.pointsDistance(tx3, ty3, tx2, ty2);\n let a = geom.angleBySide(bc, ab, ac);\n let A = geom.angleBySide(BC, AB, AC);\n // 先至90°,再旋转至目标角,可以合并成tan相加,不知道为什么不能直接tan倾斜差值角度\n if(a !== A) {\n t = matrix.identity();\n t[4] = Math.tan(a - Math.PI * 0.5) + Math.tan(Math.PI * 0.5 - A);\n m = matrix.multiply(t, m);\n }\n // 发生翻转时特殊处理按x轴垂直翻转\n if(overflow) {\n m[1] = -m[1];\n m[5] = -m[5];\n m[13] = -m[13];\n }\n // 第5步,再次旋转,角度为目标旋转到x轴的负值,可与下步合并\n if(alpha !== 0) {\n t = rotate(alpha);\n // m = matrix.multiply(t, m);\n }\n else {\n t = matrix.identity();\n }\n // 第6步,移动第一个点的差值\n // t = matrix.identity();\n t[12] = tx1;\n t[13] = ty1;\n return matrix.multiply(t, m);\n}\n\nexport default {\n exchangeOrder,\n isOverflow,\n transform,\n};\n","/**\n * martinez v0.7.1\n * Martinez polygon clipping algorithm, does boolean operation on polygons (multipolygons, polygons with holes etc): intersection, union, difference, xor\n *\n * @author Alex Milevski \n * @license MIT\n * @preserve\n */\n\nfunction DEFAULT_COMPARE (a, b) { return a > b ? 1 : a < b ? -1 : 0; }\n\nvar SplayTree = function SplayTree(compare, noDuplicates) {\n if ( compare === void 0 ) compare = DEFAULT_COMPARE;\n if ( noDuplicates === void 0 ) noDuplicates = false;\n\n this._compare = compare;\n this._root = null;\n this._size = 0;\n this._noDuplicates = !!noDuplicates;\n};\n\nvar prototypeAccessors = { size: { configurable: true } };\n\n\nSplayTree.prototype.rotateLeft = function rotateLeft (x) {\n var y = x.right;\n if (y) {\n x.right = y.left;\n if (y.left) { y.left.parent = x; }\n y.parent = x.parent;\n }\n\n if (!x.parent) { this._root = y; }\n else if (x === x.parent.left) { x.parent.left = y; }\n else { x.parent.right = y; }\n if (y) { y.left = x; }\n x.parent = y;\n};\n\n\nSplayTree.prototype.rotateRight = function rotateRight (x) {\n var y = x.left;\n if (y) {\n x.left = y.right;\n if (y.right) { y.right.parent = x; }\n y.parent = x.parent;\n }\n\n if (!x.parent) { this._root = y; }\n else if(x === x.parent.left) { x.parent.left = y; }\n else { x.parent.right = y; }\n if (y) { y.right = x; }\n x.parent = y;\n};\n\n\nSplayTree.prototype._splay = function _splay (x) {\n while (x.parent) {\n var p = x.parent;\n if (!p.parent) {\n if (p.left === x) { this.rotateRight(p); }\n else { this.rotateLeft(p); }\n } else if (p.left === x && p.parent.left === p) {\n this.rotateRight(p.parent);\n this.rotateRight(p);\n } else if (p.right === x && p.parent.right === p) {\n this.rotateLeft(p.parent);\n this.rotateLeft(p);\n } else if (p.left === x && p.parent.right === p) {\n this.rotateRight(p);\n this.rotateLeft(p);\n } else {\n this.rotateLeft(p);\n this.rotateRight(p);\n }\n }\n};\n\n\nSplayTree.prototype.splay = function splay (x) {\n var p, gp, ggp, l, r;\n\n while (x.parent) {\n p = x.parent;\n gp = p.parent;\n\n if (gp && gp.parent) {\n ggp = gp.parent;\n if (ggp.left === gp) { ggp.left= x; }\n else { ggp.right = x; }\n x.parent = ggp;\n } else {\n x.parent = null;\n this._root = x;\n }\n\n l = x.left; r = x.right;\n\n if (x === p.left) { // left\n if (gp) {\n if (gp.left === p) {\n /* zig-zig */\n if (p.right) {\n gp.left = p.right;\n gp.left.parent = gp;\n } else { gp.left = null; }\n\n p.right = gp;\n gp.parent = p;\n } else {\n /* zig-zag */\n if (l) {\n gp.right = l;\n l.parent = gp;\n } else { gp.right = null; }\n\n x.left = gp;\n gp.parent = x;\n }\n }\n if (r) {\n p.left = r;\n r.parent = p;\n } else { p.left = null; }\n\n x.right= p;\n p.parent = x;\n } else { // right\n if (gp) {\n if (gp.right === p) {\n /* zig-zig */\n if (p.left) {\n gp.right = p.left;\n gp.right.parent = gp;\n } else { gp.right = null; }\n\n p.left = gp;\n gp.parent = p;\n } else {\n /* zig-zag */\n if (r) {\n gp.left = r;\n r.parent = gp;\n } else { gp.left = null; }\n\n x.right = gp;\n gp.parent = x;\n }\n }\n if (l) {\n p.right = l;\n l.parent = p;\n } else { p.right = null; }\n\n x.left = p;\n p.parent = x;\n }\n }\n};\n\n\nSplayTree.prototype.replace = function replace (u, v) {\n if (!u.parent) { this._root = v; }\n else if (u === u.parent.left) { u.parent.left = v; }\n else { u.parent.right = v; }\n if (v) { v.parent = u.parent; }\n};\n\n\nSplayTree.prototype.minNode = function minNode (u) {\n if ( u === void 0 ) u = this._root;\n\n if (u) { while (u.left) { u = u.left; } }\n return u;\n};\n\n\nSplayTree.prototype.maxNode = function maxNode (u) {\n if ( u === void 0 ) u = this._root;\n\n if (u) { while (u.right) { u = u.right; } }\n return u;\n};\n\n\nSplayTree.prototype.insert = function insert (key, data) {\n var z = this._root;\n var p = null;\n var comp = this._compare;\n var cmp;\n\n if (this._noDuplicates) {\n while (z) {\n p = z;\n cmp = comp(z.key, key);\n if (cmp === 0) { return; }\n else if (comp(z.key, key) < 0) { z = z.right; }\n else { z = z.left; }\n }\n } else {\n while (z) {\n p = z;\n if (comp(z.key, key) < 0) { z = z.right; }\n else { z = z.left; }\n }\n }\n\n z = { key: key, data: data, left: null, right: null, parent: p };\n\n if (!p) { this._root = z; }\n else if (comp(p.key, z.key) < 0) { p.right = z; }\n else { p.left= z; }\n\n this.splay(z);\n this._size++;\n return z;\n};\n\n\nSplayTree.prototype.find = function find (key) {\n var z = this._root;\n var comp = this._compare;\n while (z) {\n var cmp = comp(z.key, key);\n if (cmp < 0) { z = z.right; }\n else if (cmp > 0) { z = z.left; }\n else { return z; }\n }\n return null;\n};\n\n/**\n * Whether the tree contains a node with the given key\n * @param{Key} key\n * @return {boolean} true/false\n */\nSplayTree.prototype.contains = function contains (key) {\n var node = this._root;\n var comparator = this._compare;\n while (node){\n var cmp = comparator(key, node.key);\n if (cmp === 0) { return true; }\n else if (cmp < 0) { node = node.left; }\n else { node = node.right; }\n }\n\n return false;\n};\n\n\nSplayTree.prototype.remove = function remove (key) {\n var z = this.find(key);\n\n if (!z) { return false; }\n\n this.splay(z);\n\n if (!z.left) { this.replace(z, z.right); }\n else if (!z.right) { this.replace(z, z.left); }\n else {\n var y = this.minNode(z.right);\n if (y.parent !== z) {\n this.replace(y, y.right);\n y.right = z.right;\n y.right.parent = y;\n }\n this.replace(z, y);\n y.left = z.left;\n y.left.parent = y;\n }\n\n this._size--;\n return true;\n};\n\n\nSplayTree.prototype.removeNode = function removeNode (z) {\n if (!z) { return false; }\n\n this.splay(z);\n\n if (!z.left) { this.replace(z, z.right); }\n else if (!z.right) { this.replace(z, z.left); }\n else {\n var y = this.minNode(z.right);\n if (y.parent !== z) {\n this.replace(y, y.right);\n y.right = z.right;\n y.right.parent = y;\n }\n this.replace(z, y);\n y.left = z.left;\n y.left.parent = y;\n }\n\n this._size--;\n return true;\n};\n\n\nSplayTree.prototype.erase = function erase (key) {\n var z = this.find(key);\n if (!z) { return; }\n\n this.splay(z);\n\n var s = z.left;\n var t = z.right;\n\n var sMax = null;\n if (s) {\n s.parent = null;\n sMax = this.maxNode(s);\n this.splay(sMax);\n this._root = sMax;\n }\n if (t) {\n if (s) { sMax.right = t; }\n else { this._root = t; }\n t.parent = sMax;\n }\n\n this._size--;\n};\n\n/**\n * Removes and returns the node with smallest key\n * @return {?Node}\n */\nSplayTree.prototype.pop = function pop () {\n var node = this._root, returnValue = null;\n if (node) {\n while (node.left) { node = node.left; }\n returnValue = { key: node.key, data: node.data };\n this.remove(node.key);\n }\n return returnValue;\n};\n\n\n/* eslint-disable class-methods-use-this */\n\n/**\n * Successor node\n * @param{Node} node\n * @return {?Node}\n */\nSplayTree.prototype.next = function next (node) {\n var successor = node;\n if (successor) {\n if (successor.right) {\n successor = successor.right;\n while (successor && successor.left) { successor = successor.left; }\n } else {\n successor = node.parent;\n while (successor && successor.right === node) {\n node = successor; successor = successor.parent;\n }\n }\n }\n return successor;\n};\n\n\n/**\n * Predecessor node\n * @param{Node} node\n * @return {?Node}\n */\nSplayTree.prototype.prev = function prev (node) {\n var predecessor = node;\n if (predecessor) {\n if (predecessor.left) {\n predecessor = predecessor.left;\n while (predecessor && predecessor.right) { predecessor = predecessor.right; }\n } else {\n predecessor = node.parent;\n while (predecessor && predecessor.left === node) {\n node = predecessor;\n predecessor = predecessor.parent;\n }\n }\n }\n return predecessor;\n};\n/* eslint-enable class-methods-use-this */\n\n\n/**\n * @param{forEachCallback} callback\n * @return {SplayTree}\n */\nSplayTree.prototype.forEach = function forEach (callback) {\n var current = this._root;\n var s = [], done = false, i = 0;\n\n while (!done) {\n // Reach the left most Node of the current Node\n if (current) {\n // Place pointer to a tree node on the stack\n // before traversing the node's left subtree\n s.push(current);\n current = current.left;\n } else {\n // BackTrack from the empty subtree and visit the Node\n // at the top of the stack; however, if the stack is\n // empty you are done\n if (s.length > 0) {\n current = s.pop();\n callback(current, i++);\n\n // We have visited the node and its left\n // subtree. Now, it's right subtree's turn\n current = current.right;\n } else { done = true; }\n }\n }\n return this;\n};\n\n\n/**\n * Walk key range from `low` to `high`. Stops if `fn` returns a value.\n * @param{Key} low\n * @param{Key} high\n * @param{Function} fn\n * @param{*?} ctx\n * @return {SplayTree}\n */\nSplayTree.prototype.range = function range (low, high, fn, ctx) {\n var Q = [];\n var compare = this._compare;\n var node = this._root, cmp;\n\n while (Q.length !== 0 || node) {\n if (node) {\n Q.push(node);\n node = node.left;\n } else {\n node = Q.pop();\n cmp = compare(node.key, high);\n if (cmp > 0) {\n break;\n } else if (compare(node.key, low) >= 0) {\n if (fn.call(ctx, node)) { return this; } // stop if smth is returned\n }\n node = node.right;\n }\n }\n return this;\n};\n\n/**\n * Returns all keys in order\n * @return {Array}\n */\nSplayTree.prototype.keys = function keys () {\n var current = this._root;\n var s = [], r = [], done = false;\n\n while (!done) {\n if (current) {\n s.push(current);\n current = current.left;\n } else {\n if (s.length > 0) {\n current = s.pop();\n r.push(current.key);\n current = current.right;\n } else { done = true; }\n }\n }\n return r;\n};\n\n\n/**\n * Returns `data` fields of all nodes in order.\n * @return {Array}\n */\nSplayTree.prototype.values = function values () {\n var current = this._root;\n var s = [], r = [], done = false;\n\n while (!done) {\n if (current) {\n s.push(current);\n current = current.left;\n } else {\n if (s.length > 0) {\n current = s.pop();\n r.push(current.data);\n current = current.right;\n } else { done = true; }\n }\n }\n return r;\n};\n\n\n/**\n * Returns node at given index\n * @param{number} index\n * @return {?Node}\n */\nSplayTree.prototype.at = function at (index) {\n // removed after a consideration, more misleading than useful\n // index = index % this.size;\n // if (index < 0) index = this.size - index;\n\n var current = this._root;\n var s = [], done = false, i = 0;\n\n while (!done) {\n if (current) {\n s.push(current);\n current = current.left;\n } else {\n if (s.length > 0) {\n current = s.pop();\n if (i === index) { return current; }\n i++;\n current = current.right;\n } else { done = true; }\n }\n }\n return null;\n};\n\n/**\n * Bulk-load items. Both array have to be same size\n * @param{Array} keys\n * @param{Array}[values]\n * @param{Boolean} [presort=false] Pre-sort keys and values, using\n * tree's comparator. Sorting is done\n * in-place\n * @return {AVLTree}\n */\nSplayTree.prototype.load = function load (keys, values, presort) {\n if ( keys === void 0 ) keys = [];\n if ( values === void 0 ) values = [];\n if ( presort === void 0 ) presort = false;\n\n if (this._size !== 0) { throw new Error('bulk-load: tree is not empty'); }\n var size = keys.length;\n if (presort) { sort(keys, values, 0, size - 1, this._compare); }\n this._root = loadRecursive(null, keys, values, 0, size);\n this._size = size;\n return this;\n};\n\n\nSplayTree.prototype.min = function min () {\n var node = this.minNode(this._root);\n if (node) { return node.key; }\n else { return null; }\n};\n\n\nSplayTree.prototype.max = function max () {\n var node = this.maxNode(this._root);\n if (node) { return node.key; }\n else { return null; }\n};\n\nSplayTree.prototype.isEmpty = function isEmpty () { return this._root === null; };\nprototypeAccessors.size.get = function () { return this._size; };\n\n\n/**\n * Create a tree and load it with items\n * @param{Array} keys\n * @param{Array?} [values]\n\n * @param{Function?} [comparator]\n * @param{Boolean?} [presort=false] Pre-sort keys and values, using\n * tree's comparator. Sorting is done\n * in-place\n * @param{Boolean?} [noDuplicates=false] Allow duplicates\n * @return {SplayTree}\n */\nSplayTree.createTree = function createTree (keys, values, comparator, presort, noDuplicates) {\n return new SplayTree(comparator, noDuplicates).load(keys, values, presort);\n};\n\nObject.defineProperties( SplayTree.prototype, prototypeAccessors );\n\n\nfunction loadRecursive (parent, keys, values, start, end) {\n var size = end - start;\n if (size > 0) {\n var middle = start + Math.floor(size / 2);\n var key = keys[middle];\n var data = values[middle];\n var node = { key: key, data: data, parent: parent };\n node.left = loadRecursive(node, keys, values, start, middle);\n node.right = loadRecursive(node, keys, values, middle + 1, end);\n return node;\n }\n return null;\n}\n\n\nfunction sort(keys, values, left, right, compare) {\n if (left >= right) { return; }\n\n var pivot = keys[(left + right) >> 1];\n var i = left - 1;\n var j = right + 1;\n\n while (true) {\n do { i++; } while (compare(keys[i], pivot) < 0);\n do { j--; } while (compare(keys[j], pivot) > 0);\n if (i >= j) { break; }\n\n var tmp = keys[i];\n keys[i] = keys[j];\n keys[j] = tmp;\n\n tmp = values[i];\n values[i] = values[j];\n values[j] = tmp;\n }\n\n sort(keys, values, left, j, compare);\n sort(keys, values, j + 1, right, compare);\n}\n\nvar NORMAL = 0;\nvar NON_CONTRIBUTING = 1;\nvar SAME_TRANSITION = 2;\nvar DIFFERENT_TRANSITION = 3;\n\nvar INTERSECTION = 0;\nvar UNION = 1;\nvar DIFFERENCE = 2;\nvar XOR = 3;\n\n/**\n * @param {SweepEvent} event\n * @param {SweepEvent} prev\n * @param {Operation} operation\n */\nfunction computeFields (event, prev, operation) {\n // compute inOut and otherInOut fields\n if (prev === null) {\n event.inOut = false;\n event.otherInOut = true;\n\n // previous line segment in sweepline belongs to the same polygon\n } else {\n if (event.isSubject === prev.isSubject) {\n event.inOut = !prev.inOut;\n event.otherInOut = prev.otherInOut;\n\n // previous line segment in sweepline belongs to the clipping polygon\n } else {\n event.inOut = !prev.otherInOut;\n event.otherInOut = prev.isVertical() ? !prev.inOut : prev.inOut;\n }\n\n // compute prevInResult field\n if (prev) {\n event.prevInResult = (!inResult(prev, operation) || prev.isVertical())\n ? prev.prevInResult : prev;\n }\n }\n\n // check if the line segment belongs to the Boolean operation\n var isInResult = inResult(event, operation);\n if (isInResult) {\n event.resultTransition = determineResultTransition(event, operation);\n } else {\n event.resultTransition = 0;\n }\n}\n\n\n/* eslint-disable indent */\nfunction inResult(event, operation) {\n switch (event.type) {\n case NORMAL:\n switch (operation) {\n case INTERSECTION:\n return !event.otherInOut;\n case UNION:\n return event.otherInOut;\n case DIFFERENCE:\n // return (event.isSubject && !event.otherInOut) ||\n // (!event.isSubject && event.otherInOut);\n return (event.isSubject && event.otherInOut) ||\n (!event.isSubject && !event.otherInOut);\n case XOR:\n return true;\n }\n break;\n case SAME_TRANSITION:\n return operation === INTERSECTION || operation === UNION;\n case DIFFERENT_TRANSITION:\n return operation === DIFFERENCE;\n case NON_CONTRIBUTING:\n return false;\n }\n return false;\n}\n/* eslint-enable indent */\n\n\nfunction determineResultTransition(event, operation) {\n var thisIn = !event.inOut;\n var thatIn = !event.otherInOut;\n\n var isIn;\n switch (operation) {\n case INTERSECTION:\n isIn = thisIn && thatIn; break;\n case UNION:\n isIn = thisIn || thatIn; break;\n case XOR:\n isIn = thisIn ^ thatIn; break;\n case DIFFERENCE:\n if (event.isSubject) {\n isIn = thisIn && !thatIn;\n } else {\n isIn = thatIn && !thisIn;\n }\n break;\n }\n return isIn ? +1 : -1;\n}\n\nvar SweepEvent = function SweepEvent (point, left, otherEvent, isSubject, edgeType) {\n\n /**\n * Is left endpoint?\n * @type {Boolean}\n */\n this.left = left;\n\n /**\n * @type {Array.}\n */\n this.point = point;\n\n /**\n * Other edge reference\n * @type {SweepEvent}\n */\n this.otherEvent = otherEvent;\n\n /**\n * Belongs to source or clipping polygon\n * @type {Boolean}\n */\n this.isSubject = isSubject;\n\n /**\n * Edge contribution type\n * @type {Number}\n */\n this.type = edgeType || NORMAL;\n\n\n /**\n * In-out transition for the sweepline crossing polygon\n * @type {Boolean}\n */\n this.inOut = false;\n\n\n /**\n * @type {Boolean}\n */\n this.otherInOut = false;\n\n /**\n * Previous event in result?\n * @type {SweepEvent}\n */\n this.prevInResult = null;\n\n /**\n * Type of result transition (0 = not in result, +1 = out-in, -1, in-out)\n * @type {Number}\n */\n this.resultTransition = 0;\n\n // connection step\n\n /**\n * @type {Number}\n */\n this.otherPos = -1;\n\n /**\n * @type {Number}\n */\n this.outputContourId = -1;\n\n this.isExteriorRing = true; // TODO: Looks unused, remove?\n};\n\nvar prototypeAccessors$1 = { inResult: { configurable: true } };\n\n\n/**\n * @param{Array.}p\n * @return {Boolean}\n */\nSweepEvent.prototype.isBelow = function isBelow (p) {\n var p0 = this.point, p1 = this.otherEvent.point;\n return this.left\n ? (p0[0] - p[0]) * (p1[1] - p[1]) - (p1[0] - p[0]) * (p0[1] - p[1]) > 0\n // signedArea(this.point, this.otherEvent.point, p) > 0 :\n : (p1[0] - p[0]) * (p0[1] - p[1]) - (p0[0] - p[0]) * (p1[1] - p[1]) > 0;\n //signedArea(this.otherEvent.point, this.point, p) > 0;\n};\n\n\n/**\n * @param{Array.}p\n * @return {Boolean}\n */\nSweepEvent.prototype.isAbove = function isAbove (p) {\n return !this.isBelow(p);\n};\n\n\n/**\n * @return {Boolean}\n */\nSweepEvent.prototype.isVertical = function isVertical () {\n return this.point[0] === this.otherEvent.point[0];\n};\n\n\n/**\n * Does event belong to result?\n * @return {Boolean}\n */\nprototypeAccessors$1.inResult.get = function () {\n return this.resultTransition !== 0;\n};\n\n\nSweepEvent.prototype.clone = function clone () {\n var copy = new SweepEvent(\n this.point, this.left, this.otherEvent, this.isSubject, this.type);\n\n copy.contourId = this.contourId;\n copy.resultTransition = this.resultTransition;\n copy.prevInResult = this.prevInResult;\n copy.isExteriorRing = this.isExteriorRing;\n copy.inOut = this.inOut;\n copy.otherInOut = this.otherInOut;\n\n return copy;\n};\n\nObject.defineProperties( SweepEvent.prototype, prototypeAccessors$1 );\n\nfunction equals(p1, p2) {\n if (p1[0] === p2[0]) {\n if (p1[1] === p2[1]) {\n return true;\n } else {\n return false;\n }\n }\n return false;\n}\n\n// const EPSILON = 1e-9;\n// const abs = Math.abs;\n// TODO https://github.com/w8r/martinez/issues/6#issuecomment-262847164\n// Precision problem.\n//\n// module.exports = function equals(p1, p2) {\n// return abs(p1[0] - p2[0]) <= EPSILON && abs(p1[1] - p2[1]) <= EPSILON;\n// };\n\nvar epsilon = 1.1102230246251565e-16;\nvar splitter = 134217729;\nvar resulterrbound = (3 + 8 * epsilon) * epsilon;\n\n// fast_expansion_sum_zeroelim routine from oritinal code\nfunction sum(elen, e, flen, f, h) {\n var Q, Qnew, hh, bvirt;\n var enow = e[0];\n var fnow = f[0];\n var eindex = 0;\n var findex = 0;\n if ((fnow > enow) === (fnow > -enow)) {\n Q = enow;\n enow = e[++eindex];\n } else {\n Q = fnow;\n fnow = f[++findex];\n }\n var hindex = 0;\n if (eindex < elen && findex < flen) {\n if ((fnow > enow) === (fnow > -enow)) {\n Qnew = enow + Q;\n hh = Q - (Qnew - enow);\n enow = e[++eindex];\n } else {\n Qnew = fnow + Q;\n hh = Q - (Qnew - fnow);\n fnow = f[++findex];\n }\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n while (eindex < elen && findex < flen) {\n if ((fnow > enow) === (fnow > -enow)) {\n Qnew = Q + enow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (enow - bvirt);\n enow = e[++eindex];\n } else {\n Qnew = Q + fnow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (fnow - bvirt);\n fnow = f[++findex];\n }\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n }\n while (eindex < elen) {\n Qnew = Q + enow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (enow - bvirt);\n enow = e[++eindex];\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n while (findex < flen) {\n Qnew = Q + fnow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (fnow - bvirt);\n fnow = f[++findex];\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n if (Q !== 0 || hindex === 0) {\n h[hindex++] = Q;\n }\n return hindex;\n}\n\nfunction estimate(elen, e) {\n var Q = e[0];\n for (var i = 1; i < elen; i++) { Q += e[i]; }\n return Q;\n}\n\nfunction vec(n) {\n return new Float64Array(n);\n}\n\nvar ccwerrboundA = (3 + 16 * epsilon) * epsilon;\nvar ccwerrboundB = (2 + 12 * epsilon) * epsilon;\nvar ccwerrboundC = (9 + 64 * epsilon) * epsilon * epsilon;\n\nvar B = vec(4);\nvar C1 = vec(8);\nvar C2 = vec(12);\nvar D = vec(16);\nvar u = vec(4);\n\nfunction orient2dadapt(ax, ay, bx, by, cx, cy, detsum) {\n var acxtail, acytail, bcxtail, bcytail;\n var bvirt, c, ahi, alo, bhi, blo, _i, _j, _0, s1, s0, t1, t0, u3;\n\n var acx = ax - cx;\n var bcx = bx - cx;\n var acy = ay - cy;\n var bcy = by - cy;\n\n s1 = acx * bcy;\n c = splitter * acx;\n ahi = c - (c - acx);\n alo = acx - ahi;\n c = splitter * bcy;\n bhi = c - (c - bcy);\n blo = bcy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acy * bcx;\n c = splitter * acy;\n ahi = c - (c - acy);\n alo = acy - ahi;\n c = splitter * bcx;\n bhi = c - (c - bcx);\n blo = bcx - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n B[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n B[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n B[2] = _j - (u3 - bvirt) + (_i - bvirt);\n B[3] = u3;\n\n var det = estimate(4, B);\n var errbound = ccwerrboundB * detsum;\n if (det >= errbound || -det >= errbound) {\n return det;\n }\n\n bvirt = ax - acx;\n acxtail = ax - (acx + bvirt) + (bvirt - cx);\n bvirt = bx - bcx;\n bcxtail = bx - (bcx + bvirt) + (bvirt - cx);\n bvirt = ay - acy;\n acytail = ay - (acy + bvirt) + (bvirt - cy);\n bvirt = by - bcy;\n bcytail = by - (bcy + bvirt) + (bvirt - cy);\n\n if (acxtail === 0 && acytail === 0 && bcxtail === 0 && bcytail === 0) {\n return det;\n }\n\n errbound = ccwerrboundC * detsum + resulterrbound * Math.abs(det);\n det += (acx * bcytail + bcy * acxtail) - (acy * bcxtail + bcx * acytail);\n if (det >= errbound || -det >= errbound) { return det; }\n\n s1 = acxtail * bcy;\n c = splitter * acxtail;\n ahi = c - (c - acxtail);\n alo = acxtail - ahi;\n c = splitter * bcy;\n bhi = c - (c - bcy);\n blo = bcy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acytail * bcx;\n c = splitter * acytail;\n ahi = c - (c - acytail);\n alo = acytail - ahi;\n c = splitter * bcx;\n bhi = c - (c - bcx);\n blo = bcx - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n u[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n u[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n var C1len = sum(4, B, 4, u, C1);\n\n s1 = acx * bcytail;\n c = splitter * acx;\n ahi = c - (c - acx);\n alo = acx - ahi;\n c = splitter * bcytail;\n bhi = c - (c - bcytail);\n blo = bcytail - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acy * bcxtail;\n c = splitter * acy;\n ahi = c - (c - acy);\n alo = acy - ahi;\n c = splitter * bcxtail;\n bhi = c - (c - bcxtail);\n blo = bcxtail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n u[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n u[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n var C2len = sum(C1len, C1, 4, u, C2);\n\n s1 = acxtail * bcytail;\n c = splitter * acxtail;\n ahi = c - (c - acxtail);\n alo = acxtail - ahi;\n c = splitter * bcytail;\n bhi = c - (c - bcytail);\n blo = bcytail - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acytail * bcxtail;\n c = splitter * acytail;\n ahi = c - (c - acytail);\n alo = acytail - ahi;\n c = splitter * bcxtail;\n bhi = c - (c - bcxtail);\n blo = bcxtail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n u[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n u[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n var Dlen = sum(C2len, C2, 4, u, D);\n\n return D[Dlen - 1];\n}\n\nfunction orient2d(ax, ay, bx, by, cx, cy) {\n var detleft = (ay - cy) * (bx - cx);\n var detright = (ax - cx) * (by - cy);\n var det = detleft - detright;\n\n if (detleft === 0 || detright === 0 || (detleft > 0) !== (detright > 0)) { return det; }\n\n var detsum = Math.abs(detleft + detright);\n if (Math.abs(det) >= ccwerrboundA * detsum) { return det; }\n\n return -orient2dadapt(ax, ay, bx, by, cx, cy, detsum);\n}\n\n/**\n * Signed area of the triangle (p0, p1, p2)\n * @param {Array.} p0\n * @param {Array.} p1\n * @param {Array.} p2\n * @return {Number}\n */\nfunction signedArea(p0, p1, p2) {\n var res = orient2d(p0[0], p0[1], p1[0], p1[1], p2[0], p2[1]);\n if (res > 0) { return -1; }\n if (res < 0) { return 1; }\n return 0;\n}\n\n/**\n * @param {SweepEvent} e1\n * @param {SweepEvent} e2\n * @return {Number}\n */\nfunction compareEvents(e1, e2) {\n var p1 = e1.point;\n var p2 = e2.point;\n\n // Different x-coordinate\n if (p1[0] > p2[0]) { return 1; }\n if (p1[0] < p2[0]) { return -1; }\n\n // Different points, but same x-coordinate\n // Event with lower y-coordinate is processed first\n if (p1[1] !== p2[1]) { return p1[1] > p2[1] ? 1 : -1; }\n\n return specialCases(e1, e2, p1);\n}\n\n\n/* eslint-disable no-unused-vars */\nfunction specialCases(e1, e2, p1, p2) {\n // Same coordinates, but one is a left endpoint and the other is\n // a right endpoint. The right endpoint is processed first\n if (e1.left !== e2.left)\n { return e1.left ? 1 : -1; }\n\n // const p2 = e1.otherEvent.point, p3 = e2.otherEvent.point;\n // const sa = (p1[0] - p3[0]) * (p2[1] - p3[1]) - (p2[0] - p3[0]) * (p1[1] - p3[1])\n // Same coordinates, both events\n // are left endpoints or right endpoints.\n // not collinear\n if (signedArea(p1, e1.otherEvent.point, e2.otherEvent.point) !== 0) {\n // the event associate to the bottom segment is processed first\n return (!e1.isBelow(e2.otherEvent.point)) ? 1 : -1;\n }\n\n return (!e1.isSubject && e2.isSubject) ? 1 : -1;\n}\n/* eslint-enable no-unused-vars */\n\n/**\n * @param {SweepEvent} se\n * @param {Array.} p\n * @param {Queue} queue\n * @return {Queue}\n */\nfunction divideSegment(se, p, queue) {\n var r = new SweepEvent(p, false, se, se.isSubject);\n var l = new SweepEvent(p, true, se.otherEvent, se.isSubject);\n\n /* eslint-disable no-console */\n if (equals(se.point, se.otherEvent.point)) {\n console.warn('what is that, a collapsed segment?', se);\n }\n /* eslint-enable no-console */\n\n r.contourId = l.contourId = se.contourId;\n\n // avoid a rounding error. The left event would be processed after the right event\n if (compareEvents(l, se.otherEvent) > 0) {\n se.otherEvent.left = true;\n l.left = false;\n }\n\n // avoid a rounding error. The left event would be processed after the right event\n // if (compareEvents(se, r) > 0) {}\n\n se.otherEvent.otherEvent = l;\n se.otherEvent = r;\n\n queue.push(l);\n queue.push(r);\n\n return queue;\n}\n\n//const EPS = 1e-9;\n\n/**\n * Finds the magnitude of the cross product of two vectors (if we pretend\n * they're in three dimensions)\n *\n * @param {Object} a First vector\n * @param {Object} b Second vector\n * @private\n * @returns {Number} The magnitude of the cross product\n */\nfunction crossProduct(a, b) {\n return (a[0] * b[1]) - (a[1] * b[0]);\n}\n\n/**\n * Finds the dot product of two vectors.\n *\n * @param {Object} a First vector\n * @param {Object} b Second vector\n * @private\n * @returns {Number} The dot product\n */\nfunction dotProduct(a, b) {\n return (a[0] * b[0]) + (a[1] * b[1]);\n}\n\n/**\n * Finds the intersection (if any) between two line segments a and b, given the\n * line segments' end points a1, a2 and b1, b2.\n *\n * This algorithm is based on Schneider and Eberly.\n * http://www.cimec.org.ar/~ncalvo/Schneider_Eberly.pdf\n * Page 244.\n *\n * @param {Array.} a1 point of first line\n * @param {Array.} a2 point of first line\n * @param {Array.} b1 point of second line\n * @param {Array.} b2 point of second line\n * @param {Boolean=} noEndpointTouch whether to skip single touchpoints\n * (meaning connected segments) as\n * intersections\n * @returns {Array.>|Null} If the lines intersect, the point of\n * intersection. If they overlap, the two end points of the overlapping segment.\n * Otherwise, null.\n */\nfunction intersection (a1, a2, b1, b2, noEndpointTouch) {\n // The algorithm expects our lines in the form P + sd, where P is a point,\n // s is on the interval [0, 1], and d is a vector.\n // We are passed two points. P can be the first point of each pair. The\n // vector, then, could be thought of as the distance (in x and y components)\n // from the first point to the second point.\n // So first, let's make our vectors:\n var va = [a2[0] - a1[0], a2[1] - a1[1]];\n var vb = [b2[0] - b1[0], b2[1] - b1[1]];\n // We also define a function to convert back to regular point form:\n\n /* eslint-disable arrow-body-style */\n\n function toPoint(p, s, d) {\n return [\n p[0] + s * d[0],\n p[1] + s * d[1]\n ];\n }\n\n /* eslint-enable arrow-body-style */\n\n // The rest is pretty much a straight port of the algorithm.\n var e = [b1[0] - a1[0], b1[1] - a1[1]];\n var kross = crossProduct(va, vb);\n var sqrKross = kross * kross;\n var sqrLenA = dotProduct(va, va);\n //const sqrLenB = dotProduct(vb, vb);\n\n // Check for line intersection. This works because of the properties of the\n // cross product -- specifically, two vectors are parallel if and only if the\n // cross product is the 0 vector. The full calculation involves relative error\n // to account for possible very small line segments. See Schneider & Eberly\n // for details.\n if (sqrKross > 0/* EPS * sqrLenB * sqLenA */) {\n // If they're not parallel, then (because these are line segments) they\n // still might not actually intersect. This code checks that the\n // intersection point of the lines is actually on both line segments.\n var s = crossProduct(e, vb) / kross;\n if (s < 0 || s > 1) {\n // not on line segment a\n return null;\n }\n var t = crossProduct(e, va) / kross;\n if (t < 0 || t > 1) {\n // not on line segment b\n return null;\n }\n if (s === 0 || s === 1) {\n // on an endpoint of line segment a\n return noEndpointTouch ? null : [toPoint(a1, s, va)];\n }\n if (t === 0 || t === 1) {\n // on an endpoint of line segment b\n return noEndpointTouch ? null : [toPoint(b1, t, vb)];\n }\n return [toPoint(a1, s, va)];\n }\n\n // If we've reached this point, then the lines are either parallel or the\n // same, but the segments could overlap partially or fully, or not at all.\n // So we need to find the overlap, if any. To do that, we can use e, which is\n // the (vector) difference between the two initial points. If this is parallel\n // with the line itself, then the two lines are the same line, and there will\n // be overlap.\n //const sqrLenE = dotProduct(e, e);\n kross = crossProduct(e, va);\n sqrKross = kross * kross;\n\n if (sqrKross > 0 /* EPS * sqLenB * sqLenE */) {\n // Lines are just parallel, not the same. No overlap.\n return null;\n }\n\n var sa = dotProduct(va, e) / sqrLenA;\n var sb = sa + dotProduct(va, vb) / sqrLenA;\n var smin = Math.min(sa, sb);\n var smax = Math.max(sa, sb);\n\n // this is, essentially, the FindIntersection acting on floats from\n // Schneider & Eberly, just inlined into this function.\n if (smin <= 1 && smax >= 0) {\n\n // overlap on an end point\n if (smin === 1) {\n return noEndpointTouch ? null : [toPoint(a1, smin > 0 ? smin : 0, va)];\n }\n\n if (smax === 0) {\n return noEndpointTouch ? null : [toPoint(a1, smax < 1 ? smax : 1, va)];\n }\n\n if (noEndpointTouch && smin === 0 && smax === 1) { return null; }\n\n // There's overlap on a segment -- two points of intersection. Return both.\n return [\n toPoint(a1, smin > 0 ? smin : 0, va),\n toPoint(a1, smax < 1 ? smax : 1, va)\n ];\n }\n\n return null;\n}\n\n/**\n * @param {SweepEvent} se1\n * @param {SweepEvent} se2\n * @param {Queue} queue\n * @return {Number}\n */\nfunction possibleIntersection (se1, se2, queue) {\n // that disallows self-intersecting polygons,\n // did cost us half a day, so I'll leave it\n // out of respect\n // if (se1.isSubject === se2.isSubject) return;\n var inter = intersection(\n se1.point, se1.otherEvent.point,\n se2.point, se2.otherEvent.point\n );\n\n var nintersections = inter ? inter.length : 0;\n if (nintersections === 0) { return 0; } // no intersection\n\n // the line segments intersect at an endpoint of both line segments\n if ((nintersections === 1) &&\n (equals(se1.point, se2.point) ||\n equals(se1.otherEvent.point, se2.otherEvent.point))) {\n return 0;\n }\n\n if (nintersections === 2 && se1.isSubject === se2.isSubject) {\n // if(se1.contourId === se2.contourId){\n // console.warn('Edges of the same polygon overlap',\n // se1.point, se1.otherEvent.point, se2.point, se2.otherEvent.point);\n // }\n //throw new Error('Edges of the same polygon overlap');\n return 0;\n }\n\n // The line segments associated to se1 and se2 intersect\n if (nintersections === 1) {\n\n // if the intersection point is not an endpoint of se1\n if (!equals(se1.point, inter[0]) && !equals(se1.otherEvent.point, inter[0])) {\n divideSegment(se1, inter[0], queue);\n }\n\n // if the intersection point is not an endpoint of se2\n if (!equals(se2.point, inter[0]) && !equals(se2.otherEvent.point, inter[0])) {\n divideSegment(se2, inter[0], queue);\n }\n return 1;\n }\n\n // The line segments associated to se1 and se2 overlap\n var events = [];\n var leftCoincide = false;\n var rightCoincide = false;\n\n if (equals(se1.point, se2.point)) {\n leftCoincide = true; // linked\n } else if (compareEvents(se1, se2) === 1) {\n events.push(se2, se1);\n } else {\n events.push(se1, se2);\n }\n\n if (equals(se1.otherEvent.point, se2.otherEvent.point)) {\n rightCoincide = true;\n } else if (compareEvents(se1.otherEvent, se2.otherEvent) === 1) {\n events.push(se2.otherEvent, se1.otherEvent);\n } else {\n events.push(se1.otherEvent, se2.otherEvent);\n }\n\n if ((leftCoincide && rightCoincide) || leftCoincide) {\n // both line segments are equal or share the left endpoint\n se2.type = NON_CONTRIBUTING;\n se1.type = (se2.inOut === se1.inOut)\n ? SAME_TRANSITION : DIFFERENT_TRANSITION;\n\n if (leftCoincide && !rightCoincide) {\n // honestly no idea, but changing events selection from [2, 1]\n // to [0, 1] fixes the overlapping self-intersecting polygons issue\n divideSegment(events[1].otherEvent, events[0].point, queue);\n }\n return 2;\n }\n\n // the line segments share the right endpoint\n if (rightCoincide) {\n divideSegment(events[0], events[1].point, queue);\n return 3;\n }\n\n // no line segment includes totally the other one\n if (events[0] !== events[3].otherEvent) {\n divideSegment(events[0], events[1].point, queue);\n divideSegment(events[1], events[2].point, queue);\n return 3;\n }\n\n // one line segment includes the other one\n divideSegment(events[0], events[1].point, queue);\n divideSegment(events[3].otherEvent, events[2].point, queue);\n\n return 3;\n}\n\n/**\n * @param {SweepEvent} le1\n * @param {SweepEvent} le2\n * @return {Number}\n */\nfunction compareSegments(le1, le2) {\n if (le1 === le2) { return 0; }\n\n // Segments are not collinear\n if (signedArea(le1.point, le1.otherEvent.point, le2.point) !== 0 ||\n signedArea(le1.point, le1.otherEvent.point, le2.otherEvent.point) !== 0) {\n\n // If they share their left endpoint use the right endpoint to sort\n if (equals(le1.point, le2.point)) { return le1.isBelow(le2.otherEvent.point) ? -1 : 1; }\n\n // Different left endpoint: use the left endpoint to sort\n if (le1.point[0] === le2.point[0]) { return le1.point[1] < le2.point[1] ? -1 : 1; }\n\n // has the line segment associated to e1 been inserted\n // into S after the line segment associated to e2 ?\n if (compareEvents(le1, le2) === 1) { return le2.isAbove(le1.point) ? -1 : 1; }\n\n // The line segment associated to e2 has been inserted\n // into S after the line segment associated to e1\n return le1.isBelow(le2.point) ? -1 : 1;\n }\n\n if (le1.isSubject === le2.isSubject) { // same polygon\n var p1 = le1.point, p2 = le2.point;\n if (p1[0] === p2[0] && p1[1] === p2[1]/*equals(le1.point, le2.point)*/) {\n p1 = le1.otherEvent.point; p2 = le2.otherEvent.point;\n if (p1[0] === p2[0] && p1[1] === p2[1]) { return 0; }\n else { return le1.contourId > le2.contourId ? 1 : -1; }\n }\n } else { // Segments are collinear, but belong to separate polygons\n return le1.isSubject ? -1 : 1;\n }\n\n return compareEvents(le1, le2) === 1 ? 1 : -1;\n}\n\nfunction subdivide(eventQueue, subject, clipping, sbbox, cbbox, operation) {\n var sweepLine = new SplayTree(compareSegments);\n var sortedEvents = [];\n\n var rightbound = Math.min(sbbox[2], cbbox[2]);\n\n var prev, next, begin;\n\n while (eventQueue.length !== 0) {\n var event = eventQueue.pop();\n sortedEvents.push(event);\n\n // optimization by bboxes for intersection and difference goes here\n if ((operation === INTERSECTION && event.point[0] > rightbound) ||\n (operation === DIFFERENCE && event.point[0] > sbbox[2])) {\n break;\n }\n\n if (event.left) {\n next = prev = sweepLine.insert(event);\n begin = sweepLine.minNode();\n\n if (prev !== begin) { prev = sweepLine.prev(prev); }\n else { prev = null; }\n\n next = sweepLine.next(next);\n\n var prevEvent = prev ? prev.key : null;\n var prevprevEvent = (void 0);\n computeFields(event, prevEvent, operation);\n if (next) {\n if (possibleIntersection(event, next.key, eventQueue) === 2) {\n computeFields(event, prevEvent, operation);\n computeFields(event, next.key, operation);\n }\n }\n\n if (prev) {\n if (possibleIntersection(prev.key, event, eventQueue) === 2) {\n var prevprev = prev;\n if (prevprev !== begin) { prevprev = sweepLine.prev(prevprev); }\n else { prevprev = null; }\n\n prevprevEvent = prevprev ? prevprev.key : null;\n computeFields(prevEvent, prevprevEvent, operation);\n computeFields(event, prevEvent, operation);\n }\n }\n } else {\n event = event.otherEvent;\n next = prev = sweepLine.find(event);\n\n if (prev && next) {\n\n if (prev !== begin) { prev = sweepLine.prev(prev); }\n else { prev = null; }\n\n next = sweepLine.next(next);\n sweepLine.remove(event);\n\n if (next && prev) {\n possibleIntersection(prev.key, next.key, eventQueue);\n }\n }\n }\n }\n return sortedEvents;\n}\n\nvar Contour = function Contour() {\n this.points = [];\n this.holeIds = [];\n this.holeOf = null;\n this.depth = null;\n};\n\nContour.prototype.isExterior = function isExterior () {\n return this.holeOf == null;\n};\n\n/**\n * @param {Array.} sortedEvents\n * @return {Array.}\n */\nfunction orderEvents(sortedEvents) {\n var event, i, len, tmp;\n var resultEvents = [];\n for (i = 0, len = sortedEvents.length; i < len; i++) {\n event = sortedEvents[i];\n if ((event.left && event.inResult) ||\n (!event.left && event.otherEvent.inResult)) {\n resultEvents.push(event);\n }\n }\n // Due to overlapping edges the resultEvents array can be not wholly sorted\n var sorted = false;\n while (!sorted) {\n sorted = true;\n for (i = 0, len = resultEvents.length; i < len; i++) {\n if ((i + 1) < len &&\n compareEvents(resultEvents[i], resultEvents[i + 1]) === 1) {\n tmp = resultEvents[i];\n resultEvents[i] = resultEvents[i + 1];\n resultEvents[i + 1] = tmp;\n sorted = false;\n }\n }\n }\n\n\n for (i = 0, len = resultEvents.length; i < len; i++) {\n event = resultEvents[i];\n event.otherPos = i;\n }\n\n // imagine, the right event is found in the beginning of the queue,\n // when his left counterpart is not marked yet\n for (i = 0, len = resultEvents.length; i < len; i++) {\n event = resultEvents[i];\n if (!event.left) {\n tmp = event.otherPos;\n event.otherPos = event.otherEvent.otherPos;\n event.otherEvent.otherPos = tmp;\n }\n }\n\n return resultEvents;\n}\n\n\n/**\n * @param {Number} pos\n * @param {Array.} resultEvents\n * @param {Object>} processed\n * @return {Number}\n */\nfunction nextPos(pos, resultEvents, processed, origPos) {\n var newPos = pos + 1,\n p = resultEvents[pos].point,\n p1;\n var length = resultEvents.length;\n\n if (newPos < length)\n { p1 = resultEvents[newPos].point; }\n\n while (newPos < length && p1[0] === p[0] && p1[1] === p[1]) {\n if (!processed[newPos]) {\n return newPos;\n } else {\n newPos++;\n }\n p1 = resultEvents[newPos].point;\n }\n\n newPos = pos - 1;\n\n while (processed[newPos] && newPos > origPos) {\n newPos--;\n }\n\n return newPos;\n}\n\n\nfunction initializeContourFromContext(event, contours, contourId) {\n var contour = new Contour();\n if (event.prevInResult != null) {\n var prevInResult = event.prevInResult;\n // Note that it is valid to query the \"previous in result\" for its output contour id,\n // because we must have already processed it (i.e., assigned an output contour id)\n // in an earlier iteration, otherwise it wouldn't be possible that it is \"previous in\n // result\".\n var lowerContourId = prevInResult.outputContourId;\n var lowerResultTransition = prevInResult.resultTransition;\n if (lowerResultTransition > 0) {\n // We are inside. Now we have to check if the thing below us is another hole or\n // an exterior contour.\n var lowerContour = contours[lowerContourId];\n if (lowerContour.holeOf != null) {\n // The lower contour is a hole => Connect the new contour as a hole to its parent,\n // and use same depth.\n var parentContourId = lowerContour.holeOf;\n contours[parentContourId].holeIds.push(contourId);\n contour.holeOf = parentContourId;\n contour.depth = contours[lowerContourId].depth;\n } else {\n // The lower contour is an exterior contour => Connect the new contour as a hole,\n // and increment depth.\n contours[lowerContourId].holeIds.push(contourId);\n contour.holeOf = lowerContourId;\n contour.depth = contours[lowerContourId].depth + 1;\n }\n } else {\n // We are outside => this contour is an exterior contour of same depth.\n contour.holeOf = null;\n contour.depth = contours[lowerContourId].depth;\n }\n } else {\n // There is no lower/previous contour => this contour is an exterior contour of depth 0.\n contour.holeOf = null;\n contour.depth = 0;\n }\n return contour;\n}\n\n/**\n * @param {Array.} sortedEvents\n * @return {Array.<*>} polygons\n */\nfunction connectEdges(sortedEvents) {\n var i, len;\n var resultEvents = orderEvents(sortedEvents);\n\n // \"false\"-filled array\n var processed = {};\n var contours = [];\n\n var loop = function ( ) {\n\n if (processed[i]) {\n return;\n }\n\n var contourId = contours.length;\n var contour = initializeContourFromContext(resultEvents[i], contours, contourId);\n\n // Helper function that combines marking an event as processed with assigning its output contour ID\n var markAsProcessed = function (pos) {\n processed[pos] = true;\n resultEvents[pos].outputContourId = contourId;\n };\n\n var pos = i;\n var origPos = i;\n\n var initial = resultEvents[i].point;\n contour.points.push(initial);\n\n /* eslint no-constant-condition: \"off\" */\n while (true) {\n markAsProcessed(pos);\n\n pos = resultEvents[pos].otherPos;\n\n markAsProcessed(pos);\n contour.points.push(resultEvents[pos].point);\n\n pos = nextPos(pos, resultEvents, processed, origPos);\n\n if (pos == origPos) {\n break;\n }\n }\n\n contours.push(contour);\n };\n\n for (i = 0, len = resultEvents.length; i < len; i++) loop( );\n\n return contours;\n}\n\nvar _tinyqueue_1_2_3_tinyqueue = TinyQueue;\nvar default_1 = TinyQueue;\n\nfunction TinyQueue(data, compare) {\n if (!(this instanceof TinyQueue)) { return new TinyQueue(data, compare); }\n\n this.data = data || [];\n this.length = this.data.length;\n this.compare = compare || defaultCompare;\n\n if (this.length > 0) {\n for (var i = (this.length >> 1) - 1; i >= 0; i--) { this._down(i); }\n }\n}\n\nfunction defaultCompare(a, b) {\n return a < b ? -1 : a > b ? 1 : 0;\n}\n\nTinyQueue.prototype = {\n\n push: function (item) {\n this.data.push(item);\n this.length++;\n this._up(this.length - 1);\n },\n\n pop: function () {\n if (this.length === 0) { return undefined; }\n\n var top = this.data[0];\n this.length--;\n\n if (this.length > 0) {\n this.data[0] = this.data[this.length];\n this._down(0);\n }\n this.data.pop();\n\n return top;\n },\n\n peek: function () {\n return this.data[0];\n },\n\n _up: function (pos) {\n var data = this.data;\n var compare = this.compare;\n var item = data[pos];\n\n while (pos > 0) {\n var parent = (pos - 1) >> 1;\n var current = data[parent];\n if (compare(item, current) >= 0) { break; }\n data[pos] = current;\n pos = parent;\n }\n\n data[pos] = item;\n },\n\n _down: function (pos) {\n var data = this.data;\n var compare = this.compare;\n var halfLength = this.length >> 1;\n var item = data[pos];\n\n while (pos < halfLength) {\n var left = (pos << 1) + 1;\n var right = left + 1;\n var best = data[left];\n\n if (right < this.length && compare(data[right], best) < 0) {\n left = right;\n best = data[right];\n }\n if (compare(best, item) >= 0) { break; }\n\n data[pos] = best;\n pos = left;\n }\n\n data[pos] = item;\n }\n};\n_tinyqueue_1_2_3_tinyqueue.default = default_1;\n\nvar max = Math.max;\nvar min = Math.min;\n\nvar contourId = 0;\n\n\nfunction processPolygon(contourOrHole, isSubject, depth, Q, bbox, isExteriorRing) {\n var i, len, s1, s2, e1, e2;\n for (i = 0, len = contourOrHole.length - 1; i < len; i++) {\n s1 = contourOrHole[i];\n s2 = contourOrHole[i + 1];\n e1 = new SweepEvent(s1, false, undefined, isSubject);\n e2 = new SweepEvent(s2, false, e1, isSubject);\n e1.otherEvent = e2;\n\n if (s1[0] === s2[0] && s1[1] === s2[1]) {\n continue; // skip collapsed edges, or it breaks\n }\n\n e1.contourId = e2.contourId = depth;\n if (!isExteriorRing) {\n e1.isExteriorRing = false;\n e2.isExteriorRing = false;\n }\n if (compareEvents(e1, e2) > 0) {\n e2.left = true;\n } else {\n e1.left = true;\n }\n\n var x = s1[0], y = s1[1];\n bbox[0] = min(bbox[0], x);\n bbox[1] = min(bbox[1], y);\n bbox[2] = max(bbox[2], x);\n bbox[3] = max(bbox[3], y);\n\n // Pushing it so the queue is sorted from left to right,\n // with object on the left having the highest priority.\n Q.push(e1);\n Q.push(e2);\n }\n}\n\n\nfunction fillQueue(subject, clipping, sbbox, cbbox, operation) {\n var eventQueue = new _tinyqueue_1_2_3_tinyqueue(null, compareEvents);\n var polygonSet, isExteriorRing, i, ii, j, jj; //, k, kk;\n\n for (i = 0, ii = subject.length; i < ii; i++) {\n polygonSet = subject[i];\n for (j = 0, jj = polygonSet.length; j < jj; j++) {\n isExteriorRing = j === 0;\n if (isExteriorRing) { contourId++; }\n processPolygon(polygonSet[j], true, contourId, eventQueue, sbbox, isExteriorRing);\n }\n }\n\n for (i = 0, ii = clipping.length; i < ii; i++) {\n polygonSet = clipping[i];\n for (j = 0, jj = polygonSet.length; j < jj; j++) {\n isExteriorRing = j === 0;\n if (operation === DIFFERENCE) { isExteriorRing = false; }\n if (isExteriorRing) { contourId++; }\n processPolygon(polygonSet[j], false, contourId, eventQueue, cbbox, isExteriorRing);\n }\n }\n\n return eventQueue;\n}\n\nvar EMPTY = [];\n\n\nfunction trivialOperation(subject, clipping, operation) {\n var result = null;\n if (subject.length * clipping.length === 0) {\n if (operation === INTERSECTION) {\n result = EMPTY;\n } else if (operation === DIFFERENCE) {\n result = subject;\n } else if (operation === UNION ||\n operation === XOR) {\n result = (subject.length === 0) ? clipping : subject;\n }\n }\n return result;\n}\n\n\nfunction compareBBoxes(subject, clipping, sbbox, cbbox, operation) {\n var result = null;\n if (sbbox[0] > cbbox[2] ||\n cbbox[0] > sbbox[2] ||\n sbbox[1] > cbbox[3] ||\n cbbox[1] > sbbox[3]) {\n if (operation === INTERSECTION) {\n result = EMPTY;\n } else if (operation === DIFFERENCE) {\n result = subject;\n } else if (operation === UNION ||\n operation === XOR) {\n result = subject.concat(clipping);\n }\n }\n return result;\n}\n\n\nfunction boolean(subject, clipping, operation) {\n if (typeof subject[0][0][0] === 'number') {\n subject = [subject];\n }\n if (typeof clipping[0][0][0] === 'number') {\n clipping = [clipping];\n }\n var trivial = trivialOperation(subject, clipping, operation);\n if (trivial) {\n return trivial === EMPTY ? null : trivial;\n }\n var sbbox = [Infinity, Infinity, -Infinity, -Infinity];\n var cbbox = [Infinity, Infinity, -Infinity, -Infinity];\n\n // console.time('fill queue');\n var eventQueue = fillQueue(subject, clipping, sbbox, cbbox, operation);\n //console.timeEnd('fill queue');\n\n trivial = compareBBoxes(subject, clipping, sbbox, cbbox, operation);\n if (trivial) {\n return trivial === EMPTY ? null : trivial;\n }\n // console.time('subdivide edges');\n var sortedEvents = subdivide(eventQueue, subject, clipping, sbbox, cbbox, operation);\n //console.timeEnd('subdivide edges');\n\n // console.time('connect vertices');\n var contours = connectEdges(sortedEvents);\n //console.timeEnd('connect vertices');\n\n // Convert contours to polygons\n var polygons = [];\n for (var i = 0; i < contours.length; i++) {\n var contour = contours[i];\n if (contour.isExterior()) {\n // The exterior ring goes first\n var rings = [contour.points];\n // Followed by holes if any\n for (var j = 0; j < contour.holeIds.length; j++) {\n var holeId = contour.holeIds[j];\n rings.push(contours[holeId].points);\n }\n polygons.push(rings);\n }\n }\n\n return polygons;\n}\n\nfunction union (subject, clipping) {\n return boolean(subject, clipping, UNION);\n}\n\nfunction diff (subject, clipping) {\n return boolean(subject, clipping, DIFFERENCE);\n}\n\nfunction xor (subject, clipping) {\n return boolean(subject, clipping, XOR);\n}\n\nfunction intersection$1 (subject, clipping) {\n return boolean(subject, clipping, INTERSECTION);\n}\n\n/**\n * @enum {Number}\n */\nvar operations = { UNION: UNION, DIFFERENCE: DIFFERENCE, INTERSECTION: INTERSECTION, XOR: XOR };\n\nexport { diff, intersection$1 as intersection, operations, union, xor };\n//# sourceMappingURL=martinez.es.js.map\n","import matrix from './matrix';\nimport tar from './tar';\nimport vector from './vector';\nimport geom from './geom';\nimport { union, diff, intersection, xor } from './martinez';\n\nexport default {\n matrix,\n tar,\n vector,\n geom,\n booleanOperations: {\n union,\n diff,\n intersection,\n xor,\n },\n};\n","import unit from '../style/unit';\nimport enums from '../util/enums';\nimport util from '../util/util';\nimport math from '../math/index';\n\nconst { STYLE_KEY: {\n TRANSLATE_X,\n TRANSLATE_Y,\n TRANSLATE_Z,\n SCALE_X,\n SCALE_Y,\n SCALE_Z,\n SKEW_X,\n SKEW_Y,\n ROTATE_X,\n ROTATE_Y,\n ROTATE_Z,\n ROTATE_3D,\n PERSPECTIVE,\n MATRIX,\n FONT_SIZE,\n}} = enums;\nconst { PX, PERCENT, REM, VW, VH, VMAX, VMIN } = unit;\nconst { matrix, geom } = math;\nconst { identity, multiply, isE } = matrix;\nconst { d2r } = geom;\n\nfunction calSingle(t, k, v) {\n if(k === TRANSLATE_X) {\n t[12] = v;\n }\n else if(k === TRANSLATE_Y) {\n t[13] = v;\n }\n else if(k === TRANSLATE_Z) {\n t[14] = v;\n }\n else if(k === SCALE_X) {\n t[0] = v;\n }\n else if(k === SCALE_Y) {\n t[5] = v;\n }\n else if(k === SCALE_Z) {\n t[10] = v;\n }\n else if(k === SKEW_X) {\n v = d2r(v);\n t[4] = Math.tan(v);\n }\n else if(k === SKEW_Y) {\n v = d2r(v);\n t[1] = Math.tan(v);\n }\n else if(k === ROTATE_X) {\n v = d2r(v);\n let sin = Math.sin(v);\n let cos = Math.cos(v);\n t[5] = t[10] = cos;\n t[6] = sin;\n t[9] = -sin;\n }\n else if(k === ROTATE_Y) {\n v = d2r(v);\n let sin = Math.sin(v);\n let cos = Math.cos(v);\n t[0] = t[10] = cos;\n t[8] = sin;\n t[2] = -sin;\n }\n else if(k === ROTATE_Z) {\n v = d2r(v);\n let sin = Math.sin(v);\n let cos = Math.cos(v);\n t[0] = t[5] = cos;\n t[1] = sin;\n t[4] = -sin;\n }\n else if(k === ROTATE_3D) {\n let [x, y, z, r] = v;\n r = d2r(r[0]);\n let s = Math.sin(r);\n let c = Math.cos(r);\n if(x && !y && !z) {\n if(x < 0) {\n s = -s;\n }\n t[5] = c;\n t[9] = -s;\n t[6] = s;\n t[10] = c;\n }\n else if(y && !x && !z) {\n if(y < 0) {\n s = -s;\n }\n t[0] = c;\n t[8] = s;\n t[2] = -s;\n t[10] = c;\n }\n else if(z && !x && !y) {\n if(z < 0) {\n s = -s;\n }\n t[0] = c;\n t[4] = -s;\n t[1] = s;\n t[5] = c;\n }\n else {\n let len = Math.sqrt(x * x + y * y + z * z);\n if(len !== 1) {\n let rlen = 1 / len;\n x *= rlen;\n y *= rlen;\n z *= rlen;\n }\n let nc = 1 - c;\n let xy = x * y;\n let yz = y * z;\n let zx = z * x;\n let xs = x * s;\n let ys = y * s;\n let zs = z * s;\n\n t[0] = x * x * nc + c;\n t[1] = xy * nc + zs;\n t[2] = zx * nc - ys;\n t[3] = 0;\n\n t[4] = xy * nc - zs;\n t[5] = y * y * nc + c;\n t[6] = yz * nc + xs;\n t[7] = 0;\n\n t[8] = zx * nc + ys;\n t[9] = yz * nc - xs;\n t[10] = z * z * nc + c;\n t[11] = 0;\n\n t[12] = 0;\n t[13] = 0;\n t[14] = 0;\n t[15] = 1;\n }\n }\n else if(k === PERSPECTIVE && v > 0) {\n v = Math.max(v, 1);\n t[11] = -1 / v;\n }\n else if(k === MATRIX) {\n util.assignMatrix(t, v);\n }\n}\n\nfunction calMatrix(transform, ow, oh, root) {\n let list = normalize(transform, ow, oh, root);\n let m = identity();\n list.forEach(item => {\n let [k, v] = item;\n let t = identity();\n calSingle(t, k, v);\n m = multiply(m, t);\n });\n return m;\n}\n\n// 已有计算好的变换矩阵,根据tfo原点计算最终的matrix\nfunction calMatrixByOrigin(m, transformOrigin) {\n let [ox, oy] = transformOrigin;\n let res = m.slice(0);\n if(ox === 0 && oy === 0 || isE(m)) {\n return res;\n }\n res = multiply([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, ox, oy, 0, 1], res);\n res = multiply(res, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -ox, -oy, 0, 1]);\n return res;\n}\n\n// img缩放svg下专用,无rem\nfunction calMatrixWithOrigin(transform, transformOrigin, ow, oh) {\n let m = calMatrix(transform, ow, oh);\n return calMatrixByOrigin(m, transformOrigin);\n}\n\nfunction normalizeSingle(k, v, ow, oh, root) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n if(v[1] === PERCENT) {\n return v[0] * ow * 0.01;\n }\n else if(v[1] === REM) {\n return v[0] * root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n return v[0] * root.width * 0.01;\n }\n else if(v[1] === VH) {\n return v[0] * root.height * 0.01;\n }\n else if(v[1] === VMAX) {\n return v[0] * Math.max(root.width, root.height) * 0.01;\n }\n else if(v[1] === VMIN) {\n return v[0] * Math.min(root.width, root.height) * 0.01;\n }\n }\n else if(k === TRANSLATE_Y) {\n if(v[1] === PERCENT) {\n return v[0] * oh * 0.01;\n }\n else if(v[1] === REM) {\n return v[0] * root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n return v[0] * root.width * 0.01;\n }\n else if(v[1] === VH) {\n return v[0] * root.height * 0.01;\n }\n else if(v[1] === VMAX) {\n return v[0] * Math.max(root.width, root.height) * 0.01;\n }\n else if(v[1] === VMIN) {\n return v[0] * Math.min(root.width, root.height) * 0.01;\n }\n }\n else if(k === MATRIX) {\n return v;\n }\n else if(k === ROTATE_3D) {\n return v;\n }\n return v[0];\n}\n\nfunction normalize(transform, ow, oh, root) {\n let res = [];\n transform.forEach(item => {\n let [k, v] = item;\n res.push([k, normalizeSingle(k, v, ow, oh, root)]);\n });\n return res;\n}\n\nfunction calOrigin(transformOrigin, w, h, root) {\n let tfo = [];\n transformOrigin.forEach((item, i) => {\n if(item[1] === PX) {\n tfo.push(item[0]);\n }\n else if(item[1] === PERCENT) {\n tfo.push(item[0] * (i ? h : w) * 0.01);\n }\n else if(item[1] === REM) {\n tfo.push(item[0] * root.computedStyle[FONT_SIZE]);\n }\n else if(item[1] === VW) {\n tfo.push(item[0] * root.width * 0.01);\n }\n else if(item[1] === VH) {\n tfo.push(item[0] * root.height * 0.01);\n }\n else if(item[1] === VMAX) {\n tfo.push(item[0] * Math.max(root.width, root.height) * 0.01);\n }\n else if(item[1] === VMIN) {\n tfo.push(item[0] * Math.min(root.width, root.height) * 0.01);\n }\n });\n return tfo;\n}\n\nfunction calMatrixByPerspective(m, pm) {\n if(!isE(pm)) {\n m = multiply(pm, m);\n }\n return m;\n}\n\nfunction calPerspectiveMatrix(ppt, po) {\n if(ppt && ppt > 0) {\n let res = identity();\n ppt = Math.max(ppt, 1);\n res[11] = -1 / ppt;\n let [ox, oy] = po;\n if(ox || oy) {\n res = multiply([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, ox, oy, 0, 1], res);\n res = multiply(res, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -ox, -oy, 0, 1]);\n }\n return res;\n }\n}\n\n// 是否有透视矩阵应用\nfunction isPerspectiveMatrix(m) {\n if(!m) {\n return;\n }\n return !!(m[3] || m[7] || m[11]);\n}\n\nexport default {\n calMatrix,\n calOrigin,\n calMatrixByPerspective,\n calPerspectiveMatrix,\n calMatrixByOrigin,\n calMatrixWithOrigin,\n isPerspectiveMatrix,\n};\n","/**\n * https://www.w3.org/TR/2018/WD-filter-effects-1-20181218/#feGaussianBlurElement\n * 根据模糊参数sigma求卷积核尺寸\n * @param sigma\n * @returns {number}\n */\nfunction kernelSize(sigma) {\n if(sigma <= 0) {\n return 0;\n }\n let d = Math.floor(sigma * 3 * Math.sqrt(2 * Math.PI) / 4 + 0.5);\n if(d < 2) {\n d = 2;\n }\n if(d % 2 === 0) {\n d++;\n }\n return d;\n}\n\n/**\n * 根据sigma求模糊扩展尺寸,卷积核求得后为d,再求半径/2,然后因为算法要执行3次,所以*3\n * 比如本来d为5,半径2.5算上自身像素点则各方向扩展2,*3则扩展6\n * @param sigma\n * @returns {number}\n */\nfunction outerSize(sigma) {\n let d = kernelSize(sigma);\n return outerSizeByD(d);\n}\n\nfunction outerSizeByD(d) {\n return Math.floor(d * 0.5) * 3;\n}\n\n/**\n * 一维高斯正态分布,根据标准差和卷积核尺寸返回一维权重数组\n * @param sigma\n * @param d\n */\nfunction gaussianWeight(sigma, d) {\n let list = [];\n let len = Math.floor(d * 0.5);\n let total = 0;\n for(let i = len; i >= 0; i--) {\n let n = Math.pow(Math.E, -Math.pow(i, 2) / (2 * Math.pow(sigma, 2)))\n / (sigma * Math.sqrt(2 * Math.PI));\n list.push(n);\n total += n;\n }\n for(let i = 1; i <= len; i++) {\n let n = Math.pow(Math.E, -Math.pow(i, 2) / (2 * Math.pow(sigma, 2)))\n / (sigma * Math.sqrt(2 * Math.PI));\n list.push(n);\n total += n;\n }\n if(total !== 1) {\n for(let i = 0; i < d; i++) {\n list[i] /= total;\n }\n }\n return list;\n}\n\nexport default {\n kernelSize,\n outerSize,\n outerSizeByD,\n gaussianWeight,\n};\n","import Page from './Page';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport enums from '../util/enums';\nimport painter from '../util/painter';\nimport debug from '../util/debug';\nimport tf from '../style/transform';\nimport mx from '../math/matrix';\nimport blur from '../math/blur';\n\nconst {\n STYLE_KEY: {\n TRANSFORM_ORIGIN,\n TRANSFORM,\n },\n} = enums;\n\n// 根据一个共享cache的信息,生成一个独立的离屏canvas,一般是filter,mask用\nfunction genSingle(cache, message) {\n let { size, sx1, sy1, width, height, bbox } = cache;\n let offscreen = inject.getCacheCanvas(width, height, null, message);\n offscreen.x = 0;\n offscreen.y = 0;\n offscreen.bbox = bbox;\n offscreen.size = size;\n offscreen.sx1 = sx1;\n offscreen.sy1 = sy1;\n offscreen.dx = cache.dx;\n offscreen.dy = cache.dy;\n offscreen.dbx = cache.dbx;\n offscreen.dby = cache.dby;\n offscreen.width = width;\n offscreen.height = height;\n return offscreen;\n}\n\nclass Cache {\n constructor(w, h, bbox, page, pos, x1, y1) {\n this.__init(w, h, bbox, page, pos, x1, y1);\n }\n\n __init(w, h, bbox, page, pos, x1, y1) {\n this.__width = w;\n this.__height = h;\n this.__bbox = bbox;\n this.__page = page;\n this.__pos = pos;\n let [x, y] = page.getCoords(pos);\n this.__x = x;\n this.__y = y;\n this.__appendData(x1, y1);\n this.__isNew = true;\n if(page.canvas) {\n this.__enabled = true;\n let ctx = page.ctx;\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.globalAlpha = 1;\n if(debug.flag) {\n page.canvas.setAttribute && page.canvas.setAttribute('size', page.size);\n }\n }\n }\n\n __appendData(sx1, sy1) {\n this.sx1 = sx1; // 去除margin的左上角原点坐标\n this.sy1 = sy1;\n let bbox = this.bbox;\n this.dx = this.x - bbox[0]; // cache坐标和box原点的差值\n this.dy = this.y - bbox[1];\n this.dbx = sx1 - bbox[0]; // 原始x1/y1和box原点的差值\n this.dby = sy1 - bbox[1];\n this.update();\n }\n\n update() {\n this.page.update = true;\n }\n\n clear() {\n if(this.available) {\n let ctx = this.ctx;\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n let size = this.page.size;\n ctx.clearRect(this.x, this.y, size, size);\n this.__available = false;\n this.__isNew = true;\n }\n }\n\n release() {\n if(this.enabled) {\n this.clear();\n this.page.del(this.pos);\n this.__page = null;\n this.__enabled = false;\n }\n }\n\n reset(bbox, x1, y1) {\n // 尺寸没变复用之前的并清空\n if(util.equalArr(this.bbox, bbox) && this.enabled) {\n this.clear();\n return;\n }\n this.release();\n let w = Math.ceil(bbox[2] - bbox[0]);\n let h = Math.ceil(bbox[3] - bbox[1]);\n let res = Page.getInstance(Math.max(w, h));\n if(!res) {\n this.__enabled = false;\n return;\n }\n let { page, pos } = res;\n this.__init(w, h, bbox, page, pos, x1, y1);\n }\n\n // 是否功能可用,生成离屏canvas及尺寸超限\n get enabled() {\n return this.__enabled;\n }\n\n // 是否有可用缓存内容\n get available() {\n return this.enabled && this.__available;\n }\n\n get bbox() {\n return this.__bbox;\n }\n\n get page() {\n return this.__page;\n }\n\n get canvas() {\n return this.page.canvas;\n }\n\n get ctx() {\n return this.page.ctx;\n }\n\n get size() {\n return this.page.size;\n }\n\n get x() {\n return this.__x;\n }\n\n get y() {\n return this.__y;\n }\n\n get width() {\n return this.__width;\n }\n\n get height() {\n return this.__height;\n }\n\n get pos() {\n return this.__pos;\n }\n\n get isNew() {\n return this.__isNew;\n }\n\n static get MAX() {\n return Page.MAX;\n }\n\n static getInstance(bbox, x1, y1) {\n let w = Math.ceil(bbox[2] - bbox[0]);\n let h = Math.ceil(bbox[3] - bbox[1]);\n let res = Page.getInstance(Math.max(w, h));\n if(!res) {\n return;\n }\n let { page, pos } = res;\n return new Cache(w, h, bbox, page, pos, x1, y1);\n }\n\n /**\n * 复制cache的一块出来单独作为cacheFilter,尺寸边距保持一致,用浏览器原生ctx.filter滤镜\n * @param cache\n * @param filter\n * @returns {{canvas: *, ctx: *, release(): void, available: boolean, draw()}}\n */\n static genFilter(cache, filter) {\n let d = 0;\n filter.forEach(item => {\n let [k, v] = item;\n if(k === 'blur') {\n d = blur.outerSize(v);\n }\n });\n let { x, y, size, canvas, sx1, sy1, width, height, bbox } = cache;\n bbox = bbox.slice(0);\n bbox[0] -= d;\n bbox[1] -= d;\n bbox[2] += d;\n bbox[3] += d;\n let offscreen = inject.getCacheCanvas(width + d * 2, height + d * 2, null, 'filter');\n offscreen.ctx.filter = painter.canvasFilter(filter);\n offscreen.ctx.drawImage(canvas, x, y, width, height, d, d, width, height);\n offscreen.ctx.filter = 'none';\n offscreen.draw();\n offscreen.bbox = bbox;\n offscreen.x = 0;\n offscreen.y = 0;\n offscreen.size = size;\n offscreen.sx1 = sx1 - d;\n offscreen.sy1 = sy1 - d;\n offscreen.dx = cache.dx;\n offscreen.dy = cache.dy;\n offscreen.dbx = cache.dbx;\n offscreen.dby = cache.dby;\n offscreen.width = width + d * 2;\n offscreen.height = height + d * 2;\n return offscreen;\n }\n\n static genMask(target, node, cb) {\n let cacheMask = genSingle(target, 'mask1');\n let list = [];\n let { [TRANSFORM]: transform, [TRANSFORM_ORIGIN]: tfo } = node.computedStyle;\n let next = node.next;\n let isClip = next.isClip;\n while(next && next.isMask) {\n list.push(next);\n next = next.next;\n }\n let { x, y, ctx, dbx, dby } = cacheMask;\n tfo[0] += x + dbx + node.__sx1 - target.sx1;\n tfo[1] += y + dby + node.__sy1 - target.sy1;\n let inverse = tf.calMatrixByOrigin(transform, tfo);\n // 先将mask本身绘制到cache上,再设置模式绘制dom本身,因为都是img所以1个就够了\n list.forEach(item => {\n cb(item, cacheMask, inverse);\n });\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.globalAlpha = 1;\n ctx.globalCompositeOperation = isClip ? 'source-out' : 'source-in';\n Cache.drawCache(target, cacheMask);\n ctx.globalCompositeOperation = 'source-over';\n cacheMask.draw(ctx);\n return cacheMask;\n }\n\n /**\n * 如果不超过bbox,直接用已有的total/filter/mask,否则生成一个新的\n */\n static genOverflow(target, node) {\n let { bbox } = target;\n let { sx, sy, outerWidth, outerHeight } = node;\n let xe = sx + outerWidth;\n let ye = sy + outerHeight;\n if(bbox[0] < sx || bbox[1] < sy || bbox[2] > xe || bbox[3] > ye) {\n let cacheOverflow = genSingle(target, 'overflow');\n let ctx = cacheOverflow.ctx;\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.globalAlpha = 1;\n Cache.drawCache(target, cacheOverflow);\n cacheOverflow.draw(ctx);\n ctx.globalCompositeOperation = 'destination-in';\n ctx.fillStyle = '#FFF';\n ctx.beginPath();\n ctx.rect(sx - bbox[0], sy - bbox[1], outerWidth, outerHeight);\n ctx.fill();\n ctx.closePath();\n ctx.globalCompositeOperation = 'source-over';\n return cacheOverflow;\n }\n }\n\n /**\n * bbox变化时直接用老的cache内容重设bbox\n * @param cache\n * @param bbox\n */\n static updateCache(cache, bbox) {\n let old = cache.bbox;\n if(!util.equalArr(bbox, old)) {\n let dx = old[0] - bbox[0];\n let dy = old[1] - bbox[1];\n let newCache = Cache.getInstance(bbox);\n if(newCache && newCache.enabled) {\n let { x: ox, y: oy, canvas, width, height } = cache;\n let { x: nx, y: ny } = newCache;\n newCache.sx1 = cache.sx1;\n newCache.sy1 = cache.sy1;\n newCache.dx = cache.dx + dx;\n newCache.dy = cache.dy + dy;\n newCache.dbx = cache.dbx + dx;\n newCache.dby = cache.dby + dy;\n newCache.ctx.drawImage(canvas, ox, oy, width, height, dx + nx, dy + ny, width, height);\n newCache.__available = true;\n cache.release();\n return newCache;\n }\n }\n else {\n return cache;\n }\n }\n\n static drawCache(source, target, transform, matrix, tfo, parentMatrix, inverse) {\n let { x: tx, y: ty, sx1, sy1, ctx, dbx, dby } = target;\n let { x, y, canvas, sx1: sx2, sy1: sy2, dbx: dbx2, dby: dby2, width, height } = source;\n let ox = tx + sx2 - sx1 + dbx - dbx2;\n let oy = ty + sy2 - sy1 + dby - dby2;\n if(transform && matrix && tfo) {\n tfo[0] += ox;\n tfo[1] += oy;\n let m = tf.calMatrixByOrigin(transform, tfo);\n matrix = mx.multiply(matrix, m);\n if(!mx.isE(parentMatrix)) {\n matrix = mx.multiply(parentMatrix, matrix);\n }\n if(inverse) {\n // 很多情况mask和target相同matrix,可简化计算\n if(util.equalArr(matrix, inverse)) {\n matrix = mx.identity();\n }\n else {\n inverse = mx.inverse(inverse);\n matrix = mx.multiply(inverse, matrix);\n }\n }\n ctx.setTransform(matrix[0], matrix[1], matrix[4], matrix[5], matrix[12], matrix[13]);\n }\n ctx.drawImage(canvas, x, y, width, height, ox, oy, width, height);\n }\n\n static draw(ctx, opacity, matrix, cache) {\n ctx.globalAlpha = opacity;\n ctx.setTransform(matrix[0], matrix[1], matrix[4], matrix[5], matrix[12], matrix[13]);\n let { x, y, canvas, sx1, sy1, dbx, dby, width, height } = cache;\n ctx.drawImage(canvas, x, y, width, height, sx1 - dbx, sy1 - dby, width, height);\n }\n\n static getCache(list) {\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(item && item.available) {\n return item;\n }\n }\n }\n\n static NA = 0; // 无缓存模式\n static LOCAL = 1; // 局部根节点\n static CHILD = 2; // 其子节点\n static SELF = 3; // webgl专用\n}\n\nexport default Cache;\n","import change from './change';\nimport enums from '../util/enums';\n\nconst { STYLE_KEY, STYLE_KEY: {\n TRANSLATE_X,\n TRANSLATE_Y,\n TRANSLATE_Z,\n OPACITY,\n FILTER,\n PERSPECTIVE,\n PERSPECTIVE_ORIGIN,\n} } = enums;\n\nconst ENUM = {\n // 低位表示 0;\n },\n /**\n * 得出等级\n * @param k\n * @returns {number|*}\n */\n getLevel(k) {\n if(change.isIgnore(k)) {\n return ENUM.NONE;\n }\n if(k === TRANSLATE_X) {\n return ENUM.TRANSLATE_X;\n }\n else if(k === TRANSLATE_Y) {\n return ENUM.TRANSLATE_Y;\n }\n else if(k === TRANSLATE_Z) {\n return ENUM.TRANSLATE_Z;\n }\n else if(TRANSFORMS.hasOwnProperty(k)) {\n return ENUM.TRANSFORM;\n }\n else if(k === OPACITY) {\n return ENUM.OPACITY;\n }\n else if(k === FILTER) {\n return ENUM.FILTER;\n }\n else if(k === PERSPECTIVE || k === PERSPECTIVE_ORIGIN) {\n return ENUM.PERSPECTIVE;\n }\n else if(change.isRepaint(k)) {\n return ENUM.REPAINT;\n }\n return ENUM.REFLOW;\n },\n isReflow(lv) {\n return !this.isRepaint(lv);\n },\n isRepaint(lv) {\n return lv < ENUM.REFLOW;\n },\n isRebuild(lv) {\n return lv >= ENUM.REBUILD;\n },\n}, ENUM);\no.TRANSFORMS = TRANSFORMS;\n\nexport default o;\n","import Node from './Node';\nimport TextBox from './TextBox';\nimport mode from '../refresh/mode';\nimport css from '../style/css';\nimport font from '../style/font';\nimport unit from '../style/unit';\nimport enums from '../util/enums';\nimport util from '../util/util';\nimport textCache from './textCache';\nimport inject from '../util/inject';\nimport Cache from '../refresh/Cache';\nimport level from '../refresh/level';\n\nconst {\n STYLE_KEY: {\n DISPLAY,\n LINE_HEIGHT,\n FONT_SIZE,\n FONT_FAMILY,\n FONT_STYLE,\n FONT_WEIGHT,\n COLOR,\n VISIBILITY,\n LETTER_SPACING,\n OVERFLOW,\n WHITE_SPACE,\n TEXT_OVERFLOW,\n WIDTH,\n TEXT_STROKE_COLOR,\n TEXT_STROKE_WIDTH,\n },\n NODE_KEY: {\n NODE_CACHE,\n NODE_LIMIT_CACHE,\n NODE_DOM_PARENT,\n NODE_MATRIX_EVENT,\n NODE_OPACITY,\n NODE_VIRTUAL_DOM,\n },\n UPDATE_KEY: {\n UPDATE_NODE,\n UPDATE_MEASURE,\n UPDATE_FOCUS,\n UPDATE_CONFIG,\n },\n} = enums;\n\nconst ELLIPSIS = textCache.ELLIPSIS;\nconst { AUTO, REM, VW, VH, VMAX, VMIN } = unit;\n\nclass Text extends Node {\n constructor(content) {\n super();\n this.__content = util.isNil(content) ? '' : content.toString();\n this.__textBoxes = [];\n this.__charWidthList = [];\n this.__charWidth = 0; // 最小字符宽度(单个)\n this.__textWidth = 0; // 整体宽度\n this.__bp = null; // block父节点\n }\n\n /**\n * 预先计算每个字的宽度,在每次布局渲染前做\n * @param renderMode\n * @param ctx\n * @private\n */\n __computeMeasure(renderMode, ctx) {\n let { content, computedStyle, charWidthList } = this;\n // 每次都要清空重新计算,计算会有缓存\n charWidthList.splice(0);\n let ffs = computedStyle[FONT_FAMILY].split(',');\n let ff = 'arial';\n for(let i = 0, len = ffs.length; i < len; i++) {\n if(inject.checkSupportFontFamily(ffs[i])) {\n ff = ffs[i];\n break;\n }\n }\n this.__ff = ff;\n let fs = computedStyle[FONT_SIZE];\n let fw = computedStyle[FONT_WEIGHT];\n let key = this.__key = computedStyle[FONT_SIZE] + ',' + ff + ',' + fw;\n let wait = textCache.data[key] = textCache.data[key] || {\n ff,\n fs,\n fw,\n hash: {},\n s: '',\n };\n let cache = textCache.charWidth[key] = textCache.charWidth[key] || {};\n let sum = 0;\n let needMeasure = false;\n let parentComputedStyle = this.domParent.computedStyle;\n let pff = 'arial';\n for(let i = 0, pffs = parentComputedStyle[FONT_FAMILY].split(','), len = pffs.length; i < len; i++) {\n if(inject.checkSupportFontFamily(pffs[i])) {\n ff = ffs[i];\n break;\n }\n }\n let pfs = parentComputedStyle[FONT_SIZE];\n let pfw = parentComputedStyle[FONT_WEIGHT];\n let pKey = this.__pKey = pfs + ',' + pff + ',' + pfw;\n let parentCache = textCache.charWidth[pKey] = textCache.charWidth[pKey] || {};\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n if(renderMode === mode.WEBGL) {\n ctx = inject.getCacheCanvas(16, 16, '__$$CHECK_SUPPORT_FONT_FAMILY$$__').ctx;\n }\n if(!parentCache.hasOwnProperty(ELLIPSIS)) {\n ctx.font = css.setFontStyle(parentComputedStyle);\n parentCache[ELLIPSIS] = ctx.measureText(ELLIPSIS).width;\n }\n ctx.font = css.setFontStyle(computedStyle);\n }\n else if(renderMode === mode.SVG) {\n if(!parentCache.hasOwnProperty(ELLIPSIS)) {\n parentCache[ELLIPSIS] = 0;\n let wait = textCache.data[pKey] = textCache.data[pKey] || {\n ff: pff,\n fs: pfs,\n fw: pfw,\n hash: {},\n s: '',\n };\n wait.s += ELLIPSIS;\n needMeasure = true;\n }\n }\n // 逐字测量,canvas可瞬间得到信息,svg先预存统一进行\n for(let i = 0, length = content.length; i < length; i++) {\n let char = content.charAt(i);\n let mw;\n if(cache.hasOwnProperty(char)) {\n mw = cache[char];\n charWidthList.push(mw);\n sum += mw;\n this.__charWidth = Math.max(this.charWidth, mw);\n }\n else if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n mw = cache[char] = ctx.measureText(char).width;\n charWidthList.push(mw);\n sum += mw;\n this.__charWidth = Math.max(this.charWidth, mw);\n }\n else {\n if(!wait.hash.hasOwnProperty(char)) {\n wait.s += char;\n }\n wait.hash[char] = true;\n // 先预存标识位-1,测量完后替换它\n charWidthList.push(-1);\n needMeasure = true;\n }\n }\n this.__textWidth = sum;\n if(needMeasure) {\n textCache.list.push(this);\n }\n }\n\n __measureCb() {\n let { content, charWidthList } = this;\n let key = this.__key;\n let cache = textCache.charWidth[key];\n let sum = 0;\n for(let i = 0, len = charWidthList.length; i < len; i++) {\n if(charWidthList[i] < 0) {\n let mw = charWidthList[i] = cache[content.charAt(i)];\n sum += mw;\n this.__charWidth = Math.max(this.charWidth, mw);\n }\n }\n this.__textWidth = sum;\n }\n\n /**\n * text在virtual时和普通一样,无需特殊处理\n * endSpace由外界inline布局控制,末尾最后一行的空白mpb,包含递归情况,递归为多个嵌套末尾节点的空白mpb之和\n * 即便宽度不足,每行还是强制渲染一个字符,换行依据lx开始,因为x可能是从中间开始的,非inline则两个相等\n * 最后一个字符排版时要考虑末尾mpb,排不下的话回退删掉这个字符,如果最后一个字符另起开头,排不下也强制排,每行至少1个字符\n * 在textOverflow时很特殊,多个inline同行,回退可能到前一个inline节点,这个通过x和lx判断是否行首,决定至少1个字符规则\n * @param data\n * @private\n */\n __layout(data) {\n let __cache = this.__config[NODE_CACHE];\n if(__cache) {\n __cache.release();\n }\n let { x, y, w, lx = x, lineBoxManager, endSpace = 0, lineClamp = 0, lineClampCount = 0 } = data;\n this.__x = this.__sx = this.__sx1 = x;\n this.__y = this.__sy = this.__sy1 = y;\n let { isDestroyed, content, computedStyle, textBoxes, charWidthList, root, __ff, __key } = this;\n textBoxes.splice(0);\n let __config = this.__config;\n __config[NODE_LIMIT_CACHE] = false;\n // 空内容w/h都为0可以提前跳出\n if(isDestroyed || computedStyle[DISPLAY] === 'none' || !content) {\n return lineClampCount;\n }\n this.__ox = this.__oy = 0;\n // 顺序尝试分割字符串为TextBox,形成多行,begin为每行起始索引,i是当前字符索引\n let begin = 0;\n let i = 0;\n let beginSpace = x - lx; // x>=lx,当第一行非起始处时前面被prev节点占据,这个差值可认为是count宽度\n let count = beginSpace;\n let length = content.length;\n let maxW = 0;\n let {\n [LINE_HEIGHT]: lineHeight,\n [LETTER_SPACING]: letterSpacing,\n [WHITE_SPACE]: whiteSpace,\n [FONT_SIZE]: fontSize,\n [FONT_WEIGHT]: fontWeight,\n } = computedStyle;\n // 特殊字体中特殊字符连续时需减少一定的padding量\n let padding = font.info[__ff].padding;\n let needReduce = !!padding;\n let lastChar;\n let ew = textCache.charWidth[this.__pKey][ELLIPSIS];\n // block的overflow:hidden和textOverflow:clip/ellipsis一起才生效,inline要看最近非inline父元素\n let bp = this.domParent;\n while(bp.computedStyle[DISPLAY] === 'inline') {\n bp = bp.domParent;\n }\n this.__bp = bp;\n let lineCount = 0;\n // 不换行特殊对待,同时考虑overflow和textOverflow\n if(whiteSpace === 'nowrap') {\n let isTextOverflow;\n let {\n [DISPLAY]: display,\n [OVERFLOW]: overflow,\n [WIDTH]: width,\n [TEXT_OVERFLOW]: textOverflow,\n } = bp.currentStyle;\n // 只要是overflow隐藏,不管textOverflow如何(默认是clip等同于overflow:hidden的功能)都截取\n if(overflow === 'hidden') {\n while(i < length) {\n count += charWidthList[i] + letterSpacing;\n if(count > w) {\n // block/flex无需宽度,inline-block需要设置宽度才生效\n if(display === 'block' || display === 'flex') {\n isTextOverflow = true;\n }\n else if(width[1] !== AUTO) {\n isTextOverflow = true;\n }\n break;\n }\n i++;\n }\n }\n else {\n while(i < length) {\n count += charWidthList[i++] + letterSpacing;\n }\n }\n // ellipsis生效情况,本节点开始向前回退查找,尝试放下一部分字符\n if(isTextOverflow && textOverflow === 'ellipsis') {\n [y, maxW] = this.__lineBack(count, w, beginSpace, endSpace, ew, letterSpacing, begin, i, length, lineCount,\n lineHeight, lx, x, y, maxW, textBoxes, content, charWidthList, lineBoxManager);\n }\n // 默认clip跟随overflow:hidden,无需感知\n else {\n let textBox = new TextBox(this, textBoxes.length, x, y, count - beginSpace, lineHeight,\n content, charWidthList);\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox);\n maxW = count - beginSpace;\n y += lineHeight;\n }\n }\n // 普通换行,注意x和lx的区别,可能相同(block起始处)可能不同(非起始处),第1行从x开始,第2行及以后都从lx开始\n // 然后第一次换行还有特殊之处,可能同一行前半部行高很大,此时y增加并非自身的lineHeight,而是整体LineBox的\n else {\n while(i < length) {\n let cw = charWidthList[i] + letterSpacing;\n count += cw;\n // 连续字符减少padding,除了连续还需判断char是否在padding的hash中\n if(needReduce) {\n let char = content[i];\n if(char === lastChar && padding.hasOwnProperty(char) && padding[char]) {\n let hasCache, p = textCache.padding[__key] = textCache.padding[__key] || {};\n if(textCache.padding.hasOwnProperty(__key)) {\n if(p.hasOwnProperty(char)) {\n hasCache = true;\n count -= p[char];\n }\n }\n if(!hasCache) {\n let n = 0;\n if(root.renderMode === mode.CANVAS) {\n root.ctx.font = css.setFontStyle(computedStyle);\n let w1 = root.ctx.measureText(char).width;\n let w2 = root.ctx.measureText(char + char).width;\n n = w1 * 2 - w2;\n n *= padding[char];\n }\n else if(root.renderMode === mode.SVG) {\n n = inject.measureTextSync(__key, __ff, fontSize, fontWeight, char);\n n *= padding[char];\n }\n count -= n;\n p[char] = n;\n }\n }\n lastChar = char;\n }\n // 忽略零宽字符\n if(cw === 0) {\n i++;\n continue;\n }\n // 换行都要判断i不是0的时候,第1个字符强制不换行\n if(count === w) {\n // 多行文本截断,这里肯定需要回退,注意防止恰好是最后一个字符,此时无需截取\n if(lineClamp && lineCount + lineClampCount >= lineClamp - 1 && i < length - 1) {\n [y, maxW] = this.__lineBack(count, w, beginSpace, endSpace, ew, letterSpacing, begin, i, length, lineCount,\n lineHeight, lx, x, y, maxW, textBoxes, content, charWidthList, lineBoxManager);\n lineCount++;\n break;\n }\n let textBox;\n // 特殊情况,恰好最后一行最后一个排满,此时查看末尾mpb,要防止i为0的情况首个字符特殊不回退,无需看开头mpb\n if(i === length - 1 && count > w - endSpace && i) {\n count -= charWidthList[i--];\n }\n i++;\n if(!lineCount) {\n maxW = count - beginSpace;\n textBox = new TextBox(this, textBoxes.length, x, y, maxW, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n }\n else {\n textBox = new TextBox(this, textBoxes.length, lx, y, count, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n maxW = Math.max(maxW, count);\n }\n // 必须先添加再设置y,当有diff的lineHeight时,第一个换行不影响,再换行时第2个换行即第3行会被第1行影响\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox, true);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n begin = i;\n count = 0;\n lineCount++;\n lastChar = null; // 换行后连续字符reduce不生效重新计数\n }\n // 奇怪的精度问题,暂时不用相等判断,而是为原本w宽度加一点点冗余1e-10\n else if(count > w + (1e-10)) {\n // 多行文本截断,这里肯定需要回退\n if(lineClamp && lineCount + lineClampCount >= lineClamp - 1) {\n [y, maxW] = this.__lineBack(count, w, beginSpace, endSpace, ew, letterSpacing, begin, i, length, lineCount,\n lineHeight, lx, x, y, maxW, textBoxes, content, charWidthList, lineBoxManager);\n lineCount++;\n break;\n }\n // 普通非多行文本阶段逻辑\n let width;\n // 宽度不足时无法跳出循环,至少也要塞个字符形成一行,无需判断第1行,因为是否放得下逻辑在dom中做过了,\n // 如果第1行放不下,一定会另起一行,此时作为开头再放不下才会进这里,这个if只有0或1个字符的情况\n if(i <= begin) {\n width = count;\n }\n // 超过2个字符回退1个\n else {\n width = count - charWidthList[i--];\n }\n i++;\n // 根据是否第一行分开处理行首空白\n let textBox;\n if(!lineCount) {\n maxW = width - beginSpace;\n textBox = new TextBox(this, textBoxes.length, x, y, maxW, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n }\n else {\n textBox = new TextBox(this, textBoxes.length, lx, y, width, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n maxW = Math.max(maxW, width);\n }\n // 必须先添加再设置y,同上\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox, true);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n begin = i;\n count = 0;\n lineCount++;\n lastChar = null;\n }\n else {\n i++;\n }\n }\n // 换行后Text的x重设为lx\n if(lineCount) {\n this.__x = this.__sx1 = lx;\n }\n // 最后一行,只有一行未满时也进这里,需查看末尾mpb,排不下回退一个字符\n // 声明了lineClamp时特殊考虑,这里一定是最后一行,要对比行数不能超过,超过忽略掉这些文本\n if(begin < length && (!lineClamp || lineCount + lineClampCount < lineClamp)) {\n let textBox;\n if(!lineCount) {\n let needBack;\n // 防止开头第一个begin=0时回退,这在inline有padding且是第一个child时会发生\n if(begin && count > w - endSpace) {\n needBack = true;\n count -= charWidthList[length - 1];\n }\n maxW = count - beginSpace;\n textBox = new TextBox(this, textBoxes.length, x, y, maxW, lineHeight,\n content.slice(begin, needBack ? length - 1 : length), charWidthList.slice(begin, needBack ? length - 1 : length));\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n if(needBack) {\n let width = charWidthList[length - 1];\n textBox = new TextBox(this, textBoxes.length, lx, y, width, lineHeight,\n content.slice(length - 1), charWidthList.slice(length - 1));\n maxW = Math.max(maxW, width);\n textBoxes.push(textBox);\n lineBoxManager.setNewLine();\n lineBoxManager.addItem(textBox);\n y += lineHeight;\n lineCount++;\n }\n }\n else {\n let needBack;\n // 防止begin在结尾时回退,必须要有个字符,这在最后一行1个字符排不下时会出现\n if(count > w - endSpace && begin < length - 1) {\n needBack = true;\n count -= charWidthList[length - 1];\n }\n textBox = new TextBox(this, textBoxes.length, lx, y, count, lineHeight,\n content.slice(begin, needBack ? length - 1 : length), charWidthList.slice(begin, needBack ? length - 1 : length));\n maxW = Math.max(maxW, count);\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n if(needBack) {\n let width = charWidthList[length - 1];\n textBox = new TextBox(this, textBoxes.length, lx, y, width, lineHeight,\n content.slice(length - 1), charWidthList.slice(length - 1));\n maxW = Math.max(maxW, width);\n textBoxes.push(textBox);\n lineBoxManager.setNewLine();\n lineBoxManager.addItem(textBox);\n y += lineHeight;\n lineCount++;\n }\n }\n }\n }\n this.__width = maxW;\n this.__height = y - data.y;\n this.__baseline = css.getBaseline(computedStyle);\n return lineCount;\n }\n\n // 末尾行因ellipsis的缘故向前回退字符生成textBox,可能会因不满足宽度导致无法生成,此时向前继续回退TextBox\n __lineBack(count, w, beginSpace, endSpace, ew, letterSpacing, begin, i, length, lineCount, lineHeight, lx, x, y, maxW,\n textBoxes, content, charWidthList, lineBoxManager) {\n for(; i >= begin; i--) {\n count -= charWidthList[i] + letterSpacing;\n if(count + ew + endSpace <= w) {\n // 至少1个字符不用回退,到0也没找到需要回退\n if(i) {\n maxW = count - (lineCount ? 0 : beginSpace);\n let textBox = new TextBox(this, textBoxes.length, lineCount ? lx : x, y, maxW, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox, true);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n this.__ellipsis = true;\n break;\n }\n }\n }\n // 最后也没找到,看是否要查找前一个inline节点,还是本身是行首兜底首字母\n if(i < 0) {\n let lineBox = lineBoxManager.lineBox;\n // lineBox为空是行首,至少放1个字符\n if(!lineBox || !lineBox.size) {\n maxW = count - (lineCount ? 0 : beginSpace);\n let textBox = new TextBox(this, textBoxes.length, lineCount ? lx : x, y, maxW, lineHeight,\n content.charAt(begin), charWidthList.slice(begin, begin + 1));\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox, true);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n this.__ellipsis = true;\n }\n // 向前查找inline节点,可能会有前面inline嵌套,因此直接用lineBox,不会出现inlineBlock,\n // 这里和css不同,ib强制超限换行不会同行\n else {\n let list = lineBox.list;\n outer:\n for(let j = list.length - 1; j >= 0; j--) {\n let tb = list[j];\n let { content, wList, width } = tb;\n // 整体减去可以说明可能在这个tb中,只要最后发现不是空文本节点就行,否则继续;第0个强制进入保证1字符\n if(count - width + ew <= w || !j) {\n // 找到可以跳出outer循环,找不到继续,注意第0个且1个字符判断\n for(let k = wList.length - 1; k >= 0; k--) {\n if(!k && !j || count + ew <= w) {\n tb.__content = content;\n tb.__width = width;\n tb.parent.__ellipsis = true;\n break outer;\n }\n else {\n let w2 = wList[k];\n tb.__endY -= w2;\n width -= w2;\n content = content.slice(0, k);\n count -= w2;\n wList.pop();\n }\n }\n }\n // 不够则看前一个tb并且删掉这个\n else {\n count -= width;\n }\n list.pop();\n tb.parent.textBoxes.pop();\n }\n }\n }\n return [y, maxW];\n }\n\n __offsetX(diff, isLayout) {\n super.__offsetX(diff, isLayout);\n if(isLayout) {\n this.textBoxes.forEach(item => {\n item.__offsetX(diff);\n });\n }\n this.__sx1 += diff;\n }\n\n __offsetY(diff, isLayout) {\n super.__offsetY(diff, isLayout);\n if(isLayout) {\n this.textBoxes.forEach(item => {\n item.__offsetY(diff);\n });\n }\n this.__sy1 += diff;\n }\n\n __tryLayInline(w) {\n return w - this.charWidthList[0];\n }\n\n __inlineSize() {\n let minX, maxX;\n this.textBoxes.forEach((item, i) => {\n if(i) {\n minX = Math.min(minX, item.x);\n maxX = Math.max(maxX, item.x + item.width);\n }\n else {\n minX = item.x;\n maxX = item.x + item.width;\n }\n });\n this.__x = minX;\n this.__sx = this.__sx1 = minX + this.ox;\n this.__sy = this.__sy1;\n this.__width = maxX - minX;\n }\n\n render(renderMode, lv, ctx, cache, dx = 0, dy = 0) {\n let { isDestroyed, computedStyle, textBoxes, cacheStyle, __ellipsis, __bp, __config } = this;\n if(renderMode === mode.SVG) {\n __config[NODE_VIRTUAL_DOM] = this.__virtualDom = {\n type: 'text',\n children: [],\n };\n }\n if(isDestroyed || computedStyle[DISPLAY] === 'none' || computedStyle[VISIBILITY] === 'hidden'\n || !textBoxes.length) {\n return;\n }\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n // webgl借用离屏canvas绘制文本,cache标识为true是普通绘制,否则是超限降级情况\n if(renderMode === mode.WEBGL) {\n if(cache) {\n let { sx, sy, bbox } = this;\n let __cache = __config[NODE_CACHE];\n if(__cache) {\n __cache.reset(bbox, sx, sy);\n }\n else {\n __cache = Cache.getInstance(bbox, sx, sy);\n }\n if(__cache && __cache.enabled) {\n __config[NODE_CACHE] = __cache;\n __cache.__available = true;\n ctx = __cache.ctx;\n dx += __cache.dx;\n dy += __cache.dy;\n __config[NODE_LIMIT_CACHE] = false;\n }\n else {\n __config[NODE_LIMIT_CACHE] = true;\n return;\n }\n }\n else {\n let root = this.root;\n let c = inject.getCacheCanvas(root.width, root.height, '__$$OVERSIZE$$__');\n ctx = c.ctx;\n let {\n [NODE_DOM_PARENT]: {\n __config: {\n [NODE_MATRIX_EVENT]: m,\n [NODE_OPACITY]: opacity,\n },\n },\n } = __config;\n ctx.setTransform(m[0], m[1], m[4], m[5], m[12], m[13]);\n ctx.globalAlpha = opacity;\n }\n }\n let font = css.setFontStyle(computedStyle);\n if(ctx.font !== font) {\n ctx.font = font;\n }\n let color = cacheStyle[COLOR];\n if(ctx.fillStyle !== color) {\n ctx.fillStyle = color;\n }\n let strokeWidth = computedStyle[TEXT_STROKE_WIDTH];\n if(ctx.lineWidth !== strokeWidth) {\n ctx.lineWidth = strokeWidth;\n }\n let strokeColor = cacheStyle[TEXT_STROKE_COLOR];\n if(ctx.strokeStyle !== strokeColor) {\n ctx.strokeStyle = strokeColor;\n }\n }\n // 可能为空,整个是个ellipsis\n textBoxes.forEach(item => {\n item.render(renderMode, ctx, computedStyle, cacheStyle, dx, dy);\n });\n if(renderMode === mode.SVG) {\n this.virtualDom.children = textBoxes.map(textBox => textBox.virtualDom);\n }\n // textOverflow的省略号font使用最近非inline的父节点\n if(__ellipsis) {\n let last = textBoxes[textBoxes.length - 1];\n let { endX, endY } = last;\n let computedStyle = __bp.computedStyle;\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n let font = css.setFontStyle(computedStyle);\n if(ctx.font !== font) {\n ctx.font = font;\n }\n let color = __bp.__cacheStyle[COLOR];\n if(ctx.fillStyle !== color) {\n ctx.fillStyle = color;\n }\n ctx.fillText(ELLIPSIS, endX, endY);\n }\n else if(renderMode === mode.SVG) {\n let props = [\n ['x', endX],\n ['y', endY],\n ['fill', __bp.__cacheStyle[COLOR]],\n ['font-family', computedStyle[FONT_FAMILY]],\n ['font-weight', computedStyle[FONT_WEIGHT]],\n ['font-style', computedStyle[FONT_STYLE]],\n ['font-size', computedStyle[FONT_SIZE] + 'px'],\n ];\n this.virtualDom.children.push({\n type: 'item',\n tagName: 'text',\n props,\n content: ELLIPSIS,\n });\n }\n }\n }\n\n __deepScan(cb) {\n cb(this);\n }\n\n __destroy() {\n if(this.isDestroyed) {\n return;\n }\n super.__destroy();\n let __cache = this.__config[NODE_CACHE];\n if(__cache) {\n __cache.release();\n }\n }\n\n getComputedStyle(key) {\n return this.domParent.getComputedStyle(key);\n }\n\n updateContent(s, cb) {\n let self = this;\n if(s === self.__content) {\n if(util.isFunction(cb)) {\n cb(-1);\n }\n return;\n }\n root.delRefreshTask(self.__task);\n root.addRefreshTask(self.__task = {\n __before() {\n self.__content = s;\n let res = {};\n let vd = self.domParent;\n res[UPDATE_NODE] = vd;\n res[UPDATE_MEASURE] = true;\n res[UPDATE_FOCUS] = level.REFLOW;\n res[UPDATE_CONFIG] = vd.__config;\n let root = vd.root;\n root.__addUpdate(vd, vd.__config, root, root.__config, res);\n },\n __after(diff) {\n if(util.isFunction(cb)) {\n cb(diff);\n }\n },\n });\n }\n\n get content() {\n return this.__content;\n }\n\n set content(v) {\n this.__content = v;\n }\n\n get textBoxes() {\n return this.__textBoxes;\n }\n\n get charWidthList() {\n return this.__charWidthList;\n }\n\n get charWidth() {\n return this.__charWidth;\n }\n\n get firstCharWidth() {\n return this.charWidthList[0] || 0;\n }\n\n get textWidth() {\n return this.__textWidth;\n }\n\n get baseline() {\n return this.__baseline;\n }\n\n get root() {\n return this.domParent.root;\n }\n\n get currentStyle() {\n return this.domParent.currentStyle;\n }\n\n get style() {\n return this.__style;\n }\n\n get computedStyle() {\n return this.domParent.computedStyle;\n }\n\n get cacheStyle() {\n return this.domParent.__cacheStyle;\n }\n\n get bbox() {\n let { __sx1: sx, __sy1: sy, width, height, root, currentStyle: { [TEXT_STROKE_WIDTH]: textStrokeWidth } } = this;\n let half = 0;\n if(textStrokeWidth[1] === REM) {\n half = Math.max(textStrokeWidth[0] * root.computedStyle[FONT_SIZE], half);\n }\n else if(textStrokeWidth[1] === VW) {\n half = Math.max(textStrokeWidth[0] * root.width, half);\n }\n else if(textStrokeWidth[1] === VH) {\n half = Math.max(textStrokeWidth[0] * root.height, half);\n }\n else if(textStrokeWidth[1] === VMAX) {\n half = Math.max(textStrokeWidth[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else if(textStrokeWidth[1] === VMIN) {\n half = Math.max(textStrokeWidth[0] * Math.min(root.width, root.height) * 0.01, half);\n }\n else {\n half = Math.max(textStrokeWidth[0], half);\n }\n return [sx - half, sy - half, sx + width + half, sy + height + half];\n }\n\n get isShadowRoot() {\n return !this.parent && this.host && this.host !== this.root;\n }\n\n get matrix() {\n return this.domParent.matrix;\n }\n\n get matrixEvent() {\n return this.domParent.matrixEvent;\n }\n}\n\nText.prototype.__renderByMask = Text.prototype.render;\n\nexport default Text;\n","import util from './util';\nimport $$type from './$$type';\n\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\n/**\n * 2. 打平children中的数组,变成一维\n * 3. 合并相连的Text节点,即string内容\n */\nfunction flattenJson(parent) {\n if(Array.isArray(parent)) {\n return parent.map(item => flattenJson(item));\n }\n else if(!parent || [TYPE_VD, TYPE_GM, TYPE_CP].indexOf(parent.$$type) === -1 || !Array.isArray(parent.children)) {\n return parent;\n }\n let list = [];\n traverseJson(list, parent.children, {\n lastText: null,\n });\n parent.children = list;\n return parent;\n}\n\nfunction traverseJson(list, children, options) {\n if(Array.isArray(children)) {\n children.forEach(item => {\n traverseJson(list, item, options);\n });\n }\n else if(children && (children.$$type === TYPE_VD || children.$$type === TYPE_GM)) {\n if(['canvas', 'svg', 'webgl'].indexOf(children.tagName) > -1) {\n throw new Error('Can not nest canvas/svg/webgl');\n }\n if(children.$$type === TYPE_VD) {\n flattenJson(children);\n }\n list.push(children);\n options.lastText = null;\n }\n else if(children && children.$$type === TYPE_CP) {\n list.push(children);\n // 强制component即便返回text也形成一个独立的节点,合并在layout布局中做\n options.lastText = null;\n }\n // 排除掉空的文本,连续的text合并\n else if(!util.isNil(children) && children !== '') {\n if(options.lastText !== null) {\n list[list.length - 1] = options.lastText += children;\n }\n else {\n list.push(children);\n }\n }\n}\n\nexport default flattenJson;\n","import Text from '../node/Text';\nimport util from './util';\nimport $$type from './$$type';\nimport enums from './enums';\nimport flatten from './flatten';\n\nconst { NODE_KEY: {\n NODE_DOM_PARENT,\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n} } = enums;\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet Xom, Dom, Img, Geom, Component;\n\nfunction initRoot(cd, root) {\n let c = flatten({\n tagName: root.tagName,\n props: {},\n children: cd,\n $$type: TYPE_VD,\n });\n root.__json = c;\n root.__host = root;\n let children = build(c.children, root, root);\n return relation(root, children);\n}\n\nfunction initDom(json, root, host, parent) {\n let vd = build(json, root, host);\n return relation(parent, vd);\n}\n\nfunction initCp(json, root, host) {\n if(util.isObject(json)) {\n // cp的flatten在__init中自己做\n return build(json, root, host);\n }\n // text的relation会由上层如Root设置\n else {\n return new Text(json);\n }\n}\n\nfunction initCp2(json, root, host, parent) {\n let vd = new json.klass(json.props);\n vd.__tagName = json.tagName || vd.__tagName;\n vd.__root = root;\n vd.__host = host;\n vd.__json = json;\n vd.__init();\n return relation(parent, vd);\n}\n\n/**\n * 将初始json文件生成virtualDom\n * @param json\n * @param root\n * @param host\n * @param hasP 出现过p标签\n * @returns vd\n */\nfunction build(json, root, host, hasP) {\n if(Array.isArray(json)) {\n return json.map(item => build(item, root, host, hasP));\n }\n let vd;\n if(util.isObject(json) && json.$$type) {\n let { tagName, props, children, klass, $$type, __inheritAnimate, __animateRecords } = json;\n // 更新过程中无变化的cp直接使用原来生成的\n if($$type === TYPE_CP && json.__placeholder) {\n return json.__placeholder;\n }\n if($$type === TYPE_VD) {\n if(tagName === 'img') {\n vd = new Img(tagName, props);\n if(Array.isArray(children) && children.length) {\n throw new Error('Img can not contain children');\n }\n }\n else {\n vd = new Dom(tagName, props);\n }\n // 检查p不能包含div\n if(tagName === 'p') {\n hasP = true;\n }\n else if(tagName === 'div' && hasP) {\n throw new Error('Markup p can not contain div');\n }\n if(Array.isArray(children)) {\n children = relation(vd, build(children, root, host, hasP));\n }\n else {\n children = [];\n }\n vd.__children = children;\n }\n else if($$type === TYPE_GM) {\n if(util.isString(tagName)) {\n let klass = Geom.getRegister(tagName);\n vd = new klass(tagName, props);\n }\n else if(tagName) {\n vd = new tagName('$', props);\n }\n }\n else if($$type === TYPE_CP) {\n vd = new klass(props);\n vd.__tagName = tagName || vd.__tagName;\n }\n else {\n return new Text(json);\n }\n // 根parse需要用到真正的vd引用,然后vd也要引用json,用以做domApi\n json.vd = vd;\n vd.__json = json;\n // 递归parse中的动画记录需特殊处理,将target改为真正的vd引用\n if(__animateRecords) {\n vd.__animateRecords = __animateRecords;\n __animateRecords.list.forEach(item => {\n item.target = item.target.vd;\n });\n delete json.__animateRecords;\n }\n // 更新过程中key相同或者普通相同的vd继承动画\n if(__inheritAnimate) {\n util.extendAnimate(__inheritAnimate, vd);\n delete json.__inheritAnimate;\n }\n vd.__root = root;\n vd.__host = host;\n if($$type === TYPE_CP) {\n vd.__init();\n }\n let ref = props.ref;\n if(util.isString(ref) && ref || util.isNumber(ref)) {\n host.ref[ref] = vd;\n }\n else if(util.isFunction(ref)) {\n ref(vd);\n }\n return vd;\n }\n return new Text(json);\n}\n\n/**\n * 设置关系,父子和兄弟\n * @param parent\n * @param children\n * @param options\n * @returns {Xom|Text|Component}\n */\nfunction relation(parent, children, options = {}) {\n if(Array.isArray(children)) {\n children.forEach(item => {\n relation(parent, item, options);\n });\n }\n else if(children instanceof Xom || children instanceof Component || children instanceof Text) {\n children.__parent = parent;\n children.__domParent = parent;\n // 极为恶心,为了v8的性能优化,text复用parent的__config部分,但domParent重设\n if(children instanceof Text) {\n [\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n ].forEach(k => {\n children.__config[k] = parent.__config[k];\n });\n }\n if(children.__config) {\n children.__config[NODE_DOM_PARENT] = parent;\n }\n if(options.prev) {\n options.prev.__next = children;\n children.__prev = options.prev;\n }\n options.prev = children;\n // 文字视作为父节点的直接文字子节点\n if(children instanceof Component) {\n let sr = children.shadowRoot;\n if(sr instanceof Text) {\n sr.__parent = parent;\n [\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n ].forEach(k => {\n children.__config[k] = parent.__config[k];\n });\n }\n sr.__domParent = parent;\n if(sr.__config) {\n sr.__config[NODE_DOM_PARENT] = parent;\n }\n }\n }\n return children;\n}\n\nexport default {\n ref(o) {\n Xom = o.Xom;\n Dom = o.Dom;\n Img = o.Img;\n Geom = o.Geom;\n Component = o.Component;\n },\n initRoot,\n initDom,\n initCp,\n initCp2,\n relation,\n};\n","import util from './util';\n\nconst { isFunction } = util;\n\nclass Event {\n constructor() {\n this.__eHash = {};\n }\n\n on(id, handle) {\n if(!isFunction(handle)) {\n return;\n }\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.on(id[i], handle);\n }\n }\n else {\n if(!self.__eHash.hasOwnProperty(id)) {\n self.__eHash[id] = [];\n }\n // 遍历防止此handle被侦听过了\n for(let i = 0, item = self.__eHash[id], len = item.length; i < len; i++) {\n if(item[i] === handle) {\n return self;\n }\n }\n self.__eHash[id].push(handle);\n }\n return self;\n }\n\n once(id, handle) {\n if(!isFunction(handle)) {\n return;\n }\n let self = this;\n\n // 包裹一层会导致添加后删除对比引用删不掉,需保存原有引用进行对比\n function cb(...data) {\n handle.apply(self, data);\n self.off(id, cb);\n }\n\n cb.__karasEventCb = handle;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.once(id[i], handle);\n }\n }\n else if(handle) {\n self.on(id, cb);\n }\n return this;\n }\n\n off(id, handle) {\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.off(id[i], handle);\n }\n }\n else if(self.__eHash.hasOwnProperty(id)) {\n if(handle) {\n for(let i = 0, item = self.__eHash[id], len = item.length; i < len; i++) {\n // 需考虑once包裹的引用对比\n if(item[i] === handle || item[i].__karasEventCb === handle) {\n item.splice(i, 1);\n break;\n }\n }\n }\n // 未定义为全部清除\n else {\n delete self.__eHash[id];\n }\n }\n return this;\n }\n\n emit(id, ...data) {\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.emit(id[i], data);\n }\n }\n else {\n if(self.__eHash.hasOwnProperty(id)) {\n let list = self.__eHash[id];\n if(list.length) {\n list = list.slice();\n for(let i = 0, len = list.length; i < len; i++) {\n let cb = list[i];\n if(isFunction(cb)) {\n cb.apply(self, data);\n }\n }\n }\n }\n }\n return this;\n }\n\n static mix(...obj) {\n for(let i = obj.length - 1; i >= 0; i--) {\n let o = obj[i];\n let event = new Event();\n o.__eHash = {};\n let fns = ['on', 'once', 'off', 'emit'];\n for(let j = fns.length - 1; j >= 0; j--) {\n let fn = fns[j];\n o[fn] = event[fn];\n }\n }\n }\n\n static REFRESH = 'refresh';\n static PAUSE = 'pause';\n static PLAY = 'play';\n static FRAME = 'frame';\n static FINISH = 'finish';\n static CANCEL = 'cancel';\n static BEGIN = 'begin';\n static END = 'end';\n}\n\nexport default Event;\n","import Node from './Node';\nimport Text from './Text';\nimport builder from '../util/builder';\nimport Event from '../util/Event';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport flatten from '../util/flatten';\nimport css from '../style/css';\nimport change from '../refresh/change';\n\nconst { isNil, isFunction, clone, extend } = util;\n\nconst REGISTER = {};\n\n/**\n * 向上设置cp类型叶子节点,表明从root到本节点这条链路有更新,使得无链路更新的节约递归\n * 在check时树递归会用到,判断是否需要查找cp更新\n * @param cp\n */\nfunction setUpdateFlag(cp) {\n // 去重\n if(cp.__hasCpUpdate) {\n return;\n }\n cp.__hasCpUpdate = true;\n let host = cp.host;\n if(host) {\n setUpdateFlag(host);\n }\n}\n\nclass Component extends Event {\n constructor(props = {}) {\n super();\n this.__tagName = /(?:function|class)\\s+([\\w$]+)/.exec(this.constructor.toString())[1];\n // 构建工具中都是arr,手写可能出现hash情况\n if(Array.isArray(props)) {\n this.props = util.arr2hash(props);\n }\n else {\n this.props = props;\n }\n this.__parent = null;\n this.__host = null;\n this.__ref = {};\n this.state = {};\n this.__isMounted = false;\n this.__taskList = [];\n }\n\n setState(n, cb) {\n let self = this;\n if(isNil(n)) {\n n = {};\n }\n else if(isFunction(n)) {\n return;\n }\n else {\n if(Object.keys(n).length === 0) {\n if(isFunction(cb)) {\n cb.call(self);\n }\n return;\n }\n let state = clone(self.state);\n n = extend(state, n);\n }\n let root = self.root;\n if(root && self.__isMounted) {\n // 一帧之内多次调用,需合并\n if(self.__nextState) {\n Object.assign(self.__nextState, n);\n self.__taskList.push(cb);\n }\n else {\n self.__nextState = n;\n self.__taskList = [cb];\n // 回调更新列表,before执行时splice出来供after执行,防止中途产生的后续setState干扰\n let list = [];\n let t = self.__task = {\n __before: () => {\n list = self.__taskList.splice(0);\n // 标识更新\n setUpdateFlag(this);\n },\n __after: () => {\n // self.__nextState = null; 由updater.js每次refresh前同步执行清空,这里不能异步清除,否则frame动画会乱序\n list.forEach(cb => {\n if(isFunction(cb)) {\n cb.call(self);\n }\n });\n },\n };\n root.addRefreshCp(t);\n }\n }\n // 构造函数中调用还未render,\n else if(isFunction(cb)) {\n self.state = n;\n cb.call(self);\n }\n }\n\n /**\n * build中调用初始化,json有值时是update过程才有,且处理过flatten\n * @param json\n * @private\n */\n __init(json) {\n this.__ref = {};\n let root = this.root;\n let cd = json || flatten(this.render());\n let sr = builder.initCp(cd, root, this);\n this.__cd = cd;\n if(sr instanceof Text) {\n // 文字视作为父节点的直接文字子节点,在builder里做\n }\n else if(sr instanceof Node) {\n let style = css.normalize(this.props.style);\n let keys = Object.keys(style);\n extend(sr.style, style, keys);\n extend(sr.currentStyle, style, keys);\n // 事件添加到sr\n Object.keys(this.props).forEach(k => {\n let v = this.props[k];\n if(/^on[a-zA-Z]/.test(k)) {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n });\n }\n else if(!(sr instanceof Component)) {\n // 本身build是递归的,子cp已经初始化了\n throw new Error('Component render() must return a dom/text: ' + this);\n }\n // 自定义事件无视返回强制添加\n Object.keys(this.props).forEach(k => {\n let v = this.props[k];\n if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n k = k.slice(3);\n this.on(k, v);\n }\n });\n // shadow指向直接renderRoot,shadowRoot考虑到返回Component的递归即hoc高阶组件\n // host是直接所属,hostRoot同考虑到高阶组件\n this.__shadow = sr;\n sr.__host = this;\n // 递归下去,多层级时执行顺序由里到外,最终会被最上层执行替换\n while(sr instanceof Component) {\n sr.__hostRoot = this;\n sr.shadow.__host = sr;\n sr = sr.shadow;\n }\n this.__shadowRoot = sr;\n sr.__hostRoot = this;\n if(!this.__isMounted) {\n this.__isMounted = true;\n if(isFunction(this.componentDidMount)) {\n root.once(Event.REFRESH, () => {\n this.componentDidMount();\n });\n }\n }\n }\n\n render() {\n inject.warn('Component must implement render()');\n }\n\n __destroy() {\n if(this.isDestroyed) {\n return;\n }\n this.__isDestroyed = true;\n this.__isMounted = false;\n if(isFunction(this.componentWillUnmount)) {\n this.componentWillUnmount();\n }\n this.root.delRefreshTask(this.__task);\n if(this.shadowRoot) {\n this.shadowRoot.__destroy();\n }\n this.__parent = null;\n }\n\n __emitEvent(e, force) {\n let sr = this.shadowRoot;\n if(sr instanceof Text) {\n return;\n }\n let res = sr.__emitEvent(e, force);\n if(res) {\n e.target = this;\n return true;\n }\n }\n\n get tagName() {\n return this.__tagName;\n }\n\n get shadow() {\n return this.__shadow;\n }\n\n get shadowRoot() {\n return this.__shadowRoot;\n }\n\n get root() {\n return this.__root;\n }\n\n get host() {\n return this.__host;\n }\n\n get hostRoot() {\n return this.__hostRoot;\n }\n\n get parent() {\n return this.__parent;\n }\n\n get prev() {\n return this.__prev;\n }\n\n get next() {\n return this.__next;\n }\n\n get ref() {\n return this.__ref;\n }\n\n get domParent() {\n return this.__domParent;\n }\n\n get state() {\n return this.__state;\n }\n\n set state(v) {\n this.__state = v;\n }\n\n get isDestroyed() {\n return this.__isDestroyed;\n }\n\n static get REGISTER() {\n return REGISTER;\n }\n\n static getRegister(name) {\n if(!name || !util.isString(name) || !/^[A-Z]/.test(name)) {\n throw new Error('Invalid param');\n }\n if(!REGISTER.hasOwnProperty(name)) {\n throw new Error(`Component has not register: ${name}`);\n }\n return REGISTER[name];\n }\n\n static register(name, obj) {\n if(!name || !util.isString(name) || !/^[A-Z]/.test(name)\n || !obj.prototype || !(obj.prototype instanceof Component)) {\n throw new Error('Invalid param: Component register');\n }\n if(Component.hasRegister(name)) {\n throw new Error(`Component has already register: ${name}`);\n }\n REGISTER[name] = obj;\n }\n\n static hasRegister(name) {\n return name && REGISTER.hasOwnProperty(name);\n }\n\n static delRegister(name) {\n if(Component.hasRegister(name)) {\n delete REGISTER[name];\n }\n }\n}\n\nObject.keys(change.GEOM).concat([\n 'x',\n 'y',\n 'ox',\n 'oy',\n 'sx',\n 'sy',\n // '__sx1',\n // '__sx2',\n // '__sx3',\n // '__sx4',\n // '__sx5',\n // '__sx6',\n // '__sy1',\n // '__sy2',\n // '__sy3',\n // '__sy4',\n // '__sy5',\n // '__sy6',\n 'width',\n 'height',\n 'outerWidth',\n 'outerHeight',\n 'clientWidth',\n 'clientHeight',\n 'offsetWidth',\n 'offsetHeight',\n 'style',\n 'animationList',\n 'animateStyle',\n 'currentStyle',\n 'computedStyle',\n 'currentProps',\n 'baseline',\n 'virtualDom',\n 'mask',\n 'maskId',\n 'textWidth',\n 'content',\n 'lineBoxes',\n 'charWidthList',\n 'charWidth',\n '__layoutData',\n 'availableAnimating',\n 'effectiveAnimating',\n 'displayAnimating',\n 'visibilityAnimating',\n 'bbox',\n '__config',\n 'contentBoxList',\n 'listener',\n 'matrix',\n 'matrixEvent',\n]).forEach(fn => {\n Object.defineProperty(Component.prototype, fn, {\n get() {\n let sr = this.shadowRoot;\n if(sr) {\n return sr[fn];\n }\n },\n });\n});\n\n[\n '__layout',\n '__layoutAbs',\n '__layoutNone',\n '__tryLayInline',\n '__offsetX',\n '__offsetY',\n '__calAutoBasis',\n '__calMp',\n '__calAbs',\n '__renderAsMask',\n '__renderByMask',\n '__mp',\n 'animate',\n 'removeAnimate',\n 'clearAnimate',\n 'updateStyle',\n 'getBoundingClientRect',\n 'getComputedStyle',\n '__deepScan',\n 'clearCache',\n '__structure',\n '__modifyStruct',\n '__updateStruct',\n 'flowChildren',\n 'absChildren',\n '__isRealInline',\n '__calBasis',\n '__calMinMax',\n '__computeMeasure',\n 'appendChild',\n 'prependChild',\n 'insertBefore',\n 'insertAfter',\n 'removeChild',\n 'remove',\n].forEach(fn => {\n Component.prototype[fn] = function() {\n let sr = this.shadowRoot;\n if(sr && isFunction(sr[fn])) {\n return sr[fn].apply(sr, arguments);\n }\n };\n});\n\nexport default Component;\n","import unit from './unit';\nimport transform from './transform';\nimport enums from '../util/enums';\n\nconst { STYLE_KEY: { SCALE_X, SCALE_Y } } = enums;\nconst { PERCENT, NUMBER } = unit;\n\nfunction matrixResize(imgWidth, imgHeight, targetWidth, targetHeight, x, y, w, h) {\n if(imgWidth === targetWidth && imgHeight === targetHeight) {\n return;\n }\n let list = [\n [SCALE_X, [targetWidth / imgWidth, NUMBER]],\n [SCALE_Y, [targetHeight / imgHeight, NUMBER]],\n ];\n let tfo = transform.calOrigin([[0, PERCENT], [0, PERCENT]], w, h);\n tfo[0] += x;\n tfo[1] += y;\n return transform.calMatrixWithOrigin(list, tfo, w, h);\n}\n\nexport default {\n matrixResize,\n};\n","import border from './border';\nimport transform from './transform';\nimport mx from '../math/matrix';\nimport mode from '../refresh/mode';\nimport painter from '../util/painter';\nimport util from '../util/util';\nimport unit from './unit';\nimport enums from '../util/enums';\nimport image from './image';\n\nconst {\n STYLE_KEY: {\n BACKGROUND_POSITION_X,\n BACKGROUND_POSITION_Y,\n FONT_SIZE,\n },\n NODE_KEY: {\n NODE_DEFS_CACHE,\n },\n} = enums;\nconst { clone, joinArr } = util;\nconst { canvasPolygon, svgPolygon } = painter;\nconst { AUTO, PX, PERCENT, STRING, REM, VW, VH, VMAX, VMIN } = unit;\n\nfunction renderBgc(xom, renderMode, ctx, color, list, x, y, w, h, btlr, btrr, bbrr, bblr,\n method = 'fill', isInline = false, dx = 0, dy = 0) {\n // radial渐变ellipse形状会有matrix,用以从圆缩放到椭圆\n let matrix, cx, cy;\n if(Array.isArray(color)) {\n matrix = color[1];\n cx = color[2];\n cy = color[3];\n color = color[0];\n }\n // border-radius使用三次贝塞尔曲线模拟1/4圆角,误差在[0, 0.000273]之间\n list = list || border.calRadius(x, y, w, h, btlr, btrr, bbrr, bblr);\n if(!list) {\n list = [\n [x, y],\n [x + w, y],\n [x + w, y + h],\n [x, y + h],\n [x, y],\n ];\n }\n // 椭圆有matrix,用逆矩阵变化点来完成\n if(matrix) {\n let tfo = [cx, cy];\n matrix = transform.calMatrixByOrigin(matrix, tfo);\n let t = mx.inverse(matrix);\n list = list.map(item => {\n if(!item || !item.length) {\n return null;\n }\n let arr = [];\n for(let i = 0, len = item.length; i < len; i += 2) {\n let p = mx.calPoint([item[i], item[i + 1]], t);\n arr.push(p[0]);\n arr.push(p[1]);\n }\n return arr;\n });\n }\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n if(matrix) {\n ctx.save();\n let me = xom.matrixEvent;\n matrix = mx.multiply(me, matrix);\n ctx.setTransform(matrix[0], matrix[1], matrix[4], matrix[5], matrix[12], matrix[13]);\n }\n ctx.beginPath();\n if(ctx.fillStyle !== color) {\n ctx.fillStyle = color;\n }\n canvasPolygon(ctx, list, dx, dy);\n ctx[method]();\n ctx.closePath();\n if(matrix) {\n ctx.restore();\n }\n }\n else if(renderMode === mode.SVG) {\n let d = svgPolygon(list);\n if(isInline) {\n let v = {\n tagName: 'symbol',\n props: [],\n children: [\n {\n type: 'item',\n tagName: 'path',\n props: [\n ['d', d],\n ['fill', color],\n ],\n },\n ],\n };\n xom.__config[NODE_DEFS_CACHE].push(v);\n return ctx.add(v);\n }\n else {\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', d],\n ['fill', color],\n ],\n });\n // 椭圆渐变独有\n if(matrix) {\n let bb = xom.virtualDom.bb;\n bb[bb.length - 1].props.push(['transform', `matrix(${joinArr(mx.m2m6(matrix), ',')})`]);\n }\n }\n }\n}\n\nfunction calBackgroundSize(value, w, h, root) {\n let res = [];\n value.forEach((item, i) => {\n if(item[1] === PX) {\n res.push(item[0]);\n }\n else if(item[1] === PERCENT) {\n res.push(item[0] * (i ? h : w) * 0.01);\n }\n else if(item[1] === REM) {\n res.push(item[0] * root.computedStyle[FONT_SIZE]);\n }\n else if(item[1] === VW) {\n res.push(item[0] * root.width * 0.01);\n }\n else if(item[1] === VH) {\n res.push(item[0] * root.height * 0.01);\n }\n else if(item[1] === VMAX) {\n res.push(item[0] * Math.max(root.width, root.height) * 0.01);\n }\n else if(item[1] === VMIN) {\n res.push(item[0] * Math.min(root.width, root.height) * 0.01);\n }\n else if(item[1] === AUTO) {\n res.push(-1);\n }\n else if(item[1] === STRING) {\n res.push(item[0] === 'contain' ? -2 : -3);\n }\n });\n return res;\n}\n\nfunction calBackgroundPosition(position, container, size, root) {\n if(Array.isArray(position)) {\n if(position[1] === PX) {\n return position[0];\n }\n else if(position[1] === PERCENT) {\n return (container - size) * position[0] * 0.01;\n }\n else if(position[1] === REM) {\n return position[0] * root.computedStyle[FONT_SIZE];\n }\n else if(position[1] === VW) {\n return position[0] * root.width * 0.01;\n }\n else if(position[1] === VH) {\n return position[0] * root.height * 0.01;\n }\n else if(position[1] === VMAX) {\n return position[0] * Math.max(root.width, root.height) * 0.01;\n }\n else if(position[1] === VMIN) {\n return position[0] * Math.min(root.width, root.height) * 0.01;\n }\n }\n return 0;\n}\n\nfunction renderImage(xom, renderMode, ctx, loadBgi,\n bx1, by1, bx2, by2, btlr, btrr, bbrr, bblr,\n currentStyle, i, backgroundSize, backgroundRepeat, __config, isInline,\n dx = 0, dy = 0) {\n let source = loadBgi.source;\n // 无source不绘制,可能错误或加载中\n if(source) {\n bx1 += dx;\n by1 += dy;\n bx2 += dx;\n by2 += dy;\n let bgW = bx2 - bx1;\n let bgH = by2 - by1;\n let { width, height } = loadBgi;\n let [w, h] = backgroundSize[i] || [];\n // -1为auto,-2为contain,-3为cover\n if(w === -1 && h === -1) {\n w = width;\n h = height;\n }\n else if(w === -2) {\n if(width > bgW && height > bgH) {\n w = width / bgW;\n h = height / bgH;\n if(w >= h) {\n w = bgW;\n h = w * height / width;\n }\n else {\n h = bgH;\n w = h * width / height;\n }\n }\n else if(width > bgW) {\n w = bgW;\n h = w * height / width;\n }\n else if(height > bgH) {\n h = bgH;\n w = h * width / height;\n }\n else {\n w = width;\n h = height;\n }\n }\n else if(w === -3) {\n if(bgW > width && bgH > height) {\n w = width / bgW;\n h = height / bgH;\n if(w <= h) {\n w = bgW;\n h = w * height / width;\n }\n else {\n h = bgH;\n w = h * width / height;\n }\n }\n else if(bgW > width) {\n w = bgW;\n h = w * height / width;\n }\n else if(bgH > height) {\n h = bgH;\n w = h * width / height;\n }\n else {\n w = width / bgW;\n h = height / bgH;\n if(w <= h) {\n w = bgW;\n h = w * height / width;\n }\n else {\n h = bgH;\n w = h * width / height;\n }\n }\n }\n else if(w === -1) {\n w = h * width / height;\n }\n else if(h === -1) {\n h = w * height / width;\n }\n let bgX = bx1 + calBackgroundPosition(currentStyle[BACKGROUND_POSITION_X][i], bgW, w, xom.root);\n let bgY = by1 + calBackgroundPosition(currentStyle[BACKGROUND_POSITION_Y][i], bgH, h, xom.root);\n // 超出尺寸模拟mask截取\n let needMask = bgX < bx1 || bgY < by1 || (bgX + w) > (bx1 + bgW) || (bgY + h) > (by1 + bgH);\n // 计算因为repeat,需要向4个方向扩展渲染几个数量图片\n let xnl = 0;\n let xnr = 0;\n let ynt = 0;\n let ynb = 0;\n // repeat-x\n if(['repeat-x', 'repeatX', 'repeat'].indexOf(backgroundRepeat[i]) > -1) {\n let diff = bgX - bx1;\n if(diff > 0) {\n xnl = Math.ceil(diff / w);\n }\n diff = bx1 + bgW - bgX - w;\n if(diff > 0) {\n xnr = Math.ceil(diff / w);\n }\n }\n // repeat-y\n if(['repeat-y', 'repeatY', 'repeat'].indexOf(backgroundRepeat[i]) > -1) {\n let diff = bgY - by1;\n if(diff > 0) {\n ynt = Math.ceil(diff / h);\n }\n diff = by1 + bgH - bgY - h;\n if(diff > 0) {\n ynb = Math.ceil(diff / h);\n }\n }\n // 分同行列和4个角分别判断,先看同行同列,再看4个角的象限\n let repeat = [];\n if(xnl > 0) {\n for(let i = 0; i < xnl; i++) {\n let x = bgX - (i + 1) * w;\n repeat.push([x, bgY]);\n // 看最左边超过没有\n if(!needMask && i === 0 && x < bx1) {\n needMask = true;\n }\n }\n }\n if(xnr > 0) {\n for(let i = 0; i < xnr; i++) {\n let x = bgX + (i + 1) * w;\n repeat.push([x, bgY]);\n // 看最右边超过没有\n if(!needMask && i === xnr - 1 && x + w > bx1 + bgW) {\n needMask = true;\n }\n }\n }\n if(ynt > 0) {\n for(let i = 0; i < ynt; i++) {\n let y = bgY - (i + 1) * h;\n repeat.push([bgX, y]);\n // 看最上边超过没有\n if(!needMask && i === 0 && y < by1) {\n needMask = true;\n }\n }\n }\n if(ynb > 0) {\n for(let i = 0; i < ynb; i++) {\n let y = bgY + (i + 1) * h;\n repeat.push([bgX, y]);\n // 看最下边超过没有\n if(!needMask && i === ynb - 1 && y + w > by1 + bgH) {\n needMask = true;\n }\n }\n }\n // 原点和同行列十字画完,看4个角的情况\n if(xnl > 0 && ynt > 0) {\n for(let i = 0; i < xnl; i++) {\n for(let j = 0; j < ynt; j++) {\n repeat.push([bgX - (i + 1) * w, bgY - (j + 1) * h]);\n }\n }\n }\n if(xnr > 0 && ynt > 0) {\n for(let i = 0; i < xnr; i++) {\n for(let j = 0; j < ynt; j++) {\n repeat.push([bgX + (i + 1) * w, bgY - (j + 1) * h]);\n }\n }\n }\n if(xnl > 0 && ynb > 0) {\n for(let i = 0; i < xnl; i++) {\n for(let j = 0; j < ynb; j++) {\n repeat.push([bgX - (i + 1) * w, bgY + (j + 1) * h]);\n }\n }\n }\n if(xnr > 0 && ynb > 0) {\n for(let i = 0; i < xnr; i++) {\n for(let j = 0; j < ynb; j++) {\n repeat.push([bgX + (i + 1) * w, bgY + (j + 1) * h]);\n }\n }\n }\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n if(needMask) {\n ctx.save();\n renderBgc(this, renderMode, ctx, '#FFF', null,\n bx1, by1, bgW, bgH, btlr, btrr, bbrr, bblr, 'clip');\n }\n // 先画不考虑repeat的中心声明的\n ctx.drawImage(source, bgX, bgY, w, h);\n // 再画重复的十字和4角象限\n repeat.forEach(item => {\n ctx.drawImage(source, item[0], item[1], w, h);\n });\n if(needMask) {\n ctx.restore();\n }\n }\n else if(renderMode === mode.SVG) {\n let matrix = image.matrixResize(width, height, w, h, bgX, bgY, bgW, bgH);\n let props = [\n ['xlink:href', loadBgi.url],\n ['x', bgX],\n ['y', bgY],\n ['width', width],\n ['height', height],\n ];\n let needResize;\n if(matrix && !mx.isE(matrix)) {\n needResize = true;\n props.push(['transform', 'matrix(' + joinArr(mx.m2m6(matrix), ',') + ')']);\n }\n if(needMask) {\n let p1 = [bx1, by1];\n let p2 = [bx2, by2];\n if(needResize) {\n let inverse = mx.inverse(matrix);\n p1 = mx.calPoint(p1, inverse);\n p2 = mx.calPoint(p2, inverse);\n }\n let v = {\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', `M${p1[0]},${p1[1]}L${p2[0]},${p1[1]}L${p2[0]},${p2[1]}L${p1[0]},${p2[1]}L${p1[0]},${p1[1]}`],\n ['fill', '#FFF'],\n ],\n }],\n };\n let id = ctx.add(v);\n __config[NODE_DEFS_CACHE].push(v);\n props.push(['clip-path', 'url(#' + id + ')']);\n }\n if(isInline) {\n let v = {\n tagName: 'symbol',\n props: [],\n children: [\n {\n type: 'img',\n tagName: 'image',\n props,\n }\n ],\n };\n xom.__config[NODE_DEFS_CACHE].push(v);\n repeat.forEach(item => {\n let copy = clone(props);\n if(needResize) {\n let matrix = image.matrixResize(width, height, w, h, item[0], item[1], bgW, bgH);\n if(matrix && !mx.isE(matrix)) {\n copy[5][1] = 'matrix(' + joinArr(mx.m2m6(matrix), ',') + ')';\n }\n }\n copy[1][1] = item[0];\n copy[2][1] = item[1];\n v.children.push({\n type: 'img',\n tagName: 'image',\n props: copy,\n });\n });\n return ctx.add(v);\n }\n else {\n // 先画不考虑repeat的中心声明的\n xom.virtualDom.bb.push({\n type: 'img',\n tagName: 'image',\n props,\n });\n // 再画重复的十字和4角象限\n repeat.forEach(item => {\n let copy = clone(props);\n if(needResize) {\n let matrix = image.matrixResize(width, height, w, h, item[0], item[1], bgW, bgH);\n if(matrix && !mx.isE(matrix)) {\n copy[5][1] = 'matrix(' + joinArr(mx.m2m6(matrix), ',') + ')';\n }\n }\n copy[1][1] = item[0];\n copy[2][1] = item[1];\n xom.virtualDom.bb.push({\n type: 'img',\n tagName: 'image',\n props: copy,\n });\n });\n }\n }\n }\n}\n\nexport default {\n renderBgc,\n renderImage,\n calBackgroundSize,\n};\n","import inject from '../util/inject';\nimport util from '../util/util';\n\nconst { isFunction } = util;\n\nfunction traversal(list, length, diff, after) {\n if(after) {\n for(let i = 0; i < length; i++) {\n let item = list[i];\n if(item[1]) {\n item[1](diff);\n }\n else {\n item.__after && item.__after(diff);\n }\n }\n }\n else {\n for(let i = 0; i < length; i++) {\n let item = list[i];\n if(item[0]) {\n item[0](diff);\n }\n else {\n item.__before && item.__before(diff);\n }\n }\n }\n}\n\nlet isPause;\n\nclass Frame {\n constructor() {\n this.__hookTask = []; // 动画刷新后,每个root注册的刷新回调执行\n this.__task = [];\n this.__taskCp = []; // 区别于task,component专用,和animate等其它不同流水线,在最后执行,防止混了 #122\n this.__now = null;\n }\n\n __init() {\n let self = this;\n let { task, taskCp } = self;\n inject.cancelAnimationFrame(self.id);\n let last = self.__now = inject.now();\n function cb() {\n // 必须清除,可能会发生重复,当动画finish回调中gotoAndPlay(0),下方结束判断发现aTask还有值会继续,新的init也会进入再次执行\n inject.cancelAnimationFrame(self.id);\n self.id = inject.requestAnimationFrame(function() {\n if(isPause || (!task.length && !taskCp.length)) {\n return;\n }\n let now = self.__now = inject.now();\n let diff = now - last;\n diff = Math.max(diff, 0);\n // let delta = diff * 0.06; // 比例是除以1/60s,等同于*0.06\n last = now;\n // 优先动画计算\n let clone = task.slice(0);\n let cloneCp = taskCp.splice(0); // task要常驻,taskCp只1次直接splice清空\n let length = clone.length;\n let lengthCp = cloneCp.length;\n traversal(clone, length, diff, false);\n traversal(cloneCp, lengthCp, diff, false);\n // 执行动画造成的每个Root的刷新并清空\n let list = self.__hookTask.splice(0);\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n item && item();\n }\n // 普通的before/after\n traversal(clone, length, diff, true);\n traversal(cloneCp, lengthCp, diff, true);\n // 还有则继续,没有则停止节省性能\n if(task.length || taskCp.length) {\n cb();\n }\n });\n }\n cb();\n }\n\n onFrame(handle) {\n if(!handle) {\n return;\n }\n let { task } = this;\n if(!task.length) {\n this.__init();\n }\n if(isFunction(handle)) {\n handle = {\n __after: handle,\n __karasFramecb: handle,\n };\n }\n task.push(handle);\n }\n\n offFrame(handle) {\n if(!handle) {\n return;\n }\n let { task } = this;\n for(let i = 0, len = task.length; i < len; i++) {\n let item = task[i];\n // 需考虑nextFrame包裹的引用对比\n if(item === handle || item.__karasFramecb === handle) {\n task.splice(i, 1);\n break;\n }\n }\n if(!task.length) {\n inject.cancelAnimationFrame(this.id);\n this.__now = null;\n }\n }\n\n nextFrame(handle) {\n if(!handle) {\n return;\n }\n // 包裹一层会导致添加后删除对比引用删不掉,需保存原有引用进行对比\n let cb = isFunction(handle) ? {\n __after: diff => {\n handle(diff);\n this.offFrame(cb);\n },\n } : {\n __before: handle.__before,\n __after: diff => {\n handle.__after && handle.__after(diff);\n this.offFrame(cb);\n },\n };\n cb.__karasFramecb = handle;\n this.onFrame(cb);\n }\n\n __nextFrameCp(handle) {\n let { task, taskCp } = this;\n if(!task.length && !taskCp.length) {\n this.__init();\n }\n taskCp.push(handle);\n }\n\n pause() {\n isPause = true;\n }\n\n resume() {\n if(isPause) {\n this.__init();\n isPause = false;\n }\n }\n\n get task() {\n return this.__task;\n }\n\n get taskCp() {\n return this.__taskCp;\n }\n}\n\nexport default new Frame();\n","/**\n * https://github.com/gre/bezier-easing\n * BezierEasing - use bezier curve for transition easing function\n * by Gaëtan Renaudeau 2014 - 2015 – MIT License\n */\n\n// These values are established by empiricism with tests (tradeoff: performance VS precision)\nlet NEWTON_ITERATIONS = 4;\nlet NEWTON_MIN_SLOPE = 0.001;\nlet SUBDIVISION_PRECISION = 0.0000001;\nlet SUBDIVISION_MAX_ITERATIONS = 10;\n\nlet kSplineTableSize = 11;\nlet kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);\n\nlet float32ArraySupported = typeof Float32Array === 'function';\n\nfunction A(aA1, aA2) {\n return 1.0 - 3.0 * aA2 + 3.0 * aA1;\n}\n\nfunction B(aA1, aA2) {\n return 3.0 * aA2 - 6.0 * aA1;\n}\n\nfunction C(aA1) {\n return 3.0 * aA1;\n}\n\n// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\nfunction calcBezier(aT, aA1, aA2) {\n return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;\n}\n\n// Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.\nfunction getSlope(aT, aA1, aA2) {\n return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1);\n}\n\nfunction binarySubdivide(aX, aA, aB, mX1, mX2) {\n let currentX, currentT, i = 0;\n do {\n currentT = aA + (aB - aA) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - aX;\n if(currentX > 0.0) {\n aB = currentT;\n } else {\n aA = currentT;\n }\n } while(Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\n return currentT;\n}\n\nfunction newtonRaphsonIterate(aX, aGuessT, mX1, mX2) {\n for(let i = 0; i < NEWTON_ITERATIONS; ++i) {\n let currentSlope = getSlope(aGuessT, mX1, mX2);\n if(currentSlope === 0.0) {\n return aGuessT;\n }\n let currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n aGuessT -= currentX / currentSlope;\n }\n return aGuessT;\n}\n\nfunction LinearEasing(x) {\n return x;\n}\n\nfunction bezier(mX1, mY1, mX2, mY2) {\n if(!(0 <= mX1 && mX1 <= 1 && 0 <= mX2 && mX2 <= 1)) {\n throw new Error('bezier x values must be in [0, 1] range');\n }\n\n if(mX1 === mY1 && mX2 === mY2) {\n return LinearEasing;\n }\n\n // Precompute samples table\n let sampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n for(let i = 0; i < kSplineTableSize; ++i) {\n sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\n }\n\n function getTForX(aX) {\n let intervalStart = 0.0;\n let currentSample = 1;\n let lastSample = kSplineTableSize - 1;\n\n for(; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {\n intervalStart += kSampleStepSize;\n }\n --currentSample;\n\n // Interpolate to provide an initial guess for t\n let dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]);\n let guessForT = intervalStart + dist * kSampleStepSize;\n\n let initialSlope = getSlope(guessForT, mX1, mX2);\n if(initialSlope >= NEWTON_MIN_SLOPE) {\n return newtonRaphsonIterate(aX, guessForT, mX1, mX2);\n } else if(initialSlope === 0.0) {\n return guessForT;\n } else {\n return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);\n }\n }\n\n return function BezierEasing(x) {\n // Because JavaScript number are imprecise, we should guarantee the extremes are right.\n if(x === 0 || x === 1) {\n return x;\n }\n return calcBezier(getTForX(x), mY1, mY2);\n };\n}\n\nlet easing = {\n linear: bezier(1, 1, 0, 0),\n easeIn: bezier(0.42, 0, 1, 1),\n easeOut: bezier(0, 0, 0.58, 1),\n ease: bezier(0.25, 0.1, 0.25, 1),\n easeInOut: bezier(0.42, 0, 0.58, 1),\n cubicBezier: bezier,\n getEasing(v, v1, v2, v3) {\n if(arguments.length === 4) {\n return bezier(v, v1, v2, v3);\n }\n else if(Array.isArray(v) && v.length === 4) {\n return bezier(v[0], v[1], v[2], v[3]);\n }\n else if(v) {\n v = v.toString();\n let timingFunction;\n if(/^\\s*(?:cubic-bezier\\s*)?\\(\\s*[\\d.]+\\s*,\\s*[-\\d.]+\\s*,\\s*[\\d.]+\\s*,\\s*[-\\d.]+\\s*\\)\\s*$/i.test(v)) {\n v = v.match(/[\\d.]+/g);\n timingFunction = bezier(v[0], v[1], v[2], v[3]);\n }\n else if(v !== 'getEasing') {\n timingFunction = this[v];\n }\n return timingFunction;\n }\n },\n};\n\neasing['ease-in'] = easing.easeIn;\neasing['ease-out'] = easing.easeOut;\neasing['ease-in-out'] = easing.easeInOut;\n\nexport default easing;\n","import css from '../style/css';\nimport unit from '../style/unit';\nimport tf from '../style/transform';\nimport abbr from '../style/abbr';\nimport enums from '../util/enums';\nimport util from '../util/util';\nimport Event from '../util/Event';\nimport inject from '../util/inject';\nimport frame from './frame';\nimport easing from './easing';\nimport change from '../refresh/change';\nimport key from './key';\nimport mx from '../math/matrix';\n\nconst {\n STYLE_KEY: {\n FILTER,\n TRANSFORM_ORIGIN,\n PERSPECTIVE_ORIGIN,\n BACKGROUND_CLIP,\n BACKGROUND_POSITION_X,\n BACKGROUND_POSITION_Y,\n BOX_SHADOW,\n TRANSLATE_X,\n TRANSLATE_Y,\n TRANSLATE_Z,\n BACKGROUND_SIZE,\n FONT_SIZE,\n FLEX_BASIS,\n FLEX_DIRECTION,\n WIDTH,\n HEIGHT,\n TOP,\n BOTTOM,\n LINE_HEIGHT,\n OPACITY,\n Z_INDEX,\n TRANSFORM,\n COLOR,\n FONT_WEIGHT,\n FONT_STYLE,\n FONT_FAMILY,\n TEXT_ALIGN,\n MATRIX,\n ROTATE_3D,\n TRANSLATE_PATH,\n TEXT_STROKE_COLOR,\n TEXT_STROKE_OVER,\n },\n UPDATE_KEY: {\n UPDATE_NODE,\n UPDATE_STYLE,\n UPDATE_KEYS,\n UPDATE_CONFIG,\n },\n KEY_FRAME_KEY: {\n FRAME_STYLE,\n FRAME_TIME,\n FRAME_EASING,\n FRAME_TRANSITION,\n },\n ANIMATE_KEY: {\n I_ASSIGNING,\n I_IN_FPS,\n I_IS_DELAY,\n I_BEGIN,\n I_END,\n I_FINISHED,\n I_NEXT_END,\n I_FIRST_PLAY,\n I_PLAY_CB,\n I_TARGET,\n I_ROOT,\n I_FRAMES,\n I_FRAMES_R,\n I_CURRENT_TIME,\n I_NEXT_TIME,\n I_STYLE,\n I_DURATION,\n I_ITERATIONS,\n I_FILL,\n I_PLAYBACK_RATE,\n I_PLAY_COUNT,\n I_PLAY_STATE,\n I_DESTROYED,\n I_START_TIME,\n I_FPS_TIME,\n I_EASING,\n I_ENTER_FRAME,\n I_DELAY,\n I_END_DELAY,\n I_KEYS,\n I_ORIGIN_STYLE,\n I_CURRENT_FRAMES,\n I_CURRENT_FRAME,\n I_SPF_LIMIT,\n I_FPS,\n I_DIRECTION,\n I_FIRST_ENTER,\n I_STAY_BEGIN,\n I_STAY_END,\n I_IS2,\n I_END_TIME,\n I_NODE_CONFIG,\n I_ROOT_CONFIG,\n I_OUT_BEGIN_DELAY,\n I_TIME_STAMP,\n },\n} = enums;\nconst { AUTO, PX, PERCENT, INHERIT, RGBA, STRING, NUMBER, REM, VW, VH, VMAX, VMIN, calUnit } = unit;\nconst { isNil, isFunction, isNumber, isObject, isString, clone, equalArr } = util;\nconst { linear } = easing;\nconst { cloneStyle } = css;\nconst { isGeom, GEOM } = change;\n\nconst {\n COLOR_HASH,\n LENGTH_HASH,\n RADIUS_HASH,\n GRADIENT_HASH,\n EXPAND_HASH,\n GRADIENT_TYPE,\n} = key;\n\nconst NUM_CAL_HASH = {\n};\nObject.assign(NUM_CAL_HASH, LENGTH_HASH);\nObject.assign(NUM_CAL_HASH, EXPAND_HASH);\n\nfunction unify(frames, target) {\n let hash = {};\n let keys = [];\n // 获取所有关键帧的属性\n frames.forEach(item => {\n let style = item[FRAME_STYLE];\n Object.keys(style).forEach(k => {\n let v = style[k];\n // 未定义的过滤掉,null空有意义\n if(v !== undefined && !hash.hasOwnProperty(k)) {\n hash[k] = true;\n // geom为属性字符串,style都为枚举int\n if(!GEOM.hasOwnProperty(k)) {\n k = parseInt(k);\n }\n // path动画要转为translateXY,所以手动添加,使2帧之间存在过渡,有可能之前已存在这个动画,可忽视\n if(k === TRANSLATE_PATH) {\n if(!hash.hasOwnProperty(TRANSLATE_X)) {\n keys.push(TRANSLATE_X);\n }\n if(!hash.hasOwnProperty(TRANSLATE_Y)) {\n keys.push(TRANSLATE_Y);\n }\n hash[TRANSLATE_X] = hash[TRANSLATE_Y] = true;\n }\n keys.push(k);\n }\n });\n });\n // 添补没有声明完全的关键帧属性为节点当前值\n frames.forEach(item => {\n let style = item[FRAME_STYLE];\n keys.forEach(k => {\n if(!style.hasOwnProperty(k) || isNil(style[k])) {\n if(GEOM.hasOwnProperty(k)) {\n style[k] = target.getProps(k);\n }\n else {\n style[k] = target.currentStyle[k];\n }\n }\n });\n });\n return keys;\n}\n\n// 每次初始化时处理继承值,以及转换transform为单matrix矩阵\nfunction inherit(frames, keys, target) {\n let computedStyle = target.computedStyle;\n frames.forEach(item => {\n let style = item[FRAME_STYLE];\n keys.forEach(k => {\n let v = style[k];\n // geom的属性可能在帧中没有\n if(isNil(v)) {\n return;\n }\n if(k === TRANSFORM) {\n let ow = target.outerWidth;\n let oh = target.outerHeight;\n let m = tf.calMatrix(v, ow, oh);\n style[k] = [[MATRIX, m]];\n }\n else if(v[1] === INHERIT) {\n if(k === COLOR || k === TEXT_STROKE_COLOR) {\n style[k] = [util.rgba2int(computedStyle[k]), RGBA];\n }\n else if(LENGTH_HASH.hasOwnProperty(k)) {\n style[k] = [computedStyle[k], PX];\n }\n else if(k === FONT_WEIGHT) {\n style[k] = [computedStyle[k], NUMBER];\n }\n else if(k === FONT_STYLE || k === FONT_FAMILY || k === TEXT_ALIGN || k === TEXT_STROKE_OVER) {\n style[k] = [computedStyle[k], STRING];\n }\n }\n });\n });\n}\n\n/**\n * 通知root更新当前动画,需要根据frame的状态来决定是否是同步插入\n * 在异步时,因为动画本身是异步,需要addRefreshTask\n * 而如果此时frame在执行before过程中,说明帧动画本身是在before计算的,需要同步插入\n * @param style\n * @param keys 样式所有的key\n * @param __config\n * @param root\n * @param node\n */\nfunction genBeforeRefresh(style, keys, __config, root, node) {\n let res = {};\n res[UPDATE_NODE] = node;\n res[UPDATE_STYLE] = style;\n res[UPDATE_KEYS] = keys;\n res[UPDATE_CONFIG] = __config[I_NODE_CONFIG];\n root.__addUpdate(node, __config[I_NODE_CONFIG], root, __config[I_ROOT_CONFIG], res);\n __config[I_STYLE] = style;\n __config[I_ASSIGNING] = true;\n // frame每帧回调时,下方先执行计算好变更的样式,这里特殊插入一个hook,让root增加一个刷新操作\n // 多个动画调用因为相同root也只会插入一个,这样在所有动画执行完毕后frame里检查同步进行刷新,解决单异步问题\n root.__frameHook();\n}\n\n/**\n * 将每帧的样式格式化,提取出offset属性并转化为时间,提取出缓动曲线easing\n * @param style 关键帧样式\n * @param duration 动画时间长度\n * @param es options的easing曲线控制,frame没有自定义则使用全局的\n * @returns {{style: *, time: number, easing: *, transition: []}}\n */\nfunction framing(style, duration, es) {\n let { offset, easing } = style;\n // 这两个特殊值提出来存储不干扰style\n delete style.offset;\n delete style.easing;\n // translatePath特殊对待,ae的曲线运动动画\n let translatePath = style.translatePath;\n style = css.normalize(style);\n if(Array.isArray(translatePath) && [6, 8].indexOf(translatePath.length) > -1) {\n style[TRANSLATE_PATH] = translatePath.map(item => calUnit(item));\n }\n let res = [];\n res[FRAME_STYLE] = style;\n res[FRAME_TIME] = offset * duration;\n res[FRAME_EASING] = easing || es;\n res[FRAME_TRANSITION] = [];\n return res;\n}\n\nfunction calByUnit(p, n, container, root) {\n if(p[1] === PX) {\n if(n[1] === PERCENT) {\n return n[0] * 0.01 * container - p[0];\n }\n else if(n[1] === REM) {\n return n[0] * root.computedStyle[FONT_SIZE] - p[0];\n }\n else if(n[1] === VW) {\n return n[0] * root.width * 0.01 - p[0];\n }\n else if(n[1] === VH) {\n return n[0] * root.height * 0.01 - p[0];\n }\n else if(n[1] === VMAX) {\n return n[0] * Math.max(root.width, root.height) * 0.01 - p[0];\n }\n else if(n[1] === VMIN) {\n return n[0] * Math.min(root.width, root.height) * 0.01 - p[0];\n }\n }\n else if(p[1] === PERCENT) {\n if(n[1] === PX) {\n return n[0] * 100 / container - p[0];\n }\n else if(n[1] === REM) {\n return n[0] * root.computedStyle[FONT_SIZE] * 100 / container - p[0];\n }\n else if(n[1] === VW) {\n return n[0] * root.width / container - p[0];\n }\n else if(n[1] === VH) {\n return n[0] * root.height / container - p[0];\n }\n else if(n[1] === VMAX) {\n return n[0] * Math.max(root.width, root.height) / container - p[0];\n }\n else if(n[1] === VMIN) {\n return n[0] * Math.min(root.width, root.height) / container - p[0];\n }\n }\n else if(p[1] === REM) {\n if(n[1] === PX) {\n return n[0] / root.computedStyle[FONT_SIZE] - p[0];\n }\n else if(n[1] === PERCENT) {\n return n[0] * 0.01 * container / root.computedStyle[FONT_SIZE] - p[0];\n }\n else if(n[1] === VW) {\n return n[0] * root.width * 0.01 / root.computedStyle[FONT_SIZE] - p[0];\n }\n else if(n[1] === VH) {\n return n[0] * root.height * 0.01 / root.computedStyle[FONT_SIZE] - p[0];\n }\n else if(n[1] === VMAX) {\n return n[0] * Math.max(root.width, root.height) * 0.01 / root.computedStyle[FONT_SIZE] - p[0];\n }\n else if(n[1] === VMIN) {\n return n[0] * Math.min(root.width, root.height) * 0.01 / root.computedStyle[FONT_SIZE] - p[0];\n }\n }\n else if(p[1] === VW) {\n if(n[1] === PX) {\n return n[0] * 100 / root.width - p[0];\n }\n else if(n[1] === REM) {\n return n[0] * 100 * root.computedStyle[FONT_SIZE] / root.width - p[0];\n }\n else if(n[1] === PERCENT) {\n return n[0] * container / root.width - p[0];\n }\n else if(n[1] === VH) {\n return n[0] * root.height / root.width - p[0];\n }\n else if(n[1] === VMAX) {\n return n[0] * Math.max(root.width, root.height) / root.width - p[0];\n }\n else if(n[1] === VMIN) {\n return n[0] * Math.min(root.width, root.height) / root.width - p[0];\n }\n }\n else if(p[1] === VH) {\n if(n[1] === PX) {\n return n[0] * 100 / root.height - p[0];\n }\n else if(n[1] === REM) {\n return n[0] * 100 * root.computedStyle[FONT_SIZE] / root.height - p[0];\n }\n else if(n[1] === VW) {\n return n[0] * root.width / root.height - p[0];\n }\n else if(n[1] === PERCENT) {\n return n[0] * container / root.height - p[0];\n }\n else if(n[1] === VMAX) {\n return n[0] * Math.max(root.width, root.height) / root.height - p[0];\n }\n else if(n[1] === VMIN) {\n return n[0] * Math.min(root.width, root.height) / root.height - p[0];\n }\n }\n else if(p[1] === VMAX) {\n if(n[1] === PX) {\n return n[0] * 100 / Math.max(root.width, root.height) - p[0];\n }\n else if(n[1] === REM) {\n return n[0] * 100 * root.computedStyle[FONT_SIZE] / Math.max(root.width, root.height) - p[0];\n }\n else if(n[1] === PERCENT) {\n return n[0] * container / Math.max(root.width, root.height) - p[0];\n }\n else if(n[1] === VW) {\n return n[0] * root.width / Math.max(root.width, root.height) - p[0];\n }\n else if(n[1] === VH) {\n return n[0] * root.height / Math.max(root.width, root.height) - p[0];\n }\n else if(n[1] === VMIN) {\n return n[0] * Math.min(root.width, root.height) / Math.max(root.width, root.height) - p[0];\n }\n }\n else if(p[1] === VMIN) {\n if(n[1] === PX) {\n return n[0] * 100 / Math.min(root.width, root.height) - p[0];\n }\n else if(n[1] === REM) {\n return n[0] * 100 * root.computedStyle[FONT_SIZE] / Math.min(root.width, root.height) - p[0];\n }\n else if(n[1] === PERCENT) {\n return n[0] * container / Math.min(root.width, root.height) - p[0];\n }\n else if(n[1] === VW) {\n return n[0] * root.width / Math.min(root.width, root.height) - p[0];\n }\n else if(n[1] === VH) {\n return n[0] * root.height / Math.min(root.width, root.height) - p[0];\n }\n else if(n[1] === VMAX) {\n return n[0] * Math.max(root.width, root.height) / Math.min(root.width, root.height) - p[0];\n }\n }\n}\n\n/**\n * 计算两帧之间的差,单位不同的以后面为准,返回的v表示差值\n * 没有变化返回空\n * auto等无法比较的不参与计算,不返回来标识无过度效果\n * @param prev 上一帧样式\n * @param next 下一帧样式\n * @param k 比较的样式名\n * @param target dom对象\n * @param tagName dom名\n * @returns {{k: *, v: *}}\n */\nfunction calDiff(prev, next, k, target, tagName) {\n let res = [k];\n let p = prev[k];\n let n = next[k];\n if(k === TRANSFORM) {\n // transform因默认值null很特殊,不存在时需给默认矩阵\n if(!p && !n) {\n return;\n }\n let pm, nm;\n if(p) {\n pm = p[0][1];\n }\n else {\n pm = mx.identity();\n }\n if(n) {\n nm = n[0][1];\n }\n else {\n nm = mx.identity();\n }\n // transform特殊被初始化转成matrix矩阵,直接计算差值\n if(equalArr(pm, nm)) {\n return;\n }\n res[1] = [\n nm[0] - pm[0],\n nm[1] - pm[1],\n nm[2] - pm[2],\n nm[3] - pm[3],\n nm[4] - pm[4],\n nm[5] - pm[5],\n nm[6] - pm[6],\n nm[7] - pm[7],\n nm[8] - pm[8],\n nm[9] - pm[9],\n nm[10] - pm[10],\n nm[11] - pm[11],\n nm[12] - pm[12],\n nm[13] - pm[13],\n nm[14] - pm[14],\n nm[15] - pm[15],\n ];\n return res;\n }\n else if(k === ROTATE_3D) {\n if(equalArr(p, n)) {\n return;\n }\n res[1] = [n[0] - n[0], n[1] - p[1], n[2] - p[2], [n[3][0] - p[3][0], n[3][1]]];\n }\n else if(k === FILTER) {\n // filter很特殊,里面有多个滤镜,忽视顺序按hash计算,为空视为默认值,如blur默认0,brightness默认1\n let pHash = {}, nHash = {}, keyHash = {};\n if(p) {\n p.forEach(item => {\n keyHash[item[0]] = true;\n pHash[item[0]] = item[1];\n });\n }\n if(n) {\n n.forEach(item => {\n keyHash[item[0]] = true;\n nHash[item[0]] = item[1];\n })\n }\n let v = {}, hasChange;\n // 只有blur支持px/rem/vw/vh/vmax/vmin,其余都是特殊固定单位\n Object.keys(keyHash).forEach(k => {\n if(k === 'blur') {\n if(!pHash[k]) {\n v[k] = nHash[k].slice(0);\n hasChange = true;\n }\n else if(!nHash[k]) {\n v[k] = [-pHash[k][0], pHash[k][1]];\n hasChange = true;\n }\n else {\n let v2 = calByUnit(pHash[k], nHash[k], 0, target.root);\n v[k] = [v2, pHash[k][1]];\n hasChange = true;\n }\n }\n else if(k === 'hue-rotate') {\n let nv = isNil(nHash[k]) ? 0 : nHash[k][0];\n let pv = isNil(pHash[k]) ? 0 : pHash[k][0];\n if(pv !== nv) {\n v[k] = [nv - pv, PERCENT];\n hasChange = true;\n }\n }\n else if(k === 'saturate' || k === 'brightness' || k === 'contrast' || k === 'sepia' || k === 'invert') {\n let nv = isNil(nHash[k]) ? 100 : nHash[k][0];\n let pv = isNil(pHash[k]) ? 100 : pHash[k][0];\n if(pv !== nv) {\n v[k] = [nv - pv, PERCENT];\n hasChange = true;\n }\n }\n else if(k === 'grayscale') {\n let nv = isNil(nHash[k]) ? 0 : nHash[k][0];\n let pv = isNil(pHash[k]) ? 0 : pHash[k][0];\n if(pv !== nv) {\n v[k] = [nv - pv, PERCENT];\n hasChange = true;\n }\n }\n });\n if(!hasChange) {\n return;\n }\n res[1] = v;\n }\n else if(k === TRANSFORM_ORIGIN || k === PERSPECTIVE_ORIGIN) {\n res[1] = [];\n for(let i = 0; i < 2; i++) {\n let pi = p[i];\n let ni = n[i];\n if(pi[1] === ni[1]) {\n res[1].push(ni[0] - pi[0]);\n }\n else {\n let v = calByUnit(pi, ni, target[i ? 'outerHeight' : 'outerWidth'], target.root);\n res[1].push(v || 0);\n }\n }\n if(equalArr(res[1], [0, 0])) {\n return;\n }\n }\n else if(k === BACKGROUND_POSITION_X || k === BACKGROUND_POSITION_Y) {\n res[1] = [];\n let length = Math.min(p.length, n.length);\n for(let i = 0; i < length; i++) {\n let pi = p[i], ni = n[i];\n if(!pi || !ni) {\n res[1].push(null);\n continue;\n }\n if(pi[1] === ni[1]) {\n let v = ni[0] - pi[0];\n if(!v) {\n res[1].push(null);\n return;\n }\n res[1].push(v);\n }\n else {\n let k2 = k === BACKGROUND_POSITION_X ? 'offsetWidth' : 'offsetHeight';\n if(['padding-box', 'paddingBox'].indexOf(target.computedStyle[BACKGROUND_CLIP]) > -1) {\n k2 = k === BACKGROUND_POSITION_X ? 'clientWidth' : 'clientHeight';\n }\n else if(['content-box', 'contentBox'].indexOf(target.computedStyle[BACKGROUND_CLIP]) > -1) {\n k2 = k === BACKGROUND_POSITION_X ? 'width' : 'height';\n }\n let v = calByUnit(pi, ni, target[k2], target.root);\n if(!v) {\n res[1].push(null);\n return;\n }\n res[1].push(v);\n }\n }\n }\n else if(k === BOX_SHADOW) {\n res[1] = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let a = p[i];\n let b = n[i];\n let v = [];\n // x/y/blur/spread\n for(let j = 0; j < 4; j++) {\n v.push(b[j] - a[j]);\n }\n // rgba\n let c = [];\n for(let j = 0; j < 4; j++) {\n c.push(b[4][j] - a[4][j]);\n }\n v.push(c);\n res[1].push(v);\n }\n }\n else if(EXPAND_HASH.hasOwnProperty(k)) {\n if(p[1] === n[1]) {\n let v = n[0] - p[0];\n if(v === 0) {\n return;\n }\n res[1] = v;\n }\n else {\n let v = calByUnit(p, n, target[k === TRANSLATE_X || k === TRANSLATE_Z ? 'outerWidth' : 'outerHeight'], target.root);\n if(!v) {\n return;\n }\n res[1] = v;\n }\n }\n else if(k === BACKGROUND_SIZE) {\n res[1] = [];\n let length = Math.min(p.length, n.length);\n let has;\n for(let i = 0; i < length; i++) {\n let pi = p[i], ni = n[i];\n if(!pi || !ni) {\n res[1].push(null);\n continue;\n }\n let temp = [];\n for(let j = 0; j < 2; j++) {\n let pp = pi[j], nn = ni[j];\n if(pp[1] === nn[1]) {\n temp.push(nn[0] - pp[0]);\n }\n else {\n let k2 = i ? 'offsetWidth' : 'offsetHeight';\n if(['padding-box', 'paddingBox'].indexOf(target.computedStyle[BACKGROUND_CLIP]) > -1) {\n k2 = i ? 'clientWidth' : 'clientHeight';\n }\n else if(['content-box', 'contentBox'].indexOf(target.computedStyle[BACKGROUND_CLIP]) > -1) {\n k2 = i ? 'width' : 'height';\n }\n let v = calByUnit(pp, nn, target[k2], target.root);\n temp.push(v || 0);\n }\n }\n if(equalArr(temp, [0, 0])) {\n res[1].push(null);\n }\n else {\n res[1].push(temp);\n has = true;\n }\n }\n if(!has) {\n return;\n }\n }\n else if(GRADIENT_HASH.hasOwnProperty(k)) {\n // backgroundImage发生了渐变色和图片的变化,fill发生渐变色和纯色的变化等\n res[1] = [];\n let length = Math.min(p.length, n.length);\n for(let i = 0; i < length; i++) {\n let pi = p[i], ni = n[i];\n if(!pi || !ni || isString(pi) || isString(ni)) {\n res[1].push(null);\n continue;\n }\n if(pi.k !== ni.k) {\n res[1].push(null);\n continue;\n }\n let temp = [];\n // 渐变\n if(pi.k === 'linear' || pi.k === 'radial' || pi.k === 'conic') {\n let pv = pi.v;\n let nv = ni.v;\n temp[0] = [];\n let { clientWidth } = target;\n let eq = equalArr(pv, nv);\n for(let i = 0, len = Math.min(pv.length, nv.length); i < len; i++) {\n let a = pv[i];\n let b = nv[i];\n let t = [];\n t.push([\n b[0][0] - a[0][0],\n b[0][1] - a[0][1],\n b[0][2] - a[0][2],\n b[0][3] - a[0][3],\n ]);\n if(a[1] && b[1]) {\n if(a[1][1] === b[1][1]) {\n t.push(b[1][0] - a[1][0]);\n }\n else {\n let v = calByUnit(a[1], b[1], clientWidth, target.root);\n t.push(v || 0);\n }\n }\n temp[0].push(t);\n }\n // 线性渐变有角度差值变化\n if(pi.k === 'linear') {\n let isArrP = Array.isArray(pi.d);\n let isArrN = Array.isArray(ni.d);\n if(isArrN !== isArrP) {\n res[1].push(null);\n continue;\n }\n if(isArrP) {\n let v = [ni.d[0] - pi.d[0], ni.d[1] - pi.d[1], ni.d[2] - pi.d[2], ni.d[3] - pi.d[3]];\n if(eq && equalArr(v, [0, 0, 0, 0])) {\n res[1].push(null);\n continue;\n }\n temp[1] = v;\n }\n else {\n let v = ni.d - pi.d;\n if(eq && v === 0) {\n res[1].push(null);\n continue;\n }\n temp[1] = v;\n }\n }\n // 径向渐变的位置\n else if(pi.k === 'radial') {\n let isArrP = Array.isArray(pi.z);\n let isArrN = Array.isArray(ni.z);\n if(isArrN !== isArrP) {\n res[1].push(null);\n continue;\n }\n if(isArrP) {\n temp[2] = [];\n for(let i = 0; i < 5; i++) {\n let pz = pi.z[i];\n // 半径比例省略为1\n if(pz === undefined) {\n pz = 1;\n }\n let nz = ni.z[i];\n if(nz === undefined) {\n nz = 1;\n }\n temp[2].push(nz - pz);\n }\n if(eq && equalArr(res[4], [0, 0, 0, 0, 0])) {\n res[1].push(null);\n }\n }\n else {\n temp[2] = [];\n for(let i = 0; i < 2; i++) {\n let pp = pi.p[i];\n let np = ni.p[i];\n if(pp[1] === np[1]) {\n temp[2].push(np[0] - pp[0]);\n }\n else {\n let v = calByUnit(pp, np, target[i ? 'clientWidth' : 'clientHeight'], target.root);\n temp[2].push(v || 0);\n }\n }\n if(eq && equalArr(res[3], [0, 0])) {\n res[1].push(null);\n }\n }\n }\n else if(pi.k === 'conic') {\n temp[1].push(n.d - p.d);\n temp[2] = [];\n for(let i = 0; i < 2; i++) {\n let pp = p.p[i];\n let np = n.p[i];\n if(pp[1] === np[1]) {\n temp[2].push(np[0] - pp[0]);\n }\n else {\n let v = calByUnit(pp, np, target[i ? 'clientWidth' : 'clientHeight'], target.root);\n temp[2].push(v || 0);\n }\n }\n if(eq && res[2] !== 0 && equalArr(res[3], [0, 0])) {\n res[1].push(null);\n }\n }\n }\n // 纯色\n else {\n if(equalArr(n, pi)) {\n res[1].push(null);\n }\n temp[0] = [\n ni[0] - pi[0],\n ni[1] - pi[1],\n ni[2] - pi[2],\n ni[3] - pi[3]\n ];\n }\n res[1].push(temp);\n }\n }\n else if(COLOR_HASH.hasOwnProperty(k)) {\n n = n[0];\n p = p[0];\n if(equalArr(n, p) || n[3] === 0 && p[3] === 0) {\n return;\n }\n res[1] = [\n n[0] - p[0],\n n[1] - p[1],\n n[2] - p[2],\n n[3] - p[3]\n ];\n }\n else if(RADIUS_HASH.hasOwnProperty(k)) {\n // x/y都相等无需\n if(n[0][0] === p[0][0] && n[0][1] === p[0][1]\n && n[1][0] === p[1][0] && n[1][1] === p[1][1]) {\n return;\n }\n res[1] = [];\n for(let i = 0; i < 2; i++) {\n if(n[i][1] === p[i][1]) {\n res[1].push(n[i][0] - p[i][0]);\n }\n else {\n let v = calByUnit(p[i], n[i], target[i ? 'outerHeight' : 'outerWidth'], target.root);\n res[1].push(v || 0);\n }\n }\n }\n else if(LENGTH_HASH.hasOwnProperty(k)) {\n // auto不做动画\n if(p[1] === AUTO || n[1] === AUTO) {\n return;\n }\n let computedStyle = target.computedStyle;\n let parentComputedStyle = (target.domParent || target).computedStyle;\n let diff = 0;\n if(p[1] === n[1]) {\n diff = n[0] - p[0];\n }\n // lineHeight奇怪的单位变化,%相对于fontSize\n else if(k === LINE_HEIGHT) {\n diff = calByUnit(p, n, computedStyle[FONT_SIZE], target.root);\n }\n // fontSize的%相对于parent的\n else if(k === FONT_SIZE) {\n diff = calByUnit(p, n, parentComputedStyle[FONT_SIZE], target.root);\n }\n // 相对于父height的特殊属性\n else if(k === FLEX_BASIS\n && ['column', 'column-reverse', 'columnReverse'].indexOf(computedStyle[FLEX_DIRECTION]) > -1\n || [HEIGHT, TOP, BOTTOM].indexOf(k) > -1) {\n if(p[1] !== AUTO && n[1] !== AUTO) {\n diff = calByUnit(p, n, parentComputedStyle[HEIGHT], target.root);\n }\n }\n // 其余都是相对于父width的\n else {\n if(p[1] !== AUTO && n[1] !== AUTO) {\n diff = calByUnit(p, n, parentComputedStyle[WIDTH], target.root);\n }\n }\n // 兜底NaN非法\n if(diff === 0 || isNaN(diff)) {\n return;\n }\n res[1] = diff;\n }\n else if(GEOM.hasOwnProperty(k)) {\n if(isNil(p)) {\n return;\n }\n else if(GEOM[k][tagName] && isFunction(GEOM[k][tagName].calDiff)) {\n let fn = GEOM[k][tagName].calDiff;\n if(target.isMulti) {\n let arr = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n arr.push(fn(p[i], n[i]));\n }\n return arr;\n }\n else {\n res[1] = fn(p, n);\n }\n }\n // 特殊处理multi\n else if(target.isMulti) {\n if(k === 'points' || k === 'controls') {\n if(isNil(n) || !n.length || isNil(p) || !p.length || equalArr(p, n)) {\n return;\n }\n res[1] = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let pv = p[i];\n let nv = n[i];\n if(isNil(pv) || !pv.length || isNil(nv) || !nv.length) {\n res[1].push(null);\n }\n else {\n let v2 = [];\n for(let j = 0, len2 = Math.min(pv.length, nv.length); j < len2; j++) {\n let pv2 = pv[j];\n let nv2 = nv[j];\n if(isNil(pv2) || isNil(nv2)) {\n v2.push(null);\n }\n else {\n let v3 = [];\n for(let k = 0, len3 = Math.max(pv2.length, nv2.length); k < len3; k++) {\n let pv3 = pv2[k];\n let nv3 = nv2[k];\n // control由4点变2点\n if(isNil(pv3) || isNil(nv3)) {\n v3.push(0);\n }\n else {\n v3.push(nv3 - pv3);\n }\n }\n v2.push(v3);\n }\n }\n res[1].push(v2);\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n if(isNil(n) || !n.length || isNil(p) || !p.length || equalArr(p, n)) {\n return;\n }\n res[1] = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let pv = p[i];\n let nv = n[i];\n if(isNil(pv) || !pv.length || isNil(nv) || !nv.length) {\n res[1].push(null);\n }\n else {\n res[1].push([\n nv[0] - pv[0],\n nv[1] - pv[1],\n ]);\n }\n }\n }\n else {\n if(n === p || equalArr(n, p) || k === 'edge' || k === 'closure' || k === 'booleanOperations') {\n return;\n }\n let v = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let pv = p[i];\n let nv = n[i];\n if(isNil(pv) || isNil(nv)) {\n v.push(0);\n }\n v.push(nv - pv);\n }\n res[1] = v;\n }\n }\n // 非multi特殊处理这几类数组类型数据\n else if(k === 'points' || k === 'controls') {\n if(isNil(n) || !n.length || isNil(p) || !p.length || equalArr(p, n)) {\n return;\n }\n res[1] = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let pv = p[i];\n let nv = n[i];\n if(isNil(pv) || !pv.length || isNil(nv) || !nv.length) {\n res[1].push(null);\n }\n else {\n let v2 = [];\n for(let j = 0, len2 = Math.max(pv.length, nv.length); j < len2; j++) {\n let pv2 = pv[j];\n let nv2 = nv[j];\n // control由4点变2点\n if(isNil(pv2) || isNil(nv2)) {\n v2.push(0);\n }\n else {\n v2.push(nv2 - pv2);\n }\n }\n res[1].push(v2);\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n if(isNil(n) || !n.length || isNil(p) || !p.length || equalArr(p, n)) {\n return;\n }\n res[1] = [\n n[0] - p[0],\n n[1] - p[1],\n ];\n }\n // 其它简单数据,除了edge/closure/booleanOperations没有增量\n else {\n if(n === p || k === 'edge' || k === 'closure' || k === 'booleanOperations') {\n return;\n }\n else {\n res[1] = n - p;\n }\n }\n }\n else if(k === OPACITY || k === Z_INDEX) {\n if(n === p) {\n return;\n }\n res[1] = n - p;\n }\n // 特殊的path,不存在style中但在动画某帧中,不会统一化所以可能反向计算frameR时后一帧没有\n else if(k === TRANSLATE_PATH && p) {\n let k1 = 'offsetWidth', k2 = 'offsetHeight';\n if(['padding-box', 'paddingBox'].indexOf(target.computedStyle[BACKGROUND_CLIP]) > -1) {\n k1 = 'clientWidth';\n k2 = 'clientHeight';\n }\n else if(['content-box', 'contentBox'].indexOf(target.computedStyle[BACKGROUND_CLIP]) > -1) {\n k1 = 'width';\n k2 = 'height';\n }\n res[1] = p.map((item, i) => {\n let [v, u] = item;\n if(u === PERCENT) {\n if(i % 2 === 0) {\n return [(parseFloat(v) || 0) * 0.01 * target[k1], PX];\n }\n else {\n return [(parseFloat(v) || 0) * 0.01 * target[k2], PX];\n }\n }\n else if(u === REM) {\n return [(parseFloat(v) || 0) * root.computedStyle[FONT_SIZE] * 100, PX];\n }\n else if(u === VW) {\n return [(parseFloat(v) || 0) * 0.01 * root.width, PX];\n }\n else if(u === VH) {\n return [(parseFloat(v) || 0) * 0.01 * root.height, PX];\n }\n else if(u === VMAX) {\n return [(parseFloat(v) || 0) * 0.01 * Math.max(root.width, root.height), PX];\n }\n else if(u === VMIN) {\n return [(parseFloat(v) || 0) * 0.01 * Math.min(root.width, root.height), PX];\n }\n else {\n return [parseFloat(v) || 0, PX];\n }\n });\n }\n // display等不能有增量过程的\n else {\n return;\n }\n return res;\n}\n\n// 计算两帧之间不相同的变化,存入transition,相同的忽略\nfunction calFrame(prev, next, keys, target, tagName) {\n keys.forEach(k => {\n let ts = calDiff(prev[FRAME_STYLE], next[FRAME_STYLE], k, target, tagName);\n // 可以形成过渡的才会产生结果返回\n if(ts) {\n prev[FRAME_TRANSITION].push(ts);\n }\n });\n return next;\n}\n\nfunction binarySearch(i, j, time, frames) {\n if(i === j) {\n let frame = frames[i];\n if(frame[FRAME_TIME] > time) {\n return i - 1;\n }\n return i;\n }\n else {\n let middle = i + ((j - i) >> 1);\n let frame = frames[middle];\n if(frame[FRAME_TIME] === time) {\n return middle;\n }\n else if(frame[FRAME_TIME] > time) {\n return binarySearch(i, Math.max(middle - 1, i), time, frames);\n }\n else {\n return binarySearch(Math.min(middle + 1, j), j, time, frames);\n }\n }\n}\n\nfunction getEasing(ea) {\n let timingFunction;\n if(ea) {\n if((timingFunction = /^\\s*steps\\s*\\(\\s*(\\d+)(?:\\s*,\\s*(\\w+))?\\s*\\)/i.exec(ea))) {\n let steps = parseInt(timingFunction[1]);\n let stepsD = timingFunction[2];\n timingFunction = function(percent) {\n // steps有效定义正整数\n if(steps && steps > 0) {\n let per = 1 / steps;\n let n = stepsD === 'start' ? Math.ceil(percent / per) : Math.floor(percent / per);\n return n / steps;\n }\n return percent;\n };\n }\n else {\n timingFunction = easing.getEasing(ea);\n }\n }\n return timingFunction;\n}\n\n/**\n * 根据百分比和缓动函数计算中间态样式\n * 当easing定义为steps时,优先计算\n * @param frame 当前帧\n * @param keys 所有样式key\n * @param percent 到下一帧时间的百分比\n * @param target vd\n * @returns {*}\n */\nfunction calIntermediateStyle(frame, keys, percent, target) {\n let style = cloneStyle(frame[FRAME_STYLE], keys);\n let timingFunction = getEasing(frame[FRAME_EASING]);\n if(timingFunction && timingFunction !== linear) {\n percent = timingFunction(percent);\n }\n let transition = frame[FRAME_TRANSITION];\n for(let i = 0, len = transition.length; i < len; i++) {\n let [k, v] = transition[i];\n let st = style[k];\n // transform特殊处理,只有1个matrix,有可能不存在,需给默认矩阵\n if(k === TRANSFORM) {\n if(!st) {\n st = style[k] = [[MATRIX, mx.identity()]];\n }\n for(let i = 0; i < 16; i++) {\n st[0][1][i] += v[i] * percent;\n }\n }\n // 特殊的曲线运动计算,转换为translateXY,出现在最后一定会覆盖原本的translate防重\n else if(k === TRANSLATE_PATH) {\n let t = 1 - percent;\n if(v.length === 8) {\n style[TRANSLATE_X] = [\n v[0][0] * t * t * t\n + 3 * v[2][0] * percent * t * t\n + 3 * v[4][0] * percent * percent * t\n + v[6][0] * percent * percent * percent,\n PX,\n ];\n style[TRANSLATE_Y] = [\n v[1][0] * t * t * t\n + 3 * v[3][0] * percent * t * t\n + 3 * v[5][0] * percent * percent * t\n + v[7][0] * percent * percent * percent,\n PX,\n ];\n }\n else if(v.length === 6) {\n style[TRANSLATE_X] = [\n v[0][0] * t * t\n + 2 * v[2][0] * percent * t\n + v[4][0] * percent * percent,\n PX,\n ];\n style[TRANSLATE_Y] = [\n v[1][0] * t * t\n + 3 * v[3][0] * percent * t\n + v[5][0] * percent * percent,\n PX,\n ];\n }\n }\n else if(k === ROTATE_3D) {\n st[0] += v[0] * percent;\n st[1] += v[1] * percent;\n st[2] += v[2] * percent;\n st[3][0] += v[3][0] * percent;\n }\n else if(NUM_CAL_HASH.hasOwnProperty(k)) {\n if(v) {\n st[0] += v * percent;\n }\n }\n else if(k === FILTER) {\n // 只有1个样式声明了filter另外一个为空,会造成无样式,需初始化数组并在下面计算出样式存入\n if(!st) {\n st = style[k] = [];\n }\n // 将已有的样式按key存入引用来操作\n let hash = {};\n st.forEach(item => {\n hash[item[0]] = item[1];\n });\n Object.keys(v).forEach(k => {\n if(hash.hasOwnProperty(k)) {\n hash[k][0] += v[k][0] * percent;\n }\n else {\n // 2个关键帧中有1个未声明,需新建样式存入\n if(k === 'blur' || k === 'hue-rotate' || k === 'grayscale') {\n let n = v[k].slice(0);\n n[0] *= percent;\n st.push([k, n]);\n }\n // 默认值是1而非0\n else if(k === 'saturate' || k === 'brightness' || k === 'contrast' || k === 'sepia' || k === 'invert') {\n let n = v[k].slice(0);\n n[0] = 100 + n[0] * percent;\n st.push([k, n]);\n }\n }\n });\n }\n else if(RADIUS_HASH.hasOwnProperty(k)) {\n for(let i = 0; i < 2; i++) {\n st[i][0] += v[i] * percent;\n }\n }\n else if(k === TRANSFORM_ORIGIN || k === PERSPECTIVE_ORIGIN) {\n if(v[0] !== 0) {\n st[0][0] += v[0] * percent;\n }\n if(v[1] !== 0) {\n st[1][0] += v[1] * percent;\n }\n }\n else if(k === BOX_SHADOW) {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n // x/y/blur/spread\n for(let j = 0; j < 4; j++) {\n st[i][j] += v[i][j] * percent;\n }\n // rgba\n for(let j = 0; j < 4; j++) {\n st[i][4][j] += v[i][4][j] * percent;\n }\n }\n }\n else if(k === BACKGROUND_SIZE) {\n st.forEach((item, i) => {\n if(v[i]) {\n item[0][0] += v[i][0] * percent;\n item[1][0] += v[i][1] * percent;\n }\n });\n }\n else if(k === BACKGROUND_POSITION_X || k === BACKGROUND_POSITION_Y) {\n st.forEach((item, i) => {\n if(v[i]) {\n item[0] += v[i] * percent;\n }\n });\n }\n else if(GRADIENT_HASH.hasOwnProperty(k)) {\n st.forEach((st2, i) => {\n let v2 = v[i];\n if(!v2) {\n return;\n }\n let [c, d, p, z] = v2;\n if(GRADIENT_TYPE.hasOwnProperty(st2.k)) {\n for(let i = 0, len = Math.min(st2.v.length, c.length); i < len; i++) {\n let a = st2.v[i];\n let b = c[i];\n a[0][0] += b[0][0] * percent;\n a[0][1] += b[0][1] * percent;\n a[0][2] += b[0][2] * percent;\n a[0][3] += b[0][3] * percent;\n if(a[1] && b[1]) {\n a[1][0] += b[1] * percent;\n }\n }\n if(st2.k === 'linear' && st2.d !== undefined && d !== undefined) {\n if(Array.isArray(d)) {\n st2.d[0] += d[0] * percent;\n st2.d[1] += d[1] * percent;\n st2.d[2] += d[2] * percent;\n st2.d[3] += d[3] * percent;\n }\n else {\n st2.d += d * percent;\n }\n }\n if(st2.k === 'radial') {\n if(st2.z !== undefined && z !== undefined) {\n st2.z[0] += z[0] * percent;\n st2.z[1] += z[1] * percent;\n st2.z[2] += z[2] * percent;\n st2.z[3] += z[3] * percent;\n st2.z[4] += z[4] * percent;\n }\n else if(st2.p !== undefined && p !== undefined) {\n st2.p[0][0] += p[0] * percent;\n st2.p[1][0] += p[1] * percent;\n }\n }\n else if(st2.k === 'conic' && st2.d !== undefined && d !== undefined) {\n st2.d += d * percent;\n st2.p[0][0] += p[0] * percent;\n st2.p[1][0] += p[1] * percent;\n }\n }\n // fill纯色\n else {\n st2[0] += c[0] * percent;\n st2[1] += c[1] * percent;\n st2[2] += c[2] * percent;\n st2[3] += c[3] * percent;\n }\n });\n }\n // color可能超限[0,255],但浏览器已经做了限制,无需关心\n else if(COLOR_HASH.hasOwnProperty(k)) {\n st = st[0];\n st[0] += v[0] * percent;\n st[1] += v[1] * percent;\n st[2] += v[2] * percent;\n st[3] += v[3] * percent;\n }\n else if(GEOM.hasOwnProperty(k)) {\n let st = style[k];\n let tagName = target.tagName;\n if(GEOM[k][tagName] && isFunction(GEOM[k][tagName].calIncrease)) {\n let fn = GEOM[k][tagName].calIncrease;\n if(target.isMulti) {\n style[k] = st.map((item, i) => {\n return fn(item, v[i], percent);\n });\n }\n else {\n style[k] = fn(st, v, percent);\n }\n }\n else if(target.isMulti) {\n if(k === 'points' || k === 'controls') {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n let o = st[i];\n let n = v[i];\n if(!isNil(o) && !isNil(n)) {\n for(let j = 0, len2 = Math.min(o.length, n.length); j < len2; j++) {\n let o2 = o[j];\n let n2 = n[j];\n if(!isNil(o2) && !isNil(n2)) {\n for(let k = 0, len3 = Math.min(o2.length, n2.length); k < len3; k++) {\n if(!isNil(o2[k]) && !isNil(n2[k])) {\n o2[k] += n2[k] * percent;\n }\n }\n }\n }\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n v.forEach((item, i) => {\n let st2 = st[i];\n if(!isNil(item) && !isNil(st2)) {\n for(let i = 0, len = Math.min(st2.length, item.length); i < len; i++) {\n let o = st2[i];\n let n = item[i];\n if(!isNil(o) && !isNil(n)) {\n st2[i] += n * percent;\n }\n }\n }\n });\n }\n else {\n v.forEach((item, i) => {\n if(!isNil(item) && !isNil(st[i])) {\n st[i] += item * percent;\n }\n });\n }\n }\n else {\n if(k === 'points' || k === 'controls') {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n let o = st[i];\n let n = v[i];\n if(!isNil(o) && !isNil(n)) {\n for(let j = 0, len2 = Math.min(o.length, n.length); j < len2; j++) {\n if(!isNil(o[j]) && !isNil(n[j])) {\n o[j] += n[j] * percent;\n }\n }\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n if(!isNil(st[0]) && !isNil(v[0])) {\n st[0] += v[0] * percent;\n }\n if(!isNil(st[1]) && !isNil(v[1])) {\n st[1] += v[1] * percent;\n }\n }\n else {\n if(!isNil(st) && !isNil(v)) {\n style[k] += v * percent;\n }\n }\n }\n }\n else if(k === OPACITY || k === Z_INDEX) {\n style[k] += v * percent;\n // 精度问题可能会超过[0,1]区间\n if(k === OPACITY) {\n if(style[k] < 0) {\n style[k] = 0;\n }\n else if(style[k] > 1) {\n style[k] = 1;\n }\n }\n }\n }\n return style;\n}\n\nfunction gotoOverload(options, cb) {\n if(isFunction(options)) {\n cb = options;\n options = {};\n }\n return [options || {}, cb];\n}\n\nfunction calDiffTime(__config, diff) {\n let playbackRate = __config[I_PLAYBACK_RATE];\n let spfLimit = __config[I_SPF_LIMIT];\n let fps = __config[I_FPS];\n let v = __config[I_CURRENT_TIME] = __config[I_NEXT_TIME];\n // 定帧限制每帧时间间隔最大为spf\n if(spfLimit) {\n if(spfLimit === true) {\n diff = Math.min(diff, 1000 / fps);\n }\n else if(spfLimit > 0) {\n diff = Math.min(diff, spfLimit);\n }\n }\n // 播放时间累加,并且考虑播放速度加成\n if(playbackRate !== 1 && playbackRate > 0) {\n diff *= playbackRate;\n }\n __config[I_NEXT_TIME] += diff;\n return [v, diff];\n}\n\nfunction frameCb(self, __config, diff, isDelay) {\n self.emit(Event.FRAME, diff, isDelay);\n if(__config[I_FIRST_PLAY]) {\n __config[I_FIRST_PLAY] = false;\n self.emit(Event.PLAY);\n }\n let cb = __config[I_PLAY_CB];\n if(isFunction(cb)) {\n cb.call(self, diff, isDelay);\n // 清理要检查,gotoAndStop()这种cb回调中直接再次调用goto的话cb会不一致不能删除\n if(__config[I_PLAY_CB] === cb) {\n __config[I_PLAY_CB] = null;\n }\n }\n}\n\nlet uuid = 0;\n\nclass Animation extends Event {\n constructor(target, list, options) {\n super();\n this.__id = uuid++;\n list = clone(list || []);\n if(Array.isArray(list)) {\n list = list.filter(item => item && isObject(item));\n }\n // 动画过程另外一种形式,object描述k-v形式\n else if(list && isObject(list)) {\n let nl = [];\n Object.keys(list).forEach(k => {\n let v = list[k];\n if(Array.isArray(v)) {\n for(let i = 0, len = v.length; i < len; i++) {\n let o = nl[i] = nl[i] || {\n offset: i / (len - 1),\n };\n o[k] = v[i];\n }\n }\n });\n list = nl;\n }\n else {\n list = [];\n }\n if(isNumber(options)) {\n this.__options = {\n duration: options,\n };\n options = this.__options;\n }\n let op = this.__options = options || {\n duration: 0,\n };\n let root = target.root;\n let config = this.__config = [\n false, // assigning\n false, // inFps\n false, // isDelay\n false, // begin\n false, // end\n false, // finished\n false, // nextBegin\n true, // firstPlay\n null, // playCb\n target,\n root,\n null, // frames\n null, // framesR\n 0, // currentTime\n 0, // nextTime\n {}, // style\n 0, // duration\n 1, // iterations\n 'none', // fill\n 1, // playbackRate\n 0, // playCount\n 'idle',\n false, // destroy\n 0, // startTime\n 0, // fpsTime\n op.easing,\n false, // enterFrame\n 0, // delay\n 0, // endDelay\n null, // keys,\n null, // originStyle,\n null, // currentFrames\n null, // currentFrame\n false, // spfLimit\n 60, // fps\n 'normal', // direction\n true, // firstEnter,\n false, // stayBegin\n false, // stayEnd\n false, // is2\n 0, // endTime\n target.__config, // nodeConfig\n root && root.__config, // rootConfig,destroy后root可能为空\n false, // outBeginDelay\n ];\n let iterations = this.iterations = op.iterations;\n let duration = this.duration = op.duration;\n let [frames, framesR, keys, originStyle] = this.__init(list, iterations, duration, op.easing, target);\n config[I_FRAMES] = frames;\n config[I_FRAMES_R] = framesR;\n config[I_KEYS] = keys;\n config[I_ORIGIN_STYLE] = originStyle;\n if(frames.length === 2) {\n config[I_IS2] = true;\n config[I_END_TIME] = frames[1][FRAME_TIME];\n }\n let fps = parseInt(op.fps) || 0;\n if(fps <= 0) {\n fps = 60;\n }\n this.fps = fps;\n this.spfLimit = op.spfLimit;\n this.delay = op.delay;\n this.endDelay = op.endDelay;\n this.playbackRate = op.playbackRate;\n this.fill = op.fill;\n this.iterations = op.iterations;\n this.direction = op.direction;\n config[I_CURRENT_FRAMES] = {\n reverse: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(op.direction) ? framesR : frames;\n // 时间戳\n config[I_TIME_STAMP] = frame.__now;\n // 性能优化访问\n this[0] = this.__before;\n this[1] = this.__after;\n }\n\n __init(list, iterations, duration, easing, target) {\n if(list.length < 1) {\n return [[], [], [], {}];\n }\n // 过滤时间非法的,过滤后续offset<=前面的\n let offset = -1;\n let tagName = target.tagName;\n for(let i = 0, len = list.length; i < len; i++) {\n let current = list[i];\n if(current.hasOwnProperty('offset')) {\n current.offset = parseFloat(current.offset) || 0;\n current.offset = Math.max(0, current.offset);\n current.offset = Math.min(1, current.offset);\n // 超过区间[0,1]\n if(isNaN(current.offset) || current.offset < 0 || current.offset > 1) {\n list.splice(i, 1);\n i--;\n len--;\n continue;\n }\n // <=前面的\n else if(current.offset <= offset) {\n list.splice(i, 1);\n i--;\n len--;\n continue;\n }\n }\n // 缩写处理\n Object.keys(current).forEach(k => {\n if(abbr.hasOwnProperty(k)) {\n abbr.toFull(current, k);\n }\n });\n // 检查key合法性\n Object.keys(current).forEach(k => {\n if(k !== 'easing' && k !== 'offset' && !change.isValid(tagName, k)) {\n delete current[k];\n }\n });\n }\n // 只有1帧复制出来变成2帧方便运行\n if(list.length === 1) {\n list[0] = clone(list[0]);\n if(list[0].offset === 1) {\n list.unshift({\n offset: 0,\n });\n }\n else {\n let copy = clone(list[0]);\n copy.offset = 1;\n list.push(copy);\n }\n }\n // 强制clone防止同引用\n else {\n list.forEach((item, i) => {\n list[i] = clone(item);\n });\n }\n // 首尾时间偏移强制为[0, 1],不是的话前后加空帧\n let first = list[0];\n if(first.hasOwnProperty('offset') && first.offset > 0) {\n first = {\n offset: 0,\n };\n list.unshift(first);\n }\n else {\n first.offset = 0;\n }\n let last = list[list.length - 1];\n if(last.hasOwnProperty('offset') && last.offset < 1) {\n last = {\n offset: 1,\n };\n list.push(last);\n }\n else {\n last.offset = 1;\n }\n // 计算没有设置offset的时间\n for(let i = 1, len = list.length; i < len; i++) {\n let start = list[i];\n // 从i=1开始offset一定>0,找到下一个有offset的,均分中间无声明的\n if(!start.hasOwnProperty('offset')) {\n let end;\n let j = i + 1;\n for(; j < len; j++) {\n end = list[j];\n if(end.hasOwnProperty('offset')) {\n break;\n }\n }\n let num = j - i + 1;\n start = list[i - 1];\n let per = (end.offset - start.offset) / num;\n for(let k = i; k < j; k++) {\n let item = list[k];\n item.offset = start.offset + per * (k + 1 - i);\n }\n i = j;\n }\n }\n let frames = [];\n // 换算每一关键帧样式标准化\n list.forEach(item => {\n frames.push(framing(item, duration, easing));\n });\n // 为方便两帧之间计算变化,强制统一所有帧的css属性相同,没有写的为节点的当前样式currentStyle\n let keys = unify(frames, target);\n inherit(frames, keys, target);\n let framesR = clone(frames).reverse();\n // 存储原本样式以便恢复用\n let { style, props } = target;\n let originStyle = {};\n keys.forEach(k => {\n if(isGeom(tagName, k)) {\n originStyle[k] = props[k];\n }\n originStyle[k] = style[k];\n });\n // 再计算两帧之间的变化,存入transition属性\n let length = frames.length;\n let prev = frames[0];\n for(let i = 1; i < length; i++) {\n let next = frames[i];\n prev = calFrame(prev, next, keys, target, tagName);\n }\n // 反向存储帧的倒排结果\n framesR.forEach(item => {\n item[FRAME_TIME] = duration - item[FRAME_TIME];\n item[FRAME_TRANSITION] = [];\n });\n prev = framesR[0];\n for(let i = 1; i < length; i++) {\n let next = framesR[i];\n prev = calFrame(prev, next, keys, target, tagName);\n }\n return [frames, framesR, keys, originStyle];\n }\n\n __clean(isFinish) {\n let __config = this.__config;\n this.__cancelTask();\n __config[I_NEXT_TIME] = 0;\n let restore;\n let style = __config[I_STYLE];\n let keys = __config[I_KEYS];\n let target = __config[I_TARGET];\n if(isFinish) {\n // gotoAndStop到一个很大的时间的话,也需要防止超过\n __config[I_CURRENT_TIME] = __config[I_DELAY] + __config[I_DURATION] * __config[I_ITERATIONS] + __config[I_END_DELAY];\n if(__config[I_PLAY_STATE] === 'finish') {\n return;\n }\n __config[I_PLAY_STATE] = 'finish';\n // cancel需要清除finish根据情况保留\n if(!__config[I_STAY_END]) {\n __config[I_STYLE] = {};\n restore = true;\n }\n }\n else {\n __config[I_PLAY_COUNT] = __config[I_CURRENT_TIME] = 0;\n if(__config[I_PLAY_STATE] === 'idle') {\n return;\n }\n __config[I_PLAY_STATE] = 'idle';\n __config[I_STYLE] = {};\n restore = true;\n }\n // 动画取消结束不停留在最后一帧需要还原target原本的样式,需要对比目前是否是由本动画赋值的\n if(restore) {\n keys.forEach(k => {\n if(GEOM.hasOwnProperty(k)) {\n if(target.__currentProps[k] === style[k]) {\n target.__currentProps[k] = target.props[k];\n }\n }\n else {\n if(target.__currentStyle[k] === style[k]) {\n target.__currentStyle[k] = target.style[k];\n }\n }\n });\n }\n }\n\n play(cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n let frames = __config[I_FRAMES];\n if(isDestroyed || duration <= 0 || frames.length < 1) {\n return this;\n }\n if(playState === 'running') {\n return this;\n }\n this.__cancelTask();\n __config[I_PLAY_CB] = cb;\n __config[I_PLAY_STATE] = 'running';\n // 每次play调用标识第一次运行,需响应play事件和回调\n __config[I_FIRST_PLAY] = true;\n // 防止finish/cancel事件重复触发,每次播放重置\n this.__hasFin = false;\n this.__hasCancel = false;\n // 只有第一次调用会进初始化,另外finish/cancel视为销毁也会重新初始化\n if(!__config[I_ENTER_FRAME]) {\n __config[I_ENTER_FRAME] = true;\n let framesR = __config[I_FRAMES_R];\n let direction = __config[I_DIRECTION];\n // 初始化根据方向确定帧序列\n __config[I_CURRENT_FRAMES] = {\n reverse: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(direction) ? framesR : frames;\n __config[I_CURRENT_TIME] = __config[I_NEXT_TIME] = __config[I_FPS_TIME] = 0;\n }\n // 添加每帧回调且立刻执行,本次执行调用refreshTask也是下一帧再渲染,frame的每帧都是下一帧\n // frame.offFrame(this);\n frame.onFrame(this);\n __config[I_START_TIME] = frame.__now;\n __config[I_END] = false;\n return this;\n }\n\n __before(diff) {\n let __config = this.__config;\n __config[I_TIME_STAMP] = frame.__now;\n let target = __config[I_TARGET];\n let fps = __config[I_FPS];\n let playCount = 0;\n let currentFrames = __config[I_CURRENT_FRAMES];\n let iterations = __config[I_ITERATIONS];\n let stayBegin = __config[I_STAY_BEGIN];\n let stayEnd = __config[I_STAY_END];\n let delay = __config[I_DELAY];\n let root = __config[I_ROOT];\n let is2 = __config[I_IS2];\n let endTime = __config[I_END_TIME];\n let duration = __config[I_DURATION];\n let endDelay = __config[I_END_DELAY];\n let length = currentFrames.length;\n // 用本帧和上帧时间差,计算累加运行时间currentTime,以便定位当前应该处于哪个时刻\n let [currentTime, d] = calDiffTime(__config, diff);\n diff = d;\n // 增加的fps功能,当<60时计算跳帧,每帧运行依旧累加时间,达到fps时重置,第一帧强制不跳\n if(!__config[I_FIRST_ENTER] && fps < 60) {\n diff = __config[I_FPS_TIME] += diff;\n if(diff < 1000 / fps) {\n __config[I_IN_FPS] = true;\n return;\n }\n __config[I_FPS_TIME] = 0;\n }\n __config[I_FIRST_ENTER] = false;\n // delay仅第一次生效等待\n if(currentTime < delay) {\n if(stayBegin) {\n let currentFrame = __config[I_CURRENT_FRAME] = currentFrames[0];\n let current = currentFrame[FRAME_STYLE];\n genBeforeRefresh(current, __config[I_KEYS], __config, root, target);\n }\n // 即便不刷新,依旧执行帧回调,同时标明让后续第一帧响应begin\n __config[I_OUT_BEGIN_DELAY] = true;\n __config[I_IS_DELAY] = true;\n return;\n }\n // 减去delay,计算在哪一帧\n currentTime -= delay;\n if(currentTime === 0 || __config[I_OUT_BEGIN_DELAY]) {\n __config[I_OUT_BEGIN_DELAY] = false;\n __config[I_BEGIN] = true;\n }\n // 超过duration非尾轮需处理回到开头,触发新一轮动画事件,这里可能时间间隔非常大直接跳过几轮\n let round;\n while(currentTime >= duration && playCount < iterations - 1) {\n currentTime -= duration;\n playCount++;\n }\n if(__config[I_PLAY_COUNT] < playCount) {\n __config[I_BEGIN] = true;\n round = true;\n }\n __config[I_PLAY_COUNT] = playCount;\n // 如果发生轮换,需重新确定正反向\n if(round) {\n let direction = __config[I_DIRECTION];\n let frames = __config[I_FRAMES];\n let framesR = __config[I_FRAMES_R];\n let isAlternate = {\n alternate: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(direction);\n // 有正反向播放需要重设帧序列\n if(isAlternate) {\n let isEven = playCount % 2 === 0;\n if(direction === 'alternate') {\n currentFrames = __config[I_CURRENT_FRAMES] = isEven ? frames : framesR;\n }\n else {\n currentFrames = __config[I_CURRENT_FRAMES] = isEven ? framesR : frames;\n }\n }\n }\n let isLastCount = playCount >= iterations - 1;\n // 只有2帧可优化,否则2分查找当前帧\n let i, frameTime;\n if(is2) {\n i = currentTime < endTime ? 0 : 1;\n frameTime = endTime;\n }\n else {\n i = binarySearch(0, length - 1, currentTime, currentFrames);\n frameTime = currentFrames[i][FRAME_TIME];\n }\n // 最后一帧结束动画,仅最后一轮才会进入,需处理endDelay\n let isLastFrame = isLastCount && i === length - 1;\n let percent = 0;\n if(isLastFrame) {\n // 无需任何处理\n }\n // 否则根据目前到下一帧的时间差,计算百分比,再反馈到变化数值上\n else if(is2) {\n percent = currentTime / duration;\n }\n else {\n let total = currentFrames[i + 1][FRAME_TIME] - frameTime;\n percent = (currentTime - frameTime) / total;\n }\n let inEndDelay, currentFrame = currentFrames[i], current;\n __config[I_CURRENT_FRAME] = currentFrame;\n /** 这里要考虑全几种场景:\n * 1. 单次播放无endDelay且fill不停留(有/无差异,下同)\n * 2. 单次播放无endDelay且fill停留\n * 3. 单次播放有endDelay且fill不停留\n * 4. 单次播放有endDelay且fill停留\n * 5. 多次播放无endDelay且fill不停留(尾次/非尾次,下同)\n * 6. 多次播放无endDelay且fill停留\n * 7. 多次播放有endDelay且fill不停留\n * 8. 多次播放有endDelay且fill停留\n */\n let needClean;\n if(isLastFrame) {\n inEndDelay = currentTime < duration + endDelay;\n // 停留对比最后一帧,endDelay可能会多次进入这里,第二次进入样式相等不再重绘\n if(stayEnd) {\n current = cloneStyle(currentFrame[FRAME_STYLE], __config[I_KEYS]);\n }\n // 不停留或超过endDelay则计算还原,有endDelay且fill模式不停留会再次进入这里\n else {\n current = cloneStyle(__config[I_ORIGIN_STYLE], __config[I_KEYS]);\n }\n // 进入endDelay或结束阶段触发end事件,注意只触发一次,防重在触发的地方做\n __config[I_NEXT_END] = true;\n if(!inEndDelay) {\n __config[I_PLAY_COUNT]++;\n __config[I_FINISHED] = true;\n frame.offFrame(this);\n needClean = true;\n __config[I_NEXT_TIME] = 0;\n }\n }\n else {\n current = calIntermediateStyle(currentFrame, __config[I_KEYS], percent, target);\n }\n // 无论两帧之间是否有变化,都生成计算结果赋给style,去重在root做\n genBeforeRefresh(current, __config[I_KEYS], __config, root, target);\n if(needClean) {\n let playCb = __config[I_PLAY_CB];\n this.__clean(true);\n // 丑陋的做法,防止gotoAndStop()这样的cb被clean()掉\n if(playCb) {\n __config[I_PLAY_CB] = playCb;\n }\n }\n }\n\n __after(diff) {\n let __config = this.__config;\n __config[I_ASSIGNING] = false;\n if(__config[I_IN_FPS]) {\n __config[I_IN_FPS] = false;\n return;\n }\n frameCb(this, __config, diff, __config[I_IS_DELAY]);\n __config[I_IS_DELAY] = false;\n if(__config[I_BEGIN]) {\n __config[I_BEGIN] = false;\n this.emit(Event.BEGIN, __config[I_PLAY_COUNT]);\n }\n // end事件只触发一次,末轮进入endDelay或直接结束时\n if(__config[I_NEXT_END] && !__config[I_END]) {\n __config[I_END] = true;\n this.emit(Event.END, __config[I_PLAY_COUNT] - 1);\n }\n if(__config[I_FINISHED]) {\n __config[I_BEGIN] = __config[I_END] = __config[I_IS_DELAY] = __config[I_FINISHED]\n = __config[I_IN_FPS] = __config[I_ENTER_FRAME] = false;\n __config[I_PLAY_STATE] = 'finished';\n this.emit(Event.FINISH);\n }\n }\n\n pause(silence) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let { pending } = this;\n if(isDestroyed || duration <= 0 || pending) {\n return this;\n }\n __config[I_PLAY_STATE] = 'paused';\n this.__cancelTask();\n if(!silence) {\n this.emit(Event.PAUSE);\n }\n return this;\n }\n\n resume(cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n if(isDestroyed || duration <= 0 || playState !== 'paused') {\n return this;\n }\n return this.play(cb);\n }\n\n finish(cb) {\n let self = this;\n let __config = self.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n let frames = __config[I_FRAMES];\n if(isDestroyed || duration <= 0 || frames.length < 1 || playState === 'finished' || playState === 'idle') {\n return self;\n }\n // 先清除所有回调任务,多次调用finish也会清除只留最后一次\n self.__cancelTask();\n let root = __config[I_ROOT];\n let originStyle = __config[I_ORIGIN_STYLE];\n if(root) {\n let current;\n // 停留在最后一帧\n if(__config[I_STAY_END]) {\n __config[I_CURRENT_FRAME] = frames[frames.length - 1];\n current = frames[frames.length - 1][FRAME_STYLE];\n }\n else {\n current = originStyle;\n }\n root.addRefreshTask({\n __before() {\n __config[I_ASSIGNING] = true;\n genBeforeRefresh(current, __config[I_KEYS], __config, root, __config[I_TARGET]);\n self.__clean(true);\n },\n __after(diff) {\n if(!self.__hasFin) {\n self.__hasFin = true;\n __config[I_ASSIGNING] = false;\n frameCb(self, __config, diff);\n __config[I_BEGIN] = __config[I_END] = __config[I_IS_DELAY] = __config[I_FINISHED]\n = __config[I_IN_FPS] = __config[I_ENTER_FRAME] = false;\n self.emit(Event.FINISH);\n }\n if(isFunction(cb)) {\n cb.call(self, diff);\n }\n },\n });\n }\n return self;\n }\n\n cancel(cb) {\n let self = this;\n let __config = self.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n let frames = __config[I_FRAMES];\n if(isDestroyed || duration <= 0 || playState === 'idle' || frames.length < 1) {\n return self;\n }\n self.__cancelTask();\n let root = __config[I_ROOT];\n let originStyle = __config[I_ORIGIN_STYLE];\n if(root) {\n root.addRefreshTask({\n __before() {\n __config[I_ASSIGNING] = true;\n genBeforeRefresh(originStyle, __config[I_KEYS], __config, root, __config[I_TARGET]);\n self.__clean();\n },\n __after(diff) {\n if(!self.__hasCancel) {\n self.__hasCancel = true;\n __config[I_ASSIGNING] = false;\n frameCb(self, __config, diff);\n __config[I_BEGIN] = __config[I_END] = __config[I_IS_DELAY] = __config[I_FINISHED]\n = __config[I_IN_FPS] = __config[I_ENTER_FRAME] = false;\n self.emit(Event.CANCEL);\n }\n if(isFunction(cb)) {\n cb.call(self, diff);\n }\n },\n });\n }\n return self;\n }\n\n gotoAndPlay(v, options, cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let frames = __config[I_FRAMES];\n let delay = __config[I_DELAY];\n let endDelay = __config[I_END_DELAY];\n if(isDestroyed || duration <= 0 || frames.length < 1) {\n return this;\n }\n [options, cb] = gotoOverload(options, cb);\n // 计算出时间点直接累加播放\n this.__goto(v, options.isFrame, options.excludeDelay);\n if(v > duration + delay + endDelay) {\n return this.finish(cb);\n }\n return this.play(cb);\n }\n\n gotoAndStop(v, options, cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let frames = __config[I_FRAMES];\n let delay = __config[I_DELAY];\n let endDelay = __config[I_END_DELAY];\n if(isDestroyed || duration <= 0 || frames.length < 1) {\n return this;\n }\n [options, cb] = gotoOverload(options, cb);\n v = this.__goto(v, options.isFrame, options.excludeDelay);\n if(v > duration + delay + endDelay) {\n return this.finish(cb);\n }\n // 先play一帧,回调里模拟暂停\n return this.play(diff => {\n __config[I_PLAY_STATE] = 'paused';\n this.__cancelTask();\n if(isFunction(cb)) {\n cb.call(this, diff);\n }\n });\n }\n\n // 同步赋予,用在extendAnimate\n assignCurrentStyle() {\n let __config = this.__config;\n let style = __config[I_STYLE];\n let target = __config[I_TARGET];\n let keys = __config[I_KEYS];\n keys.forEach(i => {\n if(style.hasOwnProperty(i)) {\n let v = style[i];\n // geom的属性变化\n if(GEOM.hasOwnProperty(i)) {\n target.currentProps[i] = v;\n }\n // 样式\n else {\n // 将动画样式直接赋给currentStyle\n target.currentStyle[i] = v;\n }\n }\n });\n }\n\n // 返回不包含delay且去除多轮的时间\n __goto(v, isFrame, excludeDelay) {\n let __config = this.__config;\n let iterations = __config[I_ITERATIONS];\n let duration = __config[I_DURATION];\n __config[I_PLAY_STATE] = 'paused';\n // this.__cancelTask(); // 应该不需要,gotoAndXxx都会调用play(),里面有\n if(isNaN(v) || v < 0) {\n throw new Error('Param of gotoAnd(Play/Stop) is illegal: ' + v);\n }\n if(isFrame) {\n v = (v - 1) / this.spf;\n }\n if(excludeDelay) {\n v += __config[I_DELAY];\n }\n // 在时间范围内设置好时间,复用play直接跳到播放点\n __config[I_NEXT_TIME] = v;\n v -= __config[I_DELAY];\n // 超过时间长度需要累加次数,这里可以超过iterations,因为设定也许会非常大\n let playCount = 0;\n while(v >= duration && playCount < iterations - 1) {\n playCount++;\n v -= duration;\n }\n __config[I_PLAY_COUNT] = playCount;\n // 防止play()重置时间和当前帧组,提前计算好\n __config[I_ENTER_FRAME] = true;\n let frames = __config[I_FRAMES];\n let framesR = __config[I_FRAMES_R];\n let direction = __config[I_DIRECTION];\n if({\n alternate: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(direction)) {\n let isEven = playCount % 2 === 0;\n if(direction === 'alternate') {\n __config[I_CURRENT_FRAMES] = isEven ? frames : framesR;\n }\n else {\n __config[I_CURRENT_FRAMES] = isEven ? framesR : frames;\n }\n }\n return v;\n }\n\n addControl() {\n let ac = this.root.animateController;\n if(ac) {\n ac.add(this);\n }\n }\n\n removeControl() {\n let ac = this.root.animateController;\n if(ac) {\n ac.remove(this);\n }\n }\n\n __stayBegin() {\n return {\n backwards: true,\n both: true,\n }.hasOwnProperty(this.fill);\n }\n\n __stayEnd() {\n return {\n forwards: true,\n both: true,\n }.hasOwnProperty(this.fill);\n }\n\n __setTarget(target) {\n this.__target = target;\n this.__config[I_TARGET] = target;\n this.__config[I_NODE_CONFIG] = target.__config;\n }\n\n __cancelTask() {\n frame.offFrame(this);\n this.__config[I_PLAY_CB] = null;\n }\n\n __destroy(sync) {\n let self = this;\n let __config = self.__config;\n if(__config[I_DESTROYED]) {\n return;\n }\n self.removeControl();\n // clean异步执行,因为里面的样式还原需要等到下一帧,否则同步执行清除后,紧接着的新同步动画获取不到currentStyle\n if(sync) {\n self.__clean();\n __config[I_TARGET] = null;\n }\n else {\n frame.nextFrame({\n __before() {\n self.__clean();\n __config[I_TARGET] = null;\n },\n });\n }\n __config[I_START_TIME] = 0;\n __config[I_DESTROYED] = true;\n }\n\n __checkModify() {\n let __config = this.__config;\n if(__config[I_PLAY_STATE] !== 'idle' && __config[I_PLAY_STATE] !== 'finished') {\n inject.warn('Modification will not come into effect when animation is running');\n }\n }\n\n get id() {\n return this.__id;\n }\n\n get target() {\n return this.__config[I_TARGET];\n }\n\n get root() {\n return this.__config[I_ROOT];\n }\n\n get keys() {\n return this.__config[I_KEYS];\n }\n\n get style() {\n return this.__config[I_STYLE];\n }\n\n get options() {\n return this.__options;\n }\n\n get duration() {\n return this.__config[I_DURATION];\n }\n\n set duration(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_DURATION] !== v) {\n __config[I_DURATION] = v;\n __config[I_END_TIME] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get delay() {\n return this.__config[I_DELAY];\n }\n\n set delay(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_DELAY] !== v) {\n __config[I_DELAY] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get endDelay() {\n return this.__config[I_END_DELAY];\n }\n\n set endDelay(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_END_DELAY] !== v) {\n __config[I_END_DELAY] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get fps() {\n return this.__config[I_FPS];\n }\n\n set fps(v) {\n v = parseInt(v) || 60;\n let __config = this.__config;\n if(__config[I_FPS] !== v) {\n if(v <= 0) {\n v = 60;\n }\n __config[I_FPS] = v;\n }\n return v;\n }\n\n get spf() {\n return 1 / this.fps;\n }\n\n get iterations() {\n return this.__config[I_ITERATIONS];\n }\n\n set iterations(v) {\n if(v === Infinity || util.isString(v) && v.toLowerCase() === 'infinity') {\n v = Infinity;\n }\n else {\n v = parseInt(v);\n if(isNaN(v) || v < 0) {\n v = 1;\n }\n }\n let __config = this.__config;\n if(__config[I_ITERATIONS] !== v) {\n __config[I_ITERATIONS] = v;\n }\n return v;\n }\n\n get fill() {\n return this.__config[I_FILL];\n }\n\n set fill(v) {\n v = v || 'none';\n let __config = this.__config;\n if(__config[I_FILL] !== v) {\n __config[I_FILL] = v;\n this.__checkModify();\n }\n __config[I_STAY_BEGIN] = {\n backwards: true,\n both: true,\n }.hasOwnProperty(v);\n __config[I_STAY_END] = {\n forwards: true,\n both: true,\n }.hasOwnProperty(v);\n return v;\n }\n\n get direction() {\n return this.__config[I_DIRECTION];\n }\n\n set direction(v) {\n v = v || 'normal';\n let __config = this.__config;\n if(__config[I_DIRECTION] !== v) {\n __config[I_DIRECTION] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get frames() {\n return this.__config[I_FRAMES];\n }\n\n get framesR() {\n return this.__config[I_FRAMES_R];\n }\n\n get playbackRate() {\n return this.__config[I_PLAYBACK_RATE];\n }\n\n set playbackRate(v) {\n v = parseFloat(v) || 1;\n if(v <= 0) {\n v = 1;\n }\n let __config = this.__config;\n if(__config[I_PLAYBACK_RATE] !== v) {\n __config[I_PLAYBACK_RATE] = v;\n }\n return v;\n }\n\n get easing() {\n return this.__config[I_EASING];\n }\n\n get startTime() {\n return this.__config[I_START_TIME];\n }\n\n get currentTime() {\n return this.__config[I_CURRENT_TIME];\n }\n\n set currentTime(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_CURRENT_TIME] !== v) {\n __config[I_CURRENT_TIME] = v;\n __config[I_NEXT_TIME] = v;\n }\n return v;\n }\n\n get nextTime() {\n return this.__config[I_NEXT_TIME];\n }\n\n set nextTime(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_NEXT_TIME] !== v) {\n __config[I_NEXT_TIME] = v;\n }\n return v;\n }\n\n get timestamp() {\n return this.__config[I_TIME_STAMP];\n }\n\n get pending() {\n return this.__config[I_PLAY_STATE] !== 'running';\n }\n\n get finished() {\n return this.__config[I_PLAY_STATE] === 'finished';\n }\n\n get playState() {\n return this.__config[I_PLAY_STATE];\n }\n\n get playCount() {\n return this.__config[I_PLAY_COUNT];\n }\n\n set playCount(v) {\n v = Math.max(0, parseInt(v) || 0);\n let __config = this.__config;\n if(__config[I_PLAY_COUNT] !== v) {\n __config[I_PLAY_COUNT] = v;\n }\n return v;\n }\n\n get isDestroyed() {\n return this.__config[I_DESTROYED];\n }\n\n get animating() {\n let __config = this.__config;\n let playState = __config[I_PLAY_STATE];\n if(playState === 'idle') {\n return false;\n }\n return playState !== 'finished' || __config[I_STAY_END] || __config[I_STAY_BEGIN];\n }\n\n get spfLimit() {\n let __config = this.__config;\n return __config[I_SPF_LIMIT];\n }\n\n set spfLimit(v) {\n if(util.isNumber(v) || /^\\d/.test(v)) {\n v = Math.max(0, parseInt(v) || 0);\n }\n else {\n v = !!v;\n }\n let __config = this.__config;\n if(__config[I_SPF_LIMIT] !== v) {\n __config[I_SPF_LIMIT] = v;\n }\n return v;\n }\n\n get assigning() {\n return this.__config[I_ASSIGNING];\n }\n}\n\nexport default Animation;\n","import mode from '../refresh/mode';\nimport geom from '../math/geom';\nimport blur from '../math/blur';\nimport util from '../util/util';\nimport painter from '../util/painter';\nimport enums from '../util/enums';\n\nconst {\n NODE_KEY: {\n NODE_DEFS_CACHE,\n }\n} = enums;\nconst { int2rgba } = util;\nconst { canvasPolygon, svgPolygon } = painter;\n\nfunction renderBoxShadow(xom, renderMode, ctx, data, x1, y1, x2, y2, w, h, dx = 0, dy = 0) {\n x1 += dx;\n y1 += dy;\n x2 += dx;\n y2 += dy;\n let [x, y, sigma, spread, color, inset] = data;\n let c = int2rgba(color);\n let n = Math.abs(sigma) * 2 + Math.abs(spread) * 2 + Math.abs(x) * 2 + Math.abs(y) * 2;\n // box本身坐标顺时针\n let box = [\n [x1, y1],\n [x2, y1],\n [x2, y2],\n [x1, y2],\n [x1, y1],\n ];\n // 算上各种偏移/扩散的最外层坐标,且逆时针\n let outer = [\n [x1 - n, y1 - n],\n [x1 - n, y2 + n],\n [x2 + n, y2 + n],\n [x2 + n, y1 - n],\n [x1 - n, y1 - n],\n ];\n if(color[3] > 0 && (sigma > 0 || spread > 0)) {\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n ctx.save();\n ctx.beginPath();\n // inset裁剪box外面\n if(inset === 'inset') {\n let xa = x1 + x + spread;\n let ya = y1 + y + spread;\n let xb = x2 + x - spread;\n let yb = y2 + y - spread;\n let spreadBox = [\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [xa, yb],\n ];\n // 是否相交判断需要绘制\n let cross = geom.getRectsIntersection(\n [box[0][0], box[0][1], box[2][0], box[2][1]],\n [spreadBox[0][0], spreadBox[0][1], spreadBox[2][0], spreadBox[2][1]]);\n if(!cross) {\n return;\n }\n cross = [\n [cross[0], cross[1]],\n [cross[2], cross[1]],\n [cross[2], cross[3]],\n [cross[0], cross[3]],\n [cross[0], cross[1]],\n ];\n // 扩散区域类似边框填充\n if(spread) {\n canvasPolygon(ctx, cross);\n canvasPolygon(ctx, box.slice(0).reverse());\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== c) {\n ctx.fillStyle = c;\n }\n canvasPolygon(ctx, box);\n ctx.fill();\n ctx.closePath();\n ctx.restore();\n ctx.save();\n ctx.beginPath();\n canvasPolygon(ctx, cross);\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== '#FFF') {\n ctx.fillStyle = '#FFF';\n }\n ctx.shadowColor = c;\n ctx.shadowBlur = sigma;\n // 画在外围的空心矩形,宽度要比blur大,n考虑了这一情况取了最大值\n canvasPolygon(ctx, [\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [x1 - n, yb],\n [x1 - n, y2 + n],\n [x2 + n, y2 + n],\n [x2 + n, y1 - n],\n [x1 - n, y1 - n],\n [x1 - n, yb],\n [xa, yb],\n [xa, ya],\n ]);\n }\n else {\n canvasPolygon(ctx, box);\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== '#FFF') {\n ctx.fillStyle = '#FFF';\n }\n ctx.shadowOffsetX = x;\n ctx.shadowOffsetY = y;\n ctx.shadowColor = c;\n ctx.shadowBlur = sigma;\n canvasPolygon(ctx, [\n [x1, y1],\n [x2, y1],\n [x2, y2],\n [x1 - n, y2],\n [x1 - n, y2 + n],\n [x2 + n, y2 + n],\n [x2 + n, y1 - n],\n [x1 - n, y1 - n],\n [x1 - n, y2],\n [x1, y2],\n [x1, y1],\n ]);\n }\n }\n // outset需裁减掉box本身的内容,clip()非零环绕显示box外的阴影内容,fill()绘制在内无效\n else {\n let xa = x1 + x - spread;\n let ya = y1 + y - spread;\n let xb = x2 + x + spread;\n let yb = y2 + y + spread;\n let blurBox = [\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [xa, yb],\n ];\n let cross = geom.getRectsIntersection(\n [box[0][0], box[0][1], box[2][0], box[2][1]],\n [blurBox[0][0], blurBox[0][1], blurBox[2][0], blurBox[2][1]]);\n // 分为是否有spread,因模糊成本spread区域将没有模糊\n if(spread) {\n // 扩散区域类似边框填充\n canvasPolygon(ctx, box);\n canvasPolygon(ctx, blurBox.slice(0).reverse());\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== c) {\n ctx.fillStyle = c;\n }\n canvasPolygon(ctx, blurBox);\n ctx.fill();\n ctx.closePath();\n ctx.restore();\n ctx.save();\n ctx.beginPath();\n // 阴影部分看相交情况裁剪,有相交时逆时针绘制相交区域即可排除之\n if(cross) {\n canvasPolygon(ctx, [\n [cross[0], cross[1]],\n [cross[2], cross[1]],\n [cross[2], cross[3]],\n [cross[0], cross[3]],\n [cross[0], cross[1]],\n ].reverse());\n }\n canvasPolygon(ctx, box);\n canvasPolygon(ctx, blurBox);\n canvasPolygon(ctx, outer);\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== '#FFF') {\n ctx.fillStyle = '#FFF';\n }\n ctx.shadowColor = c;\n ctx.shadowBlur = sigma;\n canvasPolygon(ctx, blurBox);\n }\n else {\n canvasPolygon(ctx, box);\n canvasPolygon(ctx, outer);\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== '#FFF') {\n ctx.fillStyle = '#FFF';\n }\n ctx.shadowOffsetX = x;\n ctx.shadowOffsetY = y;\n ctx.shadowColor = c;\n ctx.shadowBlur = sigma;\n canvasPolygon(ctx, box);\n }\n }\n ctx.fill();\n ctx.closePath();\n ctx.restore();\n }\n else if(renderMode === mode.SVG) {\n let d = blur.outerSize(sigma);\n if(inset === 'inset') {\n let xa = x1 + x + spread;\n let ya = y1 + y + spread;\n let xb = x2 + x - spread;\n let yb = y2 + y - spread;\n let spreadBox = [\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [xa, yb],\n ];\n let cross = geom.getRectsIntersection(\n [box[0][0], box[0][1], box[2][0], box[2][1]],\n [spreadBox[0][0], spreadBox[0][1], spreadBox[2][0], spreadBox[2][1]]);\n if(!cross) {\n return;\n }\n cross = [\n [cross[0], cross[1]],\n [cross[2], cross[1]],\n [cross[2], cross[3]],\n [cross[0], cross[3]],\n [cross[0], cross[1]],\n ];\n if(spread) {\n let v = {\n tagName: 'filter',\n props: [\n ['x', -d / w],\n ['y', -d / h],\n ['width', 1 + d * 2 / w],\n ['height', 1 + d * 2 / h],\n ],\n children: [\n {\n tagName: 'feDropShadow',\n props: [\n ['dx', 0],\n ['dy', 0],\n ['stdDeviation', sigma * 0.5],\n ['flood-color', c],\n ],\n },\n ],\n }\n xom.__config[NODE_DEFS_CACHE].push(v);\n let filter = ctx.add(v);\n let v2 = {\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(cross) + svgPolygon(box.slice(0).reverse())],\n ['fill', '#FFF'],\n ],\n }],\n };\n let clip = ctx.add(v2);\n xom.__config[NODE_DEFS_CACHE].push(v2);\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon(box)],\n ['fill', c],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n v = {\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(cross)],\n ['fill', '#FFF'],\n ],\n }],\n };\n clip = ctx.add(v);\n xom.__config[NODE_DEFS_CACHE].push(v);\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon([\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [x1 - n, yb],\n [x1 - n, y2 + n],\n [x2 + n, y2 + n],\n [x2 + n, y1 - n],\n [x1 - n, y1 - n],\n [x1 - n, yb],\n [xa, yb],\n [xa, ya],\n ])],\n ['fill', '#FFF'],\n ['filter', 'url(#' + filter + ')'],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n }\n else {\n let v = {\n tagName: 'filter',\n props: [\n ['x', -d / w],\n ['y', -d / h],\n ['width', 1 + d * 2 / w],\n ['height', 1 + d * 2 / h],\n ],\n children: [\n {\n tagName: 'feDropShadow',\n props: [\n ['dx', x],\n ['dy', y],\n ['stdDeviation', sigma * 0.5],\n ['flood-color', c],\n ],\n },\n ],\n }\n let filter = ctx.add(v);\n xom.__config[NODE_DEFS_CACHE].push(v);\n v = {\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(box)],\n ['fill', '#FFF'],\n ],\n }],\n };\n let clip = ctx.add(v);\n xom.__config[NODE_DEFS_CACHE].push(v);\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon([\n [x1, y1],\n [x2, y1],\n [x2, y2],\n [x1 - n, y2],\n [x1 - n, y2 + n],\n [x2 + n, y2 + n],\n [x2 + n, y1 - n],\n [x1 - n, y1 - n],\n [x1 - n, y2],\n [x1, y2],\n [x1, y1],\n ])],\n ['fill', '#FFF'],\n ['filter', 'url(#' + filter + ')'],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n }\n }\n else {\n let xa = x1 + x - spread;\n let ya = y1 + y - spread;\n let xb = x2 + x + spread;\n let yb = y2 + y + spread;\n let blurBox = [\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [xa, yb],\n ];\n let cross = geom.getRectsIntersection(\n [box[0][0], box[0][1], box[2][0], box[2][1]],\n [blurBox[0][0], blurBox[0][1], blurBox[2][0], blurBox[2][1]]);\n if(spread) {\n let v = {\n tagName: 'filter',\n props: [\n ['x', -d / w],\n ['y', -d / h],\n ['width', 1 + d * 2 / w],\n ['height', 1 + d * 2 / h],\n ],\n children: [\n {\n tagName: 'feDropShadow',\n props: [\n ['dx', 0],\n ['dy', 0],\n ['stdDeviation', sigma * 0.5],\n ['flood-color', c],\n ],\n },\n ],\n };\n let filter = ctx.add(v);\n xom.__config[NODE_DEFS_CACHE].push(v);\n v = {\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(box) + svgPolygon(blurBox.slice(0).reverse())],\n ['fill', '#FFF'],\n ],\n }],\n };\n let clip = ctx.add(v);\n xom.__config[NODE_DEFS_CACHE].push(v);\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon(blurBox)],\n ['fill', c],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n v = {\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', (cross ? svgPolygon([\n [cross[0], cross[1]],\n [cross[2], cross[1]],\n [cross[2], cross[3]],\n [cross[0], cross[3]],\n [cross[0], cross[1]],\n ].reverse()) : '')\n + svgPolygon(box) + svgPolygon(blurBox) + svgPolygon(outer)],\n ['fill', '#FFF'],\n ],\n }],\n };\n clip = ctx.add(v);\n xom.__config[NODE_DEFS_CACHE].push(v);\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon(blurBox)],\n ['fill', '#FFF'],\n ['filter', 'url(#' + filter + ')'],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n }\n else {\n let v = {\n tagName: 'filter',\n props: [\n ['x', -d / w],\n ['y', -d / h],\n ['width', 1 + d * 2 / w],\n ['height', 1 + d * 2 / h],\n ],\n children: [\n {\n tagName: 'feDropShadow',\n props: [\n ['dx', x],\n ['dy', y],\n ['stdDeviation', sigma * 0.5],\n ['flood-color', c],\n ],\n },\n ],\n };\n let filter = ctx.add(v);\n xom.__config[NODE_DEFS_CACHE].push(v);\n v = {\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(box) + svgPolygon(outer)],\n ['fill', '#FFF'],\n ],\n }],\n };\n let clip = ctx.add(v);\n xom.__config[NODE_DEFS_CACHE].push(v);\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon(box)],\n ['fill', '#FFF'],\n ['filter', 'url(#' + filter + ')'],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n }\n }\n }\n }\n}\n\nexport default {\n renderBoxShadow,\n};\n","const MBM_HASH = {\n multiply: true,\n screen: true,\n overlay: true,\n darken: true,\n lighten: true,\n 'color-dodge': true,\n 'color-burn': true,\n 'hard-light': true,\n 'soft-light': true,\n difference: true,\n exclusion: true,\n hue: true,\n saturation: true,\n color: true,\n luminosity: true,\n};\n\nfunction mbmName(v) {\n if(v) {\n return v.replace(/[A-Z]/, function($0) {\n return '-' + $0.toLowerCase();\n });\n }\n}\n\nfunction isValidMbm(v) {\n return MBM_HASH.hasOwnProperty(mbmName(v));\n}\n\nexport default {\n mbmName,\n isValidMbm,\n};\n","import TextBox from './TextBox';\nimport enums from '../util/enums';\n\nconst {\n STYLE_KEY: {\n MARGIN_LEFT,\n MARGIN_RIGHT,\n PADDING_LEFT,\n PADDING_RIGHT,\n BORDER_LEFT_WIDTH,\n BORDER_RIGHT_WIDTH,\n },\n} = enums;\n\n/**\n * 获取inline的每一行内容的矩形坐标4个点,同时附带上border的矩形,比前面4个点尺寸大或相等(有无border/padding)\n * @param xom\n * @param contentBoxList\n * @param start\n * @param end\n * @param lineBox\n * @param baseline\n * @param lineHeight\n * @param diffL\n * @param isStart\n * @param isEnd\n * @param backgroundClip\n * @param paddingTop\n * @param paddingRight\n * @param paddingBottom\n * @param paddingLeft\n * @param borderTopWidth\n * @param borderRightWidth\n * @param borderBottomWidth\n * @param borderLeftWidth\n * @returns {(*|number)[]}\n */\nfunction getInlineBox(xom, contentBoxList, start, end, lineBox, baseline, lineHeight, diffL, isStart, isEnd,\n backgroundClip, paddingTop, paddingRight, paddingBottom, paddingLeft,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth) {\n // 根据bgClip确定y伸展范围,inline渲染bg扩展到pb的位置不影响布局\n let eyt = 0, eyb = 0;\n if(backgroundClip === 'paddingBox' || backgroundClip === 'padding-box') {\n eyt = paddingTop;\n eyb = paddingBottom;\n }\n else if(backgroundClip !== 'contentBox' && backgroundClip !== 'content-box') {\n eyt = paddingTop + borderTopWidth;\n eyb = paddingBottom + borderBottomWidth;\n }\n // 同y的border伸展范围,其影响border渲染\n let pbt = paddingTop + borderTopWidth;\n let pbb = paddingBottom + borderBottomWidth;\n // inline的baseline和lineBox的差值\n let diff = lineBox.baseline - baseline;\n // x坐标取首尾contentBox的左右2侧,clip布局时已算好;y是根据lineHeight和lineBox的高度以及baseline对齐后计算的\n let x1 = start.x;\n let dom = start instanceof TextBox ? start.parent.domParent : start.domParent;\n while(dom !== xom) {\n let list = dom.contentBoxList;\n if(start === list[0]) {\n let {\n [MARGIN_LEFT]: marginLeft,\n [PADDING_LEFT]: paddingLeft,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = dom.computedStyle;\n x1 -= marginLeft + paddingLeft + borderLeftWidth;\n }\n dom = dom.domParent;\n }\n let bx1 = x1;\n if(isStart) {\n if(backgroundClip === 'paddingBox' || backgroundClip === 'padding-box') {\n x1 -= paddingLeft;\n }\n else if(backgroundClip !== 'contentBox' && backgroundClip !== 'content-box') {\n x1 -= paddingLeft + borderLeftWidth;\n }\n bx1 -= paddingLeft + borderLeftWidth;\n }\n let y1 = lineBox.y + diff - eyt;\n let by1 = lineBox.y + diff - pbt;\n let x2 = end.x + end.outerWidth;\n // TextBox的parent是Text,再是Dom,这里一定是inline,无嵌套就是xom本身,有则包含若干层最上层还是xom\n dom = end instanceof TextBox ? end.parent.domParent : end.domParent;\n // 从end开始,向上获取dom节点的尾部mpb进行累加,直到xom跳出\n while(dom !== xom) {\n let list = dom.contentBoxList;\n if(end === list[list.length - 1]) {\n let {\n [MARGIN_RIGHT]: marginRight,\n [PADDING_RIGHT]: paddingRight,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n } = dom.computedStyle;\n x2 += marginRight + paddingRight + borderRightWidth;\n }\n dom = dom.domParent;\n }\n let bx2 = x2;\n if(isEnd) {\n if(backgroundClip === 'paddingBox' || backgroundClip === 'padding-box') {\n x2 += paddingRight;\n }\n else if(backgroundClip !== 'contentBox' && backgroundClip !== 'content-box') {\n x2 += paddingRight + borderRightWidth;\n }\n bx2 += paddingRight + borderRightWidth;\n }\n let y2 = lineBox.y + diff + lineHeight - diffL + eyb;\n let by2 = lineBox.y + diff + lineHeight - diffL + pbb;\n // x要考虑xom的ox值\n x1 += xom.ox;\n x2 += xom.ox;\n bx1 += xom.ox;\n bx2 += xom.ox;\n y1 += xom.oy;\n y2 += xom.oy;\n by1 += xom.oy;\n by2 += xom.oy;\n return [x1, y1, x2, y2, bx1, by1, bx2, by2];\n}\n\n/**\n * 统计inline的所有contentBox排成一行时的总宽度,考虑嵌套的mpb\n * @param xom\n * @param contentBoxList\n * @returns {number}\n */\nfunction getInlineWidth(xom, contentBoxList) {\n let sum = 0;\n let length = contentBoxList.length;\n for(let i = 0; i < length; i++) {\n let contentBox = contentBoxList[i];\n sum += contentBox.width;\n // 嵌套时,首尾box考虑mpb\n let dom = contentBox instanceof TextBox ? contentBox.parent.domParent : contentBox.domParent;\n while(dom !== xom) {\n let list = dom.contentBoxList;\n if(contentBox === list[0]) {\n let {\n [MARGIN_LEFT]: marginLeft,\n [PADDING_LEFT]: paddingLeft,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = dom.computedStyle;\n sum += marginLeft + paddingLeft + borderLeftWidth;\n }\n if(contentBox === list[list.length - 1]) {\n let {\n [MARGIN_RIGHT]: marginRight,\n [PADDING_RIGHT]: paddingRight,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n } = dom.computedStyle;\n sum += marginRight + paddingRight + borderRightWidth;\n }\n dom = dom.domParent;\n }\n }\n return sum;\n}\n\nexport default {\n getInlineBox,\n getInlineWidth,\n};\n","import Node from './Node';\nimport Component from './Component';\nimport unit from '../style/unit';\nimport tf from '../style/transform';\nimport gradient from '../style/gradient';\nimport border from '../style/border';\nimport css from '../style/css';\nimport bg from '../style/bg';\nimport blur from '../math/blur';\nimport enums from '../util/enums';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport painter from '../util/painter';\nimport Animation from '../animate/Animation';\nimport frame from '../animate/frame';\nimport mx from '../math/matrix';\nimport geom from '../math/geom';\nimport mode from '../refresh/mode';\nimport change from '../refresh/change';\nimport level from '../refresh/level';\nimport Cache from '../refresh/Cache';\nimport font from '../style/font';\nimport bs from '../style/bs';\nimport mbm from '../style/mbm';\nimport inline from './inline';\n\nconst { svgPolygon } = painter;\nconst { CANVAS, SVG, WEBGL } = mode;\nconst { LOCAL } = Cache;\n\nconst {\n STYLE_KEY,\n STYLE_RV_KEY,\n style2Upper,\n STYLE_KEY: {\n BORDER_TOP_LEFT_RADIUS,\n BORDER_TOP_RIGHT_RADIUS,\n BORDER_BOTTOM_LEFT_RADIUS,\n BORDER_BOTTOM_RIGHT_RADIUS,\n PADDING_LEFT,\n PADDING_RIGHT,\n PADDING_TOP,\n PADDING_BOTTOM,\n MARGIN_LEFT,\n MARGIN_TOP,\n MARGIN_BOTTOM,\n MARGIN_RIGHT,\n BORDER_LEFT_WIDTH,\n BORDER_TOP_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_RIGHT_WIDTH,\n TOP,\n RIGHT,\n BOTTOM,\n LEFT,\n POSITION,\n DISPLAY,\n WIDTH,\n HEIGHT,\n MATRIX,\n TRANSLATE_X,\n TRANSLATE_Y,\n TRANSLATE_Z,\n TRANSFORM,\n SCALE_X,\n SCALE_Y,\n SCALE_Z,\n ROTATE_X,\n ROTATE_Y,\n ROTATE_Z,\n SKEW_X,\n SKEW_Y,\n PERSPECTIVE,\n PERSPECTIVE_ORIGIN,\n ROTATE_3D,\n TRANSFORM_ORIGIN,\n BACKGROUND_POSITION_X,\n BACKGROUND_POSITION_Y,\n BACKGROUND_SIZE,\n BACKGROUND_COLOR,\n BACKGROUND_IMAGE,\n BACKGROUND_REPEAT,\n BOX_SHADOW,\n OPACITY,\n Z_INDEX,\n BORDER_TOP_STYLE,\n BORDER_RIGHT_STYLE,\n BORDER_BOTTOM_STYLE,\n BORDER_LEFT_STYLE,\n FILTER,\n OVERFLOW,\n MIX_BLEND_MODE,\n TEXT_OVERFLOW,\n BORDER_TOP_COLOR,\n BORDER_BOTTOM_COLOR,\n BORDER_LEFT_COLOR,\n BORDER_RIGHT_COLOR,\n FONT_STYLE,\n COLOR,\n VISIBILITY,\n POINTER_EVENTS,\n BORDER_TOP,\n BORDER_RIGHT,\n BORDER_BOTTOM,\n BORDER_LEFT,\n BACKGROUND_CLIP,\n FONT_SIZE,\n FONT_FAMILY,\n LINE_HEIGHT,\n TEXT_STROKE_COLOR,\n TEXT_STROKE_WIDTH,\n TEXT_STROKE_OVER,\n },\n UPDATE_KEY: {\n UPDATE_NODE,\n UPDATE_FOCUS,\n UPDATE_STYLE,\n UPDATE_OVERWRITE,\n UPDATE_KEYS,\n UPDATE_CONFIG,\n UPDATE_REMOVE_DOM,\n },\n STRUCT_KEY: {\n STRUCT_HAS_MASK,\n },\n NODE_KEY: {\n NODE_TAG_NAME,\n NODE_CACHE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_STYLE,\n NODE_STRUCT,\n NODE_OPACITY,\n NODE_MATRIX_EVENT,\n NODE_MATRIX,\n NODE_LIMIT_CACHE,\n NODE_HAS_CONTENT,\n NODE_REFRESH_LV,\n NODE_CACHE,\n NODE_CACHE_TOTAL,\n NODE_CACHE_FILTER,\n NODE_CACHE_MASK,\n NODE_CACHE_OVERFLOW,\n NODE_IS_DESTROYED,\n NODE_DEFS_CACHE,\n NODE_DOM_PARENT,\n NODE_IS_INLINE,\n NODE_PERSPECTIVE_MATRIX,\n NODE_IS_MASK,\n NODE_VIRTUAL_DOM,\n NODE_CACHE_AS_BITMAP,\n }\n} = enums;\nconst { AUTO, PX, PERCENT, INHERIT, NUMBER, REM, VW, VH, VMAX, VMIN, DEG } = unit;\nconst { int2rgba, rgba2int, joinArr, isNil, isFunction } = util;\nconst { calRelative } = css;\nconst { GEOM } = change;\nconst { mbmName, isValidMbm } = mbm;\nconst { point2d } = mx;\n\nconst {\n contain,\n NONE,\n TRANSFORM: TF,\n REFLOW,\n REPAINT,\n TRANSLATE_X: TX,\n TRANSLATE_Y: TY,\n TRANSLATE_Z: TZ,\n} = level;\n\nfunction getFirstEmptyInlineWidth(xom) {\n let n = 0;\n let flowChildren = xom.flowChildren;\n let length = flowChildren.length;\n for(let i = 0; i < length; i++) {\n let child = flowChildren[i];\n if(child instanceof Xom || child instanceof Component && child.shadowRoot instanceof Xom) {\n if(child.flowChildren.length) {\n n += getFirstEmptyInlineWidth(child);\n break;\n }\n else if(child.__config[NODE_IS_INLINE]) {\n n += child.outerWidth;\n }\n }\n else {\n break;\n }\n }\n return n;\n}\n\nfunction getLastEmptyInlineWidth(xom) {\n let n = 0;\n let flowChildren = xom.flowChildren;\n let length = flowChildren.length;\n for(let i = length - 1; i >= 0; i--) {\n let child = flowChildren[i];\n if(child instanceof Xom || child instanceof Component && child.shadowRoot instanceof Xom) {\n if(child.flowChildren.length) {\n n += getLastEmptyInlineWidth(child);\n break;\n }\n else {\n n += child.outerWidth;\n }\n }\n else {\n break;\n }\n }\n return n;\n}\n\nclass Xom extends Node {\n constructor(tagName, props = {}) {\n super();\n // 构建工具中都是arr,手写可能出现hash情况\n if(Array.isArray(props)) {\n this.props = util.arr2hash(props);\n }\n else {\n this.props = props;\n }\n this.__tagName = tagName;\n this.__style = this.props.style || {}; // style被解析后的k-v形式\n this.__currentStyle = {}; // 动画过程中绘制一开始会merge动画样式\n this.__computedStyle = {}; // 类似getComputedStyle()将currentStyle计算好数值赋给\n this.__listener = {};\n Object.keys(this.props).forEach(k => {\n let v = this.props[k];\n if(/^on[a-zA-Z]/.test(k)) {\n k = k.slice(2).toLowerCase();\n this.listener[k] = v;\n }\n });\n this.__animationList = [];\n this.__loadBgi = {\n // 刷新回调函数,用以destroy取消用\n cb: function() {\n },\n };\n this.__cacheStyle = {}; // 是否缓存重新计算computedStyle的样式key\n this.__cacheDefs = []; // svg专用,缓存渲染时使用已有的defs,diff过程用,否则会defs被清空\n let isClip = this.__isClip = !!this.props.clip;\n let isMask = this.__isMask = isClip || !!this.props.mask;\n let config = this.__config;\n config[NODE_TAG_NAME] = tagName;\n config[NODE_CACHE_STYLE] = this.__cacheStyle;\n config[NODE_CURRENT_STYLE] = this.__currentStyle;\n config[NODE_COMPUTED_STYLE] = this.__computedStyle;\n config[NODE_REFRESH_LV] = REFLOW;\n config[NODE_STYLE] = this.__style;\n config[NODE_MATRIX] = [];\n config[NODE_MATRIX_EVENT] = [];\n config[NODE_DEFS_CACHE] = this.__cacheDefs;\n config[NODE_IS_MASK] = isMask;\n this.__frameAnimateList = [];\n this.__contentBoxList = []; // inline存储内容用\n // this.__json domApi需要获取生成时的json引用,builder过程添加,如appendChild时json也需要跟着变更\n config[NODE_CACHE_AS_BITMAP] = this.__cacheAsBitmap = !!this.props.cacheAsBitmap;\n this.__layoutData = null; // 缓存上次布局x/y/w/h数据\n this.__hasComputeReflow = false; // 每次布局计算缓存标,使得每次开始只computeReflow一次\n this.__parentLineBox = null; // inline时指向\n }\n\n __structure(i, lv, j) {\n let res = super.__structure(i, lv, j);\n if(this.__hasMask) {\n res[STRUCT_HAS_MASK] = this.__hasMask;\n }\n this.__config[NODE_STRUCT] = res;\n return res;\n }\n\n // 设置margin/padding的实际值,layout时执行,inline的垂直方向仍然计算值,但在布局时被忽略\n __mp(currentStyle, computedStyle, w) {\n [\n 'Top',\n 'Right',\n 'Bottom',\n 'Left',\n ].forEach(k => {\n let a = STYLE_KEY[style2Upper('margin' + k)];\n let b = STYLE_KEY[style2Upper('padding' + k)];\n computedStyle[a] = this.__mpSize(currentStyle[a], w);\n computedStyle[b] = this.__mpSize(currentStyle[b], w);\n });\n }\n\n __mpSize(mp, w) {\n if(mp[1] === PX) {\n return mp[0];\n }\n else if(mp[1] === PERCENT) {\n return mp[0] * w * 0.01;\n }\n else if(mp[1] === REM) {\n return mp[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(mp[1] === VW) {\n return mp[0] * this.root.width * 0.01;\n }\n else if(mp[1] === VH) {\n return mp[0] * this.root.height * 0.01;\n }\n else if(mp[1] === VMAX) {\n return mp[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(mp[1] === VMIN) {\n return mp[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n return 0;\n }\n\n // dom常用的几种尺寸赋值\n __ioSize(w, h) {\n let computedStyle = this.computedStyle;\n // 可能不传,在虚拟布局时用不到\n if(!isNil(w)) {\n this.__clientWidth = w += computedStyle[PADDING_LEFT] + computedStyle[PADDING_RIGHT];\n this.__offsetWidth = w += computedStyle[BORDER_LEFT_WIDTH] + computedStyle[BORDER_RIGHT_WIDTH];\n this.__outerWidth = w + computedStyle[MARGIN_LEFT] + computedStyle[MARGIN_RIGHT];\n }\n if(!isNil(h)) {\n this.__clientHeight = h += computedStyle[PADDING_TOP] + computedStyle[PADDING_BOTTOM];\n this.__offsetHeight = h += computedStyle[BORDER_TOP_WIDTH] + computedStyle[BORDER_BOTTOM_WIDTH];\n this.__outerHeight = h + computedStyle[MARGIN_TOP] + computedStyle[MARGIN_BOTTOM];\n }\n }\n\n // 换算margin/padding为px单位,onlyFixedValue只考虑绝对值,不考虑百分比等\n __calMp(v, w, onlyFixedValue) {\n let n = 0;\n if(v[1] === PX) {\n n += v[0];\n }\n else if(v[1] === PERCENT && !onlyFixedValue) {\n v[0] *= w * 0.01;\n v[1] = PX;\n n += v[0];\n }\n else if(v[1] === REM) {\n n += v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n n += v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n n += v[0] * this.root.height * 0.01;\n }\n else if(v[1] === VMAX) {\n n += v[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(v[1] === VMIN) {\n n += v[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n return n;\n }\n\n // 为basis的b/min/max添加mpb,只有当b未显示指定等于w/content时才加,同时返回mpb值\n __addMBP(isDirectionRow, w, currentStyle, computedStyle, res, isDirectItem) {\n let {\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_TOP]: marginTop,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_TOP]: paddingTop,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_BOTTOM]: paddingBottom,\n } = currentStyle;\n let {\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = computedStyle;\n let mbp = this.__calMp(marginLeft, w, !isDirectItem)\n + this.__calMp(marginRight, w, !isDirectItem)\n + this.__calMp(paddingLeft, w, !isDirectItem)\n + this.__calMp(paddingRight, w, !isDirectItem)\n + borderLeftWidth + borderRightWidth;\n if(isDirectionRow) {\n res = res.map(item => item + mbp);\n }\n else {\n let mbp = this.__calMp(marginTop, w, !isDirectItem)\n + this.__calMp(marginBottom, w, !isDirectItem)\n + this.__calMp(paddingTop, w, !isDirectItem)\n + this.__calMp(paddingBottom, w, !isDirectItem)\n + borderTopWidth + borderBottomWidth;\n res = res.map(item => item + mbp);\n }\n return res;\n }\n\n // absolute且无尺寸时,isAbs标明先假布局一次计算尺寸,还有flex列计算时isColumn假布局\n __layout(data, isAbs, isColumn) {\n css.computeReflow(this);\n let { w } = data;\n let { isDestroyed, currentStyle, computedStyle, __config } = this;\n let {\n [DISPLAY]: display,\n } = computedStyle;\n let {\n [WIDTH]: width,\n [POSITION]: position,\n } = currentStyle;\n this.__layoutData = {\n x: data.x,\n y: data.y,\n w: data.w,\n h: data.h,\n lx: data.lx,\n };\n // 防止display:none不统计mask,isVirtual忽略,abs/flex布局后续会真正来走一遍\n if(!isAbs && !isColumn) {\n this.clearCache();\n __config[NODE_REFRESH_LV] = REFLOW;\n __config[NODE_LIMIT_CACHE] = false;\n __config[NODE_IS_INLINE] = false;\n let { next } = this;\n // mask关系只有布局才会变更,普通渲染关系不会改变,clip也是mask的一种\n if(!this.isMask && next && (next.isMask)) {\n let count = 0;\n while(next) {\n if(next.isMask) {\n count++;\n }\n else {\n break;\n }\n next = next.next;\n }\n this.__hasMask = count;\n }\n }\n this.__ox = this.__oy = 0;\n if(isDestroyed || display === 'none') {\n this.__width = this.__height\n = this.__clientWidth = this.__clientHeight\n = this.__offsetWidth = this.__offsetHeight\n = this.__outerWidth = this.__outerHeight\n = computedStyle[WIDTH] = computedStyle[HEIGHT] = 0;\n this.__x = data.x;\n this.__y = data.y;\n this.__layoutNone();\n this.__hasComputeReflow = false;\n return;\n }\n // absolute特殊,在自己布局时已计算相对于容器的mbp\n if(position !== 'absolute') {\n this.__mp(currentStyle, computedStyle, w);\n }\n // inline的width/height无效,其它有效\n if(width[1] !== AUTO) {\n if(this.__isRealInline() && computedStyle[DISPLAY] === 'inline') {\n width[0] = 0;\n width[1] = AUTO;\n }\n else {\n switch(width[1]) {\n case PX:\n w = width[0];\n break;\n case PERCENT:\n w *= width[0] * 0.01;\n break;\n case REM:\n w = width[0] * this.root.computedStyle[FONT_SIZE];\n break;\n case VW:\n w = width[0] * this.root.width * 0.01;\n break;\n case VH:\n w = width[0] * this.root.height * 0.01;\n break;\n case VMAX:\n w = width[0] * Math.max(this.root.width, this.root.height) * 0.01;\n break;\n case VMIN:\n w = width[0] * Math.min(this.root.width, this.root.height) * 0.01;\n break;\n }\n }\n }\n let lineClampCount = 0;\n // 4种布局,默认block,inlineBlock基本可以复用inline逻辑,除了尺寸\n if(display === 'flex') {\n this.__layoutFlex(data, isAbs, isColumn);\n }\n else if(display === 'inlineBlock' || display === 'inline-block') {\n lineClampCount = this.__layoutInline(data, isAbs, isColumn);\n }\n else if(display === 'inline') {\n lineClampCount = this.__layoutInline(data, isAbs, isColumn, true);\n }\n else {\n this.__layoutBlock(data, isAbs, isColumn);\n }\n // relative渲染时做偏移,百分比基于父元素,若父元素没有定高则为0\n if(!isAbs && !isColumn) {\n if(position === 'relative') {\n let {[TOP]: top, [RIGHT]: right, [BOTTOM]: bottom, [LEFT]: left} = currentStyle;\n let {parent} = this;\n if(top[1] !== AUTO) {\n let n = calRelative(currentStyle, TOP, top, parent);\n this.__offsetY(n);\n computedStyle[TOP] = n;\n computedStyle[BOTTOM] = 'auto';\n }\n else if(bottom[1] !== AUTO) {\n let n = calRelative(currentStyle, BOTTOM, bottom, parent);\n this.__offsetY(-n);\n computedStyle[BOTTOM] = n;\n computedStyle[TOP] = 'auto';\n }\n else {\n computedStyle[TOP] = computedStyle[BOTTOM] = 'auto';\n }\n if(left[1] !== AUTO) {\n let n = calRelative(currentStyle, LEFT, left, parent, true);\n this.__offsetX(n);\n computedStyle[LEFT] = n;\n computedStyle[RIGHT] = 'auto';\n }\n else if (right[1] !== AUTO) {\n let n = calRelative(currentStyle, RIGHT, right, parent, true);\n this.__offsetX(-n);\n computedStyle[RIGHT] = n;\n computedStyle[LEFT] = 'auto';\n }\n else {\n computedStyle[LEFT] = computedStyle[RIGHT] = 'auto';\n }\n }\n else if (position !== 'absolute') {\n computedStyle[TOP] = computedStyle[BOTTOM] = computedStyle[LEFT] = computedStyle[RIGHT] = 'auto';\n }\n // 计算结果存入computedStyle和6个坐标,inline在其inlineSize特殊处理\n let x = this.__sx = this.x + this.ox;\n let y = this.__sy = this.y + this.oy;\n if(!__config[NODE_IS_INLINE]) {\n x = this.__sx1 = x + computedStyle[MARGIN_LEFT];\n x = this.__sx2 = x + computedStyle[BORDER_LEFT_WIDTH];\n x = this.__sx3 = x + computedStyle[PADDING_LEFT];\n x = this.__sx4 = x + this.width;\n x = this.__sx5 = x + computedStyle[PADDING_RIGHT];\n this.__sx6 = x + computedStyle[BORDER_RIGHT_WIDTH];\n y = this.__sy1 = y + computedStyle[MARGIN_TOP];\n y = this.__sy2 = y + computedStyle[BORDER_TOP_WIDTH];\n y = this.__sy3 = y + computedStyle[PADDING_TOP];\n y = this.__sy4 = y + this.height;\n y = this.__sy5 = y + computedStyle[PADDING_BOTTOM];\n this.__sy6 = y + computedStyle[BORDER_BOTTOM_WIDTH];\n }\n computedStyle[WIDTH] = this.width;\n computedStyle[HEIGHT] = this.height;\n // abs为parse的根节点时特殊自己执行,前提是真布局\n if(position !== 'absolute') {\n this.__execAr();\n }\n this.__hasComputeReflow = false;\n }\n return lineClampCount;\n }\n\n __execAr() {\n // 动态json引用时动画暂存,第一次布局时处理这些动画到root的animateController上\n let ar = this.__animateRecords;\n if(ar) {\n this.__animateRecords = null;\n // parse没有dom时,animate的target引用都是json,vd后生成需重新赋值\n ar.list.forEach(item => {\n if(item.target.vd instanceof Xom) {\n item.target = item.target.vd;\n }\n });\n let ac = ar.controller || this.root.animateController;\n // 不自动播放进入记录列表,初始化并等待手动调用\n if(ar.options && ar.options.autoPlay === false) {\n ac.__records2 = ac.__records2.concat(ar.list);\n ac.init(ac.__records2, ac.list2);\n }\n else {\n ac.__records = ac.__records.concat(ar.list);\n ac.__playAuto();\n }\n }\n }\n\n __layoutNone() {\n let { computedStyle } = this;\n computedStyle[DISPLAY] = 'none';\n computedStyle[MARGIN_TOP]\n = computedStyle[MARGIN_RIGHT]\n = computedStyle[MARGIN_BOTTOM]\n = computedStyle[MARGIN_LEFT]\n = computedStyle[BORDER_TOP_WIDTH]\n = computedStyle[BORDER_RIGHT_WIDTH]\n = computedStyle[BORDER_BOTTOM_WIDTH]\n = computedStyle[BORDER_LEFT_WIDTH]\n = computedStyle[PADDING_TOP]\n = computedStyle[PADDING_RIGHT]\n = computedStyle[PADDING_BOTTOM]\n = computedStyle[PADDING_LEFT]\n = computedStyle[WIDTH]\n = computedStyle[HEIGHT]\n = this.__width\n = this.__height\n = 0;\n }\n\n // 预先计算是否是固定宽高,布局点位和尺寸考虑margin/border/padding\n __preLayout(data, isInline) {\n let { x, y, w, h, w2, h2, w3, h3, lx, nowrap, lineBoxManager, endSpace = 0 } = data;\n this.__x = x;\n this.__y = y;\n let { currentStyle, computedStyle } = this;\n let {\n [WIDTH]: width,\n [HEIGHT]: height,\n } = currentStyle;\n let {\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [MARGIN_TOP]: marginTop,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_BOTTOM]: marginBottom,\n [MARGIN_LEFT]: marginLeft,\n [PADDING_TOP]: paddingTop,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_BOTTOM]: paddingBottom,\n [PADDING_LEFT]: paddingLeft,\n } = computedStyle;\n // 除了auto外都是固定宽高度\n let fixedWidth;\n let fixedHeight;\n // 绝对定位是left+right这种其实等于定义了width,但不能修改原始style,存入特殊变量标识\n if(w2 !== undefined) {\n fixedWidth = true;\n w = w2;\n }\n // flex时也会用到,子级得出目标主尺寸后按这个来\n else if(w3 !== undefined) {\n fixedWidth = true;\n w = w3;\n }\n else if(width[1] !== AUTO) {\n fixedWidth = true;\n switch(width[1]) {\n case PX:\n w = width[0];\n break;\n case PERCENT:\n w *= width[0] * 0.01;\n break;\n case REM:\n w = width[0] * this.root.computedStyle[FONT_SIZE];\n break;\n case VW:\n w = width[0] * this.root.width * 0.01;\n break;\n case VH:\n w = width[0] * this.root.height * 0.01;\n break;\n case VMAX:\n w = width[0] * Math.max(this.root.width, this.root.height) * 0.01;\n break;\n case VMIN:\n w = width[0] * Math.min(this.root.width, this.root.height) * 0.01;\n break;\n }\n }\n if(h2 !== undefined) {\n fixedHeight = true;\n h = h2;\n }\n else if(h3 !== undefined) {\n fixedHeight = true;\n h = h3;\n }\n else if(height[1] !== AUTO) {\n fixedHeight = true;\n switch(height[1]) {\n case PX:\n h = height[0];\n break;\n case PERCENT:\n h *= height[0] * 0.01;\n break;\n case REM:\n h = height[0] * this.root.computedStyle[FONT_SIZE];\n break;\n case VW:\n h = height[0] * this.root.width * 0.01;\n break;\n case VH:\n h = height[0] * this.root.height * 0.01;\n break;\n case VMAX:\n h = height[0] * Math.max(this.root.width, this.root.height) * 0.01;\n break;\n case VMIN:\n h = height[0] * Math.min(this.root.width, this.root.height) * 0.01;\n break;\n }\n }\n // margin/border/padding影响x和y和尺寸,注意inline的y不受mpb影响\n x += borderLeftWidth + marginLeft + paddingLeft;\n data.x = x;\n if(!isInline) {\n y += borderTopWidth + marginTop + paddingTop;\n }\n data.y = y;\n // inline的w/h很特殊,需不考虑inline自身水平的mpb以便换行,因为mpb只在首尾行生效,所以首尾需特殊处理中间忽略\n // 当嵌套inline时更加复杂,假如inline有尾部mpb,最后一行需考虑,如果此inline是父的最后一个且父有mpb需叠加\n let selfEndSpace = 0;\n if(isInline) {\n selfEndSpace = paddingRight + borderRightWidth + marginRight;\n }\n // 传入w3/h3时,flex的item已知目标主尺寸,需减去mbp,其一定是block,和inline互斥\n if(!isInline) {\n if(width[1] === AUTO || w3 !== undefined) {\n w -= borderLeftWidth + borderRightWidth + marginLeft + marginRight + paddingLeft + paddingRight;\n }\n if(height[1] === AUTO || h3 !== undefined) {\n h -= borderTopWidth + borderBottomWidth + marginTop + marginBottom + paddingTop + paddingBottom;\n }\n }\n return {\n fixedWidth,\n fixedHeight,\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n nowrap,\n endSpace,\n selfEndSpace,\n };\n }\n\n // 处理margin:xx auto居中对齐或右对齐\n __marginAuto(style, data) {\n let {\n [POSITION]: position,\n [DISPLAY]: display,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_RIGHT]: marginRight,\n [WIDTH]: width,\n } = style;\n if(position !== 'absolute' && (display === 'block' || display === 'flex')\n && (width[1] !== AUTO || this.isReplaced) && marginLeft[1] === AUTO && marginRight[1] === AUTO) {\n let ow = this.outerWidth;\n if(ow < data.w) {\n this.__offsetX((data.w - ow) * 0.5, true);\n }\n }\n }\n\n __calMatrix(lv, __cacheStyle, currentStyle, computedStyle, __config, sx1, sy1, offsetWidth, offsetHeight) {\n if(__config[NODE_IS_INLINE]) {\n computedStyle[TRANSFORM_ORIGIN] = [sx1, sy1];\n return __cacheStyle[MATRIX] = mx.identity();\n }\n let matrixCache = __cacheStyle[MATRIX];\n // tx/ty变化特殊优化\n if(matrixCache && lv < REFLOW && !contain(lv, TF)) {\n let x = 0, y = 0, z = 0;\n if(contain(lv, TX)) {\n let v = currentStyle[TRANSLATE_X];\n if(isNil(v)) {\n v = 0;\n }\n else if(v[1] === PERCENT) {\n v = v[0] * this.offsetWidth * 0.01;\n }\n else if(v[1] === REM) {\n v = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * this.root.height * 0.01;\n }\n else if(v[1] === VMAX) {\n v = v[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(v[1] === VMIN) {\n v = v[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n else {\n v = v[0];\n }\n x = v - (computedStyle[TRANSLATE_X] || 0);\n computedStyle[TRANSLATE_X] = v;\n computedStyle[TRANSFORM][12] += x;\n matrixCache[12] += x;\n }\n if(contain(lv, TY)) {\n let v = currentStyle[TRANSLATE_Y];\n if(isNil(v)) {\n v = 0;\n }\n else if(v[1] === PERCENT) {\n v = v[0] * this.offsetHeight * 0.01;\n }\n else if(v[1] === REM) {\n v = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * this.root.height * 0.01;\n }\n else if(v[1] === VMAX) {\n v = v[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(v[1] === VMIN) {\n v = v[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n else {\n v = v[0];\n }\n y = v - (computedStyle[TRANSLATE_Y] || 0);\n computedStyle[TRANSLATE_Y] = v;\n computedStyle[TRANSFORM][13] += y;\n matrixCache[13] += y;\n }\n if(contain(lv, TZ)) {\n let v = currentStyle[TRANSLATE_Z];\n if(isNil(v)) {\n v = 0;\n }\n else if(v[1] === PERCENT) {\n v = v[0] * this.offsetWidth * 0.01;\n }\n else if(v[1] === REM) {\n v = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * this.root.height * 0.01;\n }\n else if(v[1] === VMAX) {\n v = v[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(v[1] === VMIN) {\n v = v[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n else {\n v = v[0];\n }\n z = v - (computedStyle[TRANSLATE_Z] || 0);\n computedStyle[TRANSLATE_Z] = v;\n computedStyle[TRANSFORM][14] += z;\n matrixCache[14] += z;\n }\n __cacheStyle[MATRIX] = matrixCache;\n }\n // 先根据cache计算需要重新计算的computedStyle\n else {\n if(sx1 === undefined) {\n sx1 = this.__sx1;\n sy1 = this.__sy1;\n offsetWidth = this.offsetWidth;\n offsetHeight = this.offsetHeight;\n }\n if(__cacheStyle[TRANSFORM_ORIGIN] === undefined) {\n __cacheStyle[TRANSFORM_ORIGIN] = true;\n matrixCache = null;\n computedStyle[TRANSFORM_ORIGIN] = tf.calOrigin(currentStyle[TRANSFORM_ORIGIN], offsetWidth, offsetHeight, this.root);\n }\n if(__cacheStyle[TRANSFORM] === undefined\n || __cacheStyle[TRANSLATE_X] === undefined\n || __cacheStyle[TRANSLATE_Y] === undefined\n || __cacheStyle[TRANSLATE_Z] === undefined\n || __cacheStyle[ROTATE_X] === undefined\n || __cacheStyle[ROTATE_Y] === undefined\n || __cacheStyle[ROTATE_Z] === undefined\n || __cacheStyle[ROTATE_3D] === undefined\n || __cacheStyle[SCALE_X] === undefined\n || __cacheStyle[SCALE_Y] === undefined\n || __cacheStyle[SCALE_Z] === undefined\n || __cacheStyle[SKEW_X] === undefined\n || __cacheStyle[SKEW_Y] === undefined) {\n __cacheStyle[TRANSFORM]\n = __cacheStyle[TRANSLATE_X]\n = __cacheStyle[TRANSLATE_Y]\n = __cacheStyle[TRANSLATE_Z]\n = __cacheStyle[ROTATE_X]\n = __cacheStyle[ROTATE_Y]\n = __cacheStyle[ROTATE_Z]\n = __cacheStyle[SCALE_X]\n = __cacheStyle[SCALE_Y]\n = __cacheStyle[SCALE_Z]\n = __cacheStyle[SKEW_X]\n = __cacheStyle[SKEW_Y]\n = true;\n matrixCache = null;\n let matrix;\n // transform相对于自身\n if(currentStyle[TRANSFORM]) {\n matrix = tf.calMatrix(currentStyle[TRANSFORM], offsetWidth, offsetHeight, this.root);\n }\n // 没有transform则看是否有扩展的css独立变换属性\n else {\n let temp = [];\n [\n TRANSLATE_X,\n TRANSLATE_Y,\n TRANSLATE_Z,\n ROTATE_X,\n ROTATE_Y,\n ROTATE_Z,\n ROTATE_3D,\n SKEW_X,\n SKEW_Y,\n SCALE_X,\n SCALE_Y,\n SCALE_Z,\n ].forEach(k => {\n // 删除之前遗留的\n delete computedStyle[k];\n let v = currentStyle[k];\n if(isNil(v)) {\n return;\n }\n if(k === ROTATE_3D) {\n computedStyle[k] = [v[0], v[1], v[2], v[3][0]];\n if(v[3][0] === 0) {\n return;\n }\n temp.push([k, v]);\n return;\n }\n computedStyle[k] = v[0];\n // scale为1和其它为0避免计算浪费\n let isScale = k === SCALE_X || k === SCALE_Y || k === SCALE_Z;\n if(v[0] === 1 && isScale || !isScale && v[0] === 0) {\n return;\n }\n if(v[1] === PERCENT) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n computedStyle[k] = v[0] * offsetWidth * 0.01;\n }\n else if(k === TRANSLATE_Y) {\n computedStyle[k] = v[0] * offsetHeight * 0.01;\n }\n }\n else if(v[1] === REM) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n computedStyle[k] = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(k === TRANSLATE_Y) {\n computedStyle[k] = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n }\n else if(v[1] === VW) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n computedStyle[k] = v[0] * this.root.width * 0.01;\n }\n else if(k === TRANSLATE_Y) {\n computedStyle[k] = v[0] * this.root.width * 0.01;\n }\n }\n else if(v[1] === VH) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n computedStyle[k] = v[0] * this.root.height * 0.01;\n }\n else if(k === TRANSLATE_Y) {\n computedStyle[k] = v[0] * this.root.height * 0.01;\n }\n }\n else if(v[1] === VMAX) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n computedStyle[k] = v[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(k === TRANSLATE_Y) {\n computedStyle[k] = v[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n }\n else if(v[1] === VMIN) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n computedStyle[k] = v[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n else if(k === TRANSLATE_Y) {\n computedStyle[k] = v[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n }\n temp.push([k, v]);\n });\n if(temp.length) {\n matrix = tf.calMatrix(temp, offsetWidth, offsetHeight, this.root);\n }\n }\n computedStyle[TRANSFORM] = matrix || mx.identity();\n }\n if(!matrixCache) {\n let m = computedStyle[TRANSFORM];\n let tfo = computedStyle[TRANSFORM_ORIGIN].slice(0);\n tfo[0] += sx1 || 0;\n tfo[1] += sy1 || 0;\n matrixCache = __cacheStyle[MATRIX] = tf.calMatrixByOrigin(m, tfo);\n }\n }\n return matrixCache;\n }\n\n /**\n * 将currentStyle计算为computedStyle,同时存入cacheStyle可缓存的结果防止无变更重复计算\n * @param renderMode\n * @param ctx\n * @param parent\n * @param __cacheStyle\n * @param currentStyle\n * @param computedStyle\n * @param clientWidth\n * @param clientHeight\n * @param offsetWidth\n * @param offsetHeight\n * @param borderTopWidth\n * @param borderRightWidth\n * @param borderBottomWidth\n * @param borderLeftWidth\n * @param paddingTop\n * @param paddingRight\n * @param paddingBottom\n * @param paddingLeft\n * @param x1\n * @param x2\n * @param x3\n * @param x4\n * @param x5\n * @param x6\n * @param y1\n * @param y2\n * @param y3\n * @param y4\n * @param y5\n * @param y6\n * @returns {*[]}\n * @private\n */\n __calCache(renderMode, ctx, parent, __cacheStyle, currentStyle, computedStyle,\n clientWidth, clientHeight, offsetWidth, offsetHeight,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n paddingTop, paddingRight, paddingBottom, paddingLeft,\n x1, x2, x3, x4, x5, x6, y1, y2, y3, y4, y5, y6) {\n let bx1 = x1, by1 = y1, bx2 = x6, by2 = y6;\n let backgroundClip = computedStyle[BACKGROUND_CLIP] = currentStyle[BACKGROUND_CLIP];\n // 默认border-box\n if(backgroundClip === 'paddingBox' || backgroundClip === 'padding-box') {\n bx1 = x2;\n by1 = y2;\n bx2 = x5;\n by2 = y5;\n }\n else if(backgroundClip === 'contentBox' || backgroundClip === 'content-box') {\n bx1 = x3;\n by1 = y3;\n bx2 = x4;\n by2 = y4;\n }\n let isInline = this.__config[NODE_IS_INLINE];\n if(isInline && !this.contentBoxList.length) {\n isInline = false;\n }\n // 这些直接赋值的不需要再算缓存\n [\n OPACITY,\n Z_INDEX,\n BORDER_TOP_STYLE,\n BORDER_RIGHT_STYLE,\n BORDER_BOTTOM_STYLE,\n BORDER_LEFT_STYLE,\n BACKGROUND_REPEAT,\n OVERFLOW,\n MIX_BLEND_MODE,\n TEXT_OVERFLOW,\n BACKGROUND_CLIP,\n ].forEach(k => {\n computedStyle[k] = currentStyle[k];\n });\n if(isNil(__cacheStyle[FILTER])) {\n __cacheStyle[FILTER] = true;\n this.__calFilter(currentStyle, computedStyle);\n }\n if(isNil(__cacheStyle[BACKGROUND_POSITION_X])) {\n __cacheStyle[BACKGROUND_POSITION_X] = true;\n let {\n [BACKGROUND_POSITION_X]: bgX,\n } = currentStyle;\n computedStyle[BACKGROUND_POSITION_X] = (bgX || []).map(item => {\n if(item[1] === PX) {\n return item[0];\n }\n if(item[1] === REM) {\n return item[0] * this.root.computedStyle[FONT_SIZE];\n }\n if(item[1] === VW) {\n return item[0] * this.root.width * 0.01;\n }\n if(item[1] === VH) {\n return item[0] * this.root.height * 0.01;\n }\n if(item[1] === VMAX) {\n return item[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n if(item[1] === VMIN) {\n return item[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(item[1] === PERCENT) {\n return item[0] + '%';\n }\n });\n }\n if(isNil(__cacheStyle[BACKGROUND_POSITION_Y])) {\n __cacheStyle[BACKGROUND_POSITION_Y] = true;\n let {\n [BACKGROUND_POSITION_Y]: bgY,\n } = currentStyle;\n computedStyle[BACKGROUND_POSITION_Y] = (bgY || []).map(item => {\n if(item[1] === PX) {\n return item[0];\n }\n if(item[1] === REM) {\n return item[0] * this.root.computedStyle[FONT_SIZE];\n }\n if(item[1] === VW) {\n return item[0] * this.root.width * 0.01;\n }\n if(item[1] === VH) {\n return item[0] * this.root.height * 0.01;\n }\n if(item[1] === VMAX) {\n return item[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n if(item[1] === VMIN) {\n return item[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(item[1] === PERCENT) {\n return item[0] + '%';\n }\n });\n }\n if(isNil(__cacheStyle[BACKGROUND_SIZE])) {\n __cacheStyle[BACKGROUND_SIZE] = true;\n computedStyle[BACKGROUND_SIZE] = (currentStyle[BACKGROUND_SIZE] || []).map(item => {\n return bg.calBackgroundSize(item, bx2 - bx1, by2 - by1, this.root);\n });\n }\n if(isNil(__cacheStyle[BACKGROUND_IMAGE])) {\n let bgI = computedStyle[BACKGROUND_IMAGE] = currentStyle[BACKGROUND_IMAGE].slice(0);\n __cacheStyle[BACKGROUND_IMAGE] = bgI.map((bgi, i) => {\n if(!bgi) {\n return null;\n }\n // 防止隐藏不加载背景图\n if(util.isString(bgi)) {\n let loadBgi = this.__loadBgi[i] = this.__loadBgi[i] || {};\n let cache = inject.IMG[BACKGROUND_IMAGE];\n if(cache && cache.state === inject.LOADED) {\n loadBgi.url = BACKGROUND_IMAGE;\n loadBgi.source = cache.source;\n loadBgi.width = cache.width;\n loadBgi.height = cache.height;\n }\n else if(loadBgi.url !== bgi) {\n // 可能改变导致多次加载,每次清空,成功后还要比对url是否相同\n loadBgi.url = bgi;\n loadBgi.source = null;\n let node = this;\n let root = node.root;\n inject.measureImg(bgi, data => {\n // 还需判断url,防止重复加载时老的替换新的,失败不绘制bgi\n if(data.success && data.url === loadBgi.url && !this.isDestroyed) {\n loadBgi.source = data.source;\n loadBgi.width = data.width;\n loadBgi.height = data.height;\n root.delRefreshTask(loadBgi.cb);\n root.addRefreshTask(loadBgi.cb = {\n __before() {\n __cacheStyle[BACKGROUND_IMAGE] = undefined;\n let res = {};\n res[UPDATE_NODE] = node;\n res[UPDATE_FOCUS] = REPAINT;\n res[UPDATE_CONFIG] = node.__config;\n root.__addUpdate(node, node.__config, root, root.__config, res);\n },\n });\n }\n }, {\n ctx,\n root,\n width: bx2 - bx1,\n height: by2 - by1,\n });\n }\n return true;\n }\n else if(!isInline && bgi.k) {\n // gradient在渲染时才生成\n return true;\n }\n });\n }\n if(isNil(__cacheStyle[BOX_SHADOW])) {\n __cacheStyle[BOX_SHADOW] = true;\n computedStyle[BOX_SHADOW] = (currentStyle[BOX_SHADOW] || []).map(item => {\n return item.map((item2, i) => {\n if(i > 3) {\n return item2;\n }\n let v = item2[0];\n if(item2[1] === PERCENT) {\n if(i % 2 === 0) {\n v *= 0.01 * (bx2 - bx1);\n }\n else {\n v *= 0.01 * (by2 - by1);\n }\n }\n else if(item2[1] === REM) {\n v = v * this.root.computedStyle[FONT_SIZE];\n }\n else if(item2[1] === VW) {\n v = v * this.root.width * 0.01;\n }\n else if(item2[1] === VH) {\n v = v * this.root.height * 0.01;\n }\n else if(item2[1] === VMAX) {\n v = v * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(item2[1] === VMIN) {\n v = v * Math.min(this.root.width, this.root.height) * 0.01;\n }\n return v;\n });\n });\n }\n [\n BACKGROUND_COLOR,\n BORDER_TOP_COLOR,\n BORDER_RIGHT_COLOR,\n BORDER_BOTTOM_COLOR,\n BORDER_LEFT_COLOR,\n ].forEach(k => {\n if(isNil(__cacheStyle[k])) {\n __cacheStyle[k] = int2rgba(computedStyle[k] = currentStyle[k][0]);\n }\n });\n // 圆角边计算\n if(isNil(__cacheStyle[BORDER_TOP_LEFT_RADIUS])\n || isNil(__cacheStyle[BORDER_TOP_RIGHT_RADIUS])\n || isNil(__cacheStyle[BORDER_BOTTOM_RIGHT_RADIUS])\n || isNil(__cacheStyle[BORDER_BOTTOM_LEFT_RADIUS])) {\n __cacheStyle[BORDER_TOP_LEFT_RADIUS]\n = __cacheStyle[BORDER_TOP_RIGHT_RADIUS]\n = __cacheStyle[BORDER_BOTTOM_RIGHT_RADIUS]\n = __cacheStyle[BORDER_BOTTOM_LEFT_RADIUS]\n = true;\n // 非替代的inline计算看contentBox首尾\n if(isInline) {\n border.calBorderRadiusInline(this.contentBoxList, currentStyle, computedStyle, this.root);\n }\n // 普通block整体计算\n else {\n border.calBorderRadius(offsetWidth, offsetHeight, currentStyle, computedStyle, this.root);\n }\n }\n // width/style/radius影响border,color不影响渲染缓存\n let btlr = computedStyle[BORDER_TOP_LEFT_RADIUS];\n let btrr = computedStyle[BORDER_TOP_RIGHT_RADIUS];\n let bbrr = computedStyle[BORDER_BOTTOM_RIGHT_RADIUS];\n let bblr = computedStyle[BORDER_BOTTOM_LEFT_RADIUS];\n ['Top', 'Right', 'Bottom', 'Left'].forEach(k => {\n k = 'border' + k;\n let k2 = STYLE_KEY[style2Upper(k)];\n let kw = STYLE_KEY[style2Upper(k + 'Width')];\n let ks = STYLE_KEY[style2Upper(k + 'Style')];\n // width/style变更影响border重新计算\n if(isNil(__cacheStyle[kw])) {\n __cacheStyle[kw] = true;\n __cacheStyle[k2] = undefined;\n }\n if(isNil(__cacheStyle[ks])) {\n __cacheStyle[ks] = true;\n __cacheStyle[k2] = undefined;\n }\n if(isNil(__cacheStyle[k2])) {\n if(k2 === BORDER_TOP) {\n if(borderTopWidth > 0) {\n if(!isInline) {\n let deg1 = Math.atan(borderTopWidth / borderLeftWidth);\n let deg2 = Math.atan(borderTopWidth / borderRightWidth);\n __cacheStyle[k2] = border.calPoints(borderTopWidth, computedStyle[ks], deg1, deg2,\n x1, x2, x5, x6, y1, y2, y5, y6, 0, btlr, btrr);\n }\n }\n else {\n __cacheStyle[k2] = [];\n }\n }\n else if(k2 === BORDER_RIGHT) {\n if(borderRightWidth > 0) {\n if(!isInline) {\n let deg1 = Math.atan(borderRightWidth / borderTopWidth);\n let deg2 = Math.atan(borderRightWidth / borderBottomWidth);\n __cacheStyle[k2] = border.calPoints(borderRightWidth, computedStyle[ks], deg1, deg2,\n x1, x2, x5, x6, y1, y2, y5, y6, 1, btrr, bbrr);\n }\n }\n else {\n __cacheStyle[k2] = [];\n }\n }\n else if(k2 === BORDER_BOTTOM) {\n if(borderBottomWidth > 0) {\n if(!isInline) {\n let deg1 = Math.atan(borderBottomWidth / borderLeftWidth);\n let deg2 = Math.atan(borderBottomWidth / borderRightWidth);\n __cacheStyle[k2] = border.calPoints(borderBottomWidth, computedStyle[ks], deg1, deg2,\n x1, x2, x5, x6, y1, y2, y5, y6, 2, bblr, bbrr);\n }\n }\n else {\n __cacheStyle[k2] = [];\n }\n }\n else if(k2 === BORDER_LEFT) {\n if(borderLeftWidth > 0) {\n if(!isInline) {\n let deg1 = Math.atan(borderLeftWidth / borderTopWidth);\n let deg2 = Math.atan(borderLeftWidth / borderBottomWidth);\n __cacheStyle[k2] = border.calPoints(borderLeftWidth, computedStyle[ks], deg1, deg2,\n x1, x2, x5, x6, y1, y2, y5, y6, 3, btlr, bblr);\n }\n }\n else {\n __cacheStyle[k2] = [];\n }\n }\n }\n });\n // 强制计算继承性的\n let parentComputedStyle = parent && parent.computedStyle;\n if(currentStyle[FONT_STYLE][1] === INHERIT) {\n computedStyle[FONT_STYLE] = parent ? parentComputedStyle[FONT_STYLE] : 'normal';\n }\n else if(isNil(__cacheStyle[FONT_STYLE])) {\n computedStyle[FONT_STYLE] = currentStyle[FONT_STYLE][0];\n }\n __cacheStyle[FONT_STYLE] = computedStyle[FONT_STYLE];\n if(currentStyle[COLOR][1] === INHERIT) {\n computedStyle[COLOR] = parent ? parentComputedStyle[COLOR] : [0, 0, 0, 1];\n __cacheStyle[COLOR] = int2rgba(computedStyle[COLOR]);\n }\n else if(isNil(__cacheStyle[COLOR])) {\n computedStyle[COLOR] = rgba2int(currentStyle[COLOR][0]);\n __cacheStyle[COLOR] = int2rgba(computedStyle[COLOR]);\n }\n if(currentStyle[TEXT_STROKE_COLOR][1] === INHERIT) {\n computedStyle[TEXT_STROKE_COLOR] = parent ? parentComputedStyle[TEXT_STROKE_COLOR] : [0, 0, 0, 1];\n __cacheStyle[TEXT_STROKE_COLOR] = int2rgba(computedStyle[TEXT_STROKE_COLOR]);\n }\n else if(isNil(__cacheStyle[TEXT_STROKE_COLOR])) {\n computedStyle[TEXT_STROKE_COLOR] = rgba2int(currentStyle[TEXT_STROKE_COLOR][0]);\n __cacheStyle[TEXT_STROKE_COLOR] = int2rgba(computedStyle[TEXT_STROKE_COLOR]);\n }\n if(currentStyle[TEXT_STROKE_WIDTH][1] === INHERIT) {\n computedStyle[TEXT_STROKE_WIDTH] = parent ? parentComputedStyle[TEXT_STROKE_WIDTH] : 0;\n __cacheStyle[TEXT_STROKE_WIDTH] = true;\n }\n else if(isNil(__cacheStyle[TEXT_STROKE_WIDTH])) {\n let v = currentStyle[TEXT_STROKE_WIDTH];\n if(v[1] === REM) {\n v = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * this.root.height * 0.01;\n }\n else if(v[1] === VMAX) {\n v = v[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(v[1] === VMIN) {\n v = v[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n else {\n v = v[0];\n }\n computedStyle[TEXT_STROKE_WIDTH] = v;\n __cacheStyle[TEXT_STROKE_WIDTH] = true;\n }\n if(currentStyle[TEXT_STROKE_OVER][1] === INHERIT) {\n __cacheStyle[TEXT_STROKE_OVER] = computedStyle[TEXT_STROKE_OVER] = parent ? parentComputedStyle[TEXT_STROKE_OVER] : 'none';\n }\n else {\n __cacheStyle[TEXT_STROKE_OVER] = computedStyle[TEXT_STROKE_OVER] = currentStyle[TEXT_STROKE_OVER][0];\n }\n if(currentStyle[VISIBILITY][1] === INHERIT) {\n computedStyle[VISIBILITY] = parent ? parentComputedStyle[VISIBILITY] : 'visible';\n }\n else if(isNil(__cacheStyle[VISIBILITY])) {\n computedStyle[VISIBILITY] = currentStyle[VISIBILITY][0];\n }\n __cacheStyle[VISIBILITY] = computedStyle[VISIBILITY];\n if(currentStyle[POINTER_EVENTS][1] === INHERIT) {\n computedStyle[POINTER_EVENTS] = parent ? parentComputedStyle[POINTER_EVENTS] : 'auto';\n }\n else if(isNil(__cacheStyle[POINTER_EVENTS])) {\n computedStyle[POINTER_EVENTS] = currentStyle[POINTER_EVENTS][0];\n }\n __cacheStyle[POINTER_EVENTS] = computedStyle[POINTER_EVENTS];\n this.__bx1 = bx1;\n this.__bx2 = bx2;\n this.__by1 = by1;\n this.__by2 = by2;\n return [bx1, by1, bx2, by2];\n }\n\n __calPerspective(__cacheStyle, currentStyle, computedStyle, __config, sx1, sy1) {\n let rebuild;\n if(isNil(__cacheStyle[PERSPECTIVE])) {\n __cacheStyle[PERSPECTIVE] = true;\n rebuild = true;\n let v = currentStyle[PERSPECTIVE];\n let ppt = 0;\n if(v[1] === REM) {\n ppt = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n ppt = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n ppt = v[0] * this.root.height * 0.01;\n }\n else if(v[1] === VMAX) {\n ppt = v[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(v[1] === VMIN) {\n ppt = v[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n else {\n ppt = v[0];\n }\n computedStyle[PERSPECTIVE] = ppt;\n }\n if(isNil(__cacheStyle[PERSPECTIVE_ORIGIN])) {\n __cacheStyle[PERSPECTIVE_ORIGIN] = true;\n rebuild = true;\n computedStyle[PERSPECTIVE_ORIGIN] = tf.calOrigin(currentStyle[PERSPECTIVE_ORIGIN], this.offsetWidth, this.offsetHeight, this.root);\n }\n if(rebuild) {\n if(sx1 === undefined) {\n sx1 = this.__sx1;\n sy1 = this.__sy1;\n }\n let po = computedStyle[PERSPECTIVE_ORIGIN].slice(0);\n po[0] += sx1 || 0;\n po[1] += sy1 || 0;\n __config[NODE_PERSPECTIVE_MATRIX] = tf.calPerspectiveMatrix(computedStyle[PERSPECTIVE], po);\n }\n }\n\n __calFilter(currentStyle, computedStyle) {\n return computedStyle[FILTER] = (currentStyle[FILTER] || []).map(item => {\n let [k, v] = item;\n // 部分%单位的滤镜强制使用数字\n if(v[1] === PX || v[1] === DEG || v[1] === PERCENT || v[1] === NUMBER) {\n v = v[0];\n }\n else if(v[1] === REM) {\n v = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * this.root.height * 0.01;\n }\n else if(v[1] === VMAX) {\n v = v[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(v[1] === VMIN) {\n v = v[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n return [k, v];\n });\n }\n\n __calContent(renderMode, lv, currentStyle, computedStyle) {\n if(renderMode === CANVAS || renderMode === WEBGL) {\n if(lv < REPAINT) {\n return this.__hasContent;\n }\n let visibility = currentStyle[VISIBILITY];\n if(visibility !== 'hidden') {\n let bgI = currentStyle[BACKGROUND_IMAGE];\n if(Array.isArray(bgI)) {\n for(let i = 0, len = bgI.length; i < len; i++) {\n if(bgI[i]) {\n return true;\n }\n }\n }\n if(currentStyle[BACKGROUND_COLOR][0][3] > 0) {\n let width = computedStyle[WIDTH], height = computedStyle[HEIGHT],\n paddingTop = computedStyle[PADDING_TOP], paddingRight = computedStyle[PADDING_RIGHT],\n paddingBottom = computedStyle[PADDING_BOTTOM], paddingLeft = computedStyle[PADDING_LEFT];\n if(width && height || paddingTop || paddingRight || paddingBottom || paddingLeft) {\n return true;\n }\n }\n for(let list = ['Top', 'Right', 'Bottom', 'Left'], i = 0, len = list.length; i < len; i++) {\n let k = list[i];\n if(computedStyle[STYLE_KEY[style2Upper('border' + k + 'Width')]] > 0\n && currentStyle[STYLE_KEY[style2Upper('border' + k + 'Color')]][0][3] > 0) {\n return true;\n }\n }\n let bs = currentStyle[BOX_SHADOW];\n if(Array.isArray(bs)) {\n for(let i = 0, len = bs.length; i < len; i++) {\n let item = bs[i];\n if(item && (item[2] > 0 || item[3] > 0)) {\n return true;\n }\n }\n }\n }\n }\n return false;\n }\n\n /**\n * 渲染基础方法,Dom/Geom公用\n * @param renderMode\n * @see node/mode\n * @param lv\n * @see refresh/level\n * @param ctx canvas/svg/webgl共用\n * @param cache 是否是局部根节点缓存模式下的绘制\n * @see refresh/Cache.NA\n * @param dx cache时偏移x\n * @param dy cache时偏移y\n * @return Object\n * x1/x2/x3/x4/y1/y2/y3/y4 坐标\n * break svg判断无变化提前跳出\n * cacheError 离屏申请失败,仅canvas\n * offscreenBlend 无cache时的离屏canvas,仅canvas\n * offscreenFilter 无cache时的离屏canvas,仅canvas\n * offscreenOverflow 无cache时的离屏canvas,仅canvas\n * offscreenMask 无cache时的离屏canvas,仅canvas\n */\n render(renderMode, lv, ctx, cache, dx = 0, dy = 0) {\n let {\n isDestroyed,\n root,\n __config,\n } = this;\n let __cache = __config[NODE_CACHE];\n let __cacheStyle = __config[NODE_CACHE_STYLE];\n let currentStyle = __config[NODE_CURRENT_STYLE];\n let computedStyle = __config[NODE_COMPUTED_STYLE];\n // 渲染完认为完全无变更,等布局/动画/更新重置\n __config[NODE_REFRESH_LV] = NONE;\n // >=REPAINT清空bbox\n if(lv >= REPAINT) {\n this.__bbox = null;\n }\n if(isDestroyed) {\n return { isDestroyed, break: true };\n }\n let virtualDom;\n // svg设置vd上的lv属性标明lineHeight的话,另外特殊字体如arial拥有lineGap也会产生间隙,背景色不绘制这个间隙\n * x轴根据contentBox的范围坐标,y则固定和font/lineHeight相关\n * 圆角发生在首尾lineBox处,中间不会有,bgi则产生类似bgc作为mask的效果\n * 另外要注意多个时的顺序,必须依次渲染,后面的bb可能会覆盖前面行的\n */\n if(isRealInline) {\n let contentBoxList = this.contentBoxList;\n let length = contentBoxList.length;\n let hasBgi = backgroundImage.some(item => item);\n if(length) {\n let {\n [FONT_SIZE]: fontSize,\n [FONT_FAMILY]: fontFamily,\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n let iw = 0, ih = 0;\n let offscreen, svgBgSymbol = [];\n // bgi视作inline排满一行绘制,然后按分行拆开给每行\n if(hasBgi) {\n iw = inline.getInlineWidth(this, contentBoxList);\n ih = lineHeight;\n if(backgroundClip === 'paddingBox' || backgroundClip === 'padding-box') {\n iw += paddingLeft + paddingRight;\n ih += paddingTop + paddingBottom;\n }\n else if(backgroundClip !== 'contentBox' && backgroundClip !== 'content-box') {\n iw += paddingLeft + paddingRight + borderLeftWidth + borderRightWidth;\n ih += paddingTop + paddingBottom + borderTopWidth + borderBottomWidth;\n }\n if(renderMode === CANVAS || renderMode === WEBGL) {\n offscreen = inject.getCacheCanvas(iw, ih, '__$$INLINE_BGI$$__');\n }\n let length = backgroundImage.length;\n backgroundImage.slice(0).reverse().forEach((bgi, i) => {\n if(!bgi) {\n return;\n }\n i = length - 1 - i;\n if(util.isString(bgi)) {\n let loadBgi = this.__loadBgi[i];\n if(loadBgi.url === backgroundImage[i]) {\n let uuid = bg.renderImage(this, renderMode, offscreen && offscreen.ctx || ctx, loadBgi,\n 0, 0, iw, ih, btlr, btrr, bbrr, bblr,\n currentStyle, i, backgroundSize, backgroundRepeat, __config, true, dx, dy);\n if(renderMode === SVG && uuid) {\n svgBgSymbol.push(uuid);\n }\n }\n }\n else if(bgi.k) {\n let gd = this.__gradient(renderMode, ctx, 0, 0, iw, ih, bgi, dx, dy);\n if(gd) {\n if(gd.k === 'conic') {\n let uuid = gradient.renderConic(this, renderMode, offscreen && offscreen.ctx || ctx, gd.v, 0, 0, iw, lineHeight,\n btlr, btrr, bbrr, bblr, true);\n if(renderMode === SVG && uuid) {\n svgBgSymbol.push(uuid);\n }\n }\n else {\n let uuid = bg.renderBgc(this, renderMode, offscreen && offscreen.ctx || ctx, gd.v, null,\n 0, 0, iw, ih, btlr, btrr, bbrr, bblr, 'fill', true);\n if(renderMode === SVG && uuid) {\n svgBgSymbol.push(uuid);\n }\n }\n }\n }\n });\n }\n // 获取当前dom的baseline,再减去lineBox的baseline得出差值,这样渲染范围y就是lineBox的y+差值为起始,lineHeight为高\n let ff = css.getFontFamily(fontFamily);\n let baseline = css.getBaseline(computedStyle);\n // lineGap,一般为0,某些字体如arial有,渲染高度需减去它,最终是lineHeight - diffL\n let diffL = fontSize * (font.info[ff].lgr || 0);\n // 注意只有1个的时候特殊情况,圆角只在首尾行出现\n let isFirst = true;\n let lastContentBox = contentBoxList[0], lastLineBox = lastContentBox.parentLineBox;\n // bgi需统计宽度累计值,将当前行所处理想单行的x范围位置计算出来,并进行bgi贴图绘制,svg还需统计第几行\n let count = 0, countW = 0;\n for(let i = 0; i < length; i++) {\n let contentBox = contentBoxList[i];\n if(contentBox.parentLineBox !== lastLineBox) {\n // 上一行\n let [ix1, iy1, ix2, iy2, bx1, by1, bx2, by2] = inline.getInlineBox(this, contentBoxList,\n lastContentBox, contentBoxList[i - 1], lastLineBox, baseline, lineHeight, diffL, isFirst, false,\n backgroundClip, paddingTop, paddingRight, paddingBottom, paddingLeft,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth);\n // 要算上开头空白inline,可能有多个和递归嵌套\n if(isFirst) {\n let n = getFirstEmptyInlineWidth(this);\n ix1 -= n;\n bx1 -= n;\n }\n if(backgroundColor[3] > 0) {\n bg.renderBgc(this, renderMode, ctx, __cacheStyle[BACKGROUND_COLOR], null,\n ix1, iy1, ix2 - ix1, iy2 - iy1, btlr, [0, 0], [0, 0], bblr, 'fill', false, dx, dy);\n }\n let w = ix2 - ix1;\n // canvas的bg位图裁剪\n if((renderMode === CANVAS || renderMode === WEBGL) && offscreen) {\n ctx.drawImage(offscreen.canvas, countW, 0, w, ih, ix1 + dx, iy1 + dy, w, ih);\n }\n //svg则特殊判断\n else if(renderMode === SVG && svgBgSymbol.length) {\n svgBgSymbol.forEach(symbol => {\n if(symbol) {\n let v = {\n tagName: 'clipPath',\n props: [],\n children: [\n {\n tagName: 'path',\n props: [\n ['d', `M${countW},${0}L${w+countW},${0}L${w+countW},${ih}L${countW},${ih},L${countW},${0}`],\n ],\n }\n ],\n };\n let clip = ctx.add(v);\n __config[NODE_DEFS_CACHE].push(v);\n virtualDom.bb.push({\n type: 'item',\n tagName: 'use',\n props: [\n ['xlink:href', '#' + symbol],\n ['x', ix1 - countW],\n ['y', iy1],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n }\n });\n }\n countW += w;\n if(boxShadow) {\n boxShadow.forEach(item => {\n bs.renderBoxShadow(this, renderMode, ctx, item, bx1, by1, bx2, by2, bx2 - bx1, by2 - by1, dx, dy);\n });\n }\n if(borderTopWidth > 0 && borderTopColor[3] > 0) {\n let deg1 = Math.atan(borderTopWidth / borderLeftWidth);\n let deg2 = Math.atan(borderTopWidth / borderRightWidth);\n let list = border.calPoints(borderTopWidth, computedStyle[BORDER_TOP_STYLE], deg1, deg2,\n bx1, bx1 + borderLeftWidth, bx2, bx2,\n by1, by1 + borderTopWidth, by2 - borderBottomWidth, by2, 0, isFirst ? btlr : [0, 0], [0, 0]);\n border.renderBorder(this, renderMode, ctx, list, __cacheStyle[BORDER_TOP_COLOR], dx, dy);\n }\n if(borderBottomWidth > 0 && borderBottomColor[3] > 0) {\n let deg1 = Math.atan(borderBottomWidth / borderLeftWidth);\n let deg2 = Math.atan(borderBottomWidth / borderRightWidth);\n let list = border.calPoints(borderBottomWidth, computedStyle[BORDER_BOTTOM_STYLE], deg1, deg2,\n bx1, bx1 + borderLeftWidth, bx2, bx2,\n by1, by1 + borderTopWidth, by2 - borderBottomWidth, by2, 2, isFirst ? btlr : [0, 0], [0, 0]);\n border.renderBorder(this, renderMode, ctx, list, __cacheStyle[BORDER_BOTTOM_COLOR], dx, dy);\n }\n if(isFirst && borderLeftWidth > 0 && borderLeftColor[3] > 0) {\n let deg1 = Math.atan(borderLeftWidth / borderTopWidth);\n let deg2 = Math.atan(borderLeftWidth / borderBottomWidth);\n let list = border.calPoints(borderLeftWidth, computedStyle[BORDER_LEFT_STYLE], deg1, deg2,\n bx1, bx1 + borderLeftWidth, bx2 - borderRightWidth, bx2,\n by1, by1 + borderTopWidth, by2 - borderBottomWidth, by2, 3, btlr, btrr);\n border.renderBorder(this, renderMode, ctx, list, __cacheStyle[BORDER_LEFT_COLOR], dx, dy);\n }\n isFirst = false;\n lastContentBox = contentBox;\n lastLineBox = contentBox.parentLineBox;\n count++;\n }\n // 最后一个特殊判断\n if(i === length - 1) {\n let [ix1, iy1, ix2, iy2, bx1, by1, bx2, by2] = inline.getInlineBox(this, contentBoxList,\n lastContentBox, contentBoxList[i], lastLineBox, baseline, lineHeight, diffL, isFirst, true,\n backgroundClip, paddingTop, paddingRight, paddingBottom, paddingLeft,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth);\n // 要算上开头空白inline,可能有多个和递归嵌套\n if(isFirst) {\n let n = getFirstEmptyInlineWidth(this);\n ix1 -= n;\n bx1 -= n;\n }\n // 要算上末尾空白inline,可能有多个和递归嵌套\n let n = getLastEmptyInlineWidth(this);\n ix2 += n;\n bx2 += n;\n if(backgroundColor[3] > 0) {\n bg.renderBgc(this, renderMode, ctx, __cacheStyle[BACKGROUND_COLOR], null,\n ix1, iy1, ix2 - ix1, iy2 - iy1, isFirst ? btlr : [0, 0], btrr, bbrr, isFirst ? bblr : [0, 0],\n 'fill', false, dx, dy);\n }\n let w = ix2 - ix1;\n // canvas的bg位图裁剪\n if((renderMode === CANVAS || renderMode === WEBGL) && offscreen) {\n ctx.drawImage(offscreen.canvas, countW, 0, w, ih, ix1 + dx, iy1 + dy, w, ih);\n }\n //svg则特殊判断\n else if(renderMode === SVG && svgBgSymbol.length) {\n svgBgSymbol.forEach(symbol => {\n if(symbol) {\n let v = {\n tagName: 'clipPath',\n props: [],\n children: [\n {\n tagName: 'path',\n props: [\n ['d', `M${countW},${0}L${w+countW},${0}L${w+countW},${ih}L${countW},${ih},L${countW},${0}`],\n ],\n }\n ],\n };\n let clip = ctx.add(v);\n __config[NODE_DEFS_CACHE].push(v);\n virtualDom.bb.push({\n type: 'item',\n tagName: 'use',\n props: [\n ['xlink:href', '#' + symbol],\n ['x', ix1 - countW],\n ['y', iy1],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n }\n });\n }\n if(boxShadow) {\n boxShadow.forEach(item => {\n bs.renderBoxShadow(this, renderMode, ctx, item, bx1, by1, bx2, by2, bx2 - bx1, by2 - by1, dx, dy);\n });\n }\n if(borderTopWidth > 0 && borderTopColor[3] > 0) {\n let deg1 = Math.atan(borderTopWidth / borderLeftWidth);\n let deg2 = Math.atan(borderTopWidth / borderRightWidth);\n let list = border.calPoints(borderTopWidth, computedStyle[BORDER_TOP_STYLE], deg1, deg2,\n bx1, bx1, bx2 - borderRightWidth, bx2,\n by1, by1 + borderTopWidth, by2 - borderBottomWidth, by2, 0, isFirst ? btlr : [0, 0], btrr);\n border.renderBorder(this, renderMode, ctx, list, __cacheStyle[BORDER_TOP_COLOR], dx, dy);\n }\n if(borderRightWidth > 0 && borderRightColor[3] > 0) {\n let deg1 = Math.atan(borderRightWidth / borderTopWidth);\n let deg2 = Math.atan(borderRightWidth / borderBottomWidth);\n let list = border.calPoints(borderRightWidth, computedStyle[BORDER_RIGHT_STYLE], deg1, deg2,\n bx1, bx1 + borderLeftWidth, bx2 - borderRightWidth, bx2,\n by1, by1 + borderTopWidth, by2 - borderBottomWidth, by2, 1, btlr, btrr);\n border.renderBorder(this, renderMode, ctx, list, __cacheStyle[BORDER_RIGHT_COLOR], dx, dy);\n }\n if(borderBottomWidth > 0 && borderBottomColor[3] > 0) {\n let deg1 = Math.atan(borderBottomWidth / borderLeftWidth);\n let deg2 = Math.atan(borderBottomWidth / borderRightWidth);\n let list = border.calPoints(borderBottomWidth, computedStyle[BORDER_BOTTOM_STYLE], deg1, deg2,\n bx1, bx1, bx2 - borderRightWidth, bx2,\n by1, by1 + borderTopWidth, by2 - borderBottomWidth, by2, 2, isFirst ? btlr : [0, 0], btrr);\n border.renderBorder(this, renderMode, ctx, list, __cacheStyle[BORDER_BOTTOM_COLOR], dx, dy);\n }\n if(isFirst && borderLeftWidth > 0 && borderLeftColor[3] > 0) {\n let deg1 = Math.atan(borderLeftWidth / borderTopWidth);\n let deg2 = Math.atan(borderLeftWidth / borderBottomWidth);\n let list = border.calPoints(borderLeftWidth, computedStyle[BORDER_LEFT_STYLE], deg1, deg2,\n bx1, bx1 + borderLeftWidth, bx2 - borderRightWidth, bx2,\n by1, by1 + borderTopWidth, by2 - borderBottomWidth, by2, 3, btlr, btrr);\n border.renderBorder(this, renderMode, ctx, list, __cacheStyle[BORDER_LEFT_COLOR], dx, dy);\n }\n }\n }\n if(offscreen) {\n offscreen.ctx.clearRect(0, 0, iw, ih);\n }\n return res;\n }\n // 无内容且无尺寸的无需渲染\n else if(bx1 === bx2 || by1 === by2) {\n return res;\n }\n }\n // block渲染,bgc垫底\n if(backgroundColor[3] > 0) {\n bg.renderBgc(this, renderMode, ctx, __cacheStyle[BACKGROUND_COLOR], borderList,\n bx1, by1, bx2 - bx1, by2 - by1, btlr, btrr, bbrr, bblr, 'fill', false, dx, dy);\n }\n // 渐变或图片叠加\n if(backgroundImage) {\n let length = backgroundImage.length;\n backgroundImage.slice(0).reverse().forEach((bgi, i) => {\n if(!bgi) {\n return;\n }\n i = length - 1 - i;\n if(util.isString(bgi)) {\n let loadBgi = this.__loadBgi[i];\n if(loadBgi.url === backgroundImage[i]) {\n bg.renderImage(this, renderMode, ctx, loadBgi,\n bx1, by1, bx2, by2, btlr, btrr, bbrr, bblr,\n currentStyle, i, backgroundSize, backgroundRepeat, __config, false, dx, dy);\n }\n }\n else if(bgi.k) {\n let gd = this.__gradient(renderMode, ctx, bx1, by1, bx2, by2, bgi, dx, dy);\n if(gd) {\n if(gd.k === 'conic') {\n gradient.renderConic(this, renderMode, ctx, gd.v, bx1, by1, bx2 - bx1, by2 - by1,\n btlr, btrr, bbrr, bblr);\n }\n else {\n bg.renderBgc(this, renderMode, ctx, gd.v, borderList,\n bx1, by1, bx2 - bx1, by2 - by1, btlr, btrr, bbrr, bblr, 'fill', false, dx, dy);\n }\n }\n }\n });\n }\n // boxShadow可能会有多个\n if(boxShadow) {\n boxShadow.forEach(item => {\n bs.renderBoxShadow(this, renderMode, ctx, item, x1, y1, x6, y6, x6 - x1, y6 - y1, dx, dy);\n });\n }\n // 边框需考虑尖角,两条相交边平分45°夹角\n if(borderTopWidth > 0 && borderTopColor[3] > 0) {\n border.renderBorder(this, renderMode, ctx, __cacheStyle[BORDER_TOP], __cacheStyle[BORDER_TOP_COLOR], dx, dy);\n }\n if(borderRightWidth > 0 && borderRightColor[3] > 0) {\n border.renderBorder(this, renderMode, ctx, __cacheStyle[BORDER_RIGHT], __cacheStyle[BORDER_RIGHT_COLOR], dx, dy);\n }\n if(borderBottomWidth > 0 && borderBottomColor[3] > 0) {\n border.renderBorder(this, renderMode, ctx, __cacheStyle[BORDER_BOTTOM], __cacheStyle[BORDER_BOTTOM_COLOR], dx, dy);\n }\n if(borderLeftWidth > 0 && borderLeftColor[3] > 0) {\n border.renderBorder(this, renderMode, ctx, __cacheStyle[BORDER_LEFT], __cacheStyle[BORDER_LEFT_COLOR], dx, dy);\n }\n return res;\n }\n\n __destroy() {\n if(this.isDestroyed) {\n return;\n }\n super.__destroy();\n let { root } = this;\n this.clearAnimate();\n this.clearFrameAnimate();\n // root在没有初始化到真实dom渲染的情况下没有\n root && root.delRefreshTask(this.__loadBgi.cb);\n root && root.delRefreshTask(this.__task);\n this.__task = null;\n this.__root = null;\n this.clearCache();\n }\n\n // 先查找到注册了事件的节点,再捕获冒泡判断增加性能\n __emitEvent(e, force) {\n let { isDestroyed, computedStyle, isMask } = this;\n if(isDestroyed || computedStyle[DISPLAY] === 'none' || e.__stopPropagation || isMask) {\n return;\n }\n let { event: { type } } = e;\n let { listener, __hasMask } = this;\n let cb;\n if(listener.hasOwnProperty(type)) {\n cb = listener[type];\n }\n // touchmove之类强制的直接由Root通知即可\n if(force) {\n if(computedStyle[POINTER_EVENTS] !== 'none' && isFunction(cb) && !e.__stopImmediatePropagation) {\n cb.call(this, e);\n }\n return true;\n }\n // 非force的判断事件坐标是否在节点内\n if(this.willResponseEvent(e)) {\n // 如果有mask,点在mask上才行,点在clip外才行\n if(__hasMask) {\n let next = this.next;\n let isClip = next.isClip;\n let hasEmitMask;\n while(next && next.isMask) {\n if(next.willResponseEvent(e, true)) {\n hasEmitMask = true;\n break;\n }\n next = next.next;\n }\n if(!isClip && !hasEmitMask) {\n return;\n }\n }\n if(isFunction(cb) && !e.__stopImmediatePropagation) {\n cb.call(this, e);\n }\n return true;\n }\n }\n\n willResponseEvent(e, ignore) {\n let { x, y } = e;\n let { __sx1, __sy1, offsetWidth, offsetHeight, matrixEvent, computedStyle } = this;\n if(computedStyle[POINTER_EVENTS] === 'none') {\n return;\n }\n let inThis = geom.pointInQuadrilateral(\n x, y,\n __sx1, __sy1,\n __sx1 + offsetWidth, __sy1,\n __sx1 + offsetWidth, __sy1 + offsetHeight,\n __sx1, __sy1 + offsetHeight,\n matrixEvent\n );\n if(inThis) {\n if(!e.target && !ignore) {\n e.target = this;\n // 缓存target给move用\n if(e.event.type === 'touchstart') {\n this.root && (this.root.__touchstartTarget = this);\n }\n }\n return true;\n }\n }\n\n __gradient(renderMode, ctx, bx1, by1, bx2, by2, bgi, dx = 0, dy = 0) {\n let iw = bx2 - bx1;\n let ih = by2 - by1;\n // 无尺寸无需创建渐变\n if(!iw || !ih) {\n return;\n }\n let { k, v, d, s, z, p } = bgi;\n let cx = bx1 + iw * 0.5;\n let cy = by1 + ih * 0.5;\n let res = { k };\n if(k === 'linear') {\n let gd = gradient.getLinear(v, d, bx1, by1, cx, cy, iw, ih, this.root, dx, dy);\n res.v = this.__getLg(renderMode, ctx, gd);\n }\n else if(k === 'radial') {\n let gd = gradient.getRadial(v, s, z, p, bx1, by1, bx2, by2, this.root, dx, dy);\n if(gd) {\n res.v = this.__getRg(renderMode, ctx, gd)\n if(gd.matrix) {\n res.v = [res.v, gd.matrix, gd.cx, gd.cy];\n }\n }\n }\n else if(k === 'conic') {\n let bbox = this.bbox;\n let m1 = Math.max(Math.abs(bbox[2] - bbox[0]), Math.abs(bbox[3] - bbox[1]));\n let m2 = Math.max(Math.abs(iw), Math.abs(ih));\n let gd = gradient.getConic(v, d, p, bx1, by1, bx2, by2, m1 / m2, this.root, dx, dy);\n res.v = this.__getCg(renderMode, ctx, gd);\n }\n return res;\n }\n\n __getLg(renderMode, ctx, gd) {\n if(renderMode === CANVAS || renderMode === WEBGL) {\n let lg = ctx.createLinearGradient(gd.x1, gd.y1, gd.x2, gd.y2);\n gd.stop.forEach(item => {\n lg.addColorStop(item[1], int2rgba(item[0]));\n });\n return lg;\n }\n else if(renderMode === SVG) {\n let v = {\n tagName: 'linearGradient',\n props: [\n ['x1', gd.x1],\n ['y1', gd.y1],\n ['x2', gd.x2],\n ['y2', gd.y2],\n ],\n children: gd.stop.map(item => {\n return {\n tagName: 'stop',\n props: [\n ['stop-color', int2rgba(item[0])],\n ['offset', item[1] * 100 + '%'],\n ],\n };\n }),\n };\n let uuid = ctx.add(v);\n this.__config[NODE_DEFS_CACHE].push(v);\n return 'url(#' + uuid + ')';\n }\n }\n\n __getRg(renderMode, ctx, gd) {\n if(renderMode === CANVAS || renderMode === WEBGL) {\n let rg = ctx.createRadialGradient(gd.cx, gd.cy, 0, gd.tx, gd.ty, gd.r);\n gd.stop.forEach(item => {\n rg.addColorStop(item[1], int2rgba(item[0]));\n });\n return rg;\n }\n else if(renderMode === SVG) {\n let v = {\n tagName: 'radialGradient',\n props: [\n ['cx', gd.tx],\n ['cy', gd.ty],\n ['r', gd.r],\n ],\n children: gd.stop.map(item => {\n return {\n tagName: 'stop',\n props: [\n ['stop-color', int2rgba(item[0])],\n ['offset', item[1] * 100 + '%'],\n ],\n };\n }),\n };\n if(gd.tx !== gd.cx) {\n v.props.push(['fx', gd.cx]);\n }\n if(gd.ty !== gd.cy) {\n v.props.push(['fy', gd.cy]);\n }\n let uuid = ctx.add(v);\n this.__config[NODE_DEFS_CACHE].push(v);\n return 'url(#' + uuid + ')';\n }\n }\n\n __getCg(renderMode, ctx, gd) {\n let { cx, cy, r, deg, stop } = gd;\n let len = stop.length - 1;\n if(stop[len][1] < 1) {\n stop.push([stop[len][0].slice(0), 1]);\n }\n if(stop[0][1] > 0) {\n stop.unshift([stop[0][0].slice(0), 0]);\n }\n // canvas采用点色值计算法,svg则分360度画块\n let res = [];\n if(renderMode === CANVAS || renderMode === WEBGL) {\n return gd;\n }\n else if(renderMode === SVG) {\n let offset = 0.5;\n let prev;\n // 根据2个stop之间的百分比得角度差划分块数,每0.5°一块,不足也算\n let list = [];\n for(let i = 0, len = stop.length; i < len - 1; i++) {\n let begin = stop[i][1] * 360;\n let end = stop[i + 1][1] * 360;\n let diff = end - begin;\n let n = Math.ceil(diff);\n let per = diff / n;\n // 计算每块的2个弧端点\n let bc = stop[i][0];\n let ec = stop[i + 1][0];\n let dc = [ec[0] - bc[0], ec[1] - bc[1], ec[2] - bc[2], ec[3] - bc[3]];\n let pc = [dc[0] / n, dc[1] / n, dc[2] / n, dc[3] / n];\n for(let j = 0; j < n; j++) {\n let [x1, y1] = geom.pointOnCircle(cx, cy, r, begin + per * j + deg - offset);\n let [x2, y2] = geom.pointOnCircle(cx, cy, r, begin + per * j + deg + offset);\n list.push([\n x1, y1,\n x2, y2,\n Math.round(bc[0] + pc[0] * j),\n Math.round(bc[1] + pc[1] * j),\n Math.round(bc[2] + pc[2] * j),\n Math.round(bc[3] + pc[3] * j),\n ]);\n }\n }\n // 最后一段补自己末尾颜色特殊处理\n let end = list[0].slice(0);\n let [x2, y2] = geom.pointOnCircle(cx, cy, r, deg);\n end[2] = x2;\n end[3] = y2;\n let s = stop[stop.length - 1][0];\n end[4] = s[0];\n end[5] = s[1];\n end[6] = s[2];\n end[7] = s[3];\n list.push(end);\n for(let i = 0, len = list.length; i < len; i++) {\n let cur = list[i];\n if(prev) {\n let v = {\n tagName: 'linearGradient',\n props: [\n ['x1', prev[0]],\n ['y1', prev[1]],\n ['x2', cur[2]],\n ['y2', cur[3]],\n ],\n children: [\n {\n tagName: 'stop',\n props: [\n ['stop-color', int2rgba([prev[4], prev[5], prev[6], prev[7]])],\n ['offset', '0%'],\n ],\n },\n {\n tagName: 'stop',\n props: [\n ['stop-color', int2rgba([cur[4], cur[5], cur[6], cur[7]])],\n ['offset', '100%'],\n ],\n },\n ],\n };\n let uuid = ctx.add(v);\n this.__config[NODE_DEFS_CACHE].push(v);\n res.push([[[cx, cy], [prev[0], prev[1]], [cur[2], cur[3]]], 'url(#' + uuid + ')']);\n }\n prev = cur;\n }\n }\n return res;\n }\n\n // canvas清空自身cache,cacheTotal在Root的自底向上逻辑做,svg仅有cacheTotal\n clearCache(onlyTotal) {\n let __config = this.__config;\n let __cacheTotal = __config[NODE_CACHE_TOTAL];\n let __cacheFilter = __config[NODE_CACHE_FILTER];\n let __cacheMask = __config[NODE_CACHE_MASK];\n let __cacheOverflow = __config[NODE_CACHE_OVERFLOW];\n if(!onlyTotal) {\n __config[NODE_CACHE_STYLE] = this.__cacheStyle = {};\n let __cache = __config[NODE_CACHE];\n if(__cache) {\n __cache.release();\n }\n }\n if(__cacheTotal) {\n __cacheTotal.release();\n }\n if(__cacheFilter) {\n __cacheFilter.release();\n }\n if(__cacheMask) {\n __cacheMask.release();\n }\n if(__cacheOverflow) {\n __cacheOverflow.release();\n }\n }\n\n updateStyle(style, cb) {\n let node = this;\n let { root, __config } = node;\n let formatStyle = css.normalize(style);\n // 有root说明被添加渲染过了\n if(root) {\n root.addRefreshTask(node.__task = {\n __before() {\n node.__task = null;\n if(__config[NODE_IS_DESTROYED]) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = node;\n res[UPDATE_STYLE] = formatStyle;\n res[UPDATE_OVERWRITE] = style; // 标识盖原有style样式不仅仅是修改currentStyle,不同于animate\n res[UPDATE_KEYS] = Object.keys(formatStyle).map(i => {\n if(!GEOM.hasOwnProperty(i)) {\n i = parseInt(i);\n }\n return i;\n });\n res[UPDATE_CONFIG] = __config;\n root.__addUpdate(node, __config, root, root.__config, res);\n },\n __after(diff) {\n if(isFunction(cb)) {\n cb.call(node, diff);\n }\n },\n });\n }\n // 没有是在如parse()还未添加的时候,可以直接同步覆盖\n else {\n Object.assign(this.currentStyle, formatStyle);\n if(isFunction(cb)) {\n cb.call(node, -1);\n }\n }\n }\n\n // 传入格式化好key/value的样式\n updateFormatStyle(style, cb) {\n let node = this;\n let { root, __config } = node;\n if(root) {\n root.addRefreshTask(node.__task = {\n __before() {\n node.__task = null; // 清除在before,防止after的回调增加新的task误删\n if(__config[NODE_IS_DESTROYED]) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = node;\n res[UPDATE_STYLE] = style;\n res[UPDATE_KEYS] = Object.keys(style).map(i => {\n if(!GEOM.hasOwnProperty(i)) {\n i = parseInt(i);\n }\n return i;\n });\n res[UPDATE_CONFIG] = __config;\n root.__addUpdate(node, __config, root, root.__config, res);\n },\n __after(diff) {\n if(isFunction(cb)) {\n cb.call(node, diff);\n }\n },\n });\n }\n // 没有是在如parse()还未添加的时候,可以直接同步覆盖\n else {\n Object.assign(this.currentStyle, style);\n if(isFunction(cb)) {\n cb.call(node, -1);\n }\n }\n }\n\n animate(list, options = {}) {\n let animation = new Animation(this, list, options);\n if(this.isDestroyed) {\n animation.__destroy(true);\n return animation;\n }\n this.animationList.push(animation);\n if(options.autoPlay === false) {\n return animation;\n }\n return animation.play();\n }\n\n removeAnimate(o) {\n if(o instanceof Animation) {\n let i = this.animationList.indexOf(o);\n if(i > -1) {\n o.cancel();\n o.__destroy();\n this.animationList.splice(i, 1);\n }\n }\n }\n\n clearAnimate() {\n this.animationList.splice(0).forEach(o => {\n o.cancel();\n o.__destroy();\n });\n }\n\n frameAnimate(cb) {\n if(isFunction(cb)) {\n let list = this.__frameAnimateList;\n // 防止重复\n for(let i = 0, len = list.length; i < len; i++) {\n if(list[i].__karasFramecb === cb) {\n return cb;\n }\n }\n let enter = {\n __after(diff) {\n cb(diff);\n },\n __karasFramecb: cb,\n };\n list.push(enter);\n frame.onFrame(enter);\n return cb;\n }\n }\n\n removeFrameAnimate(cb) {\n for(let i = 0, list = this.__frameAnimateList, len = list.length; i < len; i++) {\n if(list[i].__karasFramecb === cb) {\n list.splice(i, 1);\n frame.offFrame(cb);\n return;\n }\n }\n }\n\n clearFrameAnimate() {\n this.__frameAnimateList.splice(0).forEach(o => {\n frame.offFrame(o);\n });\n }\n\n __computeMeasure(renderMode, ctx, cb) {\n css.computeMeasure(this);\n if(isFunction(cb)) {\n cb(this);\n }\n }\n\n __deepScan(cb, options) {\n return cb(this, options);\n }\n\n // isLayout为false时,为relative/margin/flex/vertical等\n __offsetX(diff, isLayout, lv) {\n super.__offsetX(diff, isLayout);\n if(isLayout) {\n this.__layoutData.x += diff;\n this.clearCache();\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.__sx1 += diff;\n this.__sx2 += diff;\n this.__sx3 += diff;\n this.__sx4 += diff;\n this.__sx5 += diff;\n this.__sx6 += diff;\n }\n\n __offsetY(diff, isLayout, lv) {\n super.__offsetY(diff, isLayout);\n if(isLayout) {\n this.__layoutData.y += diff;\n this.clearCache();\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.__sy1 += diff;\n this.__sy2 += diff;\n this.__sy3 += diff;\n this.__sy4 += diff;\n this.__sy5 += diff;\n this.__sy6 += diff;\n }\n\n __resizeX(diff, lv) {\n this.computedStyle.width = this.__width += diff;\n this.__clientWidth += diff;\n this.__offsetWidth += diff;\n this.__outerWidth += diff;\n this.__layoutData && (this.__layoutData.w += diff);\n this.__sx4 += diff;\n this.__sx5 += diff;\n this.__sx6 += diff;\n if(diff < 0) {\n this.__config[NODE_LIMIT_CACHE] = false;\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.clearCache();\n }\n\n __resizeY(diff, lv) {\n this.computedStyle.height = this.__height += diff;\n this.__clientHeight += diff;\n this.__offsetHeight += diff;\n this.__outerHeight += diff;\n this.__layoutData.h += diff;\n this.__sy4 += diff;\n this.__sy5 += diff;\n this.__sy6 += diff;\n if(diff < 0) {\n this.__config[NODE_LIMIT_CACHE] = false;\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.clearCache();\n }\n\n __spreadBbox(boxShadow, filter) {\n let x1 = 0, y1 = 0, x2 = 0, y2 = 0;\n let xl = [], yt = [], xr = [], yb = [];\n if(Array.isArray(boxShadow)) {\n boxShadow.forEach(item => {\n let [x, y, sigma, spread, , inset] = item;\n x1 = x2 = x;\n y1 = y2 = y;\n if(inset !== 'inset') {\n let d = blur.outerSize(sigma);\n d += spread;\n xl.push(x - d);\n xr.push(x + d);\n yt.push(y - d);\n yb.push(y + d);\n }\n });\n }\n if(Array.isArray(filter)) {\n filter.forEach(item => {\n let [k, v] = item;\n let sigma = v[0];\n if(k === 'blur' && sigma > 0) {\n let d = blur.kernelSize(sigma);\n let spread = blur.outerSizeByD(d);\n if(spread) {\n xl.push(-spread);\n xr.push(spread);\n yt.push(-spread);\n yb.push(spread);\n }\n }\n });\n }\n xl.forEach(n => x1 = Math.min(x1, n));\n xr.forEach(n => x2 = Math.max(x2, n));\n yt.forEach(n => y1 = Math.min(y1, n));\n yb.forEach(n => y2 = Math.max(y2, n));\n return [x1, y1, x2, y2];\n }\n\n __releaseWhenEmpty(__cache) {\n if(__cache && __cache.available) {\n __cache.release();\n }\n return true;\n }\n\n getComputedStyle(key) {\n let computedStyle = this.computedStyle;\n let res = {};\n let keys;\n if(key) {\n if(Array.isArray(key)) {\n keys = key;\n }\n else {\n keys = [key];\n }\n keys = keys.map(s => {\n return STYLE_KEY[style2Upper(s)];\n });\n }\n else {\n keys = Object.keys(computedStyle);\n }\n keys.forEach(k => {\n if(GEOM.hasOwnProperty(k)) {\n res[k] = computedStyle[k];\n }\n else {\n res[STYLE_RV_KEY[k]] = computedStyle[k];\n }\n });\n return res;\n }\n\n getBoundingClientRect(includeBbox) {\n let box = [];\n if(includeBbox) {\n box = this.bbox;\n }\n else {\n let { __sx1, __sy1, offsetWidth, offsetHeight } = this;\n box = [__sx1, __sy1, __sx1 + offsetWidth, __sy1 + offsetHeight];\n }\n let matrixEvent = this.matrixEvent;\n let p1 = point2d(mx.calPoint([box[0], box[1]], matrixEvent));\n let p2 = point2d(mx.calPoint([box[2], box[1]], matrixEvent));\n let p3 = point2d(mx.calPoint([box[2], box[3]], matrixEvent));\n let p4 = point2d(mx.calPoint([box[0], box[3]], matrixEvent));\n return {\n left: Math.min(p1[0], Math.min(p2[0], Math.min(p3[0], p4[0]))),\n top: Math.min(p1[1], Math.min(p2[1], Math.min(p3[1], p4[1]))),\n right: Math.max(p1[0], Math.max(p2[0], Math.max(p3[0], p4[0]))),\n bottom: Math.max(p1[1], Math.max(p2[1], Math.max(p3[1], p4[1]))),\n points: [p1, p2, p3, p4],\n };\n }\n\n // img和geom返回false,在inline布局时判断是否是真的inline\n __isRealInline() {\n return true;\n }\n\n remove(cb) {\n let self = this;\n if(self.isDestroyed) {\n inject.warn('Remove target is destroyed.');\n if(isFunction(cb)) {\n cb();\n }\n return;\n }\n let { root, domParent } = self;\n let target = self.isShadowRoot ? self.hostRoot : self;\n // 特殊情况连续append/remove时候,还未被添加进来找不到所以无需删除\n if(domParent.children.indexOf(target) === -1) {\n if(isFunction(cb)) {\n cb();\n }\n return;\n }\n root.delRefreshTask(self.__task);\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null; // 清除在before,防止after的回调增加新的task误删\n let pJson = domParent.__json;\n let i = pJson.children.indexOf(self.isShadowRoot ? self.hostRoot.__json : self.__json);\n let zChildren = domParent.zIndexChildren;\n let j = zChildren.indexOf(self.isShadowRoot ? self.hostRoot : self);\n if(i === -1 || j === -1) {\n throw new Error('Remove index Exception.')\n }\n pJson.children.splice(i, 1);\n domParent.children.splice(i, 1);\n zChildren.splice(j, 1);\n if(self.__prev) {\n self.__prev.__next = self.__next;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = REFLOW;\n res[UPDATE_REMOVE_DOM] = true;\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n __after(diff) {\n self.isShadowRoot ? self.hostRoot.__destroy() : self.__destroy();\n if(isFunction(cb)) {\n cb.call(self, diff);\n }\n },\n });\n }\n\n get tagName() {\n return this.__tagName;\n }\n\n get sx() {\n return this.__sx;\n }\n\n get sy() {\n return this.__sy;\n }\n\n get clientWidth() {\n return this.__clientWidth || 0;\n }\n\n get clientHeight() {\n return this.__clientHeight || 0;\n }\n\n get offsetWidth() {\n return this.__offsetWidth || 0;\n }\n\n get offsetHeight() {\n return this.__offsetHeight || 0;\n }\n\n get outerWidth() {\n return this.__outerWidth || 0;\n }\n\n get outerHeight() {\n return this.__outerHeight || 0;\n }\n\n // 不考虑margin的范围,>=REPAINT渲染或个别有影响的渲染改变(如blur)清空缓存\n get bbox() {\n if(!this.__bbox) {\n let {\n __sx1, __sy1, offsetWidth, offsetHeight,\n currentStyle: {\n [BOX_SHADOW]: boxShadow,\n [FILTER]: filter,\n },\n } = this;\n let [x1, y1, x2, y2] = this.__spreadBbox(boxShadow, filter);\n this.__bbox = [__sx1 + x1, __sy1 + y1, __sx1 + offsetWidth + x2, __sy1 + offsetHeight + y2];\n }\n return this.__bbox;\n }\n\n get listener() {\n return this.__listener;\n }\n\n get matrix() {\n return this.__config[NODE_MATRIX];\n }\n\n get matrixEvent() {\n return this.__config[NODE_MATRIX_EVENT];\n }\n\n get perspectiveMatrix() {\n return this.__config[NODE_PERSPECTIVE_MATRIX];\n }\n\n get style() {\n return this.__style;\n }\n\n get computedStyle() {\n return this.__computedStyle;\n }\n\n get animationList() {\n return this.__animationList;\n }\n\n get currentStyle() {\n return this.__currentStyle;\n }\n\n get isShadowRoot() {\n return !this.parent && this.host && this.host !== this.root;\n }\n\n get contentBoxList() {\n return this.__contentBoxList;\n }\n\n get baseline() {\n return this.offsetHeight;\n }\n\n get firstBaseline() {\n return this.offsetHeight;\n }\n\n get isMask() {\n return this.__isMask;\n }\n\n get isClip() {\n return this.__isClip;\n }\n\n get cacheAsBitmap() {\n return this.__cacheAsBitmap;\n }\n\n set cacheAsBitmap(v) {\n this.__config[NODE_CACHE_AS_BITMAP] = this.__cacheAsBitmap = !!v;\n }\n}\n\nexport default Xom;\n","import enums from '../util/enums';\nimport TextBox from './TextBox';\n\nconst { STYLE_KEY: {\n DISPLAY,\n MARGIN_LEFT,\n BORDER_LEFT_WIDTH,\n PADDING_LEFT,\n PADDING_RIGHT,\n BORDER_RIGHT_WIDTH,\n MARGIN_RIGHT,\n} } = enums;\n\n/**\n * css中常见的概念,一行内容,里面可能有若干不同的内容,仅在布局阶段出现,不参与渲染逻辑\n * 本类是个抽象逻辑概念,会包含Text的内容TextBox和inlineBlock等节点,而内容TextBox则属于Text\n * 一个Text可能因为换行产生多个TextBox,从而形成不同行的内容就属于不同的LineBox\n * 本类属于block(包含flex和inlineBlock,下同)节点下,一个dom会有个专门列表,\n * 包含若干个LineBox保存着若干行文本内容TextBox,不直接关联Text,\n * inline则不会有此对象和列表,其复用最近block父层的,这样解决嵌套问题,\n * block在布局时将列表向孩子传递下去,每遇到block会重新生成\n * 每当发生换行时,专门列表中会新生成一个LineBox,让后续内容继续跟随新的LB\n * LB内部要进行垂直对齐,Text内容较简单x字符底部为baseline,inlineBlock等节点按最后一行baseline\n */\nclass LineBox {\n constructor(x, y, lineHeight, baseline) {\n this.__list = [];\n this.__x = x;\n this.__y = y;\n this.__lineHeight = lineHeight; // 可能出现空的inline,因此一个inline进入布局时先设置当前lineBox的最小lineHeight/baseline\n this.__baseline = baseline;\n }\n\n add(item) {\n this.list.push(item);\n item.__parentLineBox = this;\n }\n\n verticalAlign() {\n let baseline = this.baseline;\n let lineHeight = this.lineHeight;\n let increasedHeight = lineHeight;\n let hasReplaced;\n // 只有1个也需要对齐,因为可能内嵌了空inline使得baseline发生变化\n if(this.list.length) {\n this.list.forEach(item => {\n if(item.isReplaced) {\n hasReplaced = true;\n }\n let n = item.baseline;\n if(n !== baseline) {\n let d = baseline - n;\n item.__offsetY(d);\n // text的话对齐下移可能影响整体高度,在同行有img这样的替换元素下,需记录最大偏移导致的高度\n // 比如一个字符和img,字符下调y即字符的baseline和图片底部对齐,导致高度增加lineHeight和baseline的差值\n if(d > 0) {\n increasedHeight = Math.max(increasedHeight, item.height + d);\n }\n }\n });\n }\n let diff = 0;\n // 特殊情况,只有1个img这样的替换元素时,或者只有img没有直接text时,也要进行检查,\n // 因为此时img要参与这一行和baseline的对齐扩充\n if(hasReplaced) {\n diff = this.__lineHeight - this.__baseline;\n }\n // 增加过的高度比最大还大时需要调整\n if(increasedHeight > lineHeight) {\n diff = Math.max(increasedHeight - lineHeight);\n }\n return diff;\n }\n\n __offsetX(diff) {\n this.__x += diff;\n }\n\n __offsetY(diff, isVerticalAlign) {\n this.__y += diff;\n // vertical-align情况特殊对齐,可能替换元素img和text导致偏移,需触发整体和text偏移\n if(isVerticalAlign) {\n this.list.forEach(item => {\n // 是text的第一个的box的话,text也需要偏移\n if (item instanceof TextBox) {\n let text = item.parent;\n if (text.textBoxes[0] === item) {\n text.__offsetY(diff);\n }\n } else {\n item.__offsetY(diff);\n }\n });\n }\n }\n\n /**\n * 防止非行首空inline,每当遇到inline就设置当前lineBox的lineHeight/baseline,这样有最小值兜底\n * @param l\n * @param b\n * @private\n */\n __setLB(l, b) {\n this.__lineHeight = Math.max(l, this.__lineHeight);\n this.__baseline = Math.max(b, this.__baseline);\n }\n\n get list() {\n return this.__list;\n }\n\n get size() {\n return this.__list.length;\n }\n\n get x() {\n return this.__x;\n }\n\n get y() {\n return this.__y;\n }\n\n get endY() {\n return this.y + this.height;\n }\n\n get width() {\n let list = this.list;\n let length = list.length;\n if(length) {\n let first = list[0];\n let last = list[length - 1];\n let x1 = first.x;\n let dom = first instanceof TextBox ? first.parent.domParent : first.domParent;\n // 因为inline可以嵌套inline,所以一直向上查找到非inline为止,每层inline如果是首个则减去左侧mbp\n while(true) {\n let list = dom.contentBoxList;\n let {\n [DISPLAY]: display,\n [MARGIN_LEFT]: marginLeft,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [PADDING_LEFT]: paddingLeft,\n } = dom.computedStyle;\n if(display !== 'inline') {\n break;\n }\n if(first === list[0]) {\n x1 -= marginLeft + borderLeftWidth + paddingLeft;\n }\n dom = dom.domParent;\n }\n let x2 = last.x + last.outerWidth;\n dom = last instanceof TextBox ? last.parent.domParent : last.domParent;\n // 同向上查非inline,每层inline如果是最后一个则加上右侧mbp\n while(true) {\n let list = dom.contentBoxList;\n let {\n [DISPLAY]: display,\n [MARGIN_RIGHT]: marginRight,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [PADDING_RIGHT]: paddingRight,\n } = dom.computedStyle;\n if(display !== 'inline') {\n break;\n }\n if(first === list[list.length - 1]) {\n x2 += marginRight + borderRightWidth + paddingRight;\n }\n dom = dom.domParent;\n }\n return x2 - x1;\n }\n return 0;\n }\n\n get height() {\n return this.lineHeight;\n }\n\n get baseline() {\n let baseline = this.__baseline;\n // 只有TextBox和InlineBlock或replaced\n this.list.forEach(item => {\n baseline = Math.max(baseline, item.baseline);\n });\n return baseline;\n }\n\n get lineHeight() {\n let lineHeight = this.__lineHeight;\n // 只有TextBox和InlineBlock或replaced\n this.list.forEach(item => {\n lineHeight = Math.max(lineHeight, item.outerHeight);\n });\n return lineHeight;\n }\n}\n\nexport default LineBox;\n","import LineBox from './LineBox';\n\n/**\n * 维护一个上下文的LineBox,向LineBox中添加Item以及新增下一行的LineBox,多个LineBox组成一个区域\n * 一个block/inlineBlock拥有一个本类对象,上下文即对应这个dom流,而inline则复用最近非inline父元素的\n * 同时LineBox可能连续也可能不连续,不连续的是中间有block之类的隔离开来\n */\nclass LineBoxManager {\n constructor(x, y, lineHeight, baseline) {\n this.__x = this.__lastX = x; // last存储目前最后一行LineBox的结尾位置,供后续inline使用\n this.__y = this.__lastY = y;\n this.__maxX = x;\n this.__domList = [];\n this.__domStack = [];\n this.__list = []; // 包含若干LineBox\n this.__isNewLine = true; // 区域内是否是新行,容器dom(block)开头肯定是\n this.__lineHeight = lineHeight;\n this.__baseline = baseline;\n this.__isEnd = true; // 在dom中是否一个区域处在结尾,外部控制\n this.__spreadYList = []; // verticalAlign时每个区域增加的y高度\n }\n\n /**\n * 每次换行时重新生成LineBox存入列表,同时由于flow流当前一定是流(dom)的结尾,设置isEnd\n * @returns {LineBox}\n */\n genLineBox(x, y) {\n let lineBox = new LineBox(x, y, this.__lineHeight, this.__baseline);\n this.list.push(lineBox);\n this.__isEnd = true;\n return lineBox;\n }\n\n /**\n * inline的特殊调用,防止空内容但有mbp的inline不占位,放入一个有lineHeight的空lineBox\n * 只有新行开头时需要,后面的无论是否有内容都会影响lineHeight\n * @param x\n * @param y\n * @param l\n * @param b\n * @returns {LineBox}\n */\n genLineBoxByInlineIfNewLine(x, y, l, b) {\n let lineHeight = Math.max(this.__lineHeight, l);\n let baseline = Math.max(this.__baseline, b);\n if(this.__isNewLine) {\n let lineBox = new LineBox(x, y, lineHeight, baseline);\n this.list.push(lineBox);\n this.__isEnd = true;\n this.__isNewLine = false;\n return lineBox;\n }\n }\n\n setLbOrGenLineBoxByInline(x, y, l, b) {\n let lineHeight = Math.max(this.__lineHeight, l);\n let baseline = Math.max(this.__baseline, b);\n let lineBox;\n let list = this.list;\n if(this.__isNewLine) {\n lineBox = new LineBox(x, y, lineHeight, baseline);\n list.push(lineBox);\n this.__isEnd = true;\n this.__isNewLine = false;\n return lineBox;\n }\n else {\n let length = list.length;\n lineBox = list[length - 1];\n lineBox.__setLB(l, b);\n }\n }\n\n /**\n * 外部设置为结尾,如一个LineBox后出现一个block,此时会被隔断,不再作为流的末尾\n */\n setNotEnd() {\n this.__isEnd = false;\n }\n\n /**\n * 外部设置新行,下次新生成LineBox\n */\n setNewLine() {\n this.__isNewLine = true;\n }\n\n /**\n * 当前LineBox放入一个新项,当新行时(如第一行)产生一个新的LineBox并存入列表\n * 是否新区域和新行都是可以被外部控制,默认第一行是新\n * 当被隔断后会被外部重置新行,这样会生成新的来作为新加项的LineBox\n * 当换行时外部也会调用新行,这样再次添加Item时会自动生成新的LineBox而不是用之前的\n * @param o TextBox/Inline/InlineBlock\n * @param nextNewLine 是否设置newLine,标明下次添加新生成LineBox\n * @returns {LineBox}\n */\n addItem(o, nextNewLine) {\n let lineBox;\n if(this.__isNewLine) {\n this.__isNewLine = false;\n lineBox = this.genLineBox(o.x, o.y);\n }\n else {\n let list = this.list;\n let length = list.length;\n lineBox = list[length - 1];\n }\n // inline递归过程中所有inline父子顺序列表,每个dom都需要对当前内容保存\n this.__domStack.forEach(item => {\n item.__contentBoxList.push(o);\n });\n lineBox.add(o);\n // 设置结束x的位置给next的inline标记用,o可能是TextBox或inlineBlock,当next新行时注意位置\n if(nextNewLine) {\n this.__isNewLine = true;\n this.__lastX = o.x;\n this.__lastY = o.y + o.outerHeight;\n }\n else {\n this.__lastX = o.x + o.outerWidth;\n this.__lastY = o.y;\n }\n this.__maxX = Math.max(this.__maxX, o.x + o.outerWidth);\n return lineBox;\n }\n\n horizonAlign(w, textAlign) {\n this.list.forEach(lineBox => {\n let diff = w - lineBox.width;\n if(diff > 0) {\n if(textAlign === 'center') {\n diff *= 0.5;\n }\n lineBox.__offsetX(diff);\n lineBox.list.forEach(item => {\n item.__offsetX(diff, true);\n });\n }\n });\n }\n\n /**\n * 垂直对齐过程中,如果遇到占位元素如img,可能会导致每行lineBox高度增加,需返回增加量,\n * next行也需要y偏移\n * @returns {number}\n */\n verticalAlign() {\n let syl = this.__spreadYList;\n syl.splice(0);\n let spread = 0;\n this.list.forEach(lineBox => {\n if(spread) {\n lineBox.__offsetY(spread, true);\n }\n spread += lineBox.verticalAlign();\n syl.push(spread);\n });\n return spread;\n }\n\n addX(n) {\n this.__lastX += n;\n }\n\n /**\n * inline递归过程中布局调用,不断出入栈dom对象,获取当前行状态下有哪些dom还在\n * @param dom\n */\n pushContentBoxList(dom) {\n this.__domList.push(dom);\n this.__domStack.push(dom);\n }\n\n popContentBoxList() {\n this.__domStack.pop();\n }\n\n __offsetX(diff) {\n this.list.forEach(lineBox => {\n lineBox.__offsetX(diff);\n });\n }\n\n __offsetY(diff) {\n this.list.forEach(lineBox => {\n lineBox.__offsetY(diff);\n });\n }\n\n /**\n * inline的特殊调用,非行首无论是否有内容都设置lineBox的lineHeight\n * @param l\n * @param b\n * @private\n */\n setLbByInlineIfNotNewLine(l, b) {\n let length = this.list.length;\n if(length && !this.isNewLine) {\n this.list[length - 1].__setLB(l, b);\n }\n }\n\n get size() {\n return this.list.length;\n }\n\n get lastX() {\n return this.__lastX;\n }\n\n get lastY() {\n return this.__lastY;\n }\n\n get endY() {\n let list = this.list;\n let length = list.length;\n if(length) {\n return list[length - 1].endY;\n }\n return this.__y;\n }\n\n get isEnd() {\n return this.__isEnd;\n }\n\n get isNewLine() {\n return this.__isNewLine;\n }\n\n get breakLine() {\n return this.list.length > 1;\n }\n\n get domList() {\n return this.__domList;\n }\n\n get baseline() {\n let list = this.list;\n let length = list.length;\n if(length) {\n let n = 0;\n for(let i = 0; i < length - 1; i++) {\n n += list[i].height;\n }\n return n + list[length - 1].baseline;\n }\n return 0;\n }\n\n get firstBaseline() {\n let list = this.list;\n let length = list.length;\n if(length) {\n return list[0].baseline;\n }\n return 0;\n }\n\n get lineHeight() {\n let list = this.list;\n if(list.length) {\n return list[list.length - 1].lineHeight;\n }\n return 0;\n }\n\n get lineBox() {\n let list = this.list;\n if(list.length) {\n return list[list.length - 1];\n }\n }\n\n get list() {\n return this.__list;\n }\n\n get width() {\n let w = 0;\n this.list.forEach(item => {\n w = Math.max(w, item.width);\n });\n return w;\n }\n\n get spreadYList() {\n return this.__spreadYList;\n }\n}\n\nexport default LineBoxManager;\n","const TAG_NAME = {\n 'div': true,\n 'p': true,\n 'span': true,\n 'img': true,\n 'b': true,\n 'strong': true,\n};\n\nconst INLINE = {\n 'span': true,\n 'img': true,\n 'b': true,\n 'strong': true,\n};\n\nconst BOLD = {\n 'b': true,\n 'strong': true,\n}\n\nexport default {\n TAG_NAME,\n INLINE,\n BOLD,\n};\n","import enums from '../util/enums';\nimport unit from '../style/unit';\nimport level from './level';\n\nconst {\n STYLE_KEY: {\n DISPLAY,\n TOP,\n BOTTOM,\n POSITION,\n HEIGHT,\n },\n} = enums;\nconst { AUTO, PX, PERCENT } = unit;\nconst { REFLOW } = level;\n\nfunction offsetAndResizeByNodeOnY(node, root, reflowHash, dy, inDirectAbsList) {\n if(dy) {\n let last;\n do {\n // component的sr没有next兄弟,视为component的next\n while(node.isShadowRoot) {\n node = node.host;\n }\n last = node;\n let isContainer, parent = node.domParent;\n if(parent) {\n let cs = parent.computedStyle;\n let ps = cs[POSITION];\n isContainer = parent === root || parent.isShadowRoot || ps === 'relative' || ps === 'absolute';\n }\n // 先偏移next,忽略有定位的absolute,本身非container也忽略\n let next = node.next;\n let container;\n while(next) {\n if(next.computedStyle[DISPLAY] !== 'none') {\n if(next.currentStyle[POSITION] === 'absolute') {\n let { [TOP]: top, [BOTTOM]: bottom, [HEIGHT]: height } = next.currentStyle;\n if(top[1] === AUTO) {\n if(bottom[1] === AUTO || bottom[1] === PX) {\n next.__offsetY(dy, true, REFLOW);\n next.clearCache();\n }\n else if(bottom[1] === PERCENT) {\n let v = (1 - bottom[0] * 0.01) * dy;\n next.__offsetY(v, true, REFLOW);\n next.clearCache();\n }\n }\n else if(top[1] === PERCENT) {\n let v = top[0] * 0.01 * dy;\n next.__offsetY(v, true, REFLOW);\n next.clearCache();\n }\n // 高度百分比需发生变化的重新布局,需要在容器内\n if(height[1] === PERCENT) {\n if(isContainer) {\n parent.__layoutAbs(parent, parent.__layoutData, next);\n }\n else {\n if(!container) {\n container = parent;\n while(container) {\n if(container === root || container.isShadowRoot) {\n break;\n }\n let cs = container.currentStyle;\n if(cs[POSITION] === 'absolute' || cs[POSITION] === 'relative') {\n break;\n }\n container = container.domParent;\n }\n }\n inDirectAbsList.push([parent, container, next]);\n }\n }\n }\n else {\n next.__offsetY(dy, true, REFLOW);\n next.clearCache();\n }\n }\n next = next.next;\n }\n // root本身没domParent\n if(!parent) {\n break;\n }\n node = parent;\n // parent判断是否要resize\n let { currentStyle } = node;\n let isAbs = currentStyle[POSITION] === 'absolute';\n let need;\n if(isAbs) {\n if(currentStyle[HEIGHT][1] === AUTO\n && (currentStyle[TOP][1] === AUTO || currentStyle[BOTTOM][1] === AUTO)) {\n need = true;\n }\n }\n // height不定则需要\n else if(currentStyle[HEIGHT][1] === AUTO) {\n need = true;\n }\n if(need) {\n node.__resizeY(dy, REFLOW);\n node.clearCache();\n }\n // abs或者高度不需要继续向上调整提前跳出\n else {\n break;\n }\n if(node === root) {\n break;\n }\n }\n while(true);\n // 最后一个递归向上取消总缓存,防止过程中重复next多次无用递归\n while(last) {\n last.clearCache(true);\n last = last.domParent;\n }\n }\n}\n\nfunction clearUniqueReflowId(hash) {\n for(let i in hash) {\n if(hash.hasOwnProperty(i)) {\n let { node } = hash[i];\n delete node.__uniqueReflowId;\n }\n }\n}\n\nfunction getMergeMarginTB(topList, bottomList) {\n let total = 0;\n let max = topList[0];\n let min = topList[0];\n topList.forEach(item => {\n total += item;\n max = Math.max(max, item);\n min = Math.min(min, item);\n });\n bottomList.forEach(item => {\n total += item;\n max = Math.max(max, item);\n min = Math.min(min, item);\n });\n // 正数取最大,负数取最小,正负则相加\n let diff = 0;\n if(max > 0 && min > 0) {\n diff = Math.max(max, min) - total;\n }\n else if(max < 0 && min < 0) {\n diff = Math.min(max, min) - total;\n }\n else if(max !== 0 || min !== 0) {\n diff = max + min - total;\n }\n return diff;\n}\n\nexport default {\n offsetAndResizeByNodeOnY,\n clearUniqueReflowId,\n getMergeMarginTB,\n};\n","import Xom from './Xom';\nimport Text from './Text';\nimport LineBoxManager from './LineBoxManager';\nimport Component from './Component';\nimport tag from './tag';\nimport reset from '../style/reset';\nimport css from '../style/css';\nimport unit from '../style/unit';\nimport $$type from '../util/$$type';\nimport enums from '../util/enums';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport reflow from '../refresh/reflow';\nimport builder from '../util/builder';\nimport mode from '../refresh/mode';\nimport level from '../refresh/level';\n\nconst {\n STYLE_KEY: {\n POSITION,\n DISPLAY,\n FONT_WEIGHT,\n MARGIN_LEFT,\n MARGIN_TOP,\n MARGIN_RIGHT,\n MARGIN_BOTTOM,\n PADDING_LEFT,\n PADDING_BOTTOM,\n PADDING_RIGHT,\n PADDING_TOP,\n BORDER_TOP_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_LEFT_WIDTH,\n TOP,\n RIGHT,\n BOTTOM,\n LEFT,\n WIDTH,\n HEIGHT,\n TEXT_ALIGN,\n FLEX_DIRECTION,\n FLEX_BASIS,\n FLEX_SHRINK,\n FLEX_GROW,\n ALIGN_SELF,\n ALIGN_ITEMS,\n JUSTIFY_CONTENT,\n Z_INDEX,\n WHITE_SPACE,\n LINE_HEIGHT,\n LINE_CLAMP,\n ORDER,\n FLEX_WRAP,\n ALIGN_CONTENT,\n OVERFLOW,\n FONT_SIZE,\n },\n NODE_KEY: {\n NODE_CURRENT_STYLE,\n NODE_STYLE,\n NODE_STRUCT,\n NODE_DOM_PARENT,\n NODE_IS_INLINE,\n },\n UPDATE_KEY: {\n UPDATE_NODE,\n UPDATE_FOCUS,\n UPDATE_ADD_DOM,\n UPDATE_CONFIG,\n UPDATE_MEASURE,\n },\n STRUCT_KEY: {\n STRUCT_NUM,\n STRUCT_LV,\n STRUCT_TOTAL,\n STRUCT_CHILD_INDEX,\n STRUCT_INDEX,\n },\n} = enums;\nconst { AUTO, PX, PERCENT, REM, VW, VH, VMAX, VMIN } = unit;\nconst { calAbsolute, isRelativeOrAbsolute, calAbsFixedSize, computeReflow } = css;\nconst { extend, isNil, isFunction } = util;\n\nfunction genZIndexChildren(dom) {\n let normal = [];\n let hasMc;\n let mcHash = {};\n let lastMaskIndex;\n let children = dom.children;\n children.forEach((item, i) => {\n let child = item;\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n // 遮罩单独保存后特殊排序\n if(item instanceof Xom && item.isMask) {\n // 开头的mc忽略,后续的连续mc以第一次出现为准\n if(lastMaskIndex !== undefined) {\n mcHash[lastMaskIndex].push(item);\n }\n else if(i) {\n lastMaskIndex = i - 1;\n children[lastMaskIndex].__iIndex = lastMaskIndex;\n mcHash[lastMaskIndex] = [item];\n hasMc = true;\n }\n }\n else {\n lastMaskIndex = undefined;\n if(item instanceof Xom) {\n child.__zIndex = item.currentStyle[Z_INDEX];\n if(isRelativeOrAbsolute(item)) {\n // 临时变量为排序使用\n child.__aIndex = true;\n normal.push(child);\n }\n else {\n normal.push(child);\n }\n }\n else {\n child.__zIndex = 0;\n normal.push(child);\n }\n child.__iIndex = i;\n }\n });\n normal.sort(function(a, b) {\n if(a.__zIndex !== b.__zIndex) {\n return a.__zIndex - b.__zIndex;\n }\n // zIndex相等时abs优先flow\n if(a.__aIndex !== b.__aIndex) {\n if(a.__aIndex) {\n return 1;\n }\n return -1;\n }\n // 都相等看索引\n return a.__iIndex - b.__iIndex;\n });\n // 将遮罩插入到对应顺序上\n if(hasMc) {\n for(let i = normal.length - 1; i >= 0; i--) {\n let idx = normal[i].__iIndex;\n if(mcHash.hasOwnProperty(idx)) {\n normal.splice(i + 1, 0, ...mcHash[idx]);\n }\n }\n }\n return normal;\n}\n\n// flex布局阶段顺序,不是渲染也和struct结构无关,可以无视mask\nfunction genOrderChildren(flowChildren) {\n let normal = [];\n flowChildren.forEach((item, i) => {\n let child = item;\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n if(item instanceof Xom) {\n child.__order = item.currentStyle[ORDER];\n }\n else {\n child.__order = 0;\n }\n normal.push(child);\n child.__iIndex = i;\n });\n normal.sort(function(a, b) {\n if(a.__order !== b.__order) {\n return a.__order - b.__order;\n }\n // order相等时看节点索引\n return a.__iIndex - b.__iIndex;\n });\n return normal;\n}\n\nclass Dom extends Xom {\n constructor(tagName, props, children) {\n super(tagName, props);\n let { style } = this;\n if(!style.display || !{\n flex: true,\n block: true,\n inline: true,\n inlineBlock: true,\n 'inline-block': true,\n none: true,\n }.hasOwnProperty(style.display)) {\n if(tag.INLINE.hasOwnProperty(this.tagName)) {\n style.display = 'inline';\n }\n else {\n style.display = 'block';\n }\n }\n if(!style[FONT_WEIGHT] && tag.BOLD.hasOwnProperty(tagName)) {\n style.fontWeight = 700;\n }\n this.__style = css.normalize(style, reset.DOM_ENTRY_SET);\n // currentStyle/currentProps不深度clone,继承一层即可,动画时也是extend这样只改一层引用不动原始静态style\n this.__currentStyle = extend({}, this.__style);\n this.__children = children || [];\n this.__flexLine = []; // flex布局多行模式时存储行\n let config = this.__config;\n config[NODE_CURRENT_STYLE] = this.__currentStyle;\n config[NODE_STYLE] = this.__style;\n }\n\n __structure(i, lv, j) {\n let res = super.__structure(i++, lv, j);\n let arr = [res];\n let zIndexChildren = this.__zIndexChildren = this.__zIndexChildren || genZIndexChildren(this);\n zIndexChildren.forEach((child, j) => {\n let temp = child.__structure(i, lv + 1, j);\n if(Array.isArray(temp)) {\n i += temp.length;\n arr = arr.concat(temp);\n }\n else {\n i++;\n arr.push(temp);\n }\n });\n let total = arr.length - 1;\n res[STRUCT_NUM] = zIndexChildren.length;\n res[STRUCT_TOTAL] = total;\n return arr;\n }\n\n __modifyStruct(root, offset = 0) {\n let __config = this.__config;\n let struct = __config[NODE_STRUCT];\n let total = struct[STRUCT_TOTAL] || 0;\n // 新生成了struct,引用也变了\n let nss = this.__structure(struct[STRUCT_INDEX], struct[STRUCT_LV], struct[STRUCT_CHILD_INDEX]);\n root.__structs.splice(struct[STRUCT_INDEX] + offset, total + 1, ...nss);\n let d = 0;\n if(this !== root) {\n struct = __config[NODE_STRUCT];\n d = (struct[STRUCT_TOTAL] || 0) - total;\n let ps = __config[NODE_DOM_PARENT].__config[NODE_STRUCT];\n ps[STRUCT_TOTAL] = ps[STRUCT_TOTAL] || 0;\n ps[STRUCT_TOTAL] += d;\n }\n return [struct, d];\n }\n\n /**\n * 因为zIndex/abs的变化造成的更新,只需重排这一段顺序即可\n * 即便包含component造成的dom变化也不影响,component作为子节点reflow会再执行,这里重排老的vd\n * @param structs\n * @private\n */\n __updateStruct(structs) {\n let { [STRUCT_INDEX]: index, [STRUCT_TOTAL]: total = 0 } = this.__config[NODE_STRUCT];\n let zIndexChildren = this.__zIndexChildren = genZIndexChildren(this);\n let length = zIndexChildren.length;\n if(length === 1) {\n return;\n }\n zIndexChildren.forEach((child, i) => {\n child.__config[NODE_STRUCT][STRUCT_CHILD_INDEX] = i;\n });\n // 按直接子节点划分为相同数量的若干段进行排序\n let arr = [];\n let source = [];\n for(let i = index + 1; i <= index + total; i++) {\n let child = structs[i];\n let o = {\n child,\n list: structs.slice(child[STRUCT_INDEX], child[STRUCT_INDEX] + child[STRUCT_TOTAL] + 1),\n };\n arr.push(o);\n source.push(o);\n i += child[STRUCT_TOTAL] || 0;\n }\n arr.sort(function(a, b) {\n return a.child[STRUCT_CHILD_INDEX] - b.child[STRUCT_CHILD_INDEX];\n });\n // 是否有变更,有才进行重新计算\n let needSort;\n for(let i = 0, len = source.length; i < len; i++) {\n if(source[i] !== arr[i]) {\n needSort = true;\n break;\n }\n }\n if(needSort) {\n let list = [];\n arr.forEach(item => {\n list = list.concat(item.list);\n });\n list.forEach((struct, i) => {\n struct[STRUCT_INDEX] = index + i + 1;\n })\n structs.splice(index + 1, total, ...list);\n }\n }\n\n /**\n * 给定父宽度情况下,尝试行内放下后的剩余宽度,为负数即放不下,这里只会出现行内级即inline(Block)\n * 调用前提是非行开头的inline尝试计算是否放得下,开头无需且禁止判断,防止出现永远放不下一个字符卡死\n * 返回非负数就是放得下,这样一些尺寸为0的也算\n * @param w 剩余宽度\n * @param total 容器尺寸\n * @returns {number|*}\n * @private\n */\n __tryLayInline(w, total) {\n let { flowChildren, currentStyle: {\n [DISPLAY]: display,\n [WIDTH]: width,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_RIGHT]: marginRight,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_RIGHT]: paddingRight,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n } } = this;\n // inline没w/h,并且尝试孩子第一个能放下即可,如果是文字就是第一个字符\n if(display === 'inline') {\n if(flowChildren.length) {\n let first = flowChildren[0];\n if(first instanceof Component) {\n first = first.shadowRoot;\n }\n if(first instanceof Xom) {\n w = first.__tryLayInline(w, total);\n }\n else {\n w -= first.firstCharWidth;\n }\n }\n }\n // inlineBlock尝试所有孩子在一行上\n else {\n if(width[1] === PX) {\n w -= width[0];\n }\n else if(width[1] === PERCENT) {\n w -= total * width[0] * 0.01;\n }\n else if(width[1] === REM) {\n w -= width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w -= width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w -= width[0] * this.root.height * 0.01;\n }\n else if(width[1] === VMAX) {\n w -= width[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(width[1] === VMIN) {\n w -= width[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n else {\n for(let i = 0; i < flowChildren.length; i++) {\n // 当放不下时直接返回,无需继续多余的尝试计算\n if(w < 0) {\n return w;\n }\n let item = flowChildren[i];\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n if(item instanceof Xom) {\n w = item.__tryLayInline(w, total);\n }\n // text强制一行,否则非头就是放不下,需从头开始\n else {\n w -= item.textWidth;\n }\n }\n }\n // ib要减去末尾mpb\n if(marginRight[1] === PX) {\n w -= marginRight[0];\n }\n else if(marginRight[1] === PERCENT) {\n w -= marginRight[0] * total * 0.01;\n }\n else if(marginRight[1] === REM) {\n w -= marginRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginRight[1] === VW) {\n w -= marginRight[0] * this.root.width * 0.01;\n }\n else if(marginRight[1] === VH) {\n w -= marginRight[0] * this.root.height * 0.01;\n }\n else if(marginRight[1] === VMAX) {\n w -= marginRight[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(marginRight[1] === VMIN) {\n w -= marginRight[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(paddingRight[1] === PX) {\n w -= paddingRight[0];\n }\n else if(paddingRight[1] === PERCENT) {\n w -= paddingRight[0] * total * 0.01;\n }\n else if(paddingRight[1] === REM) {\n w -= paddingRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingRight[1] === VW) {\n w -= paddingRight[0] * this.root.width * 0.01;\n }\n else if(paddingRight[1] === VH) {\n w -= paddingRight[0] * this.root.height * 0.01;\n }\n else if(paddingRight[1] === VMAX) {\n w -= paddingRight[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(paddingRight[1] === VMIN) {\n w -= paddingRight[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(borderRightWidth[1] === PX) {\n w -= borderRightWidth[0];\n }\n else if(borderRightWidth[1] === REM) {\n w -= borderRightWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderRightWidth[1] === VW) {\n w -= borderRightWidth[0] * this.root.width * 0.01;\n }\n else if(borderRightWidth[1] === VH) {\n w -= borderRightWidth[0] * this.root.height * 0.01;\n }\n else if(borderRightWidth[1] === VMAX) {\n w -= borderRightWidth[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(borderRightWidth[1] === VMIN) {\n w -= borderRightWidth[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n }\n // 还要减去开头的mpb\n if(marginLeft[1] === PX) {\n w -= marginLeft[0];\n }\n else if(marginLeft[1] === PERCENT) {\n w -= marginLeft[0] * total * 0.01;\n }\n else if(marginLeft[1] === REM) {\n w -= marginLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginLeft[1] === VW) {\n w -= marginLeft[0] * this.root.width * 0.01;\n }\n else if(marginLeft[1] === VH) {\n w -= marginLeft[0] * this.root.height * 0.01;\n }\n else if(marginLeft[1] === VMAX) {\n w -= marginLeft[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(marginLeft[1] === VMIN) {\n w -= marginLeft[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(paddingLeft[1] === PX) {\n w -= paddingLeft[0];\n }\n else if(paddingLeft[1] === PERCENT) {\n w -= paddingLeft[0] * total * 0.01;\n }\n else if(paddingLeft[1] === REM) {\n w -= paddingLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingLeft[1] === VW) {\n w -= paddingLeft[0] * this.root.width * 0.01;\n }\n else if(paddingLeft[1] === VH) {\n w -= paddingLeft[0] * this.root.height * 0.01;\n }\n else if(paddingLeft[1] === VMAX) {\n w -= paddingLeft[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(paddingLeft[1] === VMIN) {\n w -= paddingLeft[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(borderLeftWidth[1] === PX) {\n w -= borderLeftWidth[0];\n }\n else if(borderLeftWidth[1] === REM) {\n w -= borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderLeftWidth[1] === VW) {\n w -= borderLeftWidth[0] * this.root.width * 0.01;\n }\n else if(borderLeftWidth[1] === VH) {\n w -= borderLeftWidth[0] * this.root.height * 0.01;\n }\n else if(borderLeftWidth[1] === VMAX) {\n w -= borderLeftWidth[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(borderLeftWidth[1] === VMIN) {\n w -= borderLeftWidth[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n return w;\n }\n\n // 设置y偏移值,递归包括children,此举在justify-content/margin-auto等对齐用\n __offsetX(diff, isLayout, lv) {\n super.__offsetX(diff, isLayout, lv);\n // 记得偏移LineBox\n if(isLayout && !this.__config[NODE_IS_INLINE] && this.lineBoxManager) {\n this.lineBoxManager.__offsetX(diff);\n }\n this.flowChildren.forEach(item => {\n if(item) {\n item.__offsetX(diff, isLayout, lv);\n }\n });\n }\n\n __offsetY(diff, isLayout, lv) {\n super.__offsetY(diff, isLayout, lv);\n if(isLayout && !this.__config[NODE_IS_INLINE] && this.lineBoxManager) {\n this.lineBoxManager.__offsetY(diff);\n }\n this.flowChildren.forEach(item => {\n if(item) {\n item.__offsetY(diff, isLayout, lv);\n }\n });\n }\n\n\n /**\n * flex布局时,计算basis尺寸,如果有固定声明则以其为标准,content为内容最大尺寸,auto依赖w/h或降级content\n * basis要考虑相加直接item的mpb,非绝对值单位以container为基准,basis为内容时为max值\n * item的孩子为孙子节点需递归,不参与basis计算,只参与min/max,尺寸和mpb均只考虑绝对值\n * 自动计算时影响尺寸的只有换行的text,以及一组inline,均按其中最大尺寸的一个计算\n * auto自动计算递归进行,如果是普通row方向,按最大text的charWidth为准\n * 如果是column方向,则虚拟布局后看text的height\n * 在abs下时进入特殊状态,无论是row/column,都会按row方向尝试最大尺寸,直到舞台边缘或容器声明的w折行\n * 返回b,声明则按css值,否则是auto/content\n * 返回min为最小宽度,遇到字符/inline则单列排版后需要的最大宽度\n * 返回max为最大宽度,理想情况一排最大值,在abs时virtualMode状态参与计算,文本抵达边界才进行换行\n * 当为column方向时,特殊进行虚拟布局isVirtual,需要获取高度\n * @param isDirectionRow\n * @param isAbs\n * @param isColumn\n * @param data\n * @param isDirectChild\n * @private\n */\n __calBasis(isDirectionRow, isAbs, isColumn, data, isDirectChild) {\n computeReflow(this);\n let b = 0;\n let min = 0;\n let max = 0;\n let { flowChildren, currentStyle, computedStyle } = this;\n let { x, y, w, h } = data;\n // 计算需考虑style的属性\n let {\n [FLEX_DIRECTION]: flexDirection,\n [FLEX_BASIS]: flexBasis,\n [WIDTH]: width,\n [HEIGHT]: height,\n } = currentStyle;\n let {\n [LINE_HEIGHT]: lineHeight,\n [DISPLAY]: display,\n } = computedStyle;\n let main = isDirectionRow ? width : height;\n // basis3种情况:auto、固定、content\n let isAuto = flexBasis[1] === AUTO;\n let isFixed = [PX, PERCENT, REM, VW, VH, VMAX, VMIN].indexOf(flexBasis[1]) > -1;\n let isContent = !isAuto && !isFixed;\n let fixedSize;\n // flex的item固定basis计算\n if(isFixed) {\n if(flexBasis[1] === PX) {\n b = fixedSize = flexBasis[0];\n }\n else if(flexBasis[1] === PERCENT) {\n b = fixedSize = (isDirectionRow ? w : h) * flexBasis[0] * 0.01;\n }\n else if(flexBasis[1] === REM) {\n b = fixedSize = flexBasis[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(flexBasis[1] === VW) {\n b = fixedSize = flexBasis[0] * this.root.width * 0.01;\n }\n else if(flexBasis[1] === VH) {\n b = fixedSize = flexBasis[0] * this.root.height * 0.01;\n }\n else if(flexBasis[1] === VMAX) {\n b = fixedSize = flexBasis[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(flexBasis[1] === VMIN) {\n b = fixedSize = flexBasis[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n }\n // 已声明主轴尺寸的,当basis是auto时为main值\n else if(isAuto && ([PX, PERCENT, REM, VW, VH, VMAX, VMIN].indexOf(main[1]) > -1)) {\n if(main[1] === PX) {\n b = fixedSize = main[0];\n }\n else if(main[1] === PERCENT) {\n b = fixedSize = main[0] * 0.01 * (isDirectionRow ? w : h);\n }\n else if(main[1] === REM) {\n b = fixedSize = main[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(main[1] === VW) {\n b = fixedSize = main[0] * this.root.width * 0.01;\n }\n else if(main[1] === VH) {\n b = fixedSize = main[0] * this.root.height * 0.01;\n }\n else if(main[1] === VMAX) {\n b = fixedSize = main[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(main[1] === VMIN) {\n b = fixedSize = main[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n }\n // 非固定尺寸的basis为auto时降级为content\n else if(isAuto) {\n isContent = true;\n }\n let countMin = 0, countMax = 0;\n // row的flex时,child只需计算宽度的basis/min/max,递归下去也是如此,即便包含递归的flex\n if(isDirectionRow) {\n // flex的item还是flex时\n if(display === 'flex') {\n let isRow = ['column', 'column-reverse', 'columnReverse'].indexOf(flexDirection) === -1;\n flowChildren = genOrderChildren(flowChildren);\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let [, min2, max2] = item.__calBasis(isDirectionRow, isAbs, isColumn, { x, y, w, h }, false);\n if(isRow) {\n min += min2;\n max += max2;\n }\n else {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n }\n else if(isDirectionRow) {\n if(isRow) {\n min += item.charWidth;\n max += item.textWidth;\n }\n else {\n min = Math.max(min, item.charWidth);\n max = Math.max(max, item.textWidth);\n }\n }\n });\n }\n // flex的item是block/inline时,inline也会变成block统一对待\n else {\n let lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseline(computedStyle));\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let [, min2, max2] = item.__calBasis(isDirectionRow, isAbs, isColumn, { x, y, w, h, lineBoxManager }, false);\n let display = item.computedStyle[DISPLAY];\n // row看块级最大尺寸和连续行级最大尺寸的宽\n if(display === 'block' || display === 'flex') {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n countMin = countMax = 0;\n }\n else {\n countMin += min2;\n countMax += max2;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n }\n }\n else {\n countMin += item.charWidth;\n countMax += item.textWidth;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n }\n });\n }\n if(fixedSize) {\n max = Math.max(fixedSize, max);\n }\n // row降级为内容时basis等同于max\n if(isContent) {\n b = max;\n }\n }\n // column的flex时,每个child做一次虚拟布局,获取到每个child的高度和宽度\n else {\n this.__layout({\n x,\n y,\n w,\n h,\n }, isAbs, true);\n min = max = b = this.height; // column的child,max和b总相等\n }\n // 直接item的mpb影响basis\n return this.__addMBP(isDirectionRow, w, currentStyle, computedStyle, [b, min, max], isDirectChild);\n }\n\n __layoutNone() {\n super.__layoutNone();\n let { children } = this;\n children.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n item.__layoutNone();\n }\n });\n }\n\n /**\n * block布局,本身固定尺寸优先,否则看内容从上往下从左往右flow流排布\n * 内部inline和inlineBlock组成LineBox,通过LineBoxManager来管理混排的现象\n * LineBoxManager只有block和inlineBlock内部生成,inline会复用最近父级的\n * 内部的block在垂直方向要考虑margin合并的问题,强制所有节点为bfc,精简逻辑\n * @param data\n * @param isAbs abs无尺寸时提前虚拟布局计算尺寸\n * @param isColumn flex列无尺寸时提前虚拟布局计算尺寸\n * @private\n */\n __layoutBlock(data, isAbs, isColumn) {\n let { flowChildren, currentStyle, computedStyle } = this;\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data, false);\n // abs虚拟布局需预知width,固定可提前返回\n if(isAbs && fixedWidth) {\n this.__width = w;\n this.__ioSize(w);\n return;\n }\n if(isColumn && fixedHeight) {\n this.__height = h;\n this.__ioSize(undefined, h);\n }\n let {\n [TEXT_ALIGN]: textAlign,\n [WHITE_SPACE]: whiteSpace,\n [LINE_CLAMP]: lineClamp,\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n // 只有>=1的正整数才有效\n lineClamp = lineClamp || 0;\n let lineClampCount = 0;\n // 虚线管理一个block内部的LineBox列表,使得inline的元素可以中途衔接处理折行\n // 内部维护inline结束的各种坐标来达到目的,遇到block时中断并处理换行坐标\n let lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseline(computedStyle));\n // 因精度问题,统计宽度均从0开始累加每行,最后取最大值,仅在abs布局时isVirtual生效\n let maxW = 0;\n let cw = 0;\n // 连续block(flex相同,下面都是)的上下margin合并值记录,合并时从列表中取\n let mergeMarginBottomList = [], mergeMarginTopList = [];\n let length = flowChildren.length;\n flowChildren.forEach((item, i) => {\n let isXom = item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom;\n let isInline = isXom && item.currentStyle[DISPLAY] === 'inline';\n let isInlineBlock = isXom && ['inlineBlock', 'inline-block'].indexOf(item.currentStyle[DISPLAY]) > -1;\n let isReplaced = item.isReplaced;\n // 每次循环开始前,这次不是block的话,看之前遗留待合并margin,并重置\n if((!isXom || isInline || isInlineBlock)) {\n if(mergeMarginBottomList.length && mergeMarginTopList.length) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n y += diff;\n }\n }\n mergeMarginTopList = [];\n mergeMarginBottomList = [];\n }\n if(isXom) {\n // inline和inlineBlock的细节不同之处,ib除了w/h之外,更想像block一样占据一行\n // 比如2个inline前面占一半后面比一半多但还是会从一半开始然后第2行换行继续,但ib放不下则重开一行\n // inline和ib能互相嵌套,形成的LineBox中则是TextBox和节点混合\n if(isInlineBlock || isInline) {\n // x开头,不用考虑是否放得下直接放\n if(x === data.x || isInline && whiteSpace === 'nowrap') {\n item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager, // ib内部新生成会内部判断,这里不管统一传入\n lineClamp,\n lineClampCount,\n }, isAbs, isColumn);\n // inlineBlock的特殊之处,一旦w为auto且内部产生折行时,整个变成block独占一块区域,坐标计算和block一样\n if(item.__isIbFull) {\n x = data.x;\n y += item.outerHeight;\n lineBoxManager.setNotEnd();\n }\n // inline和不折行的ib,其中ib需要手动存入当前lb中\n else {\n (isInlineBlock || isReplaced) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n // abs统计宽度\n if(isAbs) {\n cw = item.outerWidth;\n maxW = Math.max(maxW, cw);\n if(item.__isIbFull) {\n maxW = Math.max(maxW, w);\n }\n }\n }\n else {\n // 非开头先尝试是否放得下,内部判断了inline/ib,ib要考虑是否有width\n let fw = item.__tryLayInline(w + data.x - x, w);\n // 放得下继续,奇怪的精度问题,加上阈值\n if(fw >= (-1e-10)) {\n item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isAbs, isColumn);\n // ib放得下要么内部没有折行,要么声明了width限制,都需手动存入当前lb\n (isInlineBlock || isReplaced) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n // 放不下处理之前的lineBox,并重新开头\n else {\n lineClampCount++;\n x = data.x;\n y = lineBoxManager.endY;\n lineBoxManager.setNewLine();\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isAbs, isColumn);\n // 重新开头的ib和上面开头处一样逻辑\n if(item.__isIbFull) {\n x = data.x;\n y += item.outerHeight;\n lineBoxManager.setNotEnd();\n }\n // inline和不折行的ib,其中ib需要手动存入当前lb中\n else {\n (isInlineBlock || isReplaced) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n if(isAbs) {\n maxW = Math.max(maxW, cw);\n if(item.__isIbFull) {\n maxW = Math.max(maxW, w);\n }\n cw = 0;\n }\n }\n if(isAbs) {\n cw += item.outerWidth;\n maxW = Math.max(maxW, cw);\n }\n }\n }\n // block/flex先处理之前可能遗留的最后一行LineBox,然后递归时不传lineBoxManager,其内部生成新的\n else {\n // 非开头,说明之前的text未换行,需要增加行数\n if(x !== data.x && flowChildren[i - 1] instanceof Text) {\n lineClampCount++;\n }\n x = data.x;\n if(lineBoxManager.isEnd) {\n y = lineBoxManager.endY;\n lineBoxManager.setNotEnd();\n lineBoxManager.setNewLine();\n }\n item.__layout({\n x,\n y,\n w,\n h,\n }, isAbs, isColumn);\n let isNone = item.computedStyle[DISPLAY] === 'none';\n // 自身无内容\n let isEmptyBlock;\n if(!isNone && item.flowChildren && item.flowChildren.length === 0) {\n let {\n [MARGIN_TOP]: marginTop,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_TOP]: paddingTop,\n [PADDING_BOTTOM]: paddingBottom,\n [HEIGHT]: height,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n } = item.computedStyle;\n // 无内容高度为0的空block特殊情况,记录2个margin下来等后续循环判断处理\n if(paddingTop <= 0 && paddingBottom <= 0 && height <= 0 && borderTopWidth <= 0 && borderBottomWidth <= 0) {\n mergeMarginBottomList.push(marginBottom);\n mergeMarginTopList.push(marginTop);\n isEmptyBlock = true;\n }\n }\n y += item.outerHeight;\n lineBoxManager.__lastY = y;\n // absolute/flex前置虚拟计算\n if(isAbs) {\n maxW = Math.max(maxW, item.outerWidth);\n cw = 0;\n }\n // 空block要留下轮循环看,除非是最后一个,此处非空本轮处理掉看是否要合并\n if(!isNone && !isEmptyBlock) {\n let { [MARGIN_TOP]: marginTop, [MARGIN_BOTTOM]: marginBottom } = item.computedStyle;\n // 有bottom值说明之前有紧邻的block,任意个甚至空block,自己有个top所以无需判断top\n // 如果是只有紧邻的2个非空block,也被包含在情况内,取上下各1合并\n if(mergeMarginBottomList.length) {\n mergeMarginTopList.push(marginTop);\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n item.__offsetY(diff, true);\n y += diff;\n }\n }\n // 同时自己保存bottom,为后续block准备\n mergeMarginTopList = [];\n mergeMarginBottomList = [marginBottom];\n }\n // 最后一个空block当是正正和负负时要处理,正负在outHeight处理了结果是0\n else if(i === length - 1) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n y += diff;\n }\n }\n }\n }\n // 文字和inline类似\n else {\n // lineClamp作用域为block下的inline(同LineBox上下文)\n if(lineClamp && lineClampCount >= lineClamp) {\n return;\n }\n // x开头,不用考虑是否放得下直接放\n if(x === data.x || whiteSpace === 'nowrap') {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isAbs, isColumn);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n if(isAbs) {\n cw = item.width;\n // 发生换行情况,最大宽度要特殊计算,可能撑满容器,比如abs下文字换行,仅算内容宽度可能会缺少\n if(item.textWidth > w) {\n cw = Math.max(cw, w);\n }\n maxW = Math.max(maxW, cw);\n }\n }\n else {\n // 非开头先尝试是否放得下\n let fw = item.__tryLayInline(w - x + data.x);\n // 放得下继续\n if(fw >= (-1e-10)) {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isAbs, isColumn);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n // 放不下处理之前的lineBox,并重新开头\n else {\n lineClampCount++;\n x = data.x;\n y = lineBoxManager.endY;\n lineBoxManager.setNewLine();\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isAbs, isColumn);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n if(isAbs) {\n maxW = Math.max(maxW, item.width);\n // 此处发生换行撑满\n maxW = Math.max(maxW, w);\n cw = 0;\n }\n }\n if(isAbs) {\n cw += item.width;\n maxW = Math.max(maxW, cw);\n }\n }\n }\n });\n // 结束后如果是以LineBox结尾,则需要设置y到这里,否则流布局中block会设置\n // 当以block换行时,新行是true,否则是false即结尾\n if(lineBoxManager.isEnd) {\n y = lineBoxManager.endY;\n }\n let tw = this.__width = (fixedWidth || !isAbs) ? w : maxW;\n let th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\n // 不管是否虚拟,都需要垂直对齐,因为img这种占位元素会影响lineBox高度\n let spread = lineBoxManager.verticalAlign();\n if(spread) {\n if(!fixedHeight) {\n this.__resizeY(spread);\n }\n /**\n * parent以及parent的next无需处理,因为深度遍历后面还会进行,\n * 但自己的block需处理,因为对齐只处理了inline元素,忽略了block,\n * 同时由于block和inline区域可能不连续,每个增加的y不一样,\n * 需要按照每个不同区域来判断,区域是按索引次序依次增大的\n */\n let count = 0, syl = lineBoxManager.spreadYList;\n let isLastBlock = false;\n flowChildren.forEach(item => {\n let isXom = item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom;\n let isBlock = isXom && item.computedStyle[DISPLAY] === 'block';\n if(isBlock) {\n isLastBlock = true;\n item.__offsetY(syl[count], true);\n }\n else {\n if(isLastBlock) {\n count++;\n }\n isLastBlock = false;\n }\n });\n }\n // 非abs提前的虚拟布局,真实布局情况下最后为所有行内元素进行2个方向上的对齐\n if(!isAbs && !isColumn) {\n if(['center', 'right'].indexOf(textAlign) > -1) {\n lineBoxManager.horizonAlign(tw, textAlign);\n // 直接text需计算size\n flowChildren.forEach(item => {\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n if(item instanceof Text) {\n item.__inlineSize();\n }\n });\n }\n // 所有inline计算size\n lineBoxManager.domList.forEach(item => {\n item.__inlineSize(tw, textAlign);\n });\n this.__marginAuto(currentStyle, data);\n }\n }\n\n // 弹性布局时的计算位置\n __layoutFlex(data, isAbs, isColumn) {\n let { flowChildren, currentStyle, computedStyle, __flexLine } = this;\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data, false);\n if(isAbs && fixedWidth) {\n this.__width = w;\n this.__ioSize(w);\n return;\n }\n if(isColumn && fixedHeight) {\n if(isColumn && fixedHeight) {\n this.__height = h;\n this.__ioSize(undefined, h);\n }\n }\n // 每次布局情况多行内容\n __flexLine.splice(0);\n let {\n [FLEX_DIRECTION]: flexDirection,\n [JUSTIFY_CONTENT]: justifyContent,\n [ALIGN_ITEMS]: alignItems,\n [LINE_CLAMP]: lineClamp,\n [FLEX_WRAP]: flexWrap,\n [ALIGN_CONTENT]: alignContent,\n [LINE_HEIGHT]: lineHeight,\n [TEXT_ALIGN]: textAlign,\n } = computedStyle;\n // 只有>=1的正整数才有效\n lineClamp = lineClamp || 0;\n let lineClampCount = 0;\n let isDirectionRow = ['column', 'column-reverse', 'columnReverse'].indexOf(flexDirection) === -1;\n // 计算伸缩基数\n let growList = [];\n let shrinkList = [];\n let basisList = [];\n let maxList = [];\n let minList = [];\n let orderChildren = genOrderChildren(flowChildren);\n orderChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let { currentStyle, computedStyle } = item;\n let [b, min, max] = item.__calBasis(isDirectionRow, isAbs, isColumn, { x, y, w, h }, true);\n let { [FLEX_GROW]: flexGrow, [FLEX_SHRINK]: flexShrink } = currentStyle;\n computedStyle[FLEX_BASIS] = b;\n growList.push(flexGrow);\n shrinkList.push(flexShrink);\n // 根据basis不同,计算方式不同\n basisList.push(b);\n maxList.push(max);\n minList.push(min);\n }\n // 文本\n else {\n growList.push(0);\n shrinkList.push(1);\n if(isDirectionRow) {\n let cw = item.charWidth;\n let tw = item.textWidth;\n basisList.push(tw);\n maxList.push(tw);\n minList.push(cw);\n }\n else {\n let lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseline(computedStyle));\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isAbs, isColumn);\n let hh = item.height;\n basisList.push(hh);\n maxList.push(hh);\n minList.push(hh);\n }\n }\n });\n let containerSize = isDirectionRow ? w : h;\n let isMultiLine = flexWrap === 'wrap' || ['wrap-reverse', 'wrapReverse'].indexOf(flexWrap) > -1;\n /**\n * 判断是否需要分行,根据假设主尺寸来统计尺寸和计算,假设主尺寸是clamp(min_main_size, flex_base_size, max_main_size)\n * 当多行时,由于每行一定有最小限制,所以每行一般情况都不是shrink状态,\n * 但也有极端情况,比如一行只能放下1个元素时,且此元素比容器小,会是shrink\n */\n let line = [], sum = 0, hypotheticalList = [];\n basisList.forEach((item, i) => {\n let min = minList[i], max = maxList[i];\n let hypothetical;\n if(item < min) {\n hypothetical = min;\n }\n else if(item > max) {\n hypothetical = max;\n }\n else {\n hypothetical = item;\n }\n hypotheticalList.push(hypothetical);\n if(isMultiLine) {\n // 超过尺寸时,要防止sum为0即1个也会超过尺寸\n if(sum + hypothetical > containerSize) {\n if(sum) {\n __flexLine.push(line);\n line = [orderChildren[i]];\n sum = hypothetical;\n }\n else {\n line.push(orderChildren[i]);\n __flexLine.push(line);\n line = [];\n sum = 0;\n }\n }\n else {\n line.push(orderChildren[i]);\n sum += hypothetical;\n }\n }\n else {\n line.push(orderChildren[i]);\n }\n });\n if(line.length) {\n __flexLine.push(line);\n }\n let offset = 0, clone = { x, y, w, h };\n let maxCrossList = [];\n __flexLine.forEach(item => {\n let length = item.length;\n let end = offset + length;\n let [x1, y1, maxCross] = this.__layoutFlexLine(clone, isDirectionRow, isAbs, isColumn, containerSize,\n fixedWidth, fixedHeight, lineClamp, lineClampCount,\n lineHeight, computedStyle, justifyContent, alignItems,\n orderChildren.slice(offset, end), item, textAlign,\n growList.slice(offset, end), shrinkList.slice(offset, end), basisList.slice(offset, end),\n hypotheticalList.slice(offset, end), minList.slice(offset, end));\n // 下一行/列更新坐标\n if(isDirectionRow) {\n clone.y = y1;\n }\n else {\n clone.x = x1;\n }\n x = Math.max(x, x1);\n y = Math.max(y, y1);\n maxCrossList.push(maxCross);\n offset += length;\n });\n // abs预布局只计算宽度无需对齐\n if(isAbs) {\n let maxW = 0;\n __flexLine.forEach(line => {\n let count = 0;\n line.forEach(item => {\n if(isDirectionRow) {\n count += item.outerWidth;\n }\n else {\n count = Math.max(count, item.outerWidth);\n }\n // 文字发生换行无论row/column一定放不下需占满容器尺寸\n if(item instanceof Text && item.textWidth > w) {\n maxW = Math.max(maxW, w);\n }\n });\n maxW = Math.max(maxW, count);\n });\n let tw = this.__width = maxW;\n this.__ioSize(tw);\n return;\n }\n let tw = this.__width = w;\n let th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\n if(isColumn) {\n return;\n }\n // flexDirection当有reverse时交换每line的主轴序\n if(flexDirection === 'row-reverse' || flexDirection === 'rowReverse') {\n __flexLine.forEach(line => {\n line.forEach(item => {\n // 一个矩形内的子矩形进行镜像移动,用外w减去内w再减去开头空白的2倍即可\n let diff = tw - item.outerWidth - (item.x - data.x) * 2;\n if(diff) {\n item.__offsetX(diff, true);\n }\n });\n });\n }\n else if(flexDirection === 'column-reverse' || flexDirection === 'columnReverse') {\n __flexLine.forEach(line => {\n line.forEach(item => {\n // 一个矩形内的子矩形进行镜像移动,用外w减去内w再减去开头空白的2倍即可\n let diff = th - item.outerHeight - (item.y - data.y) * 2;\n if(diff) {\n item.__offsetY(diff, true);\n }\n });\n });\n }\n // wrap-reverse且多轴线时交换轴线序,需要2行及以上才行\n let length = __flexLine.length;\n if(['wrapReverse', 'wrap-reverse'].indexOf(flexWrap) > -1 && length > 1) {\n let crossSum = 0, crossSumList = [];\n maxCrossList.forEach(item => {\n crossSumList.push(crossSum);\n crossSum += item;\n });\n let count = 0;\n for(let i = length - 1; i >= 0; i--) {\n let line = __flexLine[i];\n let source = crossSumList[i];\n let diff = count - source;\n if(diff) {\n line.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(diff, true);\n }\n else {\n item.__offsetX(diff, true);\n }\n });\n }\n count += maxCrossList[i];\n }\n __flexLine.reverse();\n }\n // 侧轴对齐分flexLine做,要考虑整体的alignContent的stretch和每行的alignItems的stretch\n // 先做整体的,得出交叉轴空白再均分给每一行做单行的,整体的只有1行忽略\n let per;\n if(length > 1 && (fixedHeight && isDirectionRow || !isDirectionRow)) {\n let diff = isDirectionRow ? th - (y - data.y) : tw - (x - data.x);\n // 有空余时才进行对齐\n if(diff > 0) {\n if(alignContent === 'center') {\n let per = diff * 0.5;\n orderChildren.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(per, true);\n }\n else {\n item.__offsetX(per, true);\n }\n });\n }\n else if(alignContent === 'flex-start' || alignContent === 'flexStart') {}\n else if(alignContent === 'flex-end' || alignContent === 'flexEnd') {\n orderChildren.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(diff, true);\n }\n else {\n item.__offsetX(diff, true);\n }\n });\n }\n else if(alignContent === 'space-between' || alignContent === 'spaceBetween') {\n let between = diff / (length - 1);\n // 除了第1行其它进行偏移\n __flexLine.forEach((item, i) => {\n if(i) {\n item.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(between, true);\n }\n else {\n item.__offsetX(between, true);\n }\n });\n }\n });\n }\n else if(alignContent === 'space-around' || alignContent === 'spaceAround') {\n let around = diff / (length + 1);\n __flexLine.forEach((item, i) => {\n item.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(around * (i + 1), true);\n }\n else {\n item.__offsetX(around * (i + 1), true);\n }\n });\n });\n }\n // 默认stretch\n else {\n per = diff / length;\n // 除了第1行其它进行偏移\n __flexLine.forEach((item, i) => {\n if(i) {\n item.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(per * i, true);\n }\n else {\n item.__offsetX(per * i, true);\n }\n });\n }\n });\n }\n }\n }\n // 每行再进行cross对齐,在alignContent为stretch时计算每行的高度\n if(!isColumn) {\n if(length > 1) {\n __flexLine.forEach((item, i) => {\n let maxCross = maxCrossList[i];\n if(per) {\n maxCross += per;\n }\n this.__crossAlign(item, alignItems, isDirectionRow, maxCross);\n });\n }\n else if(length) {\n let maxCross = maxCrossList[0];\n if(isDirectionRow) {\n if(fixedHeight) {\n maxCross = h;\n }\n }\n else {\n maxCross = w;\n }\n this.__crossAlign(__flexLine[0], alignItems, isDirectionRow, maxCross);\n }\n this.__marginAuto(currentStyle, data);\n }\n }\n\n /**\n * 计算获取子元素的b/min/max完毕后,尝试进行flex每行布局\n * https://www.w3.org/TR/css-flexbox-1/#layout-algorithm\n * 假想主尺寸,其为clamp(min_main_size, flex_base_size, max_main_size)\n * 随后按算法一步步来 https://zhuanlan.zhihu.com/p/354567655\n * 规范没提到mpb,item的要计算,孙子的只考虑绝对值\n * 先收集basis和假设主尺寸\n */\n __layoutFlexLine(data, isDirectionRow, isAbs, isColumn, containerSize,\n fixedWidth, fixedHeight, lineClamp, lineClampCount,\n lineHeight, computedStyle, justifyContent, alignItems,\n orderChildren, flexLine, textAlign,\n growList, shrinkList, basisList, hypotheticalList, minList) {\n let { x, y, w, h } = data;\n let hypotheticalSum = 0;\n hypotheticalList.forEach(item => {\n hypotheticalSum += item;\n });\n // 根据假设尺寸确定使用grow还是shrink,冻结非弹性项并设置target尺寸,确定剩余未冻结数量\n let isOverflow = hypotheticalSum >= containerSize;\n let targetMainList = [];\n basisList.forEach((item, i) => {\n if(isOverflow) {\n if(!shrinkList[i] || (basisList[i] < hypotheticalList[i])) {\n targetMainList[i] = hypotheticalList[i];\n }\n }\n else {\n if(!growList[i] || (basisList[i] > hypotheticalList[i])) {\n targetMainList[i] = hypotheticalList[i];\n }\n }\n });\n // 初始可用空间,冻结使用确定的target尺寸,未冻结使用假想\n let free = 0;\n basisList.forEach((item, i) => {\n if(targetMainList[i] !== undefined) {\n free += targetMainList[i];\n }\n else {\n free += item;\n }\n });\n let total = Infinity;\n if(isDirectionRow) {\n total = w;\n }\n else if(fixedHeight) {\n total = h;\n }\n else {\n total = free;\n }\n free = Math.abs(total - free);\n // 循环,文档算法不够简练,其合并了grow和shrink,实际拆开写更简单\n let factorSum = 0;\n if(isOverflow) {\n // 计算真正的因子占比,同时得出缩小尺寸数值\n // 还需判断每个item收缩不能 {\n if(targetMainList[i] === undefined) {\n let n = item * basisList[i];\n factorSum += n;\n return n;\n }\n });\n while(true) {\n if(factorSum < 1) {\n free *= factorSum;\n }\n let needReset, factorSum2 = 0;\n factorList.forEach((item, i) => {\n if(item) {\n let r = item / factorSum;\n let s = r * free; // 需要收缩的尺寸\n let n = basisList[i] - s; // 实际尺寸\n // 比min还小设置为min,同时设0剔除\n if(n < minList[i]) {\n targetMainList[i] = minList[i];\n factorList[i] = 0;\n needReset = true;\n free -= basisList[i] - minList[i]; // 超出的尺寸也要减去实际收缩的尺寸\n }\n // 先按照没有超限的设置,正常情况直接跳出,如果有超限,记录sum2给下轮赋值重新计算\n else {\n targetMainList[i] = n;\n factorSum2 += item;\n }\n }\n });\n if(!needReset) {\n break;\n }\n factorSum = factorSum2;\n }\n }\n else {\n let factorList = growList.map((item, i) => {\n if(targetMainList[i] === undefined) {\n factorSum += item;\n return item;\n }\n });\n while(true) {\n if(factorSum < 1) {\n free *= factorSum;\n }\n let needReset, factorSum2 = 0;\n factorList.forEach((item, i) => {\n if(item) {\n let r = item / factorSum;\n let s = r * free; // 需要扩展的尺寸\n let n = basisList[i] + s; // 实际尺寸\n // 比min还小设置为min,同时设0剔除\n if(n < minList[i]) {\n targetMainList[i] = minList[i];\n factorList[i] = 0;\n needReset = true;\n free -= basisList[i] - minList[i]; // 超出的尺寸也要减去实际收缩的尺寸\n }\n // 先按照没有超限的设置,正常情况直接跳出,如果有超限,记录sum2给下轮赋值重新计算\n else {\n targetMainList[i] = n;\n factorSum2 += item;\n }\n }\n });\n if(!needReset) {\n break;\n }\n factorSum = factorSum2;\n }\n }\n let maxCross = 0;\n let lbmList = [];\n orderChildren.forEach((item, i) => {\n let main = targetMainList[i];\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n if(isDirectionRow) {\n item.__layout({\n x,\n y,\n w: main,\n h,\n w3: main, // w3假设固定宽度,忽略原始style中的设置\n }, isAbs, isColumn);\n }\n else {\n let {\n [ALIGN_SELF]: alignSelf,\n [WIDTH]: width,\n } = item.currentStyle;\n // column的child真布局时,如果是stretch宽度,则可以直接生成animateRecord,否则自适应调整后才进行\n if(!isAbs && !isColumn) {\n let needGenAr;\n if(width[1] !== AUTO || alignSelf === 'stretch') {\n needGenAr = true;\n }\n else if(alignSelf === 'auto' && alignItems === 'stretch') {\n needGenAr = true;\n }\n if(needGenAr) {\n item.__layout({\n x,\n y,\n w,\n h: main,\n h3: main, // 同w2\n }, isAbs, isColumn);\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h: main,\n h3: main, // 同w2\n }, true, isColumn);\n item.__layout({\n x,\n y,\n w,\n w3: item.outerWidth,\n h: main,\n h3: main, // 同w2\n }, isAbs, isColumn);\n }\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h: main,\n h3: main, // 同w2\n }, isAbs, isColumn);\n }\n }\n }\n else {\n let lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseline(computedStyle));\n lbmList.push(lineBoxManager);\n item.__layout({\n x,\n y,\n w: isDirectionRow ? main : w,\n h: isDirectionRow ? h : main,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isAbs, isDirectionRow);\n }\n if(isDirectionRow) {\n x += item.outerWidth;\n maxCross = Math.max(maxCross, item.outerHeight);\n }\n else {\n y += item.outerHeight;\n maxCross = Math.max(maxCross, item.outerWidth);\n }\n });\n // 计算主轴剩余时要用真实剩余空间而不能用伸缩剩余空间\n let diff = isDirectionRow ? (w - x + data.x) : (h - y + data.y);\n // 主轴对齐方式\n if(!isAbs && diff > 0) {\n let len = orderChildren.length;\n if(justifyContent === 'flexEnd' || justifyContent === 'flex-end') {\n for(let i = 0; i < len; i++) {\n let child = orderChildren[i];\n isDirectionRow ? child.__offsetX(diff, true) : child.__offsetY(diff, true);\n }\n }\n else if(justifyContent === 'center') {\n let center = diff * 0.5;\n for(let i = 0; i < len; i++) {\n let child = orderChildren[i];\n isDirectionRow ? child.__offsetX(center, true) : child.__offsetY(center, true);\n }\n }\n else if(justifyContent === 'spaceBetween' || justifyContent === 'space-between') {\n let between = diff / (len - 1);\n for(let i = 1; i < len; i++) {\n let child = orderChildren[i];\n isDirectionRow ? child.__offsetX(between * i, true) : child.__offsetY(between * i, true);\n }\n }\n else if(justifyContent === 'spaceAround' || justifyContent === 'space-around') {\n let around = diff / (len + 1);\n for(let i = 0; i < len; i++) {\n let child = orderChildren[i];\n isDirectionRow ? child.__offsetX(around * (i + 1), true) : child.__offsetY(around * (i + 1), true);\n }\n }\n }\n if(isDirectionRow) {\n y += maxCross;\n }\n else {\n x += maxCross;\n }\n // flex的直接text对齐比较特殊\n if(!isAbs && ['center', 'right'].indexOf(textAlign) > -1) {\n lbmList.forEach(item => {\n item.horizonAlign(item.width, textAlign);\n })\n }\n return [x, y, maxCross];\n }\n\n // 每个flexLine的侧轴对齐,单行时就是一行对齐\n __crossAlign(line, alignItems, isDirectionRow, maxCross) {\n let baseline = 0;\n line.forEach(item => {\n baseline = Math.max(baseline, item.firstBaseline);\n });\n line.forEach(item => {\n let { currentStyle: { [ALIGN_SELF]: alignSelf } } = item;\n if(isDirectionRow) {\n if(alignSelf === 'flexStart' || alignSelf === 'flex-start') {}\n else if(alignSelf === 'flexEnd' || alignSelf === 'flex-end') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n else if(alignSelf === 'center') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff * 0.5, true);\n }\n }\n else if(alignSelf === 'stretch') {\n let { computedStyle, currentStyle: { [HEIGHT]: height } } = item;\n let {\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [MARGIN_TOP]: marginTop,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_TOP]: paddingTop,\n [PADDING_BOTTOM]: paddingBottom,\n } = computedStyle;\n if(height[1] === AUTO) {\n let old = item.height;\n let v = item.__height = computedStyle[HEIGHT] = maxCross - marginTop - marginBottom - paddingTop - paddingBottom - borderTopWidth - borderBottomWidth;\n let d = v - old;\n item.__sy4 += d;\n item.__sy5 += d;\n item.__sy6 += d;\n item.__height += d;\n item.__clientHeight += d;\n item.__offsetHeight += d;\n item.__outerHeight += d;\n }\n }\n else if(alignSelf === 'baseline') {\n let diff = baseline - item.firstBaseline;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n // 默认auto,取alignItems\n else {\n if(alignItems === 'flexStart' || alignSelf === 'flex-start') {}\n else if(alignItems === 'center') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff * 0.5, true);\n }\n }\n else if(alignItems === 'flexEnd' || alignItems === 'flex-end') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n else if(alignItems === 'baseline') {\n let diff = baseline - item.firstBaseline;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n // 默认stretch\n else {\n let { computedStyle, currentStyle: {\n [DISPLAY]: display,\n [FLEX_DIRECTION]: flexDirection,\n [HEIGHT]: height,\n } } = item;\n // row的孩子还是flex且column且不定高时,如果高度<侧轴拉伸高度则重新布局\n if(isDirectionRow && display === 'flex' && flexDirection === 'column' && height[1] === AUTO && item.outerHeight < maxCross) {\n item.__layout(Object.assign(item.__layoutData, { h3: maxCross }));\n }\n let {\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [MARGIN_TOP]: marginTop,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_TOP]: paddingTop,\n [PADDING_BOTTOM]: paddingBottom,\n } = computedStyle;\n if(height[1] === AUTO) {\n let old = item.height;\n let v = maxCross - marginTop - marginBottom - paddingTop - paddingBottom - borderTopWidth - borderBottomWidth;\n let d = v - old;\n item.__sy4 += d;\n item.__sy5 += d;\n item.__sy6 += d;\n item.__height += d;\n item.__clientHeight += d;\n item.__offsetHeight += d;\n item.__outerHeight += d;\n }\n }\n }\n }\n // column\n else {\n if(alignSelf === 'flexStart' || alignSelf === 'flex-start') {}\n else if(alignSelf === 'flexEnd' || alignSelf === 'flex-end') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff, true);\n }\n }\n else if(alignSelf === 'center') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff * 0.5, true);\n }\n }\n else if(alignSelf === 'stretch') {\n let { computedStyle, currentStyle: { [WIDTH]: width } } = item;\n let {\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_LEFT]: marginLeft,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_LEFT]: paddingLeft,\n } = computedStyle;\n if(width[1] === AUTO) {\n let old = item.width;\n let v = item.__width = computedStyle[WIDTH] = maxCross - marginLeft - marginRight - paddingLeft - paddingRight - borderRightWidth - borderLeftWidth;\n let d = v - old;\n item.__sx4 += d;\n item.__sx5 += d;\n item.__sx6 += d;\n item.__width += d;\n item.__clientWidth += d;\n item.__offsetWidth += d;\n item.__outerWidth += d;\n }\n }\n else if(alignItems === 'baseline') {\n let diff = baseline - item.firstBaseline;\n if(diff !== 0) {\n item.__offsetX(diff, true);\n }\n }\n // 默认auto,取alignItems\n else {\n if(alignItems === 'flexStart' || alignSelf === 'flex-start') {}\n else if(alignItems === 'center') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff * 0.5, true);\n }\n }\n else if(alignItems === 'flexEnd' || alignItems === 'flex-end') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff, true);\n }\n }\n else if(alignItems === 'baseline') {\n let diff = baseline - item.firstBaseline;\n if(diff !== 0) {\n item.__offsetX(diff, true);\n }\n }\n // 默认stretch\n else {\n let { computedStyle, currentStyle: {\n [WIDTH]: width,\n } } = item;\n let {\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_LEFT]: marginLeft,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_LEFT]: paddingLeft,\n } = computedStyle;\n if(width[1] === AUTO) {\n let old = item.width;\n let v = item.__width = computedStyle[WIDTH] = maxCross - marginLeft - marginRight - paddingLeft - paddingRight - borderRightWidth - borderLeftWidth;\n let d = v - old;\n item.__sx4 += d;\n item.__sx5 += d;\n item.__sx6 += d;\n item.__width += d;\n item.__clientWidth += d;\n item.__offsetWidth += d;\n item.__outerWidth += d;\n }\n }\n }\n }\n });\n }\n\n /**\n * inline比较特殊,先简单顶部对齐,后续还需根据vertical和lineHeight计算y偏移\n * inlineBlock复用逻辑,可以设置w/h,在混排时表现不同,inlineBlock换行限制在规定的矩形内,\n * 且ib会在没设置width且换行的时候撑满上一行,即便内部尺寸没抵达边界\n * 而inline换行则会从父容器start处开始,且首尾可能占用矩形不同\n * 嵌套inline情况十分复杂,尾部mpb空白可能产生叠加情况,因此endSpace表示自身,\n * 然后根据是否在最后一个元素进行叠加父元素的,多层嵌套则多层尾部叠加,均以最后一个元素为依据判断\n * Text获取这个叠加的endSpace值即可,无需感知是否最后一个,外层(此处)进行逻辑封装\n * @param data\n * @param isAbs\n * @param isColumn\n * @param isInline\n * @private\n */\n __layoutInline(data, isAbs, isColumn, isInline) {\n let { flowChildren, currentStyle, computedStyle } = this;\n let { fixedWidth, fixedHeight, x, y, w, h, lx,\n lineBoxManager, nowrap, endSpace, selfEndSpace } = this.__preLayout(data, isInline);\n // abs虚拟布局需预知width,固定可提前返回\n if(isAbs && fixedWidth) {\n this.__width = w;\n this.__ioSize(w);\n return;\n }\n let {\n [WIDTH]: width,\n } = currentStyle;\n let {\n [TEXT_ALIGN]: textAlign,\n [WHITE_SPACE]: whiteSpace,\n [LINE_CLAMP]: lineClamp,\n [LINE_HEIGHT]: lineHeight,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_RIGHT]: marginRight,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_RIGHT]: paddingRight,\n } = computedStyle;\n let lineClampCount = data.lineClampCount || 0;\n if(isInline && !this.__isRealInline()) {\n isInline = false;\n }\n // 只有inline的孩子需要考虑换行后从行首开始,而ib不需要,因此重置行首标识lx为x,末尾空白为0\n // 而inline的LineBoxManager复用最近非inline父dom的,ib需要重新生成,末尾空白叠加\n if(isInline) {\n this.__config[NODE_IS_INLINE] = true;\n this.__lineBoxManager = lineBoxManager;\n let baseline = css.getBaseline(computedStyle);\n // 特殊inline调用,有内容的话(如左右mbp),默认生成一个lineBox,即便是空,也要形成占位,只有开头时需要\n if(marginLeft || marginRight\n || paddingLeft || paddingRight\n || borderLeftWidth || borderRightWidth) {\n if(lineBoxManager.isNewLine) {\n lineBoxManager.genLineBoxByInlineIfNewLine(x, y, lineHeight, baseline);\n }\n else {\n lineBoxManager.setLbByInlineIfNotNewLine(lineHeight, baseline);\n }\n }\n else {\n lineBoxManager.setLbByInlineIfNotNewLine(lineHeight, baseline);\n }\n lineClamp = data.lineClamp || 0;\n }\n else {\n lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseline(computedStyle));\n lx = x;\n endSpace = selfEndSpace = lineClampCount = 0;\n }\n // 存LineBox里的内容列表专用,布局过程中由lineBoxManager存入,递归情况每个inline节点都保存contentBox\n let contentBoxList;\n if(isInline) {\n contentBoxList = this.__contentBoxList = [];\n lineBoxManager.pushContentBoxList(this);\n }\n let isIbFull = false; // ib时不限定w情况下发生折行则撑满行,即便内容没有撑满边界\n let length = flowChildren.length;\n flowChildren.forEach((item, i) => {\n let isXom = item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom;\n let isInline2 = isXom && item.currentStyle[DISPLAY] === 'inline';\n let isInlineBlock2 = isXom && ['inlineBlock', 'inline-block'].indexOf(item.currentStyle[DISPLAY]) > -1;\n let isRealInline = isXom && item.__isRealInline();\n // 最后一个元素会产生最后一行,叠加父元素的尾部mpb\n let isEnd = isInline && (i === length - 1);\n if(isEnd) {\n endSpace += selfEndSpace;\n }\n if(isXom) {\n if(!isInline2 && !isInlineBlock2) {\n item.currentStyle[DISPLAY] = item.computedStyle[DISPLAY] = 'inlineBlock';\n isInlineBlock2 = true;\n inject.warn('Inline can not contain block/flex');\n }\n // x开头,不用考虑是否放得下直接放,i为0强制不换行\n if(x === lx || !i || isInline2 && whiteSpace === 'nowrap') {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isAbs, isColumn);\n // inlineBlock的特殊之处,一旦w为auto且内部产生折行时,整个变成block独占一块区域,坐标计算和block一样\n if(item.__isIbFull) {\n isInlineBlock2 && (w[1] === AUTO) && (isIbFull = true);\n lineBoxManager.addItem(item);\n x = lx;\n y += item.outerHeight;\n lineBoxManager.setNotEnd();\n }\n // inline和不折行的ib,其中ib需要手动存入当前lb中,以计算宽度\n else {\n (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n }\n else {\n // 不换行继续排,换行非开头先尝试是否放得下,结尾要考虑mpb因此减去endSpace\n let fw = (whiteSpace === 'nowrap') ? 0 : item.__tryLayInline(w - x + lx, w - (isEnd ? endSpace : 0));\n // 放得下继续\n if(fw >= (-1e-10)) {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n nowrap: whiteSpace === 'nowrap',\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isAbs, isColumn);\n // ib放得下要么内部没有折行,要么声明了width限制,都需手动存入当前lb\n (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n // 放不下处理之前的lineBox,并重新开头\n else {\n isInline2 && lineClampCount++;\n x = lx;\n y = lineBoxManager.endY;\n lineBoxManager.setNewLine();\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isAbs, isColumn);\n // 重新开头的ib和上面开头处一样逻辑\n if(item.__isIbFull) {\n lineBoxManager.addItem(item);\n x = lx;\n y += item.outerHeight;\n lineBoxManager.setNotEnd();\n }\n // inline和不折行的ib,其中ib需要手动存入当前lb中\n else {\n (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n }\n }\n }\n // inline里的其它只有文本,可能开始紧跟着之前的x,也可能换行后从lx行头开始\n // 紧跟着x可能出现在前面有节点换行后第2行,此时不一定放得下,因此不能作为判断依据,开头仅有lx\n else {\n let n = lineBoxManager.size;\n // i为0时强制不换行\n if(x === lx || !i || whiteSpace === 'nowrap') {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isAbs, isColumn);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n // ib情况发生折行,且非定宽\n if(!isInline && (lineBoxManager.size - n) > 1 && width[1] === AUTO) {\n isIbFull = true;\n }\n }\n else {\n // 非开头先尝试是否放得下,如果放得下再看是否end,加end且只有1个字时放不下要换行,否则可以放,换行由text内部做\n // 第一个Text且父元素声明了nowrap也强制不换行,非第一个则看本身whiteSpace声明\n let focusNoWrap = (!i && nowrap) || whiteSpace === 'nowrap';\n let fw = focusNoWrap ? 0 : item.__tryLayInline(w + lx - x);\n if(!focusNoWrap && fw >= 0 && isEnd && endSpace && item.content.length === 1) {\n let fw2 = fw - endSpace;\n if(fw2 < 0) {\n fw = fw2;\n }\n }\n // 放得下继续\n if(fw >= (-1e-10)) {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isAbs, isColumn);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n // 这里ib放得下一定是要么没换行要么固定宽度,所以无需判断isIbFull\n }\n // 放不下处理之前的lineBox,并重新开头\n else {\n lineClampCount++;\n x = lx;\n y = lineBoxManager.endY;\n lineBoxManager.setNewLine();\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isAbs, isColumn);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n // ib情况发生折行\n if(!isInline && (lineBoxManager.size - n) > 1 && width[1] === AUTO) {\n isIbFull = true;\n }\n }\n }\n }\n });\n // 同block结尾,不过这里一定是lineBox结束,无需判断\n y = lineBoxManager.endY;\n // 标识ib情况同block一样占满行\n this.__isIbFull = isIbFull;\n // 元素的width在固定情况或者ibFull情况已被计算出来,否则为最大延展尺寸,inline没有固定尺寸概念\n let tw, th;\n if(isInline) {\n // inline最后的x要算上右侧mpb,为next行元素提供x坐标基准,同时其尺寸计算比较特殊\n if(selfEndSpace) {\n lineBoxManager.addX(selfEndSpace);\n }\n // 如果没有内容,空白还要加上开头即左侧mpb\n if(!flowChildren.length) {\n let {\n [MARGIN_LEFT]: marginLeft,\n [PADDING_LEFT]: paddingLeft,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = computedStyle;\n lineBoxManager.addX(marginLeft + paddingLeft + borderLeftWidth);\n }\n // 结束出栈contentBox,递归情况结束子inline获取contentBox,父inline继续\n lineBoxManager.popContentBoxList();\n // abs非固定w时预计算,本来是最近非inline父层统一计算,但在abs时不算,\n if(isAbs) {\n this.__inlineSize();\n }\n }\n else {\n // ib在满时很特殊,取最大值,可能w本身很小不足排下1个字符,此时要用maxW\n let maxW = lineBoxManager.__maxX - data.x;\n tw = this.__width = fixedWidth ? w : (isIbFull ? Math.max(w, maxW) : maxW);\n th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\n }\n // 非abs提前虚拟布局,真实布局情况下最后为所有行内元素进行2个方向上的对齐,inline会被父级调用这里只看ib\n if(!isAbs && !isInline) {\n lineBoxManager.verticalAlign();\n if(['center', 'right'].indexOf(textAlign) > -1) {\n lineBoxManager.horizonAlign(tw, textAlign);\n // 直接text需计算size\n flowChildren.forEach(item => {\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n if(item instanceof Text) {\n item.__inlineSize();\n }\n });\n }\n // block的所有inline计算size\n lineBoxManager.domList.forEach(item => {\n item.__inlineSize(tw, textAlign);\n });\n }\n // inlineBlock新开上下文,但父级block遇到要处理换行\n return isInline ? lineClampCount : 0;\n }\n\n /**\n * inline的尺寸计算非常特殊,并非一个矩形区域,而是由字体行高结合节点下多个LineBox中的内容决定,\n * 且这个尺寸又并非真实LineBox中的内容直接合并计算而来,比如包含了个更大尺寸的ib却不会计入\n * 具体方法为遍历持有的LineBox下的内容,x取两侧极值,同时首尾要考虑mpb,y值取上下极值,同样首尾考虑mpb\n * 首尾行LineBox可能不是不是占满一行,比如前后都有同行inline的情况,非首尾行则肯定占满\n * 绘制内容(如背景色)的区域也很特殊,每行LineBox根据lineHeight对齐baseline得来,并非LineBox全部\n * 当LineBox只有直属Text时如果font没有lineGap则等价于全部,如有则需减去\n * 另外其client/offset/outer的w/h尺寸计算也很特殊,皆因首尾x方向的mpb导致\n * @private\n */\n __inlineSize(tw, textAlign) {\n let { contentBoxList, computedStyle, __ox, __oy } = this;\n let {\n [MARGIN_TOP]: marginTop,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_BOTTOM]: marginBottom,\n [MARGIN_LEFT]: marginLeft,\n [PADDING_TOP]: paddingTop,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_BOTTOM]: paddingBottom,\n [PADDING_LEFT]: paddingLeft,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n // x/clientX/offsetX/outerX\n let maxX, maxY, minX, minY, maxCX, maxCY, minCX, minCY, maxFX, maxFY, minFX, minFY, maxOX, maxOY, minOX, minOY;\n let length = contentBoxList.length;\n if(length) {\n // 遍历contentBox,里面存的是LineBox内容,根据父LineBox引用判断是否换行\n contentBoxList.forEach((item, i) => {\n // 非第一个除了minY不用看其它都要,minX是换行导致,而maxX在最后一个要考虑右侧mpb,中间的无需考虑嵌套inline的mpb\n if(i) {\n minX = Math.min(minX, item.x);\n minCX = Math.min(minCX, item.x);\n minFX = Math.min(minFX, item.x);\n minOX = Math.min(minOX, item.x);\n if(i === length - 1) {\n maxX = maxCX = maxFX = maxOX = Math.max(maxX, item.x + item.outerWidth);\n maxY = maxCY = maxFY = maxOY = Math.max(maxY, item.y + item.outerHeight);\n maxCX += paddingRight;\n maxCY += paddingBottom;\n maxFX += paddingRight + borderRightWidth;\n maxFY += paddingBottom + borderBottomWidth;\n maxOX += borderRightWidth + paddingRight + marginRight\n maxOY += borderBottomWidth + paddingBottom + marginBottom;\n }\n else {\n maxX = maxCX = maxFX = maxOX = Math.max(maxX, item.x + item.outerWidth);\n }\n }\n // 第一个初始化\n else {\n minX = item.x;\n minY = item.y;\n minCX = minX - paddingLeft;\n minCY = minY - paddingTop;\n minFX = minCX - borderLeftWidth;\n minFY = minCY - borderTopWidth;\n minOX = minFX - marginLeft;\n minOY = minFY - marginTop;\n maxX = maxCX = maxFX = maxOX = item.x + item.outerWidth;\n maxY = maxCY = maxFY = maxOY = item.y + item.outerHeight;\n if(i === length - 1) {\n maxCX += paddingRight;\n maxCY += paddingBottom;\n maxFX += paddingRight + borderRightWidth;\n maxFY += paddingBottom + borderBottomWidth;\n maxOX += borderRightWidth + paddingRight + marginRight\n maxOY += borderBottomWidth + paddingBottom + marginBottom;\n }\n }\n });\n this.__x = minOX;\n this.__y = minOY;\n this.__width = computedStyle[WIDTH] = maxX - minX;\n // 防止比自己最小高度lineHeight还小,比如内容是个小字体\n this.__height = computedStyle[HEIGHT] = Math.max(lineHeight, maxY - minY);\n this.__clientWidth = maxCX - minCX;\n this.__clientHeight = maxCY - minCY;\n this.__offsetWidth = maxFX - minFX;\n this.__offsetHeight = maxFY - minFY;\n this.__outerWidth = maxOX - minOX;\n this.__outerHeight = maxOY - minOY;\n this.__sx = minOX + __ox;\n this.__sy = minOY + __oy;\n this.__sx1 = minFX + __ox;\n this.__sy1 = minFY + __oy;\n this.__sx2 = minCX + __ox;\n this.__sy2 = minCY + __oy;\n this.__sx3 = minX + __ox;\n this.__sy3 = minY + __oy;\n this.__sx4 = maxX + __ox;\n this.__sy4 = maxY + __oy;\n this.__sx5 = maxCX + __ox;\n this.__sy5 = maxCY + __oy;\n this.__sx6 = maxFX + __ox;\n this.__sy6 = maxFY + __oy;\n // inline的text整体设置相同\n if(['center', 'right'].indexOf(textAlign) > -1) {\n this.children.forEach(item => {\n if(item instanceof Text) {\n item.__inlineSize();\n }\n });\n }\n }\n // 如果没有内容,宽度为0高度为lineHeight,对齐也特殊处理,lineBoxManager不会处理\n else {\n if(['center', 'right'].indexOf(textAlign) > -1) {\n let diff = tw;\n if(textAlign === 'center') {\n diff *= 0.5;\n }\n if(diff) {\n this.__offsetX(diff, true);\n }\n }\n this.__width = computedStyle[WIDTH] = 0;\n let th = this.__height = computedStyle[HEIGHT] = lineHeight;\n this.__ioSize(0, th);\n this.__sy -= marginTop + paddingTop + borderTopWidth;\n this.__sx1 = this.sx + marginLeft;\n this.__sy1 = this.sy + marginTop;\n this.__sx2 = this.__sx1 + borderLeftWidth;\n this.__sy2 = this.__sy1 + borderTopWidth;\n this.__sx4 = this.__sx3 = this.__sx2 + paddingLeft;\n this.__sy4 = this.__sy3 = this.__sy2 + paddingTop;\n this.__sx5 = this.__sx4 + paddingRight;\n this.__sy5 = this.__sy4 + th + paddingBottom;\n this.__sx6 = this.__sx5 + borderRightWidth;\n this.__sy6 = this.__sy5 + borderBottomWidth;\n this.__clientWidth = this.__sx5 - this.__sx2;\n this.__clientHeight = this.__sy5 - this.__sy2;\n this.__offsetWidth = this.__sx6 - this.__sx1;\n this.__offsetHeight = this.__sy6 - this.__sy1;\n this.__outerWidth = this.__offsetWidth + marginLeft + marginRight;\n this.__outerHeight = this.__offsetHeight + marginTop + marginBottom;\n }\n }\n\n /**\n * 只针对绝对定位children布局\n * @param container\n * @param data\n * @param target 可选,只针对某个abs的child特定布局,在局部更新时用\n * @private\n */\n __layoutAbs(container, data, target) {\n let { sx: x, sy: y, clientWidth, clientHeight, computedStyle } = container;\n let { isDestroyed, children, absChildren } = this;\n let {\n [DISPLAY]: display,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [MARGIN_TOP]: marginTop,\n [MARGIN_LEFT]: marginLeft,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_TOP]: paddingTop,\n } = computedStyle;\n if(isDestroyed || display === 'none') {\n this.__layoutNone();\n return;\n }\n x += marginLeft + borderLeftWidth;\n y += marginTop + borderTopWidth;\n // 对absolute的元素进行相对容器布局\n absChildren.forEach(item => {\n if(target) {\n // 传入target局部布局更新,这时候如果是Component引发的,当setState时是Cp自身,当layout时是sr\n let node = item;\n if(node instanceof Component) {\n node = item.shadowRoot;\n }\n // 所以得2个都对比\n if(target !== node && target !== item) {\n return;\n }\n }\n let { currentStyle, computedStyle } = item;\n if(item.isDestroyed || currentStyle[DISPLAY] === 'none') {\n item.__layoutNone();\n return;\n }\n // 先根据容器宽度计算margin/padding,匿名块对象特殊处理,此时没有computedStyle\n computeReflow(item);\n item.__mp(currentStyle, computedStyle, clientWidth);\n let {\n [LEFT]: left,\n [TOP]: top,\n [RIGHT]: right,\n [BOTTOM]: bottom,\n [WIDTH]: width,\n [HEIGHT]: height,\n } = currentStyle;\n let x2, y2, w2, h2;\n let onlyRight;\n let onlyBottom;\n let fixedTop;\n let fixedRight;\n let fixedBottom;\n let fixedLeft;\n // 判断何种方式的定位,比如左+宽度,左+右之类\n if(left[1] !== AUTO) {\n fixedLeft = true;\n computedStyle[LEFT] = calAbsolute(currentStyle, 'left', left, clientWidth, this.root);\n }\n else {\n computedStyle[LEFT] = 'auto';\n }\n if(right[1] !== AUTO) {\n fixedRight = true;\n computedStyle[RIGHT] = calAbsolute(currentStyle, 'right', right, clientWidth, this.root);\n }\n else {\n computedStyle[RIGHT] = 'auto';\n }\n if(top[1] !== AUTO) {\n fixedTop = true;\n computedStyle[TOP] = calAbsolute(currentStyle, 'top', top, clientHeight, this.root);\n }\n else {\n computedStyle[TOP] = 'auto';\n }\n if(bottom[1] !== AUTO) {\n fixedBottom = true;\n computedStyle[BOTTOM] = calAbsolute(currentStyle, 'bottom', bottom, clientHeight, this.root);\n }\n else {\n computedStyle[BOTTOM] = 'auto';\n }\n // 优先级最高left+right,其次left+width,再次right+width,再次仅申明单个,最次全部auto\n if(fixedLeft && fixedRight) {\n x2 = x + computedStyle[LEFT];\n w2 = clientWidth - computedStyle[RIGHT] - computedStyle[LEFT];\n }\n else if(fixedLeft) {\n x2 = x + computedStyle[LEFT];\n if(width[1] !== AUTO) {\n w2 = calAbsFixedSize(width, clientWidth, this.root);\n }\n }\n else if(fixedRight) {\n if(width[1] !== AUTO) {\n w2 = calAbsFixedSize(width, clientWidth, this.root);\n }\n else {\n onlyRight = true;\n }\n x2 = x + clientWidth - computedStyle[RIGHT] - (w2 || 0);\n // 右对齐有尺寸时还需减去margin/border/padding的\n x2 -= computedStyle[MARGIN_LEFT];\n x2 -= computedStyle[MARGIN_RIGHT];\n x2 -= computedStyle[PADDING_LEFT];\n x2 -= computedStyle[PADDING_RIGHT];\n x2 -= computedStyle[BORDER_LEFT_WIDTH];\n x2 -= computedStyle[BORDER_RIGHT_WIDTH];\n }\n else {\n x2 = x + paddingLeft;\n if(width[1] !== AUTO) {\n w2 = calAbsFixedSize(width, clientWidth, this.root);\n }\n }\n // top/bottom/height优先级同上\n if(fixedTop && fixedBottom) {\n y2 = y + computedStyle[TOP];\n h2 = clientHeight - computedStyle[TOP] - computedStyle[BOTTOM];\n }\n else if(fixedTop) {\n y2 = y + computedStyle[TOP];\n if(height[1] !== AUTO) {\n h2 = calAbsFixedSize(height, clientHeight, this.root);\n }\n }\n else if(fixedBottom) {\n if(height[1] !== AUTO) {\n h2 = calAbsFixedSize(height, clientHeight, this.root);\n }\n else {\n onlyBottom = true;\n }\n y2 = y + clientHeight - computedStyle[BOTTOM] - (h2 || 0);\n // 底对齐有尺寸时y值还需减去margin/border/padding的\n y2 -= computedStyle[MARGIN_TOP];\n y2 -= computedStyle[MARGIN_BOTTOM];\n y2 -= computedStyle[PADDING_TOP];\n y2 -= computedStyle[PADDING_BOTTOM];\n y2 -= computedStyle[BORDER_TOP_WIDTH];\n y2 -= computedStyle[BORDER_BOTTOM_WIDTH];\n }\n // 未声明y的找到之前的流布局child,紧随其下\n else {\n y2 = y + paddingTop;\n let prev = item.prev;\n while(prev) {\n // 以前面的flow的最近的prev末尾为准\n if(prev instanceof Text || prev.computedStyle[POSITION] !== 'absolute') {\n y2 = prev.y + prev.outerHeight;\n break;\n }\n prev = prev.prev;\n }\n if(height[1] !== AUTO) {\n h2 = calAbsFixedSize(height, clientHeight, this.root);\n }\n }\n // onlyRight时做的布局其实是以那个点位为left/top布局然后offset,limit要特殊计算,从本点向左侧为边界\n let widthLimit = onlyRight ? x2 - x : clientWidth + x - x2;\n // onlyBottom相同,正常情况是左上到右下的尺寸限制\n let heightLimit = onlyBottom ? y2 - y : clientHeight + y - y2;\n // 未直接或间接定义尺寸,取特殊孩子宽度的最大值,同时不能超限\n if(w2 === undefined) {\n item.__layout({\n x: x2,\n y: y2,\n w: widthLimit,\n h: heightLimit,\n }, true, false);\n widthLimit = item.outerWidth;\n }\n item.__layout({\n x: x2,\n y: y2,\n w: widthLimit,\n h: heightLimit,\n w2, // left+right这种等于有宽度,但不能修改style,继续传入到__preLayout中特殊对待\n h2,\n }, false, false);\n if(onlyRight) {\n item.__offsetX(-item.outerWidth, true);\n }\n if(onlyBottom) {\n item.__offsetY(-item.outerHeight, true);\n }\n });\n // 递归进行,遇到absolute/relative/component的设置新容器\n children.forEach(item => {\n if(target) {\n // 传入target局部布局更新,这时候如果是Component引发的,当setState时是Cp自身,当layout时是sr\n let node = item;\n if(node instanceof Component) {\n node = item.shadowRoot;\n }\n // 所以得2个都对比\n if(target !== node && target !== item) {\n return;\n }\n }\n if(item instanceof Dom) {\n item.__layoutAbs(isRelativeOrAbsolute(item) ? item : container, data);\n }\n else if(item instanceof Component) {\n let sr = item.shadowRoot;\n if(sr instanceof Dom) {\n sr.__layoutAbs(sr, data);\n }\n }\n });\n // 根节点自己特殊执行,不在layout统一\n this.__execAr();\n }\n\n /**\n * 布局前检查继承的样式以及统计字体测量信息\n * 首次检查为整树遍历,后续检查是节点自发局部检查,不再进入\n * @param renderMode\n * @param ctx\n * @param cb\n * @private\n */\n __computeMeasure(renderMode, ctx, cb) {\n super.__computeMeasure(renderMode, ctx, cb);\n // 即便自己不需要计算,但children还要继续递归检查\n this.children.forEach(item => {\n item.__computeMeasure(renderMode, ctx, cb);\n });\n }\n\n render(renderMode, lv, ctx, cache, dx, dy) {\n let res = super.render(renderMode, lv, ctx, cache, dx, dy);\n if(renderMode === mode.SVG) {\n this.virtualDom.type = 'dom';\n }\n return res;\n }\n\n __destroy() {\n if(this.isDestroyed) {\n return;\n }\n this.children.forEach(child => {\n // 有可能为空,因为diff过程中相同的cp被移到新的vd中,老的防止destroy设null\n if(child) {\n child.__destroy();\n }\n });\n super.__destroy();\n }\n\n __emitEvent(e, force) {\n if(force) {\n return super.__emitEvent(e, force);\n }\n let { isDestroyed, computedStyle, isMask } = this;\n if(isDestroyed || computedStyle[DISPLAY] === 'none' || e.__stopPropagation || isMask) {\n return;\n }\n // 检查perspective嵌套状态,自身有perspective则设置10位,自身有transform的p矩阵则设置01位\n // if(computedStyle[PERSPECTIVE]) {\n // perspectiveNest++;\n // }\n // if(tf.isPerspectiveMatrix(computedStyle[TRANSFORM])) {\n // perspectiveTfNest++;\n // }\n // overflow:hidden时还需要判断是否超出范围外,如果是则无效\n if(computedStyle[OVERFLOW] === 'hidden' && !this.willResponseEvent(e, true)) {\n return;\n }\n // 找到对应的callback\n let { event: { type } } = e;\n let { listener, zIndexChildren } = this;\n let cb;\n if(listener.hasOwnProperty(type)) {\n cb = listener[type];\n }\n // child触发则parent一定触发\n for(let i = zIndexChildren.length - 1; i >=0; i--) {\n let child = zIndexChildren[i];\n if(child instanceof Xom\n || child instanceof Component && child.shadowRoot instanceof Xom) {\n if(child.__emitEvent(e)) {\n // 孩子阻止冒泡\n if(e.__stopPropagation) {\n return;\n }\n if(isFunction(cb) && !e.__stopImmediatePropagation) {\n cb.call(this, e);\n }\n return true;\n }\n }\n }\n // child不触发再看自己\n return super.__emitEvent(e);\n }\n\n // 深度遍历执行所有子节点,包含自己,如果cb返回true,提前跳出不继续深度遍历\n __deepScan(cb, options) {\n if(super.__deepScan(cb, options)) {\n return;\n }\n this.children.forEach(node => {\n node.__deepScan(cb, options);\n });\n }\n\n appendChild(json, cb) {\n let self = this;\n if(!isNil(json) && !self.isDestroyed) {\n let { root, host } = self;\n if([$$type.TYPE_VD, $$type.TYPE_GM, $$type.TYPE_CP].indexOf(json.$$type) > -1) {\n if(json.vd) {\n root.delRefreshTask(json.vd.__task);\n json.vd.remove();\n }\n let vd;\n if($$type.TYPE_CP === json.$$type) {\n vd = builder.initCp2(json, root, host, self);\n }\n else {\n vd = builder.initDom(json, root, host, self);\n }\n root.addRefreshTask(vd.__task = {\n __before() {\n vd.__task = null; // 清除在before,防止after的回调增加新的task误删\n self.__json.children.push(json);\n let len = self.children.length;\n if(len) {\n let last = self.children[len - 1];\n last.__next = vd;\n vd.__prev = last;\n }\n self.children.push(vd);\n self.__zIndexChildren = null;\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = vd;\n res[UPDATE_FOCUS] = level.REFLOW;\n res[UPDATE_ADD_DOM] = true;\n res[UPDATE_MEASURE] = true;\n res[UPDATE_CONFIG] = vd.__config;\n root.__addUpdate(vd, vd.__config, root, root.__config, res);\n },\n __after(diff) {\n if(isFunction(cb)) {\n cb.call(vd, diff);\n }\n },\n });\n }\n else {\n throw new Error('Invalid parameter in appendChild.');\n }\n }\n }\n\n prependChild(json, cb) {\n let self = this;\n if(!isNil(json) && !self.isDestroyed) {\n let { root, host } = self;\n if([$$type.TYPE_VD, $$type.TYPE_GM, $$type.TYPE_CP].indexOf(json.$$type) > -1) {\n if(json.vd) {\n root.delRefreshTask(json.vd.__task);\n json.vd.remove();\n }\n let vd;\n if($$type.TYPE_CP === json.$$type) {\n vd = builder.initCp2(json, root, host, self);\n }\n else {\n vd = builder.initDom(json, root, host, self);\n }\n root.addRefreshTask(vd.__task = {\n __before() {\n vd.__task = null;\n self.__json.children.unshift(json);\n let len = self.children.length;\n if(len) {\n let first = self.children[0];\n first.__prev = vd;\n vd.__next = first;\n }\n self.children.unshift(vd);\n self.__zIndexChildren = null;\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = vd;\n res[UPDATE_FOCUS] = level.REFLOW;\n res[UPDATE_ADD_DOM] = true;\n res[UPDATE_MEASURE] = true;\n res[UPDATE_CONFIG] = vd.__config;\n root.__addUpdate(vd, vd.__config, root, root.__config, res);\n },\n __after(diff) {\n if(isFunction(cb)) {\n cb.call(vd, diff);\n }\n },\n });\n }\n else {\n throw new Error('Invalid parameter in prependChild.');\n }\n }\n }\n\n insertBefore(json, cb) {\n let self = this;\n if(!isNil(json) && !self.isDestroyed && self.domParent) {\n let { root, domParent } = self;\n let host = domParent.hostRoot;\n if([$$type.TYPE_VD, $$type.TYPE_GM, $$type.TYPE_CP].indexOf(json.$$type) > -1) {\n if(json.vd) {\n root.delRefreshTask(json.vd.__task);\n json.vd.remove();\n }\n let vd;\n if($$type.TYPE_CP === json.$$type) {\n vd = builder.initCp2(json, root, host, domParent);\n }\n else {\n vd = builder.initDom(json, root, host, domParent);\n }\n root.addRefreshTask(vd.__task = {\n __before() {\n vd.__task = null;\n let i = 0, has, __json = domParent.__json, children = __json.children, len = children.length;\n let pJson = self.isShadowRoot ? self.hostRoot.__json : self.__json;\n for(; i < len; i++) {\n if(children[i] === pJson) {\n has = true;\n break;\n }\n }\n if(!has) {\n throw new Error('InsertBefore exception.');\n }\n // 插入注意开头位置处理\n if(i) {\n children.splice(i, 0, json);\n vd.__next = self;\n vd.__prev = self.__prev;\n self.__prev = vd;\n domParent.children.splice(i, 0, vd);\n }\n else {\n if(len) {\n let first = domParent.children[0];\n first.__prev = vd;\n vd.__next = first;\n }\n children.unshift(json);\n domParent.children.unshift(vd);\n }\n domParent.__zIndexChildren = null;\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = vd;\n res[UPDATE_FOCUS] = level.REFLOW;\n res[UPDATE_ADD_DOM] = true;\n res[UPDATE_MEASURE] = true;\n res[UPDATE_CONFIG] = vd.__config;\n root.__addUpdate(vd, vd.__config, root, root.__config, res);\n },\n __after(diff) {\n if(isFunction(cb)) {\n cb.call(vd, diff);\n }\n },\n });\n }\n else {\n throw new Error('Invalid parameter in insertBefore.');\n }\n }\n }\n\n insertAfter(json, cb) {\n let self = this;\n if(!isNil(json) && !self.isDestroyed && self.domParent) {\n let { root, domParent } = self;\n let host = domParent.hostRoot;\n if([$$type.TYPE_VD, $$type.TYPE_GM, $$type.TYPE_CP].indexOf(json.$$type) > -1) {\n if(json.vd) {\n root.delRefreshTask(json.vd.__task);\n json.vd.remove();\n }\n let vd;\n if($$type.TYPE_CP === json.$$type) {\n vd = builder.initCp2(json, root, host, domParent);\n }\n else {\n vd = builder.initDom(json, root, host, domParent);\n }\n root.addRefreshTask(vd.__task = {\n __before() {\n vd.__task = null;\n let i = 0, has, __json = domParent.__json, children = __json.children, len = children.length;\n let pJson = self.isShadowRoot ? self.hostRoot.__json : self.__json;\n for(; i < len; i++) {\n if(children[i] === pJson) {\n has = true;\n break;\n }\n }\n if(!has) {\n throw new Error('insertAfter exception.');\n }\n // 插入注意末尾位置处理\n if(i < len - 1) {\n children.splice(i + 1, 0, json);\n vd.__prev = self;\n vd.__next = self.__next;\n self.__next = vd;\n domParent.children.splice(i + 1, 0, vd);\n }\n else {\n if(len) {\n let last = domParent.children[len - 1];\n last.__next = vd;\n vd.__prev = last;\n }\n children.push(json);\n domParent.children.push(vd);\n }\n domParent.__zIndexChildren = null;\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = vd;\n res[UPDATE_FOCUS] = level.REFLOW;\n res[UPDATE_ADD_DOM] = true;\n res[UPDATE_MEASURE] = true;\n res[UPDATE_CONFIG] = vd.__config;\n root.__addUpdate(vd, vd.__config, root, root.__config, res);\n },\n __after(diff) {\n if(isFunction(cb)) {\n cb.call(vd, diff);\n }\n },\n });\n }\n else {\n throw new Error('Invalid parameter in insertAfter.');\n }\n }\n }\n\n removeChild(target, cb) {\n if(target.parent === this && (target instanceof Xom || target instanceof Component)) {\n if(this.isDestroyed) {\n inject.warn('Remove parent is destroyed.');\n if(isFunction(cb)) {\n cb();\n }\n return;\n }\n target.remove(cb);\n }\n else {\n throw new Error('Invalid parameter in removeChild.');\n }\n }\n\n get children() {\n return this.__children;\n }\n\n get flowChildren() {\n return this.children.filter(item => {\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n return item instanceof Text || item.currentStyle[POSITION] !== 'absolute';\n });\n }\n\n get absChildren() {\n return this.children.filter(item => {\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n return item instanceof Xom && item.currentStyle[POSITION] === 'absolute';\n });\n }\n\n get zIndexChildren() {\n return this.__zIndexChildren;\n }\n\n get lineBoxManager() {\n return this.__lineBoxManager;\n }\n\n get baseline() {\n if(!this.lineBoxManager || !this.lineBoxManager.size) {\n return this.offsetHeight;\n }\n let {\n [MARGIN_TOP]: marginTop,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [PADDING_TOP]: paddingTop,\n } = this.computedStyle;\n return marginTop + borderTopWidth + paddingTop + this.lineBoxManager.baseline;\n }\n\n get firstBaseline() {\n if(!this.lineBoxManager || !this.lineBoxManager.size) {\n return this.offsetHeight;\n }\n let {\n [MARGIN_TOP]: marginTop,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [PADDING_TOP]: paddingTop,\n } = this.computedStyle;\n return marginTop + borderTopWidth + paddingTop + this.lineBoxManager.firstBaseline;\n }\n\n get parentLineBox() {\n return this.__parentLineBox;\n }\n}\n\nexport default Dom;\n","import Dom from './Dom';\nimport mode from '../refresh/mode';\nimport painter from '../util/painter';\nimport inject from '../util/inject';\nimport util from '../util/util';\nimport enums from '../util/enums';\nimport unit from '../style/unit';\nimport image from '../style/image';\nimport border from '../style/border';\nimport level from '../refresh/level';\nimport mx from '../math/matrix';\nimport geom from '../math/geom';\nimport css from '../style/css';\n\nconst {\n STYLE_KEY: {\n WIDTH,\n HEIGHT,\n DISPLAY,\n BORDER_TOP_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_LEFT_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_TOP_LEFT_RADIUS,\n BORDER_TOP_RIGHT_RADIUS,\n BORDER_BOTTOM_RIGHT_RADIUS,\n BORDER_BOTTOM_LEFT_RADIUS,\n VISIBILITY,\n BACKGROUND_IMAGE,\n BACKGROUND_COLOR,\n BOX_SHADOW,\n MIX_BLEND_MODE,\n MARGIN_RIGHT,\n MARGIN_LEFT,\n PADDING_RIGHT,\n PADDING_LEFT,\n FONT_SIZE,\n FLEX_BASIS,\n },\n UPDATE_KEY: {\n UPDATE_NODE,\n UPDATE_FOCUS,\n UPDATE_CONFIG,\n },\n NODE_KEY: {\n NODE_CACHE,\n NODE_DEFS_CACHE,\n NODE_IS_MASK,\n },\n} = enums;\nconst { AUTO, PX, PERCENT, REM, VW, VH, VMAX, VMIN, RGBA } = unit;\nconst { canvasPolygon, svgPolygon } = painter;\nconst { isFunction } = util;\nconst { computeReflow } = css;\n\nclass Img extends Dom {\n constructor(tagName, props) {\n super(tagName, props);\n let src = this.props.src;\n let loadImg = this.__loadImg = {\n src,\n };\n // 空url用错误图代替\n if(!src) {\n loadImg.error = true;\n }\n else {\n let ca = inject.IMG[src];\n if(ca && ca.state === inject.LOADED) {\n loadImg.source = ca.source;\n loadImg.width = ca.width;\n loadImg.height = ca.height;\n }\n }\n let config = this.__config;\n if(config[NODE_IS_MASK]) {\n let { style, currentStyle } = this;\n style[BACKGROUND_IMAGE] = currentStyle[BACKGROUND_IMAGE] = [null];\n style[BACKGROUND_COLOR] = currentStyle[BACKGROUND_COLOR] = [[0, 0, 0, 0], RGBA];\n style[BORDER_TOP_WIDTH] = currentStyle[BORDER_TOP_WIDTH] = [0, PX];\n style[BORDER_RIGHT_WIDTH] = currentStyle[BORDER_RIGHT_WIDTH] = [0, PX];\n style[BORDER_LEFT_WIDTH] = currentStyle[BORDER_LEFT_WIDTH] = [0, PX];\n style[BORDER_BOTTOM_WIDTH] = currentStyle[BORDER_BOTTOM_WIDTH] = [0, PX];\n style[BOX_SHADOW] = currentStyle[BOX_SHADOW] = null;\n style[MIX_BLEND_MODE] = currentStyle[MIX_BLEND_MODE] = 'normal';\n }\n }\n\n /**\n * 覆盖xom的方法,在__layout()3个分支中会首先被调用\n * 当样式中固定宽高时,图片按样式尺寸,加载后重新绘制即可\n * 只固定宽高一个时,加载完要计算缩放比,重新布局绘制\n * 都没有固定,按照图片尺寸,重新布局绘制\n * 这里计算非固定的情况,将其改为固定供布局渲染使用,未加载完成为0\n * @param data\n * @param isInline\n * @returns {{fixedWidth: boolean, w: *, x: *, h: *, y: *, fixedHeight: boolean}}\n * @private\n */\n __preLayout(data, isInline) {\n let res = super.__preLayout(data, isInline);\n let loadImg = this.__loadImg;\n // 可能已提前加载好了,或有缓存,为减少刷新直接使用\n if(!loadImg.error) {\n let src = loadImg.src;\n let cache = inject.IMG[src];\n if(cache && cache.state === inject.LOADED) {\n loadImg.source = cache.source;\n loadImg.width = cache.width;\n loadImg.height = cache.height;\n }\n loadImg.cache = false;\n }\n if(res.fixedWidth && res.fixedHeight) {\n return res;\n }\n if(loadImg.error && !this.props.placeholder) {\n if(res.fixedWidth) {\n res.h = res.w;\n }\n else if(res.fixedHeight) {\n res.w = res.h;\n }\n else {\n res.w = res.h = 32;\n }\n }\n else if(loadImg.source) {\n if(res.fixedWidth) {\n res.h = res.w * loadImg.height / loadImg.width;\n }\n else if(res.fixedHeight) {\n res.w = res.h * loadImg.width / loadImg.height;\n }\n else {\n res.w = loadImg.width;\n res.h = loadImg.height;\n }\n }\n else {\n res.w = res.h = 0;\n }\n res.fixedWidth = true;\n res.fixedHeight = true;\n return res;\n }\n\n __addGeom(tagName, props) {\n props = util.hash2arr(props);\n this.virtualDom.children.push({\n type: 'item',\n tagName,\n props,\n });\n }\n\n __destroy() {\n this.root.delRefreshTask(this.__task);\n super.__destroy();\n this.__task = null;\n }\n\n // img根据加载情况更新__hasContent\n __calContent(renderMode, lv, currentStyle, computedStyle) {\n let res = super.__calContent(renderMode, lv, currentStyle, computedStyle);\n if(!res) {\n let {\n __loadImg: loadImg,\n } = this;\n if(computedStyle[VISIBILITY] !== 'hidden' && (computedStyle[WIDTH] || computedStyle[HEIGHT])\n && loadImg.source) {\n res = true;\n }\n }\n return res;\n }\n\n render(renderMode, lv, ctx, cache, dx = 0, dy = 0) {\n let res = super.render(renderMode, lv, ctx, cache, dx, dy);\n if(renderMode === mode.WEBGL) {\n dx = res.dx;\n dy = res.dy;\n }\n let {\n offscreenBlend, offscreenMask, offscreenFilter, offscreenOverflow,\n } = res;\n let {\n width, height, isDestroyed,\n props: {\n placeholder,\n },\n computedStyle,\n computedStyle: {\n [DISPLAY]: display,\n [BORDER_TOP_LEFT_RADIUS]: borderTopLeftRadius,\n [BORDER_TOP_RIGHT_RADIUS]: borderTopRightRadius,\n [BORDER_BOTTOM_RIGHT_RADIUS]: borderBottomRightRadius,\n [BORDER_BOTTOM_LEFT_RADIUS]: borderBottomLeftRadius,\n [VISIBILITY]: visibility,\n },\n virtualDom,\n __config,\n __loadImg: loadImg,\n root,\n } = this;\n if(offscreenBlend) {\n ctx = offscreenBlend.target.ctx;\n }\n if(offscreenMask) {\n ctx = offscreenMask.target.ctx;\n }\n if(offscreenFilter) {\n ctx = offscreenFilter.target.ctx;\n }\n if(offscreenOverflow) {\n ctx = offscreenOverflow.target.ctx;\n }\n // 没source且不error时加载图片\n if(!loadImg.source && !loadImg.error && !loadImg.loading) {\n this.__loadAndRefresh(loadImg, root, ctx, placeholder, computedStyle, width, height);\n }\n if(isDestroyed || display === 'none' || visibility === 'hidden') {\n return res;\n }\n let __cache = __config[NODE_CACHE];\n if(cache && __cache && __cache.enabled) {\n ctx = __cache.ctx;\n }\n let originX, originY;\n originX = res.x3 + dx;\n originY = res.y3 + dy;\n // 根据配置以及占位图显示error\n let source = loadImg.source;\n if(loadImg.error && !placeholder && Img.showError) {\n let strokeWidth = Math.min(width, height) * 0.02;\n let stroke = '#CCC';\n let fill = '#DDD';\n let cx = originX + width * 0.7;\n let cy = originY + height * 0.3;\n let r = strokeWidth * 5;\n let pts = [\n [originX + width * 0.15, originY + height * 0.7],\n [originX + width * 0.3, originY + height * 0.4],\n [originX + width * 0.5, originY + height * 0.6],\n [originX + width * 0.6, originY + height * 0.5],\n [originX + width * 0.9, originY + height * 0.8],\n [originX + width * 0.15, originY + height * 0.8]\n ];\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n ctx.strokeStyle = stroke;\n ctx.lineWidth = strokeWidth;\n ctx.fillStyle = fill;\n ctx.beginPath();\n ctx.moveTo(originX, originY);\n ctx.lineTo(originX + width, originY);\n ctx.lineTo(originX + width, originY + height);\n ctx.lineTo(originX, originY + height);\n ctx.lineTo(originX, originY);\n ctx.stroke();\n ctx.closePath();\n ctx.beginPath();\n let points = geom.ellipsePoints(cx, cy, r, r);\n painter.canvasPolygon(ctx, points, 0, 0);\n ctx.fill();\n ctx.closePath();\n ctx.beginPath();\n ctx.moveTo(pts[0][0], pts[0][1]);\n for(let i = 1, len = pts.length; i < len; i++) {\n let point = pts[i];\n ctx.lineTo(point[0], point[1]);\n }\n ctx.lineTo(pts[0][0], pts[0][1]);\n ctx.fill();\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n this.__addGeom('rect', [\n ['x', originX],\n ['y', originY],\n ['width', width],\n ['height', height],\n ['stroke', stroke],\n ['stroke-width', strokeWidth],\n ['fill', 'rgba(0,0,0,0)']\n ]);\n this.__addGeom('circle', [\n ['cx', cx],\n ['cy', cy],\n ['r', r],\n ['fill', fill],\n ]);\n let s = '';\n for(let i = 0, len = pts.length; i < len; i++) {\n let point = pts[i];\n if(i) {\n s += ' ';\n }\n s += point[0] + ',' + point[1];\n }\n this.__addGeom('polygon', [\n ['points', s],\n ['fill', fill]\n ]);\n }\n }\n else if(source) {\n // 圆角需要生成一个mask\n let list = border.calRadius(originX, originY, width, height,\n borderTopLeftRadius, borderTopRightRadius, borderBottomRightRadius, borderBottomLeftRadius);\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n // 有border-radius需模拟遮罩裁剪\n if(list) {\n ctx.save();\n ctx.beginPath();\n canvasPolygon(ctx, list, dx, dy);\n ctx.clip();\n ctx.closePath();\n ctx.drawImage(source, originX, originY, width, height);\n ctx.restore();\n }\n else {\n ctx.drawImage(source, originX, originY, width, height);\n }\n }\n else if(renderMode === mode.SVG) {\n // img没有变化无需diff,直接用上次的vd\n if(loadImg.cache) {\n loadImg.cache.cache = true;\n virtualDom.children = [loadImg.cache];\n // 但是还是要校验是否有borderRadius变化,引发img的圆角遮罩\n if(!virtualDom.cache && list) {\n let d = svgPolygon(list);\n let v = {\n tagName: 'clipPath',\n props: [],\n children: [\n {\n type: 'item',\n tagName: 'path',\n props: [\n ['d', d],\n ['fill', '#FFF'],\n ],\n }\n ],\n };\n let id = ctx.add(v);\n __config[NODE_DEFS_CACHE].push(v);\n virtualDom.conClip = 'url(#' + id + ')';\n }\n return;\n }\n // 缩放图片,无需考虑原先矩阵,xom里对父层已经变换过了\n let matrix;\n if(width !== loadImg.width || height !== loadImg.height) {\n matrix = image.matrixResize(loadImg.width, loadImg.height, width, height, originX, originY, width, height);\n }\n let props = [\n ['xlink:href', loadImg.error ? placeholder : loadImg.src],\n ['x', originX],\n ['y', originY],\n ['width', loadImg.width],\n ['height', loadImg.height]\n ];\n if(list) {\n let d = svgPolygon(list);\n let v = {\n tagName: 'clipPath',\n props: [],\n children: [\n {\n type: 'item',\n tagName: 'path',\n props: [\n ['d', d],\n ['fill', '#FFF']\n ],\n }\n ],\n };\n let id = ctx.add(v);\n __config[NODE_DEFS_CACHE].push(v);\n virtualDom.conClip = 'url(#' + id + ')';\n delete virtualDom.cache;\n }\n if(matrix && !mx.isE(matrix)) {\n props.push(['transform', 'matrix(' + util.joinArr(mx.m2m6(matrix), ',') + ')']);\n }\n let vd = {\n type: 'img',\n tagName: 'image',\n props,\n };\n virtualDom.children = [vd];\n loadImg.cache = vd;\n }\n }\n return res;\n }\n\n // img没加载时,清空,这样Xom就认为没内容不生成cache,防止img先绘制cache再绘制主屏,重复\n __releaseWhenEmpty(__cache) {\n if(!this.__loadImg.error && !this.__loadImg.source) {\n return super.__releaseWhenEmpty(__cache);\n }\n }\n\n __isRealInline() {\n return false;\n }\n\n // overwrite\n __tryLayInline(w, total) {\n let { currentStyle: {\n [WIDTH]: width,\n [HEIGHT]: height,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_RIGHT]: marginRight,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_RIGHT]: paddingRight,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n } } = this;\n if(width[1] === PX) {\n w -= width[0];\n }\n else if(width[1] === PERCENT) {\n w -= total * width[0] * 0.01;\n }\n else if(width[1] === REM) {\n w -= width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w -= width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w -= width[0] * this.root.height * 0.01;\n }\n else if(width[1] === VMAX) {\n w -= width[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(width[1] === VMIN) {\n w -= width[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n else {\n let loadImg = this.__loadImg;\n // 加载成功计算缩放后的宽度\n if(loadImg.source) {\n if(height[1] === PX) {\n w -= loadImg.width * height[0] / loadImg.height;\n }\n else if(height[1] === PERCENT) {\n w -= loadImg.width * height[0] * total * 0.01 / loadImg.height;\n }\n else if(height[1] === REM) {\n w -= loadImg.width * height[0] * this.root.computedStyle[FONT_SIZE] / loadImg.height;\n }\n else if(height[1] === VW) {\n w -= loadImg.width * height[0] * this.root.width * 0.01 / loadImg.height;\n }\n else if(height[1] === VH) {\n w -= loadImg.width * height[0] * this.root.height * 0.01 / loadImg.height;\n }\n else if(height[1] === VMAX) {\n w -= height[0] * Math.max(this.root.width, this.root.height) * 0.01 / loadImg.height;\n }\n else if(height[1] === VMIN) {\n w -= height[0] * Math.min(this.root.width, this.root.height) * 0.01 / loadImg.height;\n }\n else {\n w -= loadImg.width;\n }\n }\n }\n // 减去水平mbp\n if(marginLeft[1] === PX) {\n w -= marginLeft[0];\n }\n else if(marginLeft[1] === PERCENT) {\n w -= marginLeft[0] * total * 0.01;\n }\n else if(marginLeft[1] === REM) {\n w -= marginLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginLeft[1] === VW) {\n w -= marginLeft[0] * this.root.width * 0.01;\n }\n else if(marginLeft[1] === VH) {\n w -= marginLeft[0] * this.root.height * 0.01;\n }\n else if(marginLeft[1] === VMAX) {\n w -= marginLeft[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(marginLeft[1] === VMIN) {\n w -= marginLeft[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(paddingLeft[1] === PX) {\n w -= paddingLeft[0];\n }\n else if(paddingLeft[1] === PERCENT) {\n w -= paddingLeft[0] * total * 0.01;\n }\n else if(paddingLeft[1] === REM) {\n w -= paddingLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingLeft[1] === VW) {\n w -= paddingLeft[0] * this.root.width * 0.01;\n }\n else if(paddingLeft[1] === VH) {\n w -= paddingLeft[0] * this.root.height * 0.01;\n }\n else if(paddingLeft[1] === VMAX) {\n w -= paddingLeft[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(paddingLeft[1] === VMIN) {\n w -= paddingLeft[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(borderLeftWidth[1] === PX) {\n w -= borderLeftWidth[0];\n }\n else if(borderLeftWidth[1] === REM) {\n w -= borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderLeftWidth[1] === VW) {\n w -= borderLeftWidth[0] * this.root.width * 0.01;\n }\n else if(borderLeftWidth[1] === VH) {\n w -= borderLeftWidth[0] * this.root.height * 0.01;\n }\n else if(borderLeftWidth[1] === VMAX) {\n w -= borderLeftWidth[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(borderLeftWidth[1] === VMIN) {\n w -= borderLeftWidth[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(marginRight[1] === PX) {\n w -= marginRight[0];\n }\n else if(marginRight[1] === PERCENT) {\n w -= marginRight[0] * total * 0.01;\n }\n else if(marginRight[1] === REM) {\n w -= marginRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginRight[1] === VW) {\n w -= marginRight[0] * this.root.width * 0.01;\n }\n else if(marginRight[1] === VH) {\n w -= marginRight[0] * this.root.height * 0.01;\n }\n else if(marginRight[1] === VMAX) {\n w -= marginRight[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(marginRight[1] === VMIN) {\n w -= marginRight[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(paddingRight[1] === PX) {\n w -= paddingRight[0];\n }\n else if(paddingRight[1] === PERCENT) {\n w -= paddingRight[0] * total * 0.01;\n }\n else if(paddingRight[1] === REM) {\n w -= paddingRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingRight[1] === VW) {\n w -= paddingRight[0] * this.root.width * 0.01;\n }\n else if(paddingRight[1] === VH) {\n w -= paddingRight[0] * this.root.height * 0.01;\n }\n else if(paddingRight[1] === VMAX) {\n w -= paddingRight[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(paddingRight[1] === VMIN) {\n w -= paddingRight[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(borderRightWidth[1] === PX) {\n w -= borderRightWidth[0];\n }\n else if(borderRightWidth[1] === REM) {\n w -= borderRightWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderRightWidth[1] === VW) {\n w -= borderRightWidth[0] * this.root.width * 0.01;\n }\n else if(borderRightWidth[1] === VH) {\n w -= borderRightWidth[0] * this.root.height * 0.01;\n }\n else if(borderRightWidth[1] === VMAX) {\n w -= borderRightWidth[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(borderRightWidth[1] === VMIN) {\n w -= borderRightWidth[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n return w;\n }\n\n __calBasis(isDirectionRow, isAbs, isColumn, data, isDirectChild) {\n computeReflow(this);\n let b = 0;\n let min = 0;\n let max = 0;\n let { currentStyle, computedStyle, __loadImg } = this;\n let { w, h } = data;\n // 计算需考虑style的属性\n let {\n [FLEX_BASIS]: flexBasis,\n [WIDTH]: width,\n [HEIGHT]: height,\n } = currentStyle;\n let main = isDirectionRow ? width : height;\n let cross = isDirectionRow ? height : width;\n // basis3种情况:auto、固定、content,只区分固定和其它\n let isFixed = [PX, PERCENT, REM, VW, VH, VMAX, VMIN].indexOf(flexBasis[1]) > -1;\n if(isFixed) {\n if(flexBasis[1] === PX) {\n b = max = min = flexBasis[0];\n }\n else if(flexBasis[1] === PERCENT) {\n b = max = min = flexBasis[0] * 0.01 * (isDirectionRow ? w : h);\n }\n else if(flexBasis[1] === REM) {\n b = max = min = flexBasis[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(flexBasis[1] === VW) {\n b = max = min = flexBasis[0] * this.root.width * 0.01;\n }\n else if(flexBasis[1] === VH) {\n b = max = min = flexBasis[0] * this.root.height * 0.01;\n }\n else if(flexBasis[1] === VMAX) {\n b = max = min = flexBasis[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(flexBasis[1] === VMIN) {\n b = max = min = flexBasis[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n }\n else if(([PX, PERCENT, REM, VW, VH, VMAX, VMIN].indexOf(main[1]) > -1)) {\n if(main[1] === PX) {\n b = max = min = main[0];\n }\n else if(main[1] === PERCENT) {\n b = max = min = main[0] * 0.01 * (isDirectionRow ? w : h);\n }\n else if(main[1] === REM) {\n b = max = min = main[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(main[1] === VW) {\n b = max = min = main[0] * this.root.width * 0.01;\n }\n else if(main[1] === VH) {\n b = max = min = main[0] * this.root.height * 0.01;\n }\n else if(main[1] === VMAX) {\n b = max = min = main[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(main[1] === VMIN) {\n b = max = min = main[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n }\n // auto和content固定尺寸比例计算\n else if(__loadImg.source || __loadImg.error) {\n let res = this.__preLayout(data);\n if(cross[1] !== AUTO) {\n if(cross[1] === PX) {\n cross = cross[0];\n }\n else if(cross[1] === PERCENT) {\n cross = cross[0] * 0.01 * (isDirectionRow ? h : w);\n }\n else if(cross[1] === REM) {\n cross = cross[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(cross[1] === VW) {\n cross = cross[0] * this.root.width * 0.01;\n }\n else if(cross[1] === VH) {\n cross = cross[0] * this.root.height * 0.01;\n }\n else if(cross[1] === VMAX) {\n cross = cross[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(cross[1] === VMIN) {\n cross = cross[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n let ratio = res.w / res.h;\n b = max = min = isDirectionRow ? cross * ratio : cross / ratio;\n }\n else {\n b = max = min = isDirectionRow ? res.w : res.h;\n }\n }\n // 直接item的mpb影响basis\n return this.__addMBP(isDirectionRow, w, currentStyle, computedStyle, [b, min, max], isDirectChild);\n }\n\n __loadAndRefresh(loadImg, root, ctx, placeholder, computedStyle, width, height, cb) {\n let self = this;\n // 先清空之前可能的\n if(loadImg.source || loadImg.error) {\n root.delRefreshTask(self.__task);\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null; // 清除在before,防止after的回调增加新的task误删\n if(self.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REFLOW; // 没有样式变化但内容尺寸发生了变化强制执行\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n });\n loadImg.source = null;\n }\n loadImg.loading = true;\n // 再测量,可能瞬间完成替换掉上面的\n inject.measureImg(loadImg.src, data => {\n // 还需判断url,防止重复加载时老的替换新的,失败走error绘制\n if(data.url === loadImg.src && !self.isDestroyed) {\n loadImg.cache && (loadImg.cache.cache = false);\n loadImg.loading = false;\n function reload() {\n let { currentStyle: { [WIDTH]: width, [HEIGHT]: height } } = self;\n root.delRefreshTask(self.__task);\n if(width[1] !== AUTO && height[1] !== AUTO) {\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null;\n if(self.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REPAINT;\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n __after() {\n if(isFunction(cb)) {\n cb.call(self);\n }\n },\n });\n }\n else {\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null;\n if(self.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REFLOW; // 没有样式变化但内容尺寸发生了变化强制执行\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n __after() {\n if(isFunction(cb)) {\n cb.call(self);\n }\n },\n });\n }\n }\n if(data.success) {\n loadImg.source = data.source;\n loadImg.width = data.width;\n loadImg.height = data.height;\n }\n else if(placeholder) {\n inject.measureImg(placeholder, data => {\n if(data.success) {\n loadImg.error = true;\n loadImg.source = data.source;\n loadImg.width = data.width;\n loadImg.height = data.height;\n reload();\n }\n }, {\n ctx,\n root,\n width,\n height,\n });\n return;\n }\n else {\n loadImg.error = true;\n }\n // 可见状态进行刷新操作,visibility某些情况需要刷新,可能宽高未定义要重新布局\n if(computedStyle[DISPLAY] !== 'none') {\n reload();\n }\n }\n }, {\n ctx,\n root,\n width,\n height,\n });\n }\n\n updateSrc(v, cb) {\n let self = this;\n let loadImg = self.__loadImg;\n let root = this.root;\n // 相等或空且当前error直接返回\n if(v === loadImg.src || !v && loadImg.error) {\n if(isFunction(cb)) {\n cb(-1);\n }\n }\n else if(v) {\n loadImg.src = v;\n self.__loadAndRefresh(loadImg, root, root.ctx, self.props.placeholder, self.computedStyle, self.width, self.height, cb);\n }\n else {\n loadImg.src = v;\n loadImg.source = null;\n loadImg.error = true;\n root.delRefreshTask(self.__task);\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null;\n if(self.isDestroyed) {\n return;\n }\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REFLOW;\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, self.__config, res);\n },\n __after(diff) {\n if(isFunction(cb)) {\n cb(diff);\n }\n },\n });\n }\n }\n\n appendChild() {\n inject.error('Img can not appendChild.');\n }\n\n get src() {\n return this.__loadImg.src;\n }\n\n get isReplaced() {\n return true;\n }\n\n static showError = true;\n}\n\nexport default Img;\n","class Defs {\n constructor(uuid) {\n this.id = uuid;\n this.count = 0;\n this.list = [];\n this.cacheHash = {}; // 每次svg渲染前重置,存储前次渲染不变的缓存id\n }\n add(data) {\n let uuid = this.count;\n let hash = this.cacheHash;\n while(hash.hasOwnProperty(uuid)) {\n uuid++;\n }\n this.count = uuid + 1;\n data.id = uuid;\n data.uuid = 'karas-defs-' + this.id + '-' + uuid;\n data.index = this.list.length;\n this.list.push(data);\n return data.uuid;\n }\n addCache(data) {\n data.index = this.list.length;\n this.list.push(data);\n this.cacheHash[data.id] = true;\n return data.uuid;\n }\n clear() {\n this.list = [];\n this.count = 0;\n this.cacheHash = {};\n }\n removeCache(data) {\n let list = this.list;\n let i = data.index;\n // 一般情况index即位置,但每次渲染过程中,可能会删掉一些,此时位置会往前,但index不变,因此遍历\n for(; i >= 0; i--) {\n if(list[i] === data) {\n list.splice(i, 1);\n return;\n }\n }\n }\n\n get value() {\n return this.list;\n }\n\n static getInstance(uuid) {\n return new Defs(uuid);\n }\n}\n\nexport default Defs;\n","import Xom from '../Xom';\nimport reset from '../../style/reset';\nimport css from '../../style/css';\nimport unit from '../../style/unit';\nimport enums from '../../util/enums';\nimport mode from '../../refresh/mode';\nimport util from '../../util/util';\nimport painter from '../../util/painter';\nimport transform from '../../style/transform';\nimport mx from '../../math/matrix';\nimport inject from '../../util/inject';\nimport gradient from '../../math/gradient';\n\nconst {\n STYLE_KEY: {\n MARGIN_RIGHT,\n MARGIN_LEFT,\n PADDING_RIGHT,\n PADDING_LEFT,\n WIDTH,\n HEIGHT,\n BORDER_RIGHT_WIDTH,\n BORDER_LEFT_WIDTH,\n FILL,\n STROKE,\n STROKE_MITERLIMIT,\n STROKE_WIDTH,\n STROKE_LINECAP,\n STROKE_LINEJOIN,\n STROKE_DASHARRAY,\n STROKE_DASHARRAY_STR,\n FILL_RULE,\n VISIBILITY,\n FONT_SIZE,\n FLEX_BASIS,\n },\n NODE_KEY: {\n NODE_CACHE_PROPS,\n NODE_CURRENT_PROPS,\n NODE_CURRENT_STYLE,\n NODE_STYLE,\n NODE_DEFS_CACHE,\n NODE_CACHE,\n }\n} = enums;\nconst { PX, PERCENT, REM, VW, VH, VMAX, VMIN } = unit;\nconst { int2rgba, isNil, joinArr } = util;\nconst { canvasPolygon, svgPolygon } = painter;\nconst { WEBGL } = mode;\nconst { computeReflow } = css;\n\nconst REGISTER = {};\n\nclass Geom extends Xom {\n constructor(tagName, props) {\n super(tagName, props);\n this.__isMulti = !!this.props.multi;\n this.__style = css.normalize(this.style, reset.DOM_ENTRY_SET.concat(reset.GEOM_ENTRY_SET));\n this.__currentStyle = util.extend({}, this.__style);\n this.__currentProps = util.clone(this.props);\n let config = this.__config;\n config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n config[NODE_CURRENT_PROPS] = this.__currentProps;\n config[NODE_CURRENT_STYLE] = this.__currentStyle;\n config[NODE_STYLE] = this.__style;\n }\n\n __tryLayInline(w, total) {\n // 无children,直接以style的width为宽度,不定义则为0\n let { currentStyle: {\n [WIDTH]: width,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_RIGHT]: marginRight,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_RIGHT]: paddingRight,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n } } = this;\n if(width[1] === PX) {\n w -= width[0];\n }\n else if(width[1] === PERCENT) {\n w -= total * width[0] * 0.01;\n }\n else if(width[1] === REM) {\n w -= width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w -= width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w -= width[0] * this.root.height * 0.01;\n }\n else if(width[1] === VMAX) {\n w -= width[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(width[1] === VMIN) {\n w -= width[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n // 减去水平mbp\n if(marginLeft[1] === PX) {\n w -= marginLeft[0];\n }\n else if(marginLeft[1] === PERCENT) {\n w -= marginLeft[0] * total * 0.01;\n }\n else if(marginLeft[1] === REM) {\n w -= marginLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginLeft[1] === VW) {\n w -= marginLeft[0] * this.root.width * 0.01;\n }\n else if(marginLeft[1] === VH) {\n w -= marginLeft[0] * this.root.height * 0.01;\n }\n else if(marginLeft[1] === VMAX) {\n w -= marginLeft[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(marginLeft[1] === VMIN) {\n w -= marginLeft[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(paddingLeft[1] === PX) {\n w -= paddingLeft[0];\n }\n else if(paddingLeft[1] === PERCENT) {\n w -= paddingLeft[0] * total * 0.01;\n }\n else if(paddingLeft[1] === REM) {\n w -= paddingLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingLeft[1] === VW) {\n w -= paddingLeft[0] * this.root.width * 0.01;\n }\n else if(paddingLeft[1] === VH) {\n w -= paddingLeft[0] * this.root.height * 0.01;\n }\n else if(paddingLeft[1] === VMAX) {\n w -= paddingLeft[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(paddingLeft[1] === VMIN) {\n w -= paddingLeft[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(borderLeftWidth[1] === PX) {\n w -= borderLeftWidth[0];\n }\n else if(borderLeftWidth[1] === REM) {\n w -= borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderLeftWidth[1] === VW) {\n w -= borderLeftWidth[0] * this.root.width * 0.01;\n }\n else if(borderLeftWidth[1] === VH) {\n w -= borderLeftWidth[0] * this.root.height * 0.01;\n }\n else if(borderLeftWidth[1] === VMAX) {\n w -= borderLeftWidth[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(borderLeftWidth[1] === VMIN) {\n w -= borderLeftWidth[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(marginRight[1] === PX) {\n w -= marginRight[0];\n }\n else if(marginRight[1] === PERCENT) {\n w -= marginRight[0] * total * 0.01;\n }\n else if(marginRight[1] === REM) {\n w -= marginRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginRight[1] === VW) {\n w -= marginRight[0] * this.root.width * 0.01;\n }\n else if(marginRight[1] === VH) {\n w -= marginRight[0] * this.root.height * 0.01;\n }\n else if(marginRight[1] === VMAX) {\n w -= marginRight[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(marginRight[1] === VMIN) {\n w -= marginRight[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(paddingRight[1] === PX) {\n w -= paddingRight[0];\n }\n else if(paddingRight[1] === PERCENT) {\n w -= paddingRight[0] * total * 0.01;\n }\n else if(paddingRight[1] === REM) {\n w -= paddingRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingRight[1] === VW) {\n w -= paddingRight[0] * this.root.width * 0.01;\n }\n else if(paddingRight[1] === VH) {\n w -= paddingRight[0] * this.root.height * 0.01;\n }\n else if(paddingRight[1] === VMAX) {\n w -= paddingRight[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(paddingRight[1] === VMIN) {\n w -= paddingRight[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(borderRightWidth[1] === PX) {\n w -= borderRightWidth[0];\n }\n else if(borderRightWidth[1] === REM) {\n w -= borderRightWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderRightWidth[1] === VW) {\n w -= borderRightWidth[0] * this.root.width * 0.01;\n }\n else if(borderRightWidth[1] === VH) {\n w -= borderRightWidth[0] * this.root.height * 0.01;\n }\n else if(borderRightWidth[1] === VMAX) {\n w -= borderRightWidth[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(borderRightWidth[1] === VMIN) {\n w -= borderRightWidth[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n return w;\n }\n\n __calBasis(isDirectionRow, isAbs, isColumn, data, isDirectChild) {\n computeReflow(this);\n let b = 0;\n let min = 0;\n let max = 0;\n let { currentStyle, computedStyle } = this;\n let { w, h } = data;\n // 计算需考虑style的属性\n let {\n [FLEX_BASIS]: flexBasis,\n [WIDTH]: width,\n [HEIGHT]: height,\n } = currentStyle;\n let main = isDirectionRow ? width : height;\n // basis3种情况:auto、固定、content,只区分固定和其它\n let isFixed = [PX, PERCENT, REM, VW, VH, VMAX, VMIN].indexOf(flexBasis[1]) > -1;\n if(isFixed) {\n if(flexBasis[1] === PX) {\n b = max = min = flexBasis[0];\n }\n else if(flexBasis[1] === PERCENT) {\n b = max = min = flexBasis[0] * 0.01 * (isDirectionRow ? w : h);\n }\n else if(flexBasis[1] === REM) {\n b = max = min = flexBasis[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(flexBasis[1] === VW) {\n b = max = min = flexBasis[0] * this.root.width * 0.01;\n }\n else if(flexBasis[1] === VH) {\n b = max = min = flexBasis[0] * this.root.height * 0.01;\n }\n else if(flexBasis[1] === VMAX) {\n b = max = min = flexBasis[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(flexBasis[1] === VMIN) {\n b = max = min = flexBasis[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n }\n else if(([PX, PERCENT, REM, VW, VH, VMAX, VMIN].indexOf(main[1]) > -1)) {\n if(main[1] === PX) {\n b = max = min = main[0];\n }\n else if(main[1] === PERCENT) {\n b = max = min = main[0] * 0.01 * (isDirectionRow ? w : h);\n }\n else if(main[1] === REM) {\n b = max = min = main[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(main[1] === VW) {\n b = max = min = main[0] * this.root.width * 0.01;\n }\n else if(main[1] === VH) {\n b = max = min = main[0] * this.root.height * 0.01;\n }\n else if(main[1] === VMAX) {\n b = max = min = main[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(main[1] === VMIN) {\n b = max = min = main[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n }\n // 直接item的mpb影响basis\n return this.__addMBP(isDirectionRow, w, currentStyle, computedStyle, [b, min, max], isDirectChild);\n }\n\n __layoutBlock(data, isVirtual) {\n let { fixedWidth, fixedHeight, w, h } = this.__preLayout(data, false);\n this.__height = fixedHeight ? h : 0;\n if(isVirtual) {\n w = this.__width = fixedWidth ? w : 0;\n this.__ioSize(w);\n return;\n }\n this.__width = w;\n this.__ioSize(w, this.height);\n this.__marginAuto(this.currentStyle, data);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __layoutFlex(data, isVirtual) {\n // 无children所以等同于block\n this.__layoutBlock(data, isVirtual);\n }\n\n __layoutInline(data, isVirtual, isInline) {\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data, isInline);\n // 元素的width不能超过父元素w\n let tw = this.__width = fixedWidth ? w : x - data.x;\n let th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __calCache(renderMode, ctx, parent, __cacheStyle, currentStyle, computedStyle,\n clientWidth, clientHeight, offsetWidth, offsetHeight,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n paddingTop, paddingRight, paddingBottom, paddingLeft,\n x1, x2, x3, x4, x5, x6, y1, y2, y3, y4, y5, y6) {\n let res = super.__calCache(renderMode, ctx, parent, __cacheStyle, currentStyle, computedStyle,\n clientWidth, clientHeight, offsetWidth, offsetHeight,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n paddingTop, paddingRight, paddingBottom, paddingLeft,\n x1, x2, x3, x4, x5, x6, y1, y2, y3, y4, y5, y6);\n if(isNil(__cacheStyle[STROKE_WIDTH])) {\n __cacheStyle[STROKE_WIDTH] = true;\n let strokeWidth = currentStyle[STROKE_WIDTH] || [];\n let w = this.width;\n computedStyle[STROKE_WIDTH] = strokeWidth.map(item => {\n if(item[1] === PX) {\n return item[0];\n }\n else if(item[1] === PERCENT) {\n return item[0] * w * 0.01;\n }\n else if(item[1] === REM) {\n return item[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(item[1] === VW) {\n return item[0] * this.root.width * 0.01;\n }\n else if(item[1] === VH) {\n return item[0] * this.root.height * 0.01;\n }\n else if(item[1] === VMAX) {\n return item[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(item[1] === VMIN) {\n return item[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n else {\n return 0;\n }\n });\n }\n if(isNil(__cacheStyle[STROKE_DASHARRAY])) {\n __cacheStyle[STROKE_DASHARRAY] = true;\n computedStyle[STROKE_DASHARRAY] = currentStyle[STROKE_DASHARRAY] || [];\n __cacheStyle[STROKE_DASHARRAY_STR] = computedStyle[STROKE_DASHARRAY].map(item => joinArr(item, ','));\n }\n // 直接赋值的\n [\n STROKE_LINECAP,\n STROKE_LINEJOIN,\n STROKE_MITERLIMIT,\n FILL_RULE,\n ].forEach(k => {\n computedStyle[k] = currentStyle[k];\n });\n // stroke/fll移至render里处理,因为cache涉及渐变坐标偏移\n [STROKE, FILL].forEach(k => {\n if(isNil(__cacheStyle[k])) {\n let v = currentStyle[k];\n computedStyle[k] = v;\n let res = [];\n if(Array.isArray(v)) {\n v.forEach(item => {\n if(item && (item.k === 'linear' || item.k === 'radial' || item.k === 'conic')) {\n if(renderMode === WEBGL) {\n let cache = this.__config[NODE_CACHE];\n x3 += cache.dx;\n x4 += cache.dx;\n y3 += cache.dy;\n y4 += cache.dy;\n }\n res.push(this.__gradient(renderMode, ctx, x3, y3, x4, y4, item));\n }\n else if(item[3] > 0) {\n res.push(int2rgba(item));\n }\n else {\n res.push('none');\n }\n });\n }\n __cacheStyle[k] = res;\n }\n });\n return res;\n }\n\n __calContent(renderMode, lv, currentStyle, computedStyle) {\n // Geom强制有内容\n return computedStyle[VISIBILITY] !== 'hidden';\n }\n\n __preSet(res) {\n let { width, height, __cacheStyle, computedStyle } = this;\n let cx = res.sx3 + width * 0.5;\n let cy = res.sy3 + height * 0.5;\n let {\n [FILL]: fill,\n [STROKE]: stroke,\n [STROKE_DASHARRAY_STR]: strokeDasharrayStr,\n } = __cacheStyle;\n let {\n [STROKE_WIDTH]: strokeWidth,\n [STROKE_LINECAP]: strokeLinecap,\n [STROKE_LINEJOIN]: strokeLinejoin,\n [STROKE_MITERLIMIT]: strokeMiterlimit,\n [STROKE_DASHARRAY]: strokeDasharray,\n [FILL_RULE]: fillRule,\n } = computedStyle;\n return {\n cx,\n cy,\n stroke,\n strokeWidth,\n strokeDasharray,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n fill,\n fillRule,\n };\n }\n\n __preSetCanvas(renderMode, ctx, res) {\n let {\n stroke,\n strokeWidth,\n strokeDasharray,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n fill,\n } = res;\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n if(fill) {\n if(fill.k === 'linear') {\n ctx.fillStyle = fill.v;\n }\n else if(fill.k === 'radial' && !Array.isArray(fill.v)) {\n ctx.fillStyle = fill.v;\n }\n else if(fill.k === 'conic') {\n //\n }\n else if(!fill.k && ctx.fillStyle !== fill) {\n ctx.fillStyle = fill;\n }\n }\n if(stroke) {\n if(stroke.k === 'linear') {\n ctx.strokeStyle = stroke.v;\n }\n else if(stroke.k === 'radial' && !Array.isArray(stroke.v)) {\n ctx.strokeStyle = stroke.v;\n }\n else if(stroke.k === 'conic') {\n //\n }\n else if(!stroke.k && ctx.strokeStyle !== stroke) {\n ctx.strokeStyle = stroke;\n }\n }\n if(strokeWidth !== undefined && ctx.lineWidth !== strokeWidth) {\n ctx.lineWidth = strokeWidth;\n }\n if(strokeLinecap !== undefined && ctx.lineCap !== strokeLinecap) {\n ctx.lineCap = strokeLinecap;\n }\n if(strokeLinejoin !== undefined && ctx.lineJoin !== strokeLinejoin) {\n ctx.lineJoin = strokeLinejoin;\n }\n if(strokeMiterlimit !== undefined && ctx.miterLimit !== strokeMiterlimit) {\n ctx.miterLimit = strokeMiterlimit;\n }\n // 小程序没这个方法\n if(util.isFunction(ctx.getLineDash)) {\n if(strokeDasharray && !util.equalArr(ctx.getLineDash(), strokeDasharray)) {\n ctx.setLineDash(strokeDasharray);\n }\n }\n else if(strokeDasharray) {\n ctx.setLineDash(strokeDasharray);\n }\n }\n }\n\n render(renderMode, lv, ctx, cache, dx, dy) {\n let res = super.render(renderMode, lv, ctx, cache, dx, dy);\n if(renderMode === mode.SVG) {\n this.virtualDom.type = 'geom';\n }\n // 无论canvas/svg,break可提前跳出省略计算\n if(res.break) {\n return res;\n }\n // data在无cache时没有提前设置\n let preData = this.__preSet(res);\n return Object.assign(res, preData);\n }\n\n __renderPolygon(renderMode, ctx, res) {\n let {\n fill: fills,\n fillRule: fillRules,\n stroke: strokes,\n strokeWidth: strokeWidths,\n strokeDasharray: strokeDasharrays,\n strokeDasharrayStr: strokeDasharrayStrs,\n strokeLinecap: strokeLinecaps,\n strokeLinejoin: strokeLinejoins,\n strokeMiterlimit: strokeMiterlimits,\n dx,\n dy,\n } = res;\n let { __cacheProps: { list }, isMulti, bbox } = this;\n // 普通情况下只有1个,按普通情况走\n if(fills.length <= 1 && strokes.length <= 1) {\n let o = {\n fill: fills[0],\n fillRule: fillRules[0],\n stroke: strokes[0],\n strokeWidth: strokeWidths[0],\n strokeDasharray: strokeDasharrays[0],\n strokeDasharrayStr: strokeDasharrayStrs[0],\n strokeLinecap: strokeLinecaps[0],\n strokeLinejoin: strokeLinejoins[0],\n strokeMiterlimit: strokeMiterlimits[0],\n dx,\n dy,\n bbox,\n };\n this.__renderOnePolygon(renderMode, ctx, isMulti, list, o);\n }\n // 多个需要fill在下面,stroke在上面,依次循环\n else {\n for(let i = 0, len = fills.length; i < len; i++) {\n let fill = fills[i];\n if(fill) {\n let o = {\n fill,\n fillRule: fillRules[i],\n dx,\n dy,\n bbox,\n };\n this.__renderOnePolygon(renderMode, ctx, isMulti, list, o);\n }\n }\n for(let i = 0, len = strokes.length; i < len; i++) {\n let stroke = strokes[i];\n if(stroke) {\n let o = {\n stroke,\n strokeWidth: strokeWidths[i],\n strokeDasharray: strokeDasharrays[i],\n strokeDasharrayStr: strokeDasharrayStrs[i],\n strokeLinecap: strokeLinecaps[i],\n strokeLinejoin: strokeLinejoins[i],\n strokeMiterlimit: strokeMiterlimits[i],\n dx,\n dy,\n bbox,\n };\n this.__renderOnePolygon(renderMode, ctx, isMulti, list, o);\n }\n }\n }\n }\n\n __renderOnePolygon(renderMode, ctx, isMulti, list, res) {\n let {\n fill,\n stroke,\n strokeWidth,\n } = res;\n let isFillCE = fill && fill.k === 'conic';\n let isStrokeCE = stroke && stroke.k === 'conic';\n // 椭圆是array\n let isFillRE = fill && fill.k === 'radial' && Array.isArray(fill.v);\n let isStrokeRE = strokeWidth && strokeWidth > 0 && stroke && stroke.k === 'radial' && Array.isArray(stroke.v);\n if(isFillCE || isStrokeCE) {\n if(isFillCE) {\n this.__conicGradient(renderMode, ctx, list, isMulti, res);\n }\n else if(fill !== 'none') {\n this.__drawPolygon(renderMode, ctx, isMulti, list, res, true);\n }\n if(strokeWidth && strokeWidth > 0 && isStrokeCE) {\n inject.warn('Stroke style can not use conic-gradient');\n }\n else if(strokeWidth && strokeWidth > 0 && stroke !== 'none') {\n this.__drawPolygon(renderMode, ctx, isMulti, list, res, false, true);\n }\n }\n else if(isFillRE || isStrokeRE) {\n if(isFillRE) {\n this.__radialEllipse(renderMode, ctx, list, isMulti, res, 'fill');\n }\n else if(fill !== 'none') {\n this.__drawPolygon(renderMode, ctx, isMulti, list, res, true);\n }\n // stroke椭圆渐变matrix会变形,降级为圆\n if(strokeWidth && strokeWidth > 0 && isStrokeRE) {\n inject.warn('Stroke style can not use radial-gradient for ellipse');\n res.stroke.v = res.stroke.v[0];\n this.__drawPolygon(renderMode, ctx, isMulti, list, res, false, true);\n }\n else if(strokeWidth && strokeWidth > 0 && stroke !== 'none') {\n this.__drawPolygon(renderMode, ctx, isMulti, list, res, false, true);\n }\n }\n else {\n this.__drawPolygon(renderMode, ctx, isMulti, list, res, true, true);\n }\n }\n\n __drawPolygon(renderMode, ctx, isMulti, list, res, isFill, isStroke) {\n let {\n fill,\n stroke,\n strokeWidth,\n fillRule,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n dx,\n dy,\n } = res;\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n this.__preSetCanvas(renderMode, ctx, res);\n ctx.beginPath();\n if(isMulti) {\n list.forEach(item => canvasPolygon(ctx, item, dx, dy));\n }\n else {\n canvasPolygon(ctx, list, dx, dy);\n }\n if(isFill && fill && fill !== 'none') {\n ctx.fill(fillRule);\n }\n if(isStroke && stroke && stroke !== 'none' && strokeWidth && strokeWidth > 0) {\n ctx.stroke();\n }\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n let d = '';\n if(isMulti) {\n list.forEach(item => d += svgPolygon(item));\n }\n else {\n d = svgPolygon(list);\n }\n let props = [\n ['d', d],\n ];\n // 2个都没有常出现在多fill/stroke时,也有可能特殊单个故意这样写的\n if((!fill || fill === 'none') && (!stroke || stroke === 'none')) {\n return;\n }\n if(isFill && fill && fill !== 'none') {\n props.push(['fill', fill.v || fill]);\n if(fillRule && fillRule !== 'nonzero') {\n props.push(['fill-rule', fillRule]);\n }\n }\n else {\n props.push(['fill', 'none']);\n }\n if(isStroke && stroke && stroke !== 'none' && strokeWidth && strokeWidth > 0) {\n props.push(['stroke', stroke.v || stroke]);\n props.push(['stroke-width', strokeWidth]);\n this.__propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit);\n }\n else {\n props.push(['stroke-width', 0]);\n }\n this.addGeom('path', props);\n }\n }\n\n __inversePtList(list, isMulti, t) {\n if(isMulti) {\n return list.map(item => {\n if(!item || !item.length) {\n return null;\n }\n return item.map(item => {\n if(!item || !item.length) {\n return null;\n }\n let arr = [];\n for(let i = 0, len = item.length; i < len; i += 2) {\n let p = mx.calPoint([item[i], item[i + 1]], t);\n arr.push(p[0]);\n arr.push(p[1]);\n }\n return arr;\n });\n });\n }\n else {\n return list.map(item => {\n if(!item || !item.length) {\n return null;\n }\n let arr = [];\n for(let i = 0, len = item.length; i < len; i += 2) {\n let p = mx.calPoint([item[i], item[i + 1]], t);\n arr.push(p[0]);\n arr.push(p[1]);\n }\n return arr;\n });\n }\n }\n\n __radialEllipse(renderMode, ctx, list, isMulti, res, method) {\n let {\n strokeWidth,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n dx,\n dy,\n } = res;\n let [color, matrix, cx, cy] = res[method].v;\n // 椭圆渐变的转换,顶点逆矩阵变换\n let tfo = [cx, cy];\n matrix = transform.calMatrixByOrigin(matrix, tfo);\n let t = mx.inverse(matrix);\n list = this.__inversePtList(list, isMulti, t);\n // 用正向matrix渲染\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n if(matrix) {\n ctx.save();\n let me = this.matrixEvent;\n matrix = mx.multiply(me, matrix);\n ctx.setTransform(matrix[0], matrix[1], matrix[4], matrix[5], matrix[12], matrix[13]);\n }\n ctx.beginPath();\n if(ctx[method + 'Style'] !== color) {\n ctx[method + 'Style'] = color;\n }\n if(isMulti) {\n list.forEach(item => painter.canvasPolygon(ctx, item, dx, dy));\n }\n else {\n canvasPolygon(ctx, list, dx, dy);\n }\n ctx[method]();\n ctx.closePath();\n if(matrix) {\n ctx.restore();\n }\n }\n else if(renderMode === mode.SVG) {\n let d = '';\n if(isMulti) {\n list.forEach(item => d += svgPolygon(item));\n }\n else {\n d = svgPolygon(list);\n }\n let props = [\n ['d', d],\n ];\n if(method === 'fill') {\n props.push(['fill', color]);\n props.push(['strokeWidth', 0]);\n }\n else if(method === 'stroke') {\n props.push(['fill', 'none']);\n props.push(['stroke', color]);\n props.push(['stroke-width', strokeWidth]);\n this.__propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit);\n }\n props.push(['transform', `matrix(${joinArr(mx.m2m6(matrix), ',')})`]);\n this.addGeom('path', props);\n }\n }\n\n __conicGradient(renderMode, ctx, list, isMulti, res) {\n let {\n fill,\n bbox,\n dx = 0,\n dy = 0,\n } = res;\n let color = fill.v;\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n let [x1, y1, x2, y2] = bbox;\n let w = x2 - x1, h = y2 - y1;\n let offscreen = inject.getCacheCanvas(w, h, '__$$CONIC_GRADIENT$$__');\n let imgData = offscreen.ctx.getImageData(0,0, w, h);\n gradient.getConicGradientImage(w * 0.5, h * 0.5, w, h, fill.v.stop, imgData.data);\n offscreen.ctx.putImageData(imgData, 0, 0);\n if(isMulti) {\n list.forEach(item => {\n ctx.save();\n ctx.beginPath();\n canvasPolygon(ctx, item, dx, dy);\n ctx.clip();\n ctx.closePath();\n ctx.drawImage(offscreen.canvas, x1 + dx, y1 + dy);\n ctx.restore();\n });\n }\n else {\n ctx.save();\n ctx.beginPath();\n canvasPolygon(ctx, list, dx, dy);\n ctx.clip();\n ctx.closePath();\n ctx.drawImage(offscreen.canvas, x1 + dx, y1 + dy);\n ctx.restore();\n }\n offscreen.ctx.clearRect(0, 0, w, h);\n }\n else if(renderMode === mode.SVG) {\n if(isMulti) {\n list.forEach(item => {\n let v = {\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(item)],\n ],\n }],\n };\n let clip = ctx.add(v);\n this.__config[NODE_DEFS_CACHE].push(v);\n color.forEach(item => {\n this.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon(item[0])],\n ['fill', item[1]],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n });\n });\n }\n else {\n let v = {\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(list)],\n ],\n }],\n };\n let clip = ctx.add(v);\n this.__config[NODE_DEFS_CACHE].push(v);\n color.forEach(item => {\n this.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon(item[0])],\n ['fill', item[1]],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n });\n }\n }\n }\n\n __propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit) {\n if(strokeDasharrayStr) {\n props.push(['stroke-dasharray', strokeDasharrayStr]);\n }\n if(strokeLinecap && strokeLinecap !== 'butt') {\n props.push(['stroke-linecap', strokeLinecap]);\n }\n if(strokeLinejoin && strokeLinejoin !== 'miter') {\n props.push(['stroke-linejoin', strokeLinejoin]);\n }\n if(strokeMiterlimit && strokeMiterlimit !== 4) {\n props.push(['stroke-miterlimit', strokeMiterlimit]);\n }\n }\n\n // geom的cache无内容也不清除,因为子类不清楚内容,除非看不见\n __releaseWhenEmpty(cache, computedStyle) {\n return computedStyle[VISIBILITY] === 'hidden';\n }\n\n // offset/resize时要多一步清空props上记录的缓存\n __offsetX(diff, isLayout, lv) {\n super.__offsetX(diff, isLayout, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __offsetY(diff, isLayout, lv) {\n super.__offsetY(diff, isLayout, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __resizeX(diff, lv) {\n super.__resizeX(diff, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __resizeY(diff, lv) {\n super.__resizeY(diff, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n addGeom(tagName, props) {\n props = util.hash2arr(props);\n this.virtualDom.children.push({\n type: 'item',\n tagName,\n props,\n });\n }\n\n getProps(k) {\n let v = this.currentProps[k];\n if(!isNil(v)) {\n return v;\n }\n return this['__' + k];\n }\n\n __isRealInline() {\n return false;\n }\n\n get isMulti() {\n return this.__isMulti;\n }\n\n get currentProps() {\n return this.__currentProps;\n }\n\n static get REGISTER() {\n return REGISTER;\n }\n\n static getRegister(name) {\n if(!name || !util.isString(name) || name.charAt(0) !== '$') {\n throw new Error('Invalid param');\n }\n if(!REGISTER.hasOwnProperty(name)) {\n throw new Error(`Geom has not register: ${name}`);\n }\n return REGISTER[name];\n }\n\n static register(name, obj) {\n if(!name || !util.isString(name) || name.charAt(0) !== '$'\n || !obj.prototype || !(obj.prototype instanceof Geom)) {\n throw new Error('Invalid param');\n }\n if(Geom.hasRegister(name)) {\n throw new Error(`Geom has already register: ${name}`);\n }\n REGISTER[name] = obj;\n }\n\n static hasRegister(name) {\n return name && REGISTER.hasOwnProperty(name);\n }\n\n static delRegister(name) {\n if(Geom.hasRegister(name)) {\n delete REGISTER[name];\n }\n }\n}\n\nexport default Geom;\n","import Xom from '../node/Xom';\nimport Dom from '../node/Dom';\nimport Component from '../node/Component';\nimport util from './util';\nimport inject from './inject';\nimport flatten from './flatten';\nimport $$type from './$$type';\nimport enums from './enums';\n\nconst {\n NODE_KEY: {\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_DOM_PARENT,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n NODE_STRUCT,\n },\n} = enums;\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet updateList = [];\nlet removeList = [];\n\nconst KEY_FLAG = {};\n\n/**\n * setState后刷新前先根遍历检查组件开始进行shouldComponentUpdate判断\n */\nfunction check(vd) {\n if(vd instanceof Dom) {\n vd.children.forEach(child => {\n if(child instanceof Dom) {\n check(child);\n }\n // 当组件有setState更新时,从叶子到根链路会标识__hasCpUpdate,以便节约遍历成本忽略那些没变化的链路\n else if(child instanceof Component && child.__hasCpUpdate) {\n child.__hasCpUpdate = false;\n checkCp(child, child.props);\n }\n });\n }\n // 高阶组件会进入此分支,被父组件调用\n else if(vd instanceof Component && vd.__hasCpUpdate) {\n vd.__hasCpUpdate = false;\n checkCp(vd, vd.props);\n }\n}\n\n/**\n * 检查cp是否有state变更,注意递归检查时需要看shadow不能看shadowRoot,\n * 否则高阶组件会被跳过,其更新无法触发update生命周期\n * @param cp\n * @param nextProps\n * @param forceCheckUpdate,被render()后的json的二级组件,发现props有变更强制检查更新,否则可以跳过\n */\nfunction checkCp(cp, nextProps, forceCheckUpdate) {\n if(cp.__nextState || forceCheckUpdate) {\n let shouldUpdate;\n if(util.isFunction(cp.shouldComponentUpdate)) {\n shouldUpdate = cp.shouldComponentUpdate(nextProps, cp.__nextState || cp.state);\n }\n else {\n // 没有默认更新\n shouldUpdate = true;\n }\n if(shouldUpdate) {\n updateCp(cp, nextProps, cp.__nextState || cp.state);\n }\n // 不更新则递归检查子tree的cp\n else {\n cp.props = nextProps;\n cp.state = cp.__nextState || cp.state;\n check(cp.shadow);\n }\n }\n else {\n check(cp.shadow);\n }\n}\n\n/**\n * 更新组件的props和state,清空__nextState\n * @param cp\n * @param props\n * @param state\n */\nfunction updateCp(cp, props, state) {\n cp.props = props;\n cp.state = state;\n cp.__nextState = null; // 同步在refresh前清除component的新state标识,这样frame动画在after回调中可以新设\n let oldS = cp.shadow;\n let oldSr = cp.shadowRoot;\n let oldJson = cp.__cd;\n let json = flatten(cp.render());\n // 对比新老render()返回的内容,更新后重新生成sr\n diffSr(oldS, oldJson, json);\n cp.__init(json);\n // 为了局部dom布局需要知道老的css信息\n let sr = cp.shadowRoot;\n if(sr instanceof Xom) {\n [\n '__outerWidth',\n '__outerHeight',\n '__sx',\n '__sy',\n '__sx2',\n '__sx3',\n '__sx4',\n '__sx5',\n '__sx6',\n '__sy2',\n '__sy3',\n '__sy4',\n '__sy5',\n '__sy6',\n ].forEach(k => {\n sr[k] = oldSr[k];\n });\n sr.__computedStyle = sr.__config[NODE_COMPUTED_STYLE] = oldSr.computedStyle;\n }\n else {\n let domParent = cp.domParent;\n [\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n ].forEach(k => {\n sr.__config[k] = domParent.__config[k];\n });\n }\n [\n '__x',\n '__y',\n '__width',\n '__height',\n '__sx1', // text和xom\n '__sy1',\n '__layoutData',\n '__parent',\n '__domParent',\n ].forEach(k => {\n sr[k] = oldSr[k];\n });\n sr.__config[NODE_DOM_PARENT] = oldSr.domParent;\n sr.__config[NODE_STRUCT] = oldSr.__config[NODE_STRUCT];\n updateList.push(cp);\n // 老的需回收,diff会生成新的dom,唯一列外是cp直接返回一个没变化的cp\n if(!util.isObject(json) || !json.__placeholder) {\n removeList.push(oldS);\n }\n // 子组件使用老的json时标识,更新后删除,render()返回空会没json对象\n if(json && json.__placeholder) {\n delete json.__placeholder;\n }\n if(json && json.__inheritAnimate) {\n delete json.__inheritAnimate;\n }\n if(json && json.__animateRecords) {\n delete json.__animateRecords;\n }\n // 高阶组件时需判断,子组件更新后生成新的sr,父组件的sr/host需要同时更新引用\n let host = cp.host;\n while(host) {\n if(host.shadow === cp) {\n host.__shadowRoot = sr;\n sr.__hostRoot = host;\n cp = host;\n host = host.host;\n }\n else {\n break;\n }\n }\n}\n\n/**\n * 非一级组件sr进行对比,key相同的无需重新生成且继承动画\n * @param vd\n * @param oj oldJson\n * @param nj\n */\nfunction diffSr(vd, oj, nj) {\n // 先遍历检查key相同的,将没有变化的key暂存下来,深度优先,这样叶子节点出现在前面,当key的叶子也有key时,确保叶子先对比\n let ojk = getKeyHash(oj, {}, vd);\n let njk = getKeyHash(nj, {});\n let keyList = [];\n let cpList = [];\n // 先对比key对应的节点,如果新老有一方对不上则落空\n Object.keys(ojk).forEach(k => {\n let o = ojk[k];\n let n = njk[k];\n if(!n) {\n o.json.key = KEY_FLAG;\n }\n });\n Object.keys(njk).forEach(k => {\n let o = ojk[k];\n let n = njk[k];\n // 有可能老的没有这个key,新key落空\n if(!o) {\n n.json.key = KEY_FLAG;\n return;\n }\n let oj = o.json;\n let nj = n.json;\n let vd = o.vd;\n // 相同class的组件进行对比替换\n if(oj.$$type === TYPE_CP && nj.$$type === TYPE_CP) {\n if(oj.klass === nj.klass) {\n // 对比props和children看是否全等,是则直接替换新json类型为占位符,引用老vd,否则强制更新\n diffCp(oj, nj, vd);\n // 标识对比过了\n oj.key = nj.key = KEY_FLAG;\n // 老的sr里需删除这个vd,因为老sr会回收\n cpList.push(vd);\n }\n }\n // 相同类型的vd进行对比继承动画\n else if(oj.$$type === nj.$$type && oj.tagName === nj.tagName) {\n // 需判断矢量标签mutil是否相等\n if(nj.$$type !== TYPE_GM || oj.props.multi === nj.props.multi) {\n nj.__inheritAnimate = vd;\n }\n oj.key = nj.key = KEY_FLAG;\n // key相同的dom暂存下来\n if(nj.$$type === TYPE_VD) {\n keyList.push({\n vd,\n oj,\n nj,\n });\n }\n }\n });\n // key相同的dom对比children,下面非key逻辑就不做了\n keyList.forEach(item => {\n diffChildren(item.vd, item.oj, item.nj);\n });\n // 整体tree进行对比\n diffChild(vd, oj, nj);\n // 已更新的cp需被老sr删除,因为老sr会回收,而此cp继续存在于新sr中不能回收,这里处理key的\n cpList.forEach(vd => {\n removeCpFromOldTree(vd);\n });\n}\n\n/**\n * 递归检查dom的children,相同的无需重新生成,用PL类型占位符代替直接返回老vd\n * @param vd\n * @param oj\n * @param nj\n */\nfunction diffChild(vd, oj, nj) {\n if(util.isObject(nj)) {\n if(nj.$$type === TYPE_CP) {\n // key对比过了忽略\n if(nj.key === KEY_FLAG) {\n return;\n }\n // 相同class的组件处理\n if(oj && oj.$$type === nj.$$type && oj.klass === nj.klass) {\n diffCp(oj, nj, vd);\n // 已更新的cp需被老sr删除,因为老sr会回收,而此cp继续存在于新sr中不能回收\n removeCpFromOldTree(vd);\n }\n }\n else if(nj.$$type === TYPE_GM && oj && oj.$$type === TYPE_GM) {\n // $geom的multi必须一致\n if(oj.tagName === nj.tagName && oj.props.multi === nj.props.multi) {\n nj.__inheritAnimate = vd;\n }\n }\n // dom类型递归children\n else if(nj.$$type === TYPE_VD && oj && oj.$$type === TYPE_VD) {\n if(oj.tagName === nj.tagName) {\n nj.__inheritAnimate = vd;\n }\n diffChildren(vd, oj, nj);\n }\n }\n}\n\n/**\n * dom类型的vd对比children\n * @param vd\n * @param oj\n * @param nj\n */\nfunction diffChildren(vd, oj, nj) {\n let oc = oj.children;\n let nc = nj.children;\n let ol = oc.length;\n let nl = nc.length;\n let children = vd.children;\n for(let i = 0, of = 0, nf = 0, len = Math.min(ol, nl); i < len; i++) {\n let o = oc[i + of];\n let n = nc[i + nf];\n // 新老都是key直接跳过\n if(o.key === KEY_FLAG && n.key === KEY_FLAG) {\n }\n // 其中一个是key对比过了调整索引和长度\n else if(o.key === KEY_FLAG) {\n of++;\n i--;\n ol--;\n len = Math.min(ol, nl);\n }\n else if(n.key === KEY_FLAG) {\n nf++;\n i--;\n nl--;\n len = Math.min(ol, nl);\n }\n else {\n diffChild(children[i + of], o, n);\n }\n }\n // 长度不同增减的无需关注,新json创建cp有didMount,老vd会调用cp的destroy\n}\n\n/**\n * 根据json对比看cp如何更新,被render()后的json的二级组件对比才会出现\n * @param oj\n * @param nj\n * @param vd\n */\nfunction diffCp(oj, nj, vd) {\n // props全等,直接替换新json类型为占位符,引用老vd内容,无需重新创建,暂时存在json的placeholder上\n // 否则需要强制触发组件更新,包含setState内容\n nj.__placeholder = vd;\n let sr = vd.shadowRoot;\n // 对比需忽略on开头的事件,直接改老的引用到新的上,这样只变了on的话无需更新\n let exist = {};\n Object.keys(oj.props).forEach(k => {\n let v = oj.props[k];\n exist[k] = v;\n });\n Object.keys(nj.props).forEach(k => {\n let v = nj.props[k];\n if(/^on[a-zA-Z]/.test(k)) {\n oj.props[k] = v;\n let ex = exist[k];\n if(ex) {\n delete exist[k];\n if(ex !== v) {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n }\n else {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n }\n else if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n oj.props[k] = v;\n let ex = exist[k];\n if(ex) {\n delete exist[k];\n if(ex !== v) {\n k = k.slice(2).toLowerCase();\n vd.off(k, exist[k]);\n vd.on(k, v);\n }\n delete exist[k];\n }\n else {\n k = k.slice(2).toLowerCase();\n vd.on(k, v);\n }\n }\n });\n // 新的少的事件取消\n Object.keys(exist).forEach(k => {\n let v = exist[k];\n if(/^on[a-zA-Z]/.test(k)) {\n nj.props[k] = v;\n k = k.slice(2).toLowerCase();\n delete sr.listener[k];\n }\n else if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n nj.props[k] = v;\n k = k.slice(2).toLowerCase();\n vd.off(k, v);\n }\n });\n checkCp(vd, nj.props, !util.equal(oj.props, nj.props));\n}\n\n/**\n * 深度优先遍历json,将有key的记录在hash中,如果传入根vd,同步递归保存对应位置的vd\n * @param json\n * @param hash\n * @param vd\n * @returns {*}\n */\nfunction getKeyHash(json, hash, vd) {\n if(Array.isArray(json)) {\n json.forEach((item, i) => getKeyHash(item, hash, vd && vd[i]));\n }\n else if(util.isObject(json)) {\n if(json.$$type === TYPE_VD || json.$$type === TYPE_GM || json.$$type === TYPE_CP) {\n // 深度优先\n if(json.$$type === TYPE_VD) {\n getKeyHash(json.children, hash, vd && vd.children);\n }\n let key = json.props.key;\n if(!util.isNil(key) && key !== '') {\n // 重复key错误警告\n if(hash.hasOwnProperty(key)) {\n inject.warn('Component ' + vd.tagName + ' has duplicate key: ' + key);\n }\n hash[key] = {\n json,\n vd,\n };\n }\n }\n }\n return hash;\n}\n\n/**\n * 非一级组件diff发生更新时,其需要从sr的tree中移除,因为sr会销毁\n */\nfunction removeCpFromOldTree(vd) {\n // root下的一级组件不会发生回收情况,忽略\n if(!vd.host) {\n return;\n }\n let parent = vd.parent;\n if(parent) {\n let i = parent.children.indexOf(vd);\n if(i > -1) {\n parent.children[i] = null;\n }\n else {\n throw new Error('Can not find child: ' + vd.tagName);\n }\n }\n}\n\n/**\n * 执行componentDidUpdate/destroy\n */\nfunction did() {\n updateList.forEach(item => {\n if(util.isFunction(item.componentDidUpdate)) {\n item.componentDidUpdate();\n }\n });\n updateList.splice(0);\n removeList.forEach(item => {\n item.__destroy();\n });\n removeList = [];\n}\n\nexport default {\n updateList,\n check,\n did,\n};\n","import util from './util';\nimport level from '../refresh/level';\n\nconst { joinVd, joinDef } = util;\nconst { contain, NONE, TRANSFORM_ALL, OPACITY, FILTER, MIX_BLEND_MODE } = level;\n\nfunction diff(elem, ovd, nvd) {\n let cns = elem.childNodes;\n diffDefs(cns[0], ovd.defs, nvd.defs);\n // = i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinDef(nd[i]));\n }\n }\n}\n\nfunction diffDef(elem, od, nd) {\n if(od.tagName !== nd.tagName) {\n insertAdjacentHTML(elem, 'beforebegin', joinDef(nd));\n // elem.insertAdjacentHTML('beforebegin', joinDef(nd));\n elem.parentNode.removeChild(elem);\n }\n else {\n if(od.uuid !== nd.uuid) {\n elem.setAttribute('id', nd.uuid);\n }\n let op = {};\n for(let i = 0, len = (od.props || []).length; i < len; i++) {\n let prop = od.props[i];\n let [k, v] = prop;\n op[k] = v;\n }\n for(let i = 0, len = (nd.props || []).length; i < len; i++) {\n let prop = nd.props[i];\n let [k, v] = prop;\n // 已有不等更新,没有添加\n if(op.hasOwnProperty(k)) {\n if(op[k] !== v) {\n elem.setAttribute(k, v);\n }\n delete op[k];\n }\n else {\n elem.setAttribute(k, v);\n }\n }\n // 多余的删除\n Object.keys(op).forEach(i => {\n elem.removeAttribute(i);\n });\n let cns = elem.childNodes;\n let ol = od.children.length;\n let nl = nd.children.length;\n let i = 0;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(elem, i, od.children[i], nd.children[i]);\n }\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinVd(nd.children[i]));\n }\n }\n }\n}\n\nfunction diffChild(elem, ovd, nvd) {\n if(ovd.type === 'dom') {\n if(nvd.type === 'dom') {\n diffD2D(elem, ovd, nvd);\n }\n else if(nvd.type === 'geom') {\n diffD2G(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n else if(ovd.type === 'text') {\n if(nvd.type === 'text') {\n diffT2T(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n else if(ovd.type === 'geom') {\n if(nvd.type === 'dom') {\n diffG2D(elem, ovd, nvd);\n }\n else if(nvd.type === 'geom') {\n diffG2G(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n else if(ovd.type === 'img') {\n if(nvd.type === 'img') {\n diffItemSelf(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n // 特殊情况,当有连续2个img,后面1个发生error时,其children内容不是type为img的图片,而是矢量图item,会进入此分支\n else if(ovd.type === 'item' && nvd.type === 'item') {\n diffItemSelf(elem, ovd, nvd);\n }\n}\n\nfunction diffX2X(elem, ovd, nvd) {\n let { transform, opacity, visibility, mask, overflow, filter, mixBlendMode, conClip } = nvd;\n if(ovd.transform !== transform) {\n if(transform) {\n elem.setAttribute('transform', transform);\n }\n else {\n elem.removeAttribute('transform');\n }\n }\n if(ovd.opacity !== opacity) {\n if(opacity !== 1 && opacity !== undefined) {\n elem.setAttribute('opacity', opacity);\n }\n else {\n elem.removeAttribute('opacity');\n }\n }\n if(ovd.visibility !== visibility) {\n elem.setAttribute('visibility', visibility);\n }\n if(ovd.mask !== mask) {\n if(mask) {\n elem.setAttribute('mask', mask);\n }\n else {\n elem.removeAttribute('mask');\n }\n }\n if(ovd.filter !== filter || ovd.mixBlendMode !== mixBlendMode) {\n let s = (filter ? `filter:${filter};` : '') + (mixBlendMode ? `mix-blend-mode:${mixBlendMode};` : '');\n if(s) {\n elem.setAttribute('style', s);\n }\n else {\n elem.removeAttribute('filter');\n }\n }\n // if(ovd.filter !== filter) {\n // if(filter) {\n // elem.setAttribute('filter', filter);\n // }\n // else {\n // elem.removeAttribute('filter');\n // }\n // }\n if(ovd.overflow !== overflow) {\n if(overflow) {\n elem.setAttribute('clipPath', overflow);\n }\n else {\n elem.removeAttribute('overflow');\n }\n }\n if(ovd.conClip !== conClip) {\n if(conClip) {\n elem.childNodes[1].setAttribute('clip-path', conClip);\n }\n else {\n elem.childNodes[1].removeAttribute('clip-path');\n }\n }\n}\n\nfunction diffByLessLv(elem, ovd, nvd, lv) {\n let { transform, opacity, mask, filter, mixBlendMode } = nvd;\n if(mask) {\n elem.setAttribute('mask', mask);\n }\n else {\n elem.removeAttribute('mask');\n }\n if(lv === NONE) {\n return;\n }\n if(contain(lv, TRANSFORM_ALL)) {\n if(transform) {\n elem.setAttribute('transform', transform);\n }\n else {\n elem.removeAttribute('transform');\n }\n }\n if(contain(lv, OPACITY)) {\n if(opacity !== 1 && opacity !== undefined) {\n elem.setAttribute('opacity', opacity);\n }\n else {\n elem.removeAttribute('opacity');\n }\n }\n if(contain(lv, FILTER) || contain(lv, MIX_BLEND_MODE)) {\n let s = (filter ? `filter:${filter};` : '') + (mixBlendMode ? `mix-blend-mode:${mixBlendMode};` : '');\n if(s) {\n elem.setAttribute('style', s);\n }\n else {\n elem.removeAttribute('style');\n }\n }\n}\n\nfunction diffD2D(elem, ovd, nvd, root) {\n // cache表明children无变化缓存,一定是REPAINT以下的,只需看自身的lv以及mask\n if(nvd.cache) {\n diffByLessLv(elem, ovd, nvd, nvd.lv);\n return;\n }\n // 无cache且= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffD2G(elem, ovd, nvd) {\n diffX2X(elem, ovd, nvd);\n diffBb(elem.firstChild, ovd.bb, nvd.bb);\n let ol = ovd.children.length;\n let nl = nvd.children.length;\n let i = 0;\n let lastChild = elem.lastChild;\n let cns = lastChild.childNodes;\n for(; i < Math.min(ol, nl); i++) {\n replaceWith(cns[i], nvd.children[i]);\n }\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffT2T(elem, ovd, nvd) {\n if(nvd.cache) {\n return;\n }\n let ol = ovd.children.length;\n let nl = nvd.children.length;\n let i = 0;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(elem, i, ovd.children[i], nvd.children[i], true);\n }\n let cns = elem.childNodes;\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffG2D(elem, ovd, nvd) {\n diffD2G(elem, ovd, nvd);\n}\n\nfunction diffG2G(elem, ovd, nvd) {\n if(nvd.cache) {\n diffByLessLv(elem, ovd, nvd, nvd.lv);\n return;\n }\n // 无cache且= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n }\n}\n\nfunction diffBb(elem, obb, nbb) {\n let ol = obb.length;\n let nl = nbb.length;\n let i = 0;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(elem, i, obb[i], nbb[i]);\n }\n let cns = elem.childNodes;\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinVd(nbb[i]));\n }\n }\n}\n\nfunction diffItem(elem, i, ovd, nvd, isText) {\n let cns = elem.childNodes;\n if(ovd.tagName !== nvd.tagName) {\n replaceWith(cns[i], nvd);\n }\n else {\n diffItemSelf(cns[i], ovd, nvd);\n if(isText && ovd.content !== nvd.content) {\n cns[i].innerHTML = nvd.content;\n }\n }\n}\n\nfunction diffItemSelf(elem, ovd, nvd) {\n if(nvd.cache) {\n return;\n }\n let op = {};\n for(let i = 0, len = (ovd.props || []).length; i < len; i++) {\n let prop = ovd.props[i];\n let [k, v] = prop;\n op[k] = v;\n }\n for(let i = 0, len = (nvd.props || []).length; i < len; i++) {\n let prop = nvd.props[i];\n let [k, v] = prop;\n // 已有不等更新,没有添加\n if(op.hasOwnProperty(k)) {\n if(op[k] !== v) {\n elem.setAttribute(k, v);\n }\n delete op[k];\n }\n else {\n elem.setAttribute(k, v);\n }\n }\n // 多余的删除\n Object.keys(op).forEach(i => {\n elem.removeAttribute(i);\n });\n}\n\nfunction replaceWith(elem, vd) {\n let res;\n if(Array.isArray(vd)) {\n res = '';\n vd.forEach(item => {\n res += joinVd(item);\n });\n }\n else {\n res = joinVd(vd);\n }\n insertAdjacentHTML(elem, 'beforebegin', res);\n // elem.insertAdjacentHTML('beforebegin', res);\n elem.parentNode.removeChild(elem);\n}\n\nfunction insertAt(elem, cns, index, html) {\n if(index >= cns.length) {\n insertAdjacentHTML(elem, 'beforeend', html);\n // elem.insertAdjacentHTML('beforeend', html);\n }\n else {\n insertAdjacentHTML(cns[index], 'beforebegin', html);\n // cns[index].insertAdjacentHTML('beforebegin', html);\n }\n}\n\nfunction removeAt(elem, cns, index) {\n if(cns[index]) {\n elem.removeChild(cns[index]);\n }\n}\n\nlet svg;\nfunction insertAdjacentHTML(elem, where, content) {\n if(elem.insertAdjacentHTML) {\n elem.insertAdjacentHTML(where, content);\n }\n else {\n switch(where) {\n case 'beforeend':\n elem.innerHTML += content;\n break;\n case 'beforebegin':\n svg = svg || document.createElement('svg');\n svg.innerHTML = content;\n elem.parentNode.insertBefore(svg.childNodes[0], elem);\n break;\n }\n }\n}\n\nexport default diff;\n","import util from '../util/util';\n\nconst { isFunction } = util;\n\nclass Controller {\n constructor() {\n this.__records = []; // 默认记录和自动记录\n this.__records2 = []; // 非自动播放的动画记录\n this.__list = [] // 默认初始化播放列表,自动播放也存这里\n this.__list2 = []; // json中autoPlay为false的初始化存入这里\n this.__onList = []; // list中已存在的侦听事件,list2初始化时也需要增加上\n this.__lastTime = {}; // 每个类型的上次触发时间,防止重复emit\n }\n\n add(v, list = this.list) {\n if(list.indexOf(v) === -1) {\n list.push(v);\n }\n }\n\n remove(v) {\n let i = this.list.indexOf(v);\n if(i > -1) {\n this.list.splice(i, 1);\n }\n }\n\n __destroy() {\n this.__records = [];\n this.__records2 = [];\n this.__list = [];\n this.__list2 = [];\n }\n\n __action(k, args) {\n this.list.forEach(item => {\n item[k].apply(item, args);\n });\n }\n\n init(records = this.__records, list = this.list) {\n // 检查尚未初始化的record,并初始化,后面才能调用各种控制方法\n if(records.length) {\n // 清除防止重复调用,并且新的json还会进入整体逻辑\n records.splice(0).forEach(item => {\n let { target, animate } = item;\n if(target.isDestroyed) {\n return;\n }\n if(Array.isArray(animate)) {\n animate.forEach(animate => {\n let { value, options } = animate;\n options.autoPlay = false;\n let o = target.animate(value, options);\n this.add(o, list);\n });\n }\n else {\n let { value, options } = animate;\n options.autoPlay = false;\n let o = target.animate(value, options);\n this.add(o, list);\n }\n });\n }\n // 非自动播放后初始化需检测事件,给非自动播放添加上,并清空本次\n if(records === this.__records2) {\n let onList = this.__onList;\n let list2 = this.list2;\n if(list2.length && onList.length) {\n list2.forEach(item => {\n onList.forEach(arr => {\n item.off(arr[0], arr[1]);\n item.on(arr[0], arr[1]);\n });\n });\n }\n }\n }\n\n __playAuto() {\n this.init();\n this.__action('play');\n }\n\n play(cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('play', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n pause() {\n this.__action('pause');\n }\n\n resume(cb) {\n let once = true;\n this.__action('resume', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n __mergeAuto() {\n this.init();\n this.init(this.__records2);\n if(this.__list2.length) {\n this.__list = this.__list.concat(this.__list2);\n this.__list2 = [];\n }\n }\n\n cancel(cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('cancel', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n finish(cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('finish', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n gotoAndStop(v, options, cb) {\n this.__mergeAuto();\n this.__onList = [];\n if(isFunction(options)) {\n cb = options;\n options = {};\n }\n let once = true;\n this.__action('gotoAndStop', [v, options, cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n gotoAndPlay(v, options, cb) {\n this.__mergeAuto();\n this.__onList = [];\n if(isFunction(options)) {\n cb = options;\n options = {};\n }\n let once = true;\n this.__action('gotoAndPlay', [v, options, cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n on(id, handle) {\n if(!isFunction(handle)) {\n return;\n }\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n this.__on(id[i], handle);\n }\n this.__onList.push([id, handle]);\n }\n else {\n this.__on(id, handle);\n this.__onList.push([id, handle]);\n }\n }\n\n __on(id, handle) {\n this.list.forEach(item => {\n let cb = () => {\n let time = item.timestamp;\n if(time !== this.__lastTime[id]) {\n this.__lastTime[id] = time;\n handle();\n }\n };\n cb.__karasEventCb = handle;\n item.on(id, cb);\n });\n }\n\n off(id, handle) {\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n this.off(id[i], handle);\n }\n }\n else {\n this.list.forEach(item => {\n item.off(id, handle);\n });\n }\n }\n\n get list() {\n return this.__list;\n }\n\n get list2() {\n return this.__list2;\n }\n\n __set(key, value) {\n this.list.forEach(item => {\n item[key] = value;\n });\n }\n\n set playbackRate(v) {\n this.__set('playbackRate', v);\n }\n\n set iterations(v) {\n this.__set('iterations', v);\n }\n\n set playCount(v) {\n this.__set('playCount', v);\n }\n\n set fps(v) {\n this.__set('fps', v);\n }\n\n set currentTime(v) {\n this.__set('currentTime', v);\n }\n\n set spfLimit(v) {\n this.__set('spfLimit', v);\n }\n\n set delay(v) {\n this.__set('delay', v);\n }\n\n set endDelay(v) {\n this.__set('endDelay', v);\n }\n\n set fill(v) {\n this.__set('fill', v);\n }\n\n set direction(v) {\n this.__set('direction', v);\n }\n}\n\nexport default Controller;\n","import inject from '../util/inject';\nimport painter from '../util/painter';\n\nconst { canvasPolygon } = painter;\n\n// 无cache时应用离屏时的优先级,从小到大,OFFSCREEN_MASK2是个特殊的\nconst OFFSCREEN_OVERFLOW = 0;\nconst OFFSCREEN_FILTER = 1;\nconst OFFSCREEN_MASK = 2;\nconst OFFSCREEN_BLEND = 3;\nconst OFFSCREEN_MASK2 = 4;\n\nfunction applyOffscreen(ctx, list, width, height) {\n list.sort(function(a, b) {\n if(a[1] === b[1]) {\n if(a[0] === b[0]) {\n return a[2] - b[2];\n }\n return b[0] - a[0];\n }\n return b[1] - a[1];\n });\n list.forEach(item => {\n let [, , type, offscreen] = item;\n if(type === OFFSCREEN_OVERFLOW) {\n let { matrix, target, ctx: origin, x, y, offsetWidth, offsetHeight, list } = offscreen;\n ctx.globalCompositeOperation = 'destination-in';\n ctx.globalAlpha = 1;\n ctx.setTransform(matrix[0], matrix[1], matrix[4], matrix[5], matrix[12], matrix[13]);\n ctx.fillStyle = '#FFF';\n ctx.beginPath();\n if(list) {\n canvasPolygon(ctx, list);\n }\n else {\n ctx.rect(x, y, offsetWidth, offsetHeight);\n }\n ctx.fill();\n ctx.closePath();\n ctx.globalCompositeOperation = 'source-over';\n target.draw();\n ctx = origin;\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.globalAlpha = 1;\n if(width && height) {\n ctx.drawImage(target.canvas, 0, 0, width, height, 0, 0, width, height);\n }\n ctx.draw && ctx.draw(true);\n target.ctx.setTransform(1, 0, 0, 1, 0, 0);\n target.ctx.clearRect(0, 0, width, height);\n target.draw();\n inject.releaseCacheCanvas(target.canvas);\n }\n else if(type === OFFSCREEN_FILTER) {\n let { target, ctx: origin, filter } = offscreen;\n // 申请一个新的离屏,应用blur并绘制,如没有则降级,默认ctx.filter为'none'\n if(ctx.filter) {\n let apply = inject.getCacheCanvas(width, height, null, 'filter');\n apply.ctx.filter = painter.canvasFilter(filter);\n if(width && height) {\n apply.ctx.drawImage(target.canvas, 0, 0, width, height, 0, 0, width, height);\n }\n apply.ctx.filter = 'none';\n apply.draw();\n target.ctx.globalAlpha = 1;\n target.ctx.setTransform(1, 0, 0, 1, 0, 0);\n target.ctx.clearRect(0, 0, width, height);\n if(width && height) {\n target.ctx.drawImage(apply.canvas, 0, 0, width, height, 0, 0, width, height);\n }\n target.draw();\n apply.ctx.setTransform(1, 0, 0, 1, 0, 0);\n apply.ctx.clearRect(0, 0, width, height);\n apply.draw();\n inject.releaseCacheCanvas(apply.canvas);\n }\n // 绘制回主画布,如果不支持则等同无filter原样绘制\n ctx = origin;\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.globalAlpha = 1;\n if(width && height) {\n ctx.drawImage(target.canvas, 0, 0, width, height, 0, 0, width, height);\n }\n ctx.draw && ctx.draw(true);\n target.ctx.setTransform(1, 0, 0, 1, 0, 0);\n target.ctx.globalAlpha = 1;\n target.ctx.clearRect(0, 0, width, height);\n target.draw();\n inject.releaseCacheCanvas(target.canvas);\n }\n else if(type === OFFSCREEN_MASK) {\n let { mask, isClip } = offscreen;\n if(isClip) {\n offscreen.target.draw();\n ctx = mask.ctx;\n ctx.globalCompositeOperation = 'source-out';\n ctx.globalAlpha = 1;\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n if(width && height) {\n ctx.drawImage(offscreen.target.canvas, 0, 0, width, height, 0, 0, width, height);\n }\n mask.draw();\n ctx.globalCompositeOperation = 'source-over';\n offscreen.target.ctx.setTransform(1, 0, 0, 1, 0, 0);\n offscreen.target.ctx.clearRect(0, 0, width, height);\n offscreen.target.draw();\n inject.releaseCacheCanvas(offscreen.target.canvas);\n ctx = offscreen.ctx;\n ctx.globalAlpha = 1;\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n if(width && height) {\n ctx.drawImage(mask.canvas, 0, 0, width, height, 0, 0, width, height);\n }\n ctx.draw && ctx.draw(true);\n mask.ctx.setTransform(1, 0, 0, 1, 0, 0);\n mask.ctx.clearRect(0, 0, width, height);\n mask.draw();\n inject.releaseCacheCanvas(mask.canvas);\n }\n else {\n mask.draw();\n let target = offscreen.target;\n ctx = target.ctx;\n ctx.globalCompositeOperation = 'destination-in';\n ctx.globalAlpha = 1;\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n if(width && height) {\n ctx.drawImage(mask.canvas, 0, 0, width, height, 0, 0, width, height);\n }\n ctx.globalCompositeOperation = 'source-over';\n target.draw();\n mask.ctx.setTransform(1, 0, 0, 1, 0, 0);\n mask.ctx.clearRect(0, 0, width, height);\n mask.draw();\n inject.releaseCacheCanvas(mask.canvas);\n ctx = offscreen.ctx;\n ctx.globalAlpha = 1;\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n if(width && height) {\n ctx.drawImage(target.canvas, 0, 0, width, height, 0, 0, width, height);\n }\n ctx.draw && ctx.draw(true);\n target.ctx.setTransform(1, 0, 0, 1, 0, 0);\n target.ctx.clearRect(0, 0, width, height);\n target.draw();\n inject.releaseCacheCanvas(target.canvas);\n }\n }\n else if(type === OFFSCREEN_BLEND) {\n let target = offscreen.target;\n ctx = offscreen.ctx;\n ctx.globalCompositeOperation = offscreen.mixBlendMode;\n target.draw();\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.globalAlpha = 1;\n if(width && height) {\n ctx.drawImage(target.canvas, 0, 0, width, height, 0, 0, width, height);\n }\n ctx.globalCompositeOperation = 'source-over';\n ctx.draw && ctx.draw(true);\n target.ctx.globalAlpha = 1;\n target.ctx.setTransform(1, 0, 0, 1, 0, 0);\n target.ctx.clearRect(0, 0, width, height);\n target.draw();\n inject.releaseCacheCanvas(target.canvas);\n }\n // 特殊的mask节点汇总结束,还原ctx\n else if(type === OFFSCREEN_MASK2) {\n ctx = offscreen.ctx;\n }\n });\n return ctx;\n}\n\nexport default {\n OFFSCREEN_OVERFLOW,\n OFFSCREEN_FILTER,\n OFFSCREEN_MASK,\n OFFSCREEN_BLEND,\n OFFSCREEN_MASK2,\n applyOffscreen,\n};\n","import Page from '../refresh/Page';\nimport inject from '../util/inject';\n\nclass MockPage {\n constructor(texture, width, height) {\n this.uuid = Page.genUuid();\n this.time = inject.now();\n this.texture = texture;\n this.width = width;\n this.height = height;\n }\n}\n\nexport default MockPage;\n","import MockPage from './MockPage';\n\n/**\n * 一个fbo离屏纹理,mock成cache,当webgl需要局部根节点汇总时生成,即cacheTotal,\n * 基于此纹理进行filter、mask等后处理渲染\n */\nclass MockCache {\n constructor(gl, texture, sx1, sy1, width, height, bbox) {\n this.gl = gl;\n this.x = 0;\n this.y = 0;\n this.sx1 = sx1;\n this.sy1 = sy1;\n this.width = width;\n this.height = height;\n this.bbox = bbox;\n this.available = true;\n this.__page = new MockPage(texture, width, height);\n this.dx = -bbox[0];\n this.dy = -bbox[1];\n this.dbx = sx1 - bbox[0];\n this.dby = sy1 - bbox[1];\n }\n\n release() {\n this.available = false;\n this.gl.deleteTexture(this.page.texture);\n }\n\n get page() {\n return this.__page;\n }\n}\n\nexport default MockCache;\n","import Cache from './Cache';\nimport offscreen from './offscreen';\nimport Text from '../node/Text';\nimport Dom from '../node/Dom';\nimport Img from '../node/Img';\nimport mode from './mode';\nimport mx from '../math/matrix';\nimport geom from '../math/geom';\nimport level from './level';\nimport painter from '../util/painter';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport tf from '../style/transform';\nimport mbm from '../style/mbm';\nimport enums from '../util/enums';\nimport webgl from '../gl/webgl';\nimport MockCache from '../gl/MockCache';\nimport blur from '../math/blur';\nimport vertexBlur from '../gl/filter/blur.vert';\nimport fragmentBlur from '../gl/filter/blur.frag';\nimport vertexMbm from '../gl/mbm/mbm.vert';\nimport fragmentMultiply from '../gl/mbm/multiply.frag';\nimport fragmentScreen from '../gl/mbm/screen.frag';\nimport fragmentOverlay from '../gl/mbm/overlay.frag';\nimport fragmentDarken from '../gl/mbm/darken.frag';\nimport fragmentLighten from '../gl/mbm/lighten.frag';\nimport fragmentColorDodge from '../gl/mbm/color-dodge.frag';\nimport fragmentColorBurn from '../gl/mbm/color-burn.frag';\nimport fragmentHardLight from '../gl/mbm/hard-light.frag';\nimport fragmentSoftLight from '../gl/mbm/soft-light.frag';\nimport fragmentDifference from '../gl/mbm/difference.frag';\nimport fragmentExclusion from '../gl/mbm/exclusion.frag';\nimport fragmentHue from '../gl/mbm/hue.frag';\nimport fragmentSaturation from '../gl/mbm/saturation.frag';\nimport fragmentColor from '../gl/mbm/color.frag';\nimport fragmentLuminosity from '../gl/mbm/luminosity.frag';\n\nconst { NA, LOCAL, CHILD, SELF, getCache } = Cache;\nconst {\n OFFSCREEN_OVERFLOW,\n OFFSCREEN_FILTER,\n OFFSCREEN_MASK,\n OFFSCREEN_BLEND,\n OFFSCREEN_MASK2,\n applyOffscreen,\n} = offscreen;\n\nconst {\n STYLE_KEY: {\n DISPLAY,\n OPACITY,\n VISIBILITY,\n FILTER,\n OVERFLOW,\n MIX_BLEND_MODE,\n FILL,\n TRANSFORM,\n TRANSFORM_ORIGIN,\n PERSPECTIVE,\n PERSPECTIVE_ORIGIN,\n PADDING_LEFT,\n PADDING_RIGHT,\n PADDING_TOP,\n PADDING_BOTTOM,\n BORDER_TOP_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_LEFT_WIDTH,\n MATRIX,\n },\n NODE_KEY: {\n NODE_CACHE,\n NODE_CACHE_TOTAL,\n NODE_CACHE_OVERFLOW,\n NODE_CACHE_MASK,\n NODE_CACHE_FILTER,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n NODE_OPACITY,\n NODE_COMPUTED_STYLE,\n NODE_CURRENT_STYLE,\n NODE_LIMIT_CACHE,\n NODE_REFRESH_LV,\n NODE_CACHE_STYLE,\n NODE_DEFS_CACHE,\n NODE_IS_MASK,\n NODE_DOM_PARENT,\n NODE_PERSPECTIVE_MATRIX,\n NODE_VIRTUAL_DOM,\n NODE_CACHE_AS_BITMAP,\n NODE_STRUCT,\n },\n STRUCT_KEY: {\n STRUCT_NODE,\n STRUCT_INDEX,\n STRUCT_TOTAL,\n STRUCT_HAS_MASK,\n STRUCT_LV,\n },\n} = enums;\nconst {\n NONE,\n TRANSFORM_ALL,\n OPACITY: OP,\n FILTER: FT,\n REPAINT,\n contain,\n MIX_BLEND_MODE: MBM,\n PERSPECTIVE: PPT,\n} = level;\nconst { isE, inverse, multiply } = mx;\nconst { mbmName, isValidMbm } = mbm;\nconst { assignMatrix, transformBbox } = util;\n\n/**\n * 生成一个节点及其子节点所包含的矩形范围盒,canvas和webgl的最大尺寸限制不一样,由外部传入\n * 如果某个子节点超限,则视为整个超限,超限返回空\n * @param node\n * @param __structs\n * @param index\n * @param total\n * @param parentIndexHash\n * @param opacityHash\n * @param MAX\n * @param includeLimitCache webgl时即便超限也要强制生成total,所以标识不能跳出\n * @returns {*}\n */\nfunction genBboxTotal(node, __structs, index, total, parentIndexHash, opacityHash, MAX, includeLimitCache) {\n let { __sx1: sx1, __sy1: sy1, __config } = node;\n let {\n [NODE_CACHE]: cache,\n [NODE_COMPUTED_STYLE]: {\n [FILTER]: filter,\n [PERSPECTIVE]: perspective,\n [PERSPECTIVE_ORIGIN]: perspectiveOrigin,\n },\n } = __config;\n // 先将局部根节点的bbox算好,可能没内容是空\n let bboxTotal;\n if(cache && cache.available) {\n bboxTotal = cache.bbox.slice(0);\n }\n else {\n bboxTotal = node.bbox.slice(0);\n }\n // 局部根节点如有perspective,则计算pm,这里不会出现嵌套,因为每个出现都会生成局部根节点\n let pm;\n if(perspective) {\n pm = tf.calPerspectiveMatrix(perspective, perspectiveOrigin);\n }\n // 广度遍历,不断一层层循环下去,用2个hash暂存每层的父matrix和opacity,blur只需记住顶层,因为子的如果有一定是cacheFilter\n let list = [index];\n let d = 0;\n filter.forEach(item => {\n let [k, v] = item;\n if(k === 'blur') {\n d = blur.outerSize(v);\n }\n });\n opacityHash[index] = 1;\n // opacity可以保存下来层级相乘结果供外部使用,但matrix不可以,因为这里按画布原点为坐标系计算,外部合并局部根节点以bbox左上角为原点\n let matrixHash = {};\n while(list.length) {\n let arr = list.splice(0);\n for(let i = 0, len = arr.length; i < len; i++) {\n let parentIndex = arr[i];\n let total = __structs[parentIndex][STRUCT_TOTAL] || 0;\n for(let i = parentIndex + 1, len = parentIndex + total + 1; i < len; i++) {\n let {\n [STRUCT_NODE]: node2,\n [STRUCT_TOTAL]: total,\n } = __structs[i];\n // mask也不占bbox位置\n if(node2.isMask) {\n continue;\n }\n let {\n __sx1,\n __sy1,\n __config: {\n [NODE_LIMIT_CACHE]: limitCache,\n [NODE_CACHE]: __cache,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_COMPUTED_STYLE]: {\n [DISPLAY]: display,\n [VISIBILITY]: visibility,\n [TRANSFORM]: transform,\n [TRANSFORM_ORIGIN]: transformOrigin,\n [OPACITY]: opacity,\n },\n },\n } = node2;\n // webgl不能跳过超限\n if(limitCache && !includeLimitCache) {\n return;\n }\n // display:none跳过整个节点树,visibility只跳过自身\n if(display === 'none') {\n i += total || 0;\n continue;\n }\n if(visibility === 'hidden') {\n continue;\n }\n parentIndexHash[i] = parentIndex;\n opacityHash[i] = opacityHash[parentIndex] * opacity;\n // 防止text的情况,其一定属于某个node,其bbox被计算过,text不应该计算\n if(node2 instanceof Text) {\n continue;\n }\n let bbox, dx = 0, dy = 0, hasTotal;\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal]);\n if(target) {\n bbox = target.bbox.slice(0);\n dx = target.dbx;\n dy = target.dby;\n i += total || 0;\n hasTotal = true;\n }\n else if(__cache && __cache.available) {\n bbox = __cache.bbox.slice(0);\n dx = __cache.dbx;\n dy = __cache.dby;\n }\n else {\n bbox = node2.bbox.slice(0);\n }\n // 可能Xom没有内容\n if(bbox) {\n bbox[0] -= sx1;\n bbox[1] -= sy1;\n bbox[2] -= sx1;\n bbox[3] -= sy1;\n let matrix = matrixHash[parentIndex];\n // 父级matrix初始化E为null,自身不为E时才运算,可以加速\n if(transform && !isE(transform)) {\n let tfo = transformOrigin.slice(0);\n // total下的节点tfo的计算,以total为原点,差值坐标即相对坐标\n tfo[0] += __sx1 - sx1 + dx;\n tfo[1] += __sy1 - sy1 + dy;\n let m = tf.calMatrixByOrigin(transform, tfo);\n if(matrix) {\n matrix = multiply(matrix, m);\n }\n else {\n matrix = m;\n }\n }\n if(matrix) {\n matrixHash[i] = matrix;\n }\n if(pm) {\n matrix = multiply(pm, matrix);\n }\n bbox = transformBbox(bbox, matrix, d, d);\n // 有孩子才继续存入下层级广度运算\n if(total && !hasTotal) {\n list.push(i);\n }\n mergeBbox(bboxTotal, bbox, sx1, sy1);\n }\n }\n }\n }\n return [bboxTotal, pm];\n}\n\nfunction mergeBbox(bbox, t, sx1, sy1) {\n bbox[0] = Math.min(bbox[0], sx1 + t[0]);\n bbox[1] = Math.min(bbox[1], sy1 + t[1]);\n bbox[2] = Math.max(bbox[2], sx1 + t[2]);\n bbox[3] = Math.max(bbox[3], sy1 + t[3]);\n}\n\n/**\n * 生成局部根节点离屏缓存,超限时除外\n * cache是每个节点自身的缓存,且共享离屏canvas\n * cacheTotal是基础\n * cacheFilter基于total\n * cacheOverflow基于filter\n * cacheMask基于overflow\n * cacheBlend基于mask\n * @param renderMode\n * @param node\n * @param config\n * @param index\n * @param lv\n * @param total\n * @param __structs\n * @param hasMask\n * @param width\n * @param height\n * @returns {{enabled}|Cache|*}\n */\nfunction genTotal(renderMode, node, config, index, lv, total, __structs, hasMask, width, height) {\n let {\n [NODE_CACHE_TOTAL]: cacheTotal,\n [NODE_CACHE_FILTER]: cacheFilter,\n [NODE_CACHE_MASK]: cacheMask,\n [NODE_CACHE_OVERFLOW]: cacheOverflow,\n [NODE_CURRENT_STYLE]: currentStyle,\n [NODE_COMPUTED_STYLE]: computedStyle,\n } = config;\n let needGen;\n // 先绘制形成基础的total,有可能已经存在无变化,就可省略\n if(!cacheTotal || !cacheTotal.available) {\n needGen = true; // total重新生成了,其它基于的也一定需要重新生成\n let bboxTotal, baseMatrix;\n let { __sx1: sx1, __sy1: sy1 } = node;\n // 栈代替递归,存父节点的matrix/opacity,matrix为E时存null省略计算\n let matrixList = [];\n let parentMatrix;\n let opacityList = [];\n let parentOpacity = 1;\n let lastConfig;\n let lastLv = lv;\n // 先遍历每个节点,以局部根节点左上角为原点,求得所占的总的bbox,即合并所有bbox\n for(let i = index, len = index + (total || 0) + 1; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_LV]: lv,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n } = __structs[i];\n // 排除Text\n if(node instanceof Text) {\n let bbox = node.bbox;\n if(!isE(parentMatrix)) {\n bbox = transformBbox(bbox, parentMatrix, 0, 0);\n }\n mergeBbox(bboxTotal, bbox, 0, 0);\n continue;\n }\n let __config = node.__config;\n let {\n [NODE_REFRESH_LV]: refreshLevel,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_COMPUTED_STYLE]: computedStyle,\n [NODE_IS_MASK]: isMask,\n } = __config;\n // 跳过display:none元素和它的所有子节点和mask\n if(computedStyle[DISPLAY] === 'none') {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n continue;\n }\n // mask不占bbox,本身除外\n if(i !== index && isMask) {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n continue;\n }\n // lv变大说明是child,相等是sibling,变小可能是parent或另一棵子树,根节点是第一个特殊处理\n if(i === index) {}\n else if(lv > lastLv) {\n parentMatrix = lastConfig[NODE_MATRIX_EVENT];\n if(isE(parentMatrix)) {\n parentMatrix = null;\n }\n matrixList.push(parentMatrix);\n parentOpacity = lastConfig[NODE_OPACITY];\n opacityList.push(parentOpacity);\n }\n // 变小出栈索引需注意,可能不止一层,多层计算diff层级\n else if(lv < lastLv) {\n let diff = lastLv - lv;\n matrixList.splice(-diff);\n parentMatrix = matrixList[lv - 1];\n opacityList.splice(-diff);\n parentOpacity = opacityList[lv - 1];\n }\n // 不变是同级兄弟,无需特殊处理 else {}\n lastConfig = __config;\n lastLv = lv;\n let {\n [NODE_CURRENT_STYLE]: currentStyle,\n [NODE_CACHE_STYLE]: __cacheStyle,\n } = __config;\n let matrix, opacity;\n /**\n * lv=REPAINT重新渲染,bbox重新生成,matrix重新生成,filter重新生成\n */\n else {\n node.__bbox = null;\n if(i === index) {\n node.__calFilter(currentStyle, computedStyle);\n }\n matrix = node.__calMatrix(refreshLevel, __cacheStyle, currentStyle, computedStyle, __config);\n assignMatrix(__config[NODE_MATRIX], matrix);\n opacity = computedStyle[OPACITY] = currentStyle[OPACITY];\n }\n // opacity可临时赋值下面循环渲染用,matrixEvent可能需重新计算,因为局部根节点为E没考虑继承,这里仅计算bbox用\n if(i === index) {\n opacity = 1;\n baseMatrix = matrix;\n matrix = mx.identity();\n }\n else if(!isE(parentMatrix)) {\n matrix = multiply(parentMatrix, matrix);\n }\n assignMatrix(__config[NODE_MATRIX_EVENT], matrix);\n __config[NODE_OPACITY] = parentOpacity * opacity;\n let bbox;\n // 子元素有cacheTotal优先使用,一定是子元素,局部根节点available为false不会进\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal]);\n if(target) {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n bbox = target.bbox;\n }\n else {\n bbox = node.bbox;\n }\n // 老的不变,新的会各自重新生成,根据matrixEvent合并bboxTotal\n bbox = transformBbox(bbox, matrix, 0, 0);\n if(i === index) {\n bboxTotal = bbox.slice(0);\n }\n else {\n mergeBbox(bboxTotal, bbox, 0, 0);\n }\n }\n // 生成cacheTotal,获取偏移dx/dy\n config[NODE_CACHE_TOTAL] = cacheTotal = Cache.getInstance(bboxTotal, sx1, sy1);\n if(!cacheTotal || !cacheTotal.enabled) {\n return;\n }\n cacheTotal.__available = true;\n let { dx, dy, dbx, dby, x: tx, y: ty } = cacheTotal;\n let ctxTotal = cacheTotal.ctx;\n /**\n * 再次遍历每个节点,以局部根节点左上角为基准原点,将所有节点绘制上去\n * 每个子节点的opacity有父继承计算在上面循环已经做好了,直接获取\n * 但matrixEvent可能需要重算,因为原点不一定是根节点的原点,影响tfo\n * 另外每个节点的refreshLevel需要设置REPAINT\n * 这样cacheTotal取消时子节点需确保重新计算一次matrix/opacity/filter,保证下次和父元素继承正确\n */\n parentMatrix = null;\n let lastMatrix;\n lastLv = lv;\n // 和外面没cache的类似,mask生成hash记录\n let maskStartHash = {};\n let offscreenHash = {};\n for(let i = index, len = index + (total || 0) + 1; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_LV]: lv,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n } = __structs[i];\n // 排除Text\n if(node instanceof Text) {\n node.render(renderMode, REPAINT, ctxTotal, CHILD, dx, dy);\n if(offscreenHash.hasOwnProperty(i)) {\n ctxTotal = applyOffscreen(ctxTotal, offscreenHash[i], width, height);\n }\n }\n else {\n let __config = node.__config;\n let {\n [NODE_REFRESH_LV]: refreshLevel,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_COMPUTED_STYLE]: computedStyle,\n } = __config;\n if(maskStartHash.hasOwnProperty(i)) {\n let [idx, n, offscreenMask] = maskStartHash[i];\n let target = inject.getCacheCanvas(width, height, null, 'mask2');\n offscreenMask.mask = target; // 应用mask用到\n offscreenMask.isClip = node.isClip;\n // 定位到最后一个mask元素上的末尾\n let j = i + (total || 0) + 1;\n while(--n) {\n let { [STRUCT_TOTAL]: total } = __structs[j];\n j += (total || 0) + 1;\n }\n j--;\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([idx, lv, OFFSCREEN_MASK, offscreenMask]);\n list.push([j, lv, OFFSCREEN_MASK2, {\n ctx: ctxTotal, // 保存等待OFFSCREEN_MASK2时还原\n target,\n }]);\n ctxTotal = target.ctx;\n }\n // lv变大说明是child,相等是sibling,变小可能是parent或另一棵子树,根节点是第一个特殊处理\n if(i === index) {}\n else if(lv > lastLv) {\n parentMatrix = lastMatrix;\n if(isE(parentMatrix)) {\n parentMatrix = null;\n }\n matrixList.push(parentMatrix);\n }\n // 变小出栈索引需注意,可能不止一层,多层计算diff层级\n else if(lv < lastLv) {\n let diff = lastLv - lv;\n matrixList.splice(-diff);\n parentMatrix = matrixList[lv - 1];\n }\n // 不变是同级兄弟,无需特殊处理 else {}\n let {\n [TRANSFORM]: transform,\n [TRANSFORM_ORIGIN]: tfo,\n [DISPLAY]: display,\n } = computedStyle;\n // 特殊渲染的matrix,局部根节点为原点考虑,当需要计算时再计算\n let m;\n if(i !== index && (!isE(parentMatrix) || !isE(transform))) {\n tfo = tfo.slice(0);\n tfo[0] += dbx + node.__sx1 - sx1 + tx;\n tfo[1] += dby + node.__sy1 - sy1 + ty;\n m = tf.calMatrixByOrigin(transform, tfo);\n if(!isE(parentMatrix)) {\n m = multiply(parentMatrix, m);\n }\n }\n else {\n m = null;\n }\n if(m) {\n ctxTotal.setTransform(m[0], m[1], m[4], m[5], m[12], m[13]);\n }\n else {\n ctxTotal.setTransform(1, 0, 0, 1, 0, 0);\n }\n lastLv = lv;\n lastMatrix = m;\n // 子元素有cacheTotal优先使用,也一定是子元素,局部根节点不会进\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal]);\n if(i !== index && target) {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n // 跳过display:none元素和它的所有子节点\n if(display === 'none') {\n continue;\n }\n let mixBlendMode = computedStyle[MIX_BLEND_MODE];\n if(isValidMbm(mixBlendMode)) {\n ctxTotal.globalCompositeOperation = mbmName(mixBlendMode);\n }\n else {\n ctxTotal.globalCompositeOperation = 'source-over';\n }\n ctxTotal.globalAlpha = __config[NODE_OPACITY];\n Cache.drawCache(target, cacheTotal);\n ctxTotal.globalCompositeOperation = 'source-over';\n }\n else {\n if(refreshLevel >= REPAINT) {\n // 手动计算cacheStyle和根据border-box的坐标再渲染\n node.__calCache(renderMode, ctxTotal, __config[NODE_DOM_PARENT],\n __config[NODE_CACHE_STYLE], __config[NODE_CURRENT_STYLE], computedStyle,\n node.clientWidth, node.clientHeight, node.offsetWidth, node.offsetHeight,\n computedStyle[BORDER_TOP_WIDTH], computedStyle[BORDER_RIGHT_WIDTH],\n computedStyle[BORDER_BOTTOM_WIDTH], computedStyle[BORDER_LEFT_WIDTH],\n computedStyle[PADDING_TOP], computedStyle[PADDING_RIGHT],\n computedStyle[PADDING_BOTTOM], computedStyle[PADDING_LEFT],\n node.__sx1, node.__sx2, node.__sx3, node.__sx4, node.__sx5, node.__sx6,\n node.__sy1, node.__sy2, node.__sy3, node.__sy4, node.__sy5, node.__sy6);\n }\n let res = node.render(renderMode, refreshLevel, ctxTotal, i === index ? LOCAL : CHILD, dx, dy);\n __config[NODE_REFRESH_LV] = REPAINT;\n let { offscreenBlend, offscreenMask, offscreenFilter, offscreenOverflow } = res || {};\n // 这里离屏顺序和xom里返回的一致,和下面应用离屏时的list相反\n if(offscreenBlend) {\n let j = i + (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([i, lv, OFFSCREEN_BLEND, offscreenBlend]);\n ctxTotal = offscreenBlend.target.ctx;\n }\n // 被遮罩的节点要为第一个遮罩和最后一个遮罩的索引打标,被遮罩的本身在一个离屏canvas,遮罩的元素在另外一个\n // 最后一个遮罩索引因数量不好计算,放在maskStartHash做\n if(offscreenMask) {\n let j = i + (total || 0);\n maskStartHash[j + 1] = [i, hasMask, offscreenMask];\n ctxTotal = offscreenMask.target.ctx;\n }\n // filter造成的离屏,需要将后续一段孩子节点区域的ctx替换,并在结束后应用结果,再替换回来\n if(offscreenFilter) {\n let j = i + (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([i, lv, OFFSCREEN_FILTER, offscreenFilter]);\n ctxTotal = offscreenFilter.target.ctx;\n }\n // overflow:hidden的离屏,最后孩子进行截取\n if(offscreenOverflow) {\n let j = i + (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([i, lv, OFFSCREEN_OVERFLOW, offscreenOverflow]);\n ctxTotal = offscreenOverflow.target.ctx;\n }\n // 离屏应用,按照lv从大到小即子节点在前先应用,同一个节点多个效果按offscreen优先级从小到大来,\n // 由于mask特殊索引影响,所有离屏都在最后一个mask索引判断,此时mask本身优先结算,以index序大到小判断\n if(offscreenHash.hasOwnProperty(i)) {\n ctxTotal = applyOffscreen(ctxTotal, offscreenHash[i], width, height);\n }\n // render后判断可见状态,此时computedStyle才有值\n if(display === 'none') {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n }\n }\n }\n }\n // 恢复,且局部根节点设置NONE\n assignMatrix(config[NODE_MATRIX_EVENT], baseMatrix);\n config[NODE_REFRESH_LV] = NONE;\n }\n // cacheTotal仍在说明 lastLv) {\n parentMatrix = lastMatrix;\n if(isE(parentMatrix)) {\n parentMatrix = null;\n }\n matrixList.push(parentMatrix);\n parentOpacity = lastOpacity;\n opacityList.push(parentOpacity);\n }\n // 变小出栈索引需注意,可能不止一层,多层计算diff层级\n else if(lv < lastLv) {\n let diff = lastLv - lv;\n matrixList.splice(-diff);\n parentMatrix = matrixList[lv - 1];\n opacityList.splice(-diff);\n parentOpacity = opacityList[lv - 1];\n }\n // 不变是同级兄弟,无需特殊处理 else {}\n lastLv = lv;\n // 计算临时的matrix\n let {\n [DISPLAY]: display,\n [TRANSFORM]: transform,\n [TRANSFORM_ORIGIN]: tfo,\n } = computedStyle;\n // 特殊渲染的matrix,局部根节点为原点考虑,本节点需inverse反向\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal]);\n if(target) {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n // 跳过display:none元素和它的所有子节点\n if(display === 'none') {\n continue;\n }\n let mixBlendMode = computedStyle[MIX_BLEND_MODE];\n if(isValidMbm(mixBlendMode)) {\n ctx.globalCompositeOperation = mbmName(mixBlendMode);\n }\n else {\n ctx.globalCompositeOperation = 'source-over';\n }\n ctx.globalAlpha = __config[NODE_OPACITY];\n Cache.drawCache(target, cacheMask, transform, mx.identity(), tfo.slice(0), parentMatrix, inverse);\n ctx.globalCompositeOperation = 'source-over';\n }\n // 等于将外面bbox计算和渲染合一的过程,但不需要bbox本身的内容\n else {\n let {\n [NODE_CURRENT_STYLE]: currentStyle,\n [NODE_CACHE_STYLE]: __cacheStyle,\n } = __config;\n let matrix, opacity;\n if(refreshLevel < REPAINT) {\n if(contain(refreshLevel, TRANSFORM_ALL)) {\n matrix = node.__calMatrix(refreshLevel, __cacheStyle, currentStyle, computedStyle, __config);\n assignMatrix(__config[NODE_MATRIX], matrix);\n }\n else {\n matrix = __config[NODE_MATRIX];\n }\n if(contain(refreshLevel, OP)) {\n computedStyle[OPACITY] = currentStyle[OPACITY];\n }\n opacity = computedStyle[OPACITY];\n if(contain(refreshLevel, FT)) {\n node.__bbox = null;\n node.__calFilter(currentStyle, computedStyle);\n }\n matrix = __config[NODE_MATRIX];\n if(contain(refreshLevel, MBM)) {\n computedStyle[MIX_BLEND_MODE] = currentStyle[MIX_BLEND_MODE];\n }\n }\n else {\n node.__bbox = null;\n if(i === index) {\n node.__calFilter(currentStyle, computedStyle);\n }\n matrix = node.__calMatrix(refreshLevel, __cacheStyle, currentStyle, computedStyle, __config);\n assignMatrix(__config[NODE_MATRIX], matrix);\n opacity = computedStyle[OPACITY] = currentStyle[OPACITY];\n }\n // opacity可临时赋值下面循环渲染用,matrixEvent可能需重新计算,因为局部根节点为E没考虑继承,这里仅计算bbox用\n if(i === index) {\n opacity = 1;\n matrix = mx.identity();\n }\n else if(parentMatrix) {\n matrix = multiply(parentMatrix, matrix);\n }\n assignMatrix(__config[NODE_MATRIX_EVENT], matrix);\n lastOpacity = __config[NODE_OPACITY] = parentOpacity * opacity;\n // 特殊渲染的matrix,局部根节点为原点考虑,当需要计算时再计算\n let m;\n if(i !== index && (!isE(parentMatrix) || !isE(transform))) {\n tfo = tfo.slice(0);\n tfo[0] += dbx + node.__sx1 - sx1 + tx;\n tfo[1] += dby + node.__sy1 - sy1 + ty;\n m = tf.calMatrixByOrigin(transform, tfo);\n if(!isE(parentMatrix)) {\n m = multiply(parentMatrix, m);\n }\n }\n else {\n m = null;\n }\n lastMatrix = m;\n if(m) {\n // 很多情况mask和target相同matrix,可简化计算\n if(util.equalArr(m, inverse)) {\n m = mx.identity();\n }\n else {\n inverse = mx.inverse(inverse);\n m = mx.multiply(inverse, m);\n }\n }\n if(m) {\n ctx.setTransform(m[0], m[1], m[4], m[5], m[12], m[13]);\n }\n else {\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n }\n if(refreshLevel >= REPAINT) {\n // 手动计算cacheStyle和根据border-box的坐标再渲染\n node.__calCache(renderMode, ctx, __config[NODE_DOM_PARENT],\n __config[NODE_CACHE_STYLE], __config[NODE_CURRENT_STYLE], computedStyle,\n node.clientWidth, node.clientHeight, node.offsetWidth, node.offsetHeight,\n computedStyle[BORDER_TOP_WIDTH], computedStyle[BORDER_RIGHT_WIDTH],\n computedStyle[BORDER_BOTTOM_WIDTH], computedStyle[BORDER_LEFT_WIDTH],\n computedStyle[PADDING_TOP], computedStyle[PADDING_RIGHT],\n computedStyle[PADDING_BOTTOM], computedStyle[PADDING_LEFT],\n node.__sx1, node.__sx2, node.__sx3, node.__sx4, node.__sx5, node.__sx6,\n node.__sy1, node.__sy2, node.__sy3, node.__sy4, node.__sy5, node.__sy6);\n }\n let res = node.render(renderMode, refreshLevel, ctx, CHILD, dx, dy);\n __config[NODE_REFRESH_LV] = REPAINT;\n let { offscreenBlend, offscreenMask, offscreenFilter, offscreenOverflow } = res || {};\n // 这里离屏顺序和xom里返回的一致,和下面应用离屏时的list相反\n if(offscreenBlend) {\n let j = i + (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([i, lv, OFFSCREEN_BLEND, offscreenBlend]);\n ctx = offscreenBlend.target.ctx;\n }\n // 被遮罩的节点要为第一个遮罩和最后一个遮罩的索引打标,被遮罩的本身在一个离屏canvas,遮罩的元素在另外一个\n // 最后一个遮罩索引因数量不好计算,放在maskStartHash做\n if(offscreenMask) {\n let j = i + (total || 0);\n maskStartHash[j + 1] = [i, hasMask, offscreenMask];\n ctx = offscreenMask.target.ctx;\n }\n // filter造成的离屏,需要将后续一段孩子节点区域的ctx替换,并在结束后应用结果,再替换回来\n if(offscreenFilter) {\n let j = i + (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([i, lv, OFFSCREEN_FILTER, offscreenFilter]);\n ctx = offscreenFilter.target.ctx;\n }\n // overflow:hidden的离屏,最后孩子进行截取\n if(offscreenOverflow) {\n let j = i + (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([i, lv, OFFSCREEN_OVERFLOW, offscreenOverflow]);\n ctx = offscreenOverflow.target.ctx;\n }\n // 离屏应用,按照lv从大到小即子节点在前先应用,同一个节点多个效果按offscreen优先级从小到大来,\n // 由于mask特殊索引影响,所有离屏都在最后一个mask索引判断,此时mask本身优先结算,以index序大到小判断\n if(offscreenHash.hasOwnProperty(i)) {\n ctx = applyOffscreen(ctx, offscreenHash[i], width, height);\n }\n // render后判断可见状态,此时computedStyle才有值\n if(display === 'none') {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n }\n }\n }\n }\n });\n }\n }\n}\n\nfunction genFilter(node, cache, v) {\n return Cache.genFilter(cache, v);\n}\n\nfunction genMask(node, cache, cb) {\n return Cache.genMask(cache, node, cb);\n}\n\nfunction genOverflow(node, cache) {\n let sbox = node.bbox;\n let bbox = cache.bbox;\n // 没超过无需生成\n if(bbox[0] >= sbox[0] && bbox[1] >= sbox[1] && bbox[2] <= sbox[2] && bbox[3] <= sbox[3]) {\n return;\n }\n return Cache.genOverflow(cache, node);\n}\n\nfunction resetMatrixCacheTotal(__structs, index, total, lv, matrixEvent) {\n let matrixList = [];\n let parentMatrix;\n let lastMatrix = matrixEvent;\n let lastLv = lv;\n for(let i = index + 1, len = index + (total || 0) + 1; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_LV]: lv,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n } = __structs[i];\n // 排除Text\n if(node instanceof Text) {\n continue;\n }\n let __config = node.__config;\n let {\n [NODE_MATRIX_EVENT]: old,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CURRENT_STYLE]: currentStyle,\n [NODE_COMPUTED_STYLE]: computedStyle,\n [NODE_CACHE_STYLE]: cacheStyle,\n } = __config;\n // 跳过display:none元素和它的所有子节点和mask\n if(computedStyle[DISPLAY] === 'none') {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n continue;\n }\n // lv变大说明是child,相等是sibling,变小可能是parent或另一棵子树\n if(lv > lastLv) {\n parentMatrix = lastMatrix;\n if(isE(parentMatrix)) {\n parentMatrix = null;\n }\n matrixList.push(parentMatrix);\n }\n // 变小出栈索引需注意,可能不止一层,多层计算diff层级\n else if(lv < lastLv) {\n let diff = lastLv - lv;\n matrixList.splice(-diff);\n parentMatrix = matrixList[lv - 1];\n }\n // 不变是同级兄弟,无需特殊处理 else {}\n lastLv = lv;\n old = old.slice(0);\n // 计算真正的相对于root原点的matrix\n cacheStyle[MATRIX] = null;\n let matrix = node.__calMatrix(REPAINT, cacheStyle, currentStyle, computedStyle, __config);\n assignMatrix(__config[NODE_MATRIX], matrix);\n if(!isE(parentMatrix)) {\n matrix = multiply(parentMatrix, matrix);\n }\n assignMatrix(__config[NODE_MATRIX_EVENT], matrix);\n lastMatrix = matrix;\n // 深度遍历递归进行\n if(__cacheTotal && __cacheTotal.available) {\n let needReset = __cacheTotal.isNew;\n if(!needReset && !util.equalArr(old, matrix)) {\n needReset = true;\n }\n if(needReset) {\n resetMatrixCacheTotal(__structs, i, total || 0, lv, matrix);\n }\n __cacheTotal.__isNew = false;\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n }\n }\n}\n\n/**\n * canvas/webgl支持任意节点为mask,不像svg仅单节点\n * hasMask的num是指遮罩对象后面的兄弟节点数,需要换算成包含子节点的总数\n * @param __structs\n * @param start\n * @param hasMask\n */\nfunction countMaskNum(__structs, start, hasMask) {\n let count = 0;\n while(hasMask--) {\n let {\n [STRUCT_TOTAL]: total,\n } = __structs[start];\n count += total || 0;\n start += total || 0;\n // total不算自身,所以还得+1\n count++;\n start++;\n }\n return count;\n}\n\n// webgl不太一样,使用fbo离屏绘制到一个纹理上进行汇总\nfunction genFrameBufferWithTexture(gl, texCache, width, height) {\n let n = texCache.lockOneChannel();\n let texture = webgl.createTexture(gl, null, n, width, height);\n let frameBuffer = gl.createFramebuffer();\n gl.bindFramebuffer(gl.FRAMEBUFFER, frameBuffer);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);\n let check = gl.checkFramebufferStatus(gl.FRAMEBUFFER);\n if(check !== gl.FRAMEBUFFER_COMPLETE) {\n inject.error('Framebuffer object is incomplete: ' + check.toString());\n }\n // 离屏窗口0开始\n gl.viewport(0, 0, width, height);\n gl.clearColor(0, 0, 0, 0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n return [n, frameBuffer, texture];\n}\n\n/**\n * 局部根节点复合图层生成,汇总所有子节点到一颗局部树上的位图缓存,包含超限特殊情况\n * 即便只有自己一个也要返回,因为webgl生成total的原因是有类似filter/mask等必须离屏处理的东西\n * @param gl\n * @param texCache\n * @param node\n * @param __config\n * @param index\n * @param total\n * @param __structs\n * @param cache\n * @param limitCache\n * @param hasMbm\n * @param W\n * @param H\n * @returns {*}\n */\nfunction genTotalWebgl(gl, texCache, node, __config, index, total, __structs, cache, limitCache, hasMbm, W, H) {\n // 存每层父亲的matrix和opacity和index,bbox计算过程中生成,缓存给下面渲染过程用\n let parentIndexHash = {};\n let opacityHash = {};\n let [bboxTotal, parentPm] = genBboxTotal(node, __structs, index, total, parentIndexHash, opacityHash,\n gl.getParameter(gl.MAX_TEXTURE_SIZE), limitCache);\n // 可能局部根节点合成过程中发现整体超限\n let totalLimitCache;\n if(!bboxTotal) {\n totalLimitCache = true;\n }\n // 超限情况生成画布大小的特殊纹理\n if(limitCache || totalLimitCache) {\n bboxTotal = [0, 0, W, H];\n }\n let width = bboxTotal[2] - bboxTotal[0];\n let height = bboxTotal[3] - bboxTotal[1];\n let [n, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n // 以bboxTotal的左上角为原点生成离屏texture\n let { __sx1: sx1, __sy1: sy1 } = node;\n let cx = width * 0.5, cy = height * 0.5;\n let dx = -bboxTotal[0], dy = -bboxTotal[1];\n let dbx = sx1 - bboxTotal[0], dby = sy1 - bboxTotal[1];\n // 先绘制自己的cache,起点所以matrix视作E为空,opacity固定1\n if(cache && cache.available) {\n texCache.addTexAndDrawWhenLimit(gl, cache, 1, null, cx, cy, dx, dy, false);\n }\n // limitCache无cache需先绘制到统一的离屏画布上\n else if(limitCache) {\n let c = inject.getCacheCanvas(width, height, '__$$OVERSIZE$$__');\n node.render(mode.WEBGL, 0, gl, NA, 0, 0);\n let j = texCache.lockOneChannel();\n let texture = webgl.createTexture(gl, c.canvas, j);\n let mockCache = new MockCache(gl, texture, 0, 0, width, height, [0, 0, width, height]);\n texCache.addTexAndDrawWhenLimit(gl, mockCache, 1, null, cx, cy, 0, 0, false);\n texCache.refresh(gl, cx, cy);\n c.ctx.setTransform(1, 0, 0, 1, 0, 0);\n c.ctx.globalAlpha = 1;\n c.ctx.clearRect(0, 0, width, height);\n mockCache.release();\n texCache.releaseLockChannel(j);\n }\n // 因为cacheTotal不总是以左上角原点为开始,所以必须每个节点重算matrix,合并box时计算的无法用到\n let matrixHash = {};\n // 先序遍历汇总到total\n for(let i = index + 1, len = index + (total || 0) + 1; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n } = __structs[i];\n let __config = node.__config;\n let parentIndex = parentIndexHash[i];\n let matrix = matrixHash[parentIndex]; // 父节点的在每个节点计算后保存,第一个为top的默认为E(空)\n let opacity = opacityHash[i]; // opacity在合并box时已经计算可以直接用\n // 先看text,visibility会在内部判断,display会被parent判断\n if(node instanceof Text) {\n if(parentPm) {\n matrix = multiply(parentPm, matrix);\n }\n texCache.addTexAndDrawWhenLimit(gl, __config[NODE_CACHE], opacity, matrix, cx, cy, dx, dy, false);\n }\n // 再看total缓存/cache,都没有的是无内容的Xom节点\n else {\n let {\n [NODE_CACHE]: __cache,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_IS_MASK]: isMask,\n [NODE_COMPUTED_STYLE]: {\n [DISPLAY]: display,\n [VISIBILITY]: visibility,\n [TRANSFORM]: transform,\n [TRANSFORM_ORIGIN]: transformOrigin,\n [MIX_BLEND_MODE]: mixBlendMode,\n },\n } = __config;\n if(display === 'none') {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n continue;\n }\n // mask和不可见不能被汇总到top上\n if((visibility === 'hidden' || isMask) && !node.hookGlRender) {\n continue;\n }\n if(transform && !isE(transform)) {\n let tfo = transformOrigin.slice(0);\n // total下的节点tfo的计算,以total为原点,差值坐标即相对坐标\n if(__cache && __cache.available) {\n tfo[0] += __cache.sx1;\n tfo[1] += __cache.sy1;\n }\n else {\n tfo[0] += node.__sx1;\n tfo[1] += node.__sy1;\n }\n let dx = -sx1 + dbx;\n let dy = -sy1 + dby;\n tfo[0] += dx;\n tfo[1] += dy;\n let m = tf.calMatrixByOrigin(transform, tfo);\n if(matrix) {\n matrix = multiply(matrix, m);\n }\n else {\n matrix = m;\n }\n }\n if(matrix) {\n matrixHash[i] = matrix;\n }\n if(parentPm) {\n matrix = multiply(parentPm, matrix);\n }\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal, __cache]);\n if(target) {\n // 局部的mbm和主画布一样,先刷新当前fbo,然后把后面这个mbm节点绘入一个新的等画布尺寸的fbo中,再进行2者mbm合成\n if(isValidMbm(mixBlendMode)) {\n texCache.refresh(gl, cx, cy);\n let [n2, frameBuffer2, texture2] = genFrameBufferWithTexture(gl, texCache, width, height);\n texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrix, cx, cy, dx, dy, false);\n texCache.refresh(gl, cx, cy);\n // 合成结果作为当前frameBuffer,以及纹理和单元,等于替代了当前fbo作为绘制对象\n [n, frameBuffer, texture] = genMbmWebgl(gl, texCache, n, n2, frameBuffer, texture, mbmName(mixBlendMode), width, height);\n gl.deleteFramebuffer(frameBuffer2);\n gl.deleteTexture(texture2);\n }\n else {\n texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrix, cx, cy, dx, dy, false);\n }\n if(target !== __cache) {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n }\n }\n // webgl特殊的外部钩子,比如粒子组件自定义渲染时调用\n if(node.hookGlRender) {\n node.hookGlRender(gl, opacity, matrix, cx, cy, dx, dy, false);\n }\n }\n }\n if(node.hookGlRender) {\n node.hookGlRender(gl, 1, null, cx, cy, dx, dy, false);\n }\n // 绘制到fbo的纹理对象上并删除fbo恢复\n texCache.refresh(gl, cx, cy);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.viewport(0, 0, W, H);\n gl.deleteFramebuffer(frameBuffer);\n // 生成的纹理对象本身已绑定一个纹理单元了,释放lock的同时可以给texCache的channel缓存,避免重复上传\n let mockCache = new MockCache(gl, texture, sx1, sy1, width, height, bboxTotal);\n texCache.releaseLockChannel(n, mockCache.page);\n return [limitCache || totalLimitCache, mockCache];\n}\n\nfunction genFilterWebgl(gl, texCache, node, cache, filter, W, H) {\n let { sx1, sy1, width, height, bbox } = cache;\n let mockCache = cache;\n filter.forEach(item => {\n let [k, v] = item;\n if(k === 'blur' && v > 0) {\n let res = genBlurWebgl(gl, texCache, mockCache, v, width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'hue-rotate') {\n let rotation = geom.d2r(v % 360);\n let cosR = Math.cos(rotation);\n let sinR = Math.sin(rotation);\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n 0.213 + cosR * 0.787 - sinR * 0.213, 0.715 - cosR * 0.715 - sinR * 0.715, 0.072 - cosR * 0.072 + sinR * 0.928, 0, 0,\n 0.213 - cosR * 0.213 + sinR * 0.143, 0.715 + cosR * 0.285 + sinR * 0.140, 0.072 - cosR * 0.072 - sinR * 0.283, 0, 0,\n 0.213 - cosR * 0.213 - sinR * 0.787, 0.715 - cosR * 0.715 + sinR * 0.715, 0.072 + cosR * 0.928 + sinR * 0.072, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'saturate' && v !== 100) {\n let amount = v * 0.01;\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n 0.213 + 0.787 * amount, 0.715 - 0.715 * amount, 0.072 - 0.072 * amount, 0, 0,\n 0.213 - 0.213 * amount, 0.715 + 0.285 * amount, 0.072 - 0.072 * amount, 0, 0,\n 0.213 - 0.213 * amount, 0.715 - 0.715 * amount, 0.072 + 0.928 * amount, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'brightness' && v !== 100) {\n let b = v * 0.01;\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n b, 0, 0, 0, 0,\n 0, b, 0, 0, 0,\n 0, 0, b, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'grayscale' && v > 0) {\n v = Math.min(v, 100);\n let oneMinusAmount = 1 - v * 0.01;\n if(oneMinusAmount < 0) {\n oneMinusAmount = 0;\n }\n else if(oneMinusAmount > 1) {\n oneMinusAmount = 1;\n }\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n 0.2126 + 0.7874 * oneMinusAmount, 0.7152 - 0.7152 * oneMinusAmount, 0.0722 - 0.0722 * oneMinusAmount, 0, 0,\n 0.2126 - 0.2126 * oneMinusAmount, 0.7152 + 0.2848 * oneMinusAmount, 0.0722 - 0.0722 * oneMinusAmount, 0, 0,\n 0.2126 - 0.2126 * oneMinusAmount, 0.7152 - 0.7152 * oneMinusAmount, 0.0722 + 0.9278 * oneMinusAmount, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'contrast' && v !== 100) {\n let amount = v * 0.01;\n let o = -0.5 * amount + 0.5;\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n amount, 0, 0, 0, o,\n 0, amount, 0, 0, o,\n 0, 0, amount, 0, o,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'sepia' && v > 0) {\n v = Math.min(v, 100);\n let oneMinusAmount = 1 - v * 0.01;\n if(oneMinusAmount < 0) {\n oneMinusAmount = 0;\n }\n else if(oneMinusAmount > 1) {\n oneMinusAmount = 1;\n }\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n 0.393 + 0.607 * oneMinusAmount, 0.769 - 0.769 * oneMinusAmount, 0.189 - 0.189 * oneMinusAmount, 0, 0,\n 0.349 - 0.349 * oneMinusAmount, 0.686 + 0.314 * oneMinusAmount, 0.168 - 0.168 * oneMinusAmount, 0, 0,\n 0.272 - 0.272 * oneMinusAmount, 0.534 - 0.534 * oneMinusAmount, 0.131 + 0.869 * oneMinusAmount, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'invert' && v > 0) {\n v = Math.min(v, 100);\n let o = v * 0.01;\n let amount = 1 - 2 * o;\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n amount, 0, 0, 0, o,\n 0, amount, 0, 0, o,\n 0, 0, amount, 0, o,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n });\n // 切换回主程序\n gl.useProgram(gl.program);\n gl.viewport(0, 0, W, H);\n return mockCache;\n}\n\n/**\n * https://www.w3.org/TR/2018/WD-filter-effects-1-20181218/#feGaussianBlurElement\n * 根据cacheTotal生成cacheFilter,按照css规范的优化方法执行3次,避免卷积核d扩大3倍性能慢\n * 规范的优化方法对d的值分奇偶优化,这里再次简化,d一定是奇数,即卷积核大小\n * 先动态生成gl程序,默认3核源码示例已注释,根据sigma获得d(一定奇数),再计算权重\n * 然后将d尺寸和权重拼接成真正程序并编译成program,再开始绘制\n */\nfunction genBlurWebgl(gl, texCache, cache, sigma, width, height, sx1, sy1, bbox) {\n let d = blur.kernelSize(sigma);\n let max = Math.max(15, gl.getParameter(gl.MAX_VARYING_VECTORS));\n while(d > max) {\n d -= 2;\n }\n let spread = blur.outerSizeByD(d);\n width += spread * 2;\n height += spread * 2;\n // 防止超限,webgl最大纹理尺寸限制\n let limit = gl.getParameter(gl.MAX_TEXTURE_SIZE);\n if(width > limit || height > limit) {\n return;\n }\n bbox = bbox.slice(0);\n bbox[0] -= spread;\n bbox[1] -= spread;\n bbox[2] += spread;\n bbox[3] += spread;\n let cx = width * 0.5, cy = height * 0.5;\n let weights = blur.gaussianWeight(sigma, d);\n let vert = '';\n let frag = '';\n let r = Math.floor(d * 0.5);\n for(let i = 0; i < r; i++) {\n let c = (r - i) * 0.01;\n vert += `v_texCoordsBlur[${i}] = a_texCoords + vec2(-${c}, -${c}) * u_direction;`;\n frag += `gl_FragColor += texture2D(u_texture, v_texCoordsBlur[${i}]) * ${weights[i]};`;\n }\n vert += `v_texCoordsBlur[${r}] = a_texCoords;`;\n frag += `gl_FragColor += texture2D(u_texture, v_texCoordsBlur[${r}]) * ${weights[r]};`;\n for(let i = 0; i < r; i++) {\n let c = (i + 1) * 0.01;\n vert += `v_texCoordsBlur[${i + r + 1}] = a_texCoords + vec2(${c}, ${c}) * u_direction;`;\n frag += `gl_FragColor += texture2D(u_texture, v_texCoordsBlur[${i + r + 1}]) * ${weights[i + r + 1]};`;\n }\n vert = vertexBlur.replace('[3]', '[' + d + ']').replace(/}$/, vert + '}');\n frag = fragmentBlur.replace('[3]', '[' + d + ']').replace(/}$/, frag + '}');\n let program = webgl.initShaders(gl, vert, frag);\n gl.useProgram(program);\n let [i, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n // 将本身total的page纹理放入一个单元,一般刚生成已经在了,少部分情况变更引发的可能不在\n let j = texCache.findExistTexChannel(cache.page);\n if(j === -1) {\n // 直接绑定,因为一定是个mockCache\n j = texCache.lockOneChannel();\n webgl.bindTexture(gl, cache.page.texture, j);\n }\n else {\n texCache.lockChannel(j);\n }\n texture = webgl.drawBlur(gl, program, frameBuffer, texCache, texture, cache.page.texture, i, j,\n width, height, cx, cy, spread, d, sigma);\n // 销毁这个临时program\n gl.deleteShader(program.vertexShader);\n gl.deleteShader(program.fragmentShader);\n gl.deleteProgram(program);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.deleteFramebuffer(frameBuffer);\n texCache.releaseLockChannel(j);\n let mockCache = new MockCache(gl, texture, sx1, sy1, width, height, bbox);\n texCache.releaseLockChannel(i, mockCache.page);\n return [mockCache, width, height, bbox];\n}\n\nfunction genColorMatrixWebgl(gl, texCache, cache, m, width, height, sx1, sy1, bbox) {\n // 生成最终纹理,尺寸为被遮罩节点大小\n let [i, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n // 将本身total的page纹理放入一个单元,一般刚生成已经在了,少部分情况变更引发的可能不在\n let j = texCache.findExistTexChannel(cache.page);\n if(j === -1) {\n // 直接绑定,因为一定是个mockCache\n j = texCache.lockOneChannel();\n webgl.bindTexture(gl, cache.page.texture, j);\n }\n else {\n texCache.lockChannel(j);\n }\n gl.useProgram(gl.programCm);\n webgl.drawCm(gl, gl.programCm, j, m);\n texCache.releaseLockChannel(j);\n // 切回\n gl.useProgram(gl.program);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.deleteFramebuffer(frameBuffer);\n // 同total一样生成一个mockCache\n let mockCache = new MockCache(gl, texture, sx1, sy1, width, height, bbox.slice(0));\n texCache.releaseLockChannel(i, mockCache.page);\n return [mockCache, width, height, bbox];\n}\n\nfunction genOverflowWebgl(gl, texCache, node, cache, W, H) {\n let sbox = node.bbox.slice(0);\n let bbox = cache.bbox;\n // 没超过无需生成\n if(bbox[0] >= sbox[0] && bbox[1] >= sbox[1] && bbox[2] <= sbox[2] && bbox[3] <= sbox[3]) {\n return;\n }\n let width = sbox[2] - sbox[0], height = sbox[3] - sbox[1];\n // 生成最终纹理,尺寸为被遮罩节点大小\n let [i, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n // 将本身total的page纹理放入一个单元,一般刚生成已经在了,少部分情况变更引发的可能不在\n let j = texCache.findExistTexChannel(cache.page);\n if(j === -1) {\n // 直接绑定,因为一定是个mockCache\n j = texCache.lockOneChannel();\n webgl.bindTexture(gl, cache.page.texture, j);\n }\n else {\n texCache.lockChannel(j);\n }\n // 绘制,根据坐标裁剪使用原本纹理的一部分\n gl.useProgram(gl.programOverflow);\n webgl.drawOverflow(gl, j, sbox[0] - bbox[0], sbox[1] - bbox[1], width, height, cache.width, cache.height);\n texCache.releaseLockChannel(j);\n // 切回\n gl.useProgram(gl.program);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.viewport(0, 0, W, H);\n gl.deleteFramebuffer(frameBuffer);\n // 同total一样生成一个mockCache\n let overflowCache = new MockCache(gl, texture, cache.sx1, cache.sy1, width, height, sbox);\n texCache.releaseLockChannel(i, overflowCache.page);\n return overflowCache;\n}\n\nfunction genMaskWebgl(gl, texCache, node, __config, cache, W, H, lv, __structs) {\n let { sx1, sy1, width, height, bbox, dx, dy } = cache;\n // cache一定是mockCache,可能是total/filter/overflow一种\n let cx = width * 0.5, cy = height * 0.5;\n // 先求得被遮罩的matrix,用作inverse给mask计算\n let {\n [NODE_COMPUTED_STYLE]: {\n [TRANSFORM]: transform,\n [TRANSFORM_ORIGIN]: transformOrigin,\n },\n } = __config;\n let inverse;\n if(isE(transform)) {\n inverse = mx.identity();\n }\n else {\n let tfo = transformOrigin.slice(0);\n tfo[0] += sx1 + dx;\n tfo[1] += sy1 + dy;\n inverse = tf.calMatrixByOrigin(transform, tfo);\n }\n inverse = mx.inverse(inverse);\n // 将所有mask绘入一个单独纹理中,尺寸和原点与被遮罩total相同,才能做到顶点坐标一致\n let [i, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n let next = node.next;\n let isClip = next.isClip;\n let list = [];\n while(next && next.isMask && next.isClip === isClip) {\n list.push(next);\n next = next.next;\n }\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n let matrixList = [];\n let parentMatrix;\n let lastMatrix;\n let opacityList = [];\n let parentOpacity = 1;\n let lastOpacity;\n let lastLv = lv;\n let {\n [STRUCT_INDEX]: index,\n [STRUCT_TOTAL]: total,\n } = item.__config[NODE_STRUCT];\n // 可以忽略mbm,因为只有透明遮罩\n for(let i = index, len = index + (total || 0) + 1; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_LV]: lv,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n } = __structs[i];\n let __config = node.__config;\n let {\n [NODE_CACHE]: __cache,\n [NODE_COMPUTED_STYLE]: computedStyle,\n [NODE_LIMIT_CACHE]: limitCache,\n } = __config;\n // 跳过display:none元素和它的所有子节点和mask\n if(computedStyle[DISPLAY] === 'none') {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n continue;\n }\n if(node instanceof Text) {\n if(__cache && __cache.available) {\n // text用父级的matrixEvent,在之前texCache添加到末尾了\n texCache.addTexAndDrawWhenLimit(gl, __cache, parentOpacity, texCache.last[2], cx, cy, 0, 0,true);\n }\n else if(limitCache) {\n return;\n }\n }\n else {\n let {\n [NODE_CACHE]: __cache,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_COMPUTED_STYLE]: {\n [OPACITY]: opacity,\n [TRANSFORM]: transform,\n [TRANSFORM_ORIGIN]: transformOrigin,\n },\n } = __config;\n // lv变大说明是child,相等是sibling,变小可能是parent或另一棵子树,根节点是第一个特殊处理\n if(i === index) {}\n else if(lv > lastLv) {\n parentMatrix = lastMatrix;\n if(isE(parentMatrix)) {\n parentMatrix = null;\n }\n matrixList.push(parentMatrix);\n parentOpacity = lastOpacity;\n opacityList.push(parentOpacity);\n }\n // 变小出栈索引需注意,可能不止一层,多层计算diff层级\n else if(lv < lastLv) {\n let diff = lastLv - lv;\n matrixList.splice(-diff);\n parentMatrix = matrixList[lv - 1];\n opacityList.splice(-diff);\n parentOpacity = opacityList[lv - 1];\n }\n // 不变是同级兄弟,无需特殊处理 else {}\n lastLv = lv;\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal, __cache]);\n // total和自身cache的尝试,visibility不可见时没有cache\n if(target) {\n let m;\n if(isE(transform)) {\n m = mx.identity();\n }\n else {\n let tfo = transformOrigin.slice(0);\n tfo[0] += target.bbox[0] + dx;\n tfo[1] += target.bbox[1] + dy;\n m = tf.calMatrixByOrigin(transform, tfo);\n }\n m = mx.multiply(inverse, m);\n let tfo = transformOrigin.slice(0);\n tfo[0] += target.bbox[0] + dx;\n tfo[1] += target.bbox[1] + dy;\n lastMatrix = tf.calMatrixByOrigin(transform, tfo);\n if(!isE(parentMatrix)) {\n lastMatrix = multiply(parentMatrix, lastMatrix);\n }\n lastOpacity = parentOpacity * opacity;\n texCache.addTexAndDrawWhenLimit(gl, target, lastOpacity, m, cx, cy, dx, dy, true);\n if(target !== __cache) {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n }\n }\n else if(limitCache) {\n return;\n }\n }\n }\n }\n texCache.refresh(gl, cx, cy);\n gl.deleteFramebuffer(frameBuffer);\n // 将本身total的page纹理放入一个单元,一般刚生成已经在了,少部分情况mask变更引发的可能不在\n let j = texCache.findExistTexChannel(cache.page);\n if(j === -1) {\n // 直接绑定,因为一定是个mockCache\n j = texCache.lockOneChannel();\n webgl.bindTexture(gl, cache.page.texture, j);\n }\n else {\n texCache.lockChannel(j);\n }\n // 生成最终纹理,汇总total和maskCache\n let [n, frameBuffer2, texture2] = genFrameBufferWithTexture(gl, texCache, width, height);\n let program;\n if(isClip) {\n program = gl.programClip;\n }\n else {\n program = gl.programMask;\n }\n gl.useProgram(program);\n webgl.drawMask(gl, i, j, program);\n gl.deleteTexture(texture);\n texCache.releaseLockChannel(i);\n texCache.releaseLockChannel(j);\n // 切换回主程序\n gl.useProgram(gl.program);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.viewport(0, 0, W, H);\n gl.deleteFramebuffer(frameBuffer2);\n // 同total一样生成一个mockCache\n let maskCache = new MockCache(gl, texture2, sx1, sy1, width, height, bbox);\n texCache.releaseLockChannel(n, maskCache.page);\n return maskCache;\n}\n\n/**\n * 生成blendMode混合fbo纹理结果,原本是所有元素向一个fbo记A进行绘制,当出现mbm时,进入到这里,\n * 先生成一个新的fbo记B,将A和待混合节点进行对应的mbm模式混合,结果绘制到B中,然后返回B来替换A,包括纹理单元\n * @param gl\n * @param texCache\n * @param i 之前已有的fbo和纹理单元\n * @param j 当前节点绘制的fbo和纹理单元\n * @param mbm\n * @param fbo 之前舞台绑定的fbo和纹理\n * @param tex\n * @param W\n * @param H\n * @returns {number|*}\n */\nfunction genMbmWebgl(gl, texCache, i, j, fbo, tex, mbm, W, H) {\n let frag;\n mbm = mbmName(mbm);\n if(mbm === 'multiply') {\n frag = fragmentMultiply;\n }\n else if(mbm === 'screen') {\n frag = fragmentScreen;\n }\n else if(mbm === 'overlay') {\n frag = fragmentOverlay;\n }\n else if(mbm === 'darken') {\n frag = fragmentDarken;\n }\n else if(mbm === 'lighten') {\n frag = fragmentLighten;\n }\n else if(mbm === 'color-dodge') {\n frag = fragmentColorDodge;\n }\n else if(mbm === 'color-burn') {\n frag = fragmentColorBurn;\n }\n else if(mbm === 'hard-light') {\n frag = fragmentHardLight;\n }\n else if(mbm === 'soft-light') {\n frag = fragmentSoftLight;\n }\n else if(mbm === 'difference') {\n frag = fragmentDifference;\n }\n else if(mbm === 'exclusion') {\n frag = fragmentExclusion;\n }\n else if(mbm === 'hue') {\n frag = fragmentHue;\n }\n else if(mbm === 'saturation') {\n frag = fragmentSaturation;\n }\n else if(mbm === 'color') {\n frag = fragmentColor;\n }\n else if(mbm === 'luminosity') {\n frag = fragmentLuminosity;\n }\n let program = webgl.initShaders(gl, vertexMbm, frag);\n gl.useProgram(program);\n // 生成新的fbo,将混合结果绘入\n let [n, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, W, H);\n webgl.drawMbm(gl, program, i, j, W, H);\n // 切换回主程序并销毁这个临时program\n gl.useProgram(gl.program);\n gl.deleteShader(program.vertexShader);\n gl.deleteShader(program.fragmentShader);\n gl.deleteProgram(program);\n gl.deleteFramebuffer(fbo);\n gl.deleteTexture(tex);\n texCache.releaseLockChannel(i);\n texCache.releaseLockChannel(j);\n return [n, frameBuffer, texture];\n}\n\nfunction renderSvg(renderMode, ctx, root, isFirst) {\n let { __structs, width, height } = root;\n // mask节点很特殊,本身有matrix会影响,本身没改变但对象节点有改变也需要计算逆矩阵应用顶点\n let maskEffectHash = {};\n if(!isFirst) {\n // 先遍历一遍收集完全不变的defs,缓存起来id,随后再执行遍历渲染生成新的,避免掉重复的id\n for(let i = 0, len = __structs.length; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n } = __structs[i];\n let {\n [NODE_REFRESH_LV]: refreshLevel,\n [NODE_DEFS_CACHE]: defsCache,\n } = node.__config;\n // 只要涉及到matrix和opacity就影响mask\n let hasEffectMask = hasMask && (refreshLevel >= REPAINT || contain(refreshLevel, TRANSFORM_ALL | OP));\n if(hasEffectMask) {\n let start = i + (total || 0) + 1;\n let end = start + hasMask;\n // mask索引遍历时处理,暂存遮罩对象的刷新lv\n maskEffectHash[end - 1] = refreshLevel;\n }\n // >=REPAINT重绘生成走render()跳过这里\n if(refreshLevel < REPAINT) {\n // 特殊的mask判断,遮罩对象影响这个mask了,除去filter、遮罩对象无TRANSFORM变化外都可缓存\n if(maskEffectHash.hasOwnProperty(i)) {\n let v = maskEffectHash[i];\n if(!contain(refreshLevel, TRANSFORM_ALL) && v < REPAINT && !contain(v, TRANSFORM_ALL)) {\n defsCache.forEach(item => {\n ctx.addCache(item);\n });\n }\n }\n // 去除特殊的filter,普通节点或不影响的mask在 {\n ctx.addCache(item);\n });\n }\n }\n }\n }\n let maskHash = {};\n // 栈代替递归,存父节点的matrix/opacity,matrix为E时存null省略计算\n let matrixList = [];\n let parentMatrix;\n let vdList = [];\n let parentVd;\n let lastLv = 0;\n let lastConfig;\n for(let i = 0, len = __structs.length; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n [STRUCT_LV]: lv,\n } = __structs[i];\n let __config = node.__config;\n let {\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_REFRESH_LV]: refreshLevel,\n [NODE_DEFS_CACHE]: defsCache,\n [NODE_COMPUTED_STYLE]: computedStyle,\n } = __config;\n let display = computedStyle[DISPLAY];\n // 将随后的若干个mask节点范围存下来\n if(hasMask && display !== 'none') {\n let start = i + (total || 0) + 1;\n let end = start + hasMask;\n // svg限制了只能Geom单节点,不可能是Dom,所以end只有唯一\n maskHash[end - 1] = {\n index: i,\n start,\n end,\n isClip: __structs[start][STRUCT_NODE].isClip, // 第一个节点是clip为准\n };\n }\n // lv变大说明是child,相等是sibling,变小可能是parent或另一棵子树,Root节点第一个特殊处理\n if(lv < lastLv) {\n let diff = lastLv - lv;\n matrixList.splice(-diff);\n parentMatrix = matrixList[lv - 1];\n vdList.splice(-diff);\n parentVd = vdList[lv - 1];\n }\n else if(lv > lastLv) {\n matrixList.push(lastConfig[NODE_MATRIX]);\n let vd = lastConfig[NODE_VIRTUAL_DOM];\n vdList.push(vd);\n parentVd = vd;\n }\n lastConfig = __config;\n let virtualDom;\n // svg小刷新等级时直接修改vd,这样Geom不再感知\n if(refreshLevel < REPAINT && !(node instanceof Text)) {\n __config[NODE_REFRESH_LV] = NONE;\n virtualDom = __config[NODE_VIRTUAL_DOM];\n // total可以跳过所有孩子节点省略循环\n if(__cacheTotal && __cacheTotal.available) {\n i += (total || 0);\n virtualDom.cache = true;\n }\n else {\n __cacheTotal && (__cacheTotal.available = true);\n virtualDom = __config[NODE_VIRTUAL_DOM] = node.__virtualDom = util.extend({}, virtualDom);\n // dom要清除children缓存,geom和img无需\n if(node instanceof Dom && !(node instanceof Img)) {\n virtualDom.children = [];\n }\n // 还得判断,和img加载混在一起时,触发刷新如果display:none,则还有cacheTotal\n if(display === 'none') {\n i += (total || 0);\n if(hasMask) {\n i += hasMask;\n }\n }\n else {\n delete virtualDom.cache;\n }\n }\n let {\n [NODE_CURRENT_STYLE]: currentStyle,\n [NODE_COMPUTED_STYLE]: computedStyle,\n [NODE_CACHE_STYLE]: __cacheStyle,\n } = __config;\n if(contain(refreshLevel, TRANSFORM_ALL)) {\n let matrix = node.__calMatrix(refreshLevel, __cacheStyle, currentStyle, computedStyle, __config);\n // 恶心的v8性能优化\n let m = __config[NODE_MATRIX];\n assignMatrix(m, matrix);\n if(!matrix || isE(matrix)) {\n delete virtualDom.transform;\n }\n else {\n virtualDom.transform = 'matrix(' + util.joinArr(mx.m2m6(matrix), ',') + ')';\n }\n if(parentMatrix && matrix) {\n matrix = multiply(parentMatrix, matrix);\n }\n // 恶心的v8性能优化\n m = __config[NODE_MATRIX_EVENT];\n assignMatrix(m, matrix);\n }\n if(contain(refreshLevel, OP)) {\n let opacity = computedStyle[OPACITY] = currentStyle[OPACITY];\n if(opacity === 1) {\n delete virtualDom.opacity;\n }\n else {\n virtualDom.opacity = opacity;\n }\n }\n if(contain(refreshLevel, FT)) {\n let filter = node.__calFilter(currentStyle, computedStyle);\n let s = painter.svgFilter(filter);\n if(s) {\n virtualDom.filter = s;\n }\n else {\n delete virtualDom.filter;\n }\n }\n if(contain(refreshLevel, MBM)) {\n let mixBlendMode = computedStyle[MIX_BLEND_MODE] = currentStyle[MIX_BLEND_MODE];\n if(isValidMbm(mixBlendMode)) {\n virtualDom.mixBlendMode = mbmName(mixBlendMode);\n }\n else {\n delete virtualDom.mixBlendMode;\n }\n }\n virtualDom.lv = refreshLevel;\n }\n else {\n // >=REPAINT会调用render,重新生成defsCache,text没有这个东西\n __config[NODE_DEFS_CACHE] && __config[NODE_DEFS_CACHE].splice(0);\n node.render(renderMode, refreshLevel, ctx, NA, 0, 0);\n virtualDom = __config[NODE_VIRTUAL_DOM];\n // 渲染后更新取值\n display = computedStyle[DISPLAY];\n if(display === 'none') {\n i += (total || 0);\n if(hasMask) {\n i += hasMask;\n }\n }\n }\n /**\n * mask会在join时过滤掉,这里将假设正常渲染的vd的内容获取出来组成defs的mask内容\n * 另外最初遍历时记录了会影响的mask,在=REPAINT始终重新设置\n * 本身有matrix也需要重设\n */\n if(maskHash.hasOwnProperty(i) && (maskEffectHash.hasOwnProperty(i) || refreshLevel >= REPAINT || contain(refreshLevel, TRANSFORM_ALL | OP))) {\n let { index, start, end, isClip } = maskHash[i];\n let target = __structs[index];\n let dom = target[STRUCT_NODE];\n let mChildren = [];\n // clip模式时,先添加兜底整个白色使得全部都可见,mask本身变反色(黑色)\n if(isClip) {\n mChildren.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', `M0,0L${width},0L${width},${height}L0,${height}L0,0`],\n ['fill', 'rgba(255,255,255,1)'],\n ['stroke-width', 0],\n ],\n });\n }\n for(let j = start; j < end; j++) {\n let node = __structs[j][STRUCT_NODE];\n let { computedStyle: { [DISPLAY]: display, [VISIBILITY]: visibility, [FILL]: fill },\n virtualDom: { children, opacity } } = node;\n if(display !== 'none' && visibility !== 'hidden') {\n // 引用相同无法diff,需要clone\n children = util.clone(children);\n mChildren = mChildren.concat(children);\n for(let k = 0, len = children.length; k < len; k++) {\n let { tagName, props } = children[k];\n if(tagName === 'path') {\n if(isClip) {\n for(let j = 0, len = props.length; j < len; j++) {\n let item = props[j];\n if(item[0] === 'fill') {\n item[1] = util.int2invert(fill[0]);\n }\n }\n }\n let matrix = node.matrix;\n let ivs = inverse(dom.matrix);\n matrix = multiply(ivs, matrix);\n // path没有transform属性,在vd上,需要弥补\n props.push(['transform', `matrix(${util.joinArr(mx.m2m6(matrix), ',')})`]);\n // path没有opacity属性,在vd上,需要弥补\n if(!util.isNil(opacity) && opacity !== 1) {\n props.push(['opacity', opacity]);\n }\n }\n // img可能有matrix属性,需判断\n else if(tagName === 'image') {\n let hasTransform = -1;\n for(let m = 0, len = props.length; m < len; m++) {\n if(props[m][0] === 'transform') {\n hasTransform = m;\n break;\n }\n }\n if(hasTransform === -1) {\n let ivs = inverse(dom.matrix);\n if(!isE(ivs)) {\n props.push(['transform', `matrix(${util.joinArr(mx.m2m6(ivs), ',')})`]);\n }\n }\n else {\n let matrix = props[hasTransform][1].match(/[\\d.]+/g).map(i => parseFloat(i));\n let ivs = inverse(dom.matrix);\n matrix = multiply(ivs, matrix);\n props[hasTransform][1] = `matrix(${util.joinArr(mx.m2m6(matrix), ',')})`;\n }\n }\n }\n }\n }\n // 清掉上次的\n for(let i = defsCache.length - 1; i >= 0; i--) {\n let item = defsCache[i];\n if(item.tagName === 'mask') {\n defsCache.splice(i, 1);\n }\n }\n let o = {\n tagName: 'mask',\n props: [],\n children: mChildren,\n };\n let id = ctx.add(o);\n defsCache.push(o);\n id = 'url(#' + id + ')';\n dom.virtualDom.mask = id;\n }\n // mask不入children\n if(parentVd && !node.isMask) {\n parentVd.children.push(virtualDom);\n }\n if(i === 0) {\n parentMatrix = __config[NODE_MATRIX];\n parentVd = virtualDom;\n }\n lastLv = lv;\n }\n}\n\nfunction renderWebgl(renderMode, gl, root) {\n let { __structs, width, height, texCache } = root;\n let cx = width * 0.5, cy = height * 0.5;\n // 栈代替递归,存父节点的matrix/opacity,matrix为E时存null省略计算\n let matrixList = [];\n let parentMatrix;\n let opacityList = [];\n let parentOpacity = 1;\n let pmList = [];\n let parentPm;\n let lastRefreshLevel;\n let lastConfig;\n let lastLv = 0;\n let mergeList = [];\n let hasMbm; // 是否有混合模式出现\n /**\n * 先一遍先序遍历每个节点绘制到自己__cache上,排除Text和已有的缓存以及局部根缓存,\n * 根据refreshLevel进行等级区分,可能是=REPAINT,REFLOW布局已前置处理完。\n * 首次绘制没有catchTotal等,后续则可能会有,在= REPAINT) {\n node.render(renderMode, REPAINT, gl, SELF, 0, 0);\n }\n continue;\n }\n let __config = node.__config;\n let refreshLevel = __config[NODE_REFRESH_LV];\n // lv变大说明是child,相等是sibling,变小可能是parent或另一棵子树,Root节点是第一个特殊处理\n if(i === 0) {}\n else if(lv > lastLv) {\n parentMatrix = lastConfig[NODE_MATRIX_EVENT];\n if(isE(parentMatrix)) {\n parentMatrix = null;\n }\n matrixList.push(parentMatrix);\n parentOpacity = lastConfig[NODE_OPACITY];\n opacityList.push(parentOpacity);\n parentPm = lastConfig[NODE_PERSPECTIVE_MATRIX];\n if(isE(parentPm)) {\n parentPm = null;\n }\n pmList.push(parentPm);\n }\n // 变小出栈索引需注意,可能不止一层,多层计算diff层级\n else if(lv < lastLv) {\n let diff = lastLv - lv;\n matrixList.splice(-diff);\n parentMatrix = matrixList[lv - 1];\n opacityList.splice(-diff);\n parentOpacity = opacityList[lv - 1];\n pmList.splice(-diff);\n parentPm = pmList[lv - 1];\n }\n // 不变是同级兄弟,无需特殊处理 else {}\n lastRefreshLevel = refreshLevel;\n lastConfig = __config;\n lastLv = lv;\n let {\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_COMPUTED_STYLE]: computedStyle,\n } = __config;\n // 跳过display:none元素和它的所有子节点\n if(computedStyle[DISPLAY] === 'none') {\n i += (total || 0);\n // 只跳过自身不能跳过后面的mask,mask要渲染自身并进行缓存cache,以备对象切换display用\n continue;\n }\n let hasRecordAsMask;\n /**\n * lv=REPAINT那里,小变化不动\n * 当有遮罩时,如果被遮罩节点本身无变更,需要检查其next的遮罩节点有无变更,\n * 但其实不用检查,因为next变更一定会清空cacheMask,只要检查cacheMask即可\n * 如果没有或无效,直接添加,无视节点本身变化,后面防重即可\n */\n if(refreshLevel < REPAINT) {\n __config[NODE_REFRESH_LV] = NONE;\n if(hasMask) {\n let cacheMask = __config[NODE_CACHE_MASK];\n if(!cacheMask || !cacheMask.available) {\n hasRecordAsMask = [i, lv, total, node, __config, null, hasMask];\n mergeList.push(hasRecordAsMask);\n }\n }\n let {\n [NODE_CURRENT_STYLE]: currentStyle,\n [NODE_CACHE_STYLE]: __cacheStyle,\n [NODE_MATRIX_EVENT]: matrixEvent,\n } = __config;\n if(contain(refreshLevel, PPT)) {\n node.__calPerspective(__cacheStyle, currentStyle, computedStyle, __config);\n }\n // transform变化,父元素的perspective变化也会在Root特殊处理重新计算\n let matrix;\n if(contain(refreshLevel, TRANSFORM_ALL)) {\n matrix = node.__calMatrix(refreshLevel, __cacheStyle, currentStyle, computedStyle, __config);\n assignMatrix(__config[NODE_MATRIX], matrix);\n }\n else {\n matrix = __config[NODE_MATRIX];\n }\n // node本身有或者父有perspective都认为需要生成3d渲染上下文\n if(tf.isPerspectiveMatrix(matrix) || parentPm) {\n if(hasRecordAsMask) {\n hasRecordAsMask[9] = true;\n }\n else {\n hasRecordAsMask = [i, lv, total, node, __config, null, null, null, null, true];\n }\n }\n // 先左乘perspective的矩阵,再左乘父级的总矩阵\n if(parentPm) {\n matrix = multiply(parentPm, matrix);\n }\n if(parentMatrix) {\n matrix = multiply(parentMatrix, matrix);\n }\n // 恶心的v8性能优化\n assignMatrix(matrixEvent, matrix);\n let opacity;\n if(contain(refreshLevel, OP)) {\n opacity = computedStyle[OPACITY] = currentStyle[OPACITY];\n }\n else {\n opacity = computedStyle[OPACITY];\n }\n __config[NODE_OPACITY] = parentOpacity * opacity;\n // filter会改变bbox范围\n if(contain(refreshLevel, FT)) {\n node.__bbox = null;\n let filter = node.__calFilter(currentStyle, computedStyle);\n // 防重\n if(hasRecordAsMask) {\n hasRecordAsMask[7] = filter;\n }\n else {\n // 强制存hasMask,因为filter改变影响mask\n hasRecordAsMask = [i, lv, total, node, __config, null, hasMask, filter];\n mergeList.push(hasRecordAsMask);\n }\n }\n if(contain(refreshLevel, MBM)) {\n computedStyle[MIX_BLEND_MODE] = currentStyle[MIX_BLEND_MODE];\n }\n // total可以跳过所有孩子节点省略循环,filter/mask等的强制前提是有total\n if(__cacheTotal && __cacheTotal.available) {\n i += (total || 0);\n continue;\n }\n }\n /**\n * >=REPAINT重新渲染,并根据结果判断是否离屏限制错误\n * Geom没有子节点无需汇总局部根,Dom中Img也是,它们的局部根等于自身的cache,其它符合条件的Dom需要生成\n */\n else {\n let res = node.render(renderMode, refreshLevel, gl, SELF, 0, 0);\n // geom可返回texture纹理,替代原有xom的__cache纹理\n if(res && inject.isWebGLTexture(res.texture)) {\n let { __sx1: sx1, __sy1: sy1, offsetWidth: w, offsetHeight: h, bbox } = node;\n __config[NODE_CACHE] = new MockCache(gl, res.texture, sx1, sy1, w, h, bbox);\n gl.viewport(0, 0, width, height);\n gl.useProgram(gl.program);\n }\n }\n // 每个元素检查cacheTotal生成,已有的上面会continue跳过\n let {\n [NODE_LIMIT_CACHE]: limitCache,\n [NODE_CACHE_AS_BITMAP]: cacheAsBitmap,\n } = __config;\n let {\n [OVERFLOW]: overflow,\n [FILTER]: filter,\n [MIX_BLEND_MODE]: mixBlendMode,\n [TRANSFORM]: transform,\n } = computedStyle;\n let validMbm = isValidMbm(mixBlendMode);\n // 3d渲染上下文\n let isPerspective = tf.isPerspectiveMatrix(transform) || parentPm;\n if(cacheAsBitmap || hasMask || filter.length || (overflow === 'hidden' && total) || validMbm || isPerspective) {\n if(validMbm) {\n hasMbm = true;\n }\n if(hasRecordAsMask) {\n hasRecordAsMask[5] = limitCache;\n hasRecordAsMask[7] = filter;\n hasRecordAsMask[8] = overflow;\n hasRecordAsMask[9] = isPerspective;\n hasRecordAsMask[10] = cacheAsBitmap;\n }\n else {\n mergeList.push([i, lv, total, node, __config, limitCache, hasMask, filter, overflow, isPerspective, cacheAsBitmap]);\n }\n }\n }\n let limitHash = {};\n // 根据收集的需要合并局部根的索引,尝试合并,按照层级从大到小,索引从大到小的顺序,\n // 这样保证子节点在前,后节点在前,后节点是为了mask先应用自身如filter之后再进行遮罩\n if(mergeList.length) {\n mergeList.sort(function(a, b) {\n if(a[1] === b[1]) {\n return b[0] - a[0];\n }\n return b[1] - a[1];\n });\n // ppt只有嵌套才需要生成,最下面的孩子节点的ppt无需,因此记录一个hash存index,\n // 同时因为是后序遍历,孩子先存所有父亲的index即可保证父亲才能生成cacheTotal\n let pptHash = {};\n mergeList.forEach(item => {\n let [i, lv, total, node, __config, limitCache, hasMask, filter, overflow, isPerspective, cacheAsBitmap] = item;\n // 有ppt的,向上查找所有父亲index记录,可能出现重复记得提前跳出\n if(isPerspective) {\n let parent = __config[NODE_DOM_PARENT];\n while(parent) {\n let config = parent.__config;\n let idx = config[NODE_STRUCT][STRUCT_INDEX];\n if(pptHash[idx]) {\n break;\n }\n if(tf.isPerspectiveMatrix(config[NODE_MATRIX]) || config[NODE_PERSPECTIVE_MATRIX]) {\n pptHash[idx] = true;\n }\n parent = config[NODE_DOM_PARENT];\n }\n if(!pptHash[i] && !hasMask && !filter.length && overflow !== 'hidden' && !cacheAsBitmap) {\n return;\n }\n }\n let {\n [NODE_CACHE]: __cache,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n } = __config;\n let needGen;\n // 可能没变化,比如被遮罩节点、filter变更等\n if(!__cacheTotal || !__cacheTotal.available) {\n let [limit, res] = genTotalWebgl(gl, texCache, node, __config, i, total || 0, __structs, __cache, limitCache, hasMbm, width, height);\n __cacheTotal = res;\n needGen = true;\n limitCache = limit;\n // 返回的limit包含各种情况超限,一旦超限,只能生成临时cacheTotal不能保存\n if(!limitCache) {\n __config[NODE_CACHE_TOTAL] = res;\n }\n }\n // 即使超限,也有total结果\n let target = __cacheTotal;\n if(overflow === 'hidden') {\n if(!__cacheOverflow || !__cacheOverflow.available || needGen) {\n let temp = genOverflowWebgl(gl, texCache, node, target, width, height);\n if(temp) {\n target = temp;\n needGen = true;\n if(!limitCache) {\n __config[NODE_CACHE_FILTER] = target;\n }\n }\n }\n }\n if(filter.length) {\n if(!__cacheFilter || !__cacheFilter.available || needGen) {\n let old = target;\n target = genFilterWebgl(gl, texCache, node, target, filter, width, height);\n if(target !== old) {\n needGen = true;\n if(!limitCache) {\n __config[NODE_CACHE_FILTER] = target;\n }\n }\n }\n }\n if(hasMask && (!__cacheMask || !__cacheMask.available || needGen)) {\n target = genMaskWebgl(gl, texCache, node, __config, target, width, height, lv, __structs);\n if(!limitCache) {\n __config[NODE_CACHE_MASK] = target;\n }\n }\n // 保存临时的局部根节点\n if(limitCache) {\n limitHash[i] = target;\n }\n });\n }\n /**\n * 最后先序遍历一次应用__cacheTotal即可,没有的用__cache,以及剩下的超尺寸的和Text\n * 由于mixBlendMode的存在,需先申请个fbo纹理,所有绘制默认向该纹理绘制,最后fbo纹理再进入主画布\n * 前面循环时有记录是否出现mbm,只有出现才申请,否则不浪费直接输出到主画布\n * 超尺寸的要走无cache逻辑render,和canvas很像,除了离屏canvas超限,汇总total也会纹理超限\n */\n let n, frameBuffer, texture;\n if(hasMbm) {\n [n, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n }\n for(let i = 0, len = __structs.length; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n } = __structs[i];\n let __config = node.__config;\n // text如果display不可见,parent会直接跳过,不会走到这里,这里一定是直接绘制到root的,visibility在其内部判断\n if(node instanceof Text) {\n // text特殊之处,__config部分是复用parent的\n let {\n [NODE_CACHE]: __cache,\n [NODE_LIMIT_CACHE]: limitCache,\n [NODE_DOM_PARENT]: {\n __config: {\n [NODE_MATRIX_EVENT]: matrixEvent,\n [NODE_OPACITY]: opacity,\n },\n },\n } = __config;\n if(__cache && __cache.available) {\n texCache.addTexAndDrawWhenLimit(gl, __cache, opacity, matrixEvent, cx, cy, 0, 0,true);\n }\n // 超限特殊处理,先生成画布尺寸大小的纹理然后原始位置绘制\n else if(limitCache) {\n let c = inject.getCacheCanvas(width, height, '__$$OVERSIZE$$__');\n node.render(renderMode, 0, gl, NA, 0, 0);\n let j = texCache.lockOneChannel();\n let texture = webgl.createTexture(gl, c.canvas, j);\n let mockCache = new MockCache(gl, texture, 0, 0, width, height, [0, 0, width, height]);\n texCache.addTexAndDrawWhenLimit(gl, mockCache, opacity, matrixEvent, cx, cy, 0, 0, true);\n texCache.refresh(gl, cx, cy, true);\n c.ctx.setTransform(1, 0, 0, 1, 0, 0);\n c.ctx.globalAlpha = 1;\n c.ctx.clearRect(0, 0, width, height);\n mockCache.release();\n texCache.releaseLockChannel(j);\n }\n }\n else {\n let {\n [NODE_OPACITY]: opacity,\n [NODE_MATRIX_EVENT]: matrixEvent,\n [NODE_LIMIT_CACHE]: limitCache,\n [NODE_CACHE]: __cache,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_REFRESH_LV]: refreshLevel,\n [NODE_COMPUTED_STYLE]: {\n [DISPLAY]: display,\n [VISIBILITY]: visibility,\n [MIX_BLEND_MODE]: mixBlendMode,\n },\n } = __config;\n if(display === 'none') {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n continue;\n }\n // 有total的可以直接绘制并跳过子节点索引,忽略total本身,其独占用纹理单元,注意特殊不取cacheTotal,\n // 这种情况发生在只有overflow:hidden声明但无效没有生成__cacheOverflow的情况,\n // 因为webgl纹理单元缓存原因,所以不用cacheTotal防止切换性能损耗\n // 已取消,因为perspective需要进行独立上下文渲染\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal, __cache]);\n // total和自身cache的尝试,visibility不可见时没有cache\n if(target) {\n // 有mbm先刷新当前fbo,然后把后面这个mbm节点绘入一个新的等画布尺寸的fbo中,再进行2者mbm合成\n if(hasMbm && isValidMbm(mixBlendMode)) {\n texCache.refresh(gl, cx, cy, true);\n let [n2, frameBuffer2, texture2] = genFrameBufferWithTexture(gl, texCache, width, height);\n texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrixEvent, cx, cy, 0, 0, true);\n texCache.refresh(gl, cx, cy, true);\n // 合成结果作为当前frameBuffer,以及纹理和单元,等于替代了当前画布作为绘制对象\n [n, frameBuffer, texture] = genMbmWebgl(gl, texCache, n, n2, frameBuffer, texture, mbmName(mixBlendMode), width, height);\n gl.deleteFramebuffer(frameBuffer2);\n gl.deleteTexture(texture2);\n }\n else {\n texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrixEvent, cx, cy, 0, 0, true);\n }\n if(target !== __cache) {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n }\n }\n else if(limitHash.hasOwnProperty(i)) {\n let target = limitHash[i];\n if(hasMbm && isValidMbm(mixBlendMode)) {\n texCache.refresh(gl, cx, cy, true);\n let [n2, frameBuffer2, texture2] = genFrameBufferWithTexture(gl, texCache, width, height);\n texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrixEvent, cx, cy, 0, 0, true);\n texCache.refresh(gl, cx, cy, true);\n // 合成结果作为当前frameBuffer,以及纹理和单元,等于替代了当前画布作为绘制对象\n [n, frameBuffer, texture] = genMbmWebgl(gl, texCache, n, n2, frameBuffer, texture, mbmName(mixBlendMode), width, height);\n gl.deleteFramebuffer(frameBuffer2);\n gl.deleteTexture(texture2);\n }\n else {\n texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrixEvent, cx, cy, 0, 0, true);\n }\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n }\n // 超限的情况,这里是普通单节点超限,没有合成total后再合成特殊cache如filter/mask/mbm之类的,\n // 直接按原始位置绘制到离屏canvas,再作为纹理绘制即可,特殊的在total那做过降级了\n else if(limitCache && display !== 'none' && visibility !== 'hidden') {\n let c = inject.getCacheCanvas(width, height, '__$$OVERSIZE$$__');\n node.render(renderMode, refreshLevel, gl, NA, 0, 0);\n let j = texCache.lockOneChannel();\n let texture = webgl.createTexture(gl, c.canvas, j);\n let mockCache = new MockCache(gl, texture, 0, 0, width, height, [0, 0, width, height]);\n texCache.addTexAndDrawWhenLimit(gl, mockCache, opacity, matrixEvent, cx, cy, 0, 0, true);\n texCache.refresh(gl, cx, cy, true);\n c.ctx.setTransform(1, 0, 0, 1, 0, 0);\n c.ctx.globalAlpha = 1;\n c.ctx.clearRect(0, 0, width, height);\n mockCache.release();\n texCache.releaseLockChannel(j);\n }\n // webgl特殊的外部钩子,比如粒子组件自定义渲染时调用\n if(node.hookGlRender) {\n node.hookGlRender(gl, opacity, matrixEvent, cx, cy, 0, 0, true);\n }\n }\n }\n texCache.refresh(gl, cx, cy, true);\n // 有mbm时将汇总的fbo绘入主画布,否则本身就是到主画布无需多余操作\n if(hasMbm) {\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n texCache.releaseLockChannel(n);\n gl.deleteFramebuffer(frameBuffer);\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(gl.program, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n 0, 0,\n 0, 1,\n 1, 0,\n 0, 1,\n 1, 0,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(gl.program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // opacity buffer\n let opacityBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, opacityBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, 1, 1, 1, 1]), gl.STATIC_DRAW);\n let a_opacity = gl.getAttribLocation(gl.program, 'a_opacity');\n gl.vertexAttribPointer(a_opacity, 1, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_opacity);\n // 纹理单元\n let u_texture = gl.getUniformLocation(gl.program, 'u_texture');\n gl.uniform1i(u_texture, n);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.deleteBuffer(opacityBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n gl.deleteTexture(texture);\n }\n}\n\nfunction renderCanvas(renderMode, ctx, root) {\n let { __structs, width, height } = root;\n let mergeList = [];\n /**\n * 先一遍先序遍历收集cacheAsBitmap的节点,说明这棵子树需要缓存,可能出现嵌套,高层级优先\n * 可能遇到已有缓存没变化的,这时候不要收集忽略掉,没有缓存的走后面遍历普通渲染\n */\n for(let i = 0, len = __structs.length; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_LV]: lv,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n } = __structs[i];\n // 排除Text,要么根节点直接绘制,要么被局部根节点汇总,自身并不缓存(fillText比位图更快)\n if(node instanceof Text) {\n continue;\n }\n let __config = node.__config;\n let {\n [NODE_REFRESH_LV]: refreshLevel,\n [NODE_CACHE_AS_BITMAP]: cacheAsBitmap,\n [NODE_COMPUTED_STYLE]: computedStyle,\n } = __config;\n if(refreshLevel >= REPAINT) {\n node.__calCache(renderMode, ctx, __config[NODE_DOM_PARENT],\n __config[NODE_CACHE_STYLE], __config[NODE_CURRENT_STYLE], computedStyle,\n node.clientWidth, node.clientHeight, node.offsetWidth, node.offsetHeight,\n computedStyle[BORDER_TOP_WIDTH], computedStyle[BORDER_RIGHT_WIDTH],\n computedStyle[BORDER_BOTTOM_WIDTH], computedStyle[BORDER_LEFT_WIDTH],\n computedStyle[PADDING_TOP], computedStyle[PADDING_RIGHT],\n computedStyle[PADDING_BOTTOM], computedStyle[PADDING_LEFT],\n node.__sx1, node.__sx2, node.__sx3, node.__sx4, node.__sx5, node.__sx6,\n node.__sy1, node.__sy2, node.__sy3, node.__sy4, node.__sy5, node.__sy6);\n }\n if(cacheAsBitmap) {\n // 跳过display:none元素和它的所有子节点\n if(computedStyle[DISPLAY] === 'none') {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n continue;\n }\n mergeList.push([i, lv, total, node, __config, hasMask]);\n }\n }\n /**\n * 根据收集的需要合并局部根的索引,尝试合并,按照层级从大到小,索引从大到小的顺序,\n * 这样保证子节点在前,后节点在前(mask在后面),渲染顺序正确\n */\n if(mergeList.length) {\n mergeList.sort(function(a, b) {\n if(a[1] === b[1]) {\n return b[0] - a[0];\n }\n return b[1] - a[1];\n });\n mergeList.forEach(item => {\n let [i, lv, total, node, __config, hasMask] = item;\n genTotal(renderMode, node, __config, i, lv, total || 0, __structs, hasMask, width, height);\n });\n }\n /**\n * 最后先序遍历一次并应用__cacheTotal即可,没有的普通绘制,以及剩下的超尺寸的和Text\n * 特殊离屏和cacheAsBitmap的离屏都已经产生了cacheTotal,除非超限\n * 离屏功能的数据结构和算法逻辑非常复杂,需用到下面2个hash,来完成一些filter、mask等离屏才能完成的绘制\n * 其中overflow、filter、mix-blend-mode是对自身及子节点,mask则是对自身和后续next遮罩节点\n * 一个节点在Xom渲染中申请离屏canvas,是按照一定顺序来的,且多个离屏后面的有前面的ctx引用,第一个则引用最初非离屏的ctx\n * 这个顺序在应用离屏时以反向顺序开始,这样最后ctx被还原到最初的ctx\n * mask是个十分特殊的离屏,因为除了自身外,next节点也需要汇总到另外一个离屏上,为了逻辑一致性\n * 所有离屏应用的索引都以最后一个节点的索引为准,即有mask时以最后一个mask,无mask则以自身节点的最后一个(+total)为索引\n * 由于存在普通非cache绘制,所以依然要用到栈代替递归计算matrix\n */\n let maskStartHash = {};\n let offscreenHash = {};\n for(let i = 0, len = __structs.length; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_LV]: lv,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n } = __structs[i];\n // text如果display不可见,parent会直接跳过,不会走到这里,这里一定是直接绘制到root的,visibility在其内部判断\n if(node instanceof Text) {\n node.render(renderMode, REPAINT, ctx, NA, 0, 0);\n if(offscreenHash.hasOwnProperty(i)) {\n ctx = applyOffscreen(ctx, offscreenHash[i], width, height);\n }\n }\n else {\n let __config = node.__config;\n let {\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_REFRESH_LV]: refreshLevel,\n [NODE_COMPUTED_STYLE]: {\n [DISPLAY]: display,\n [MIX_BLEND_MODE]: mixBlendMode,\n [OPACITY]: opacity,\n },\n } = __config;\n // 遮罩对象申请了个离屏,其第一个mask申请另外一个离屏mask2,开始聚集所有mask元素的绘制,\n // 这是一个十分特殊的逻辑,保存的index是最后一个节点的索引,OFFSCREEN_MASK2是最低优先级,\n // 这样当mask本身有filter时优先自身,然后才是OFFSCREEN_MASK2\n if(maskStartHash.hasOwnProperty(i)) {\n let [idx, n, offscreenMask] = maskStartHash[i];\n let target = inject.getCacheCanvas(width, height, null, 'mask2');\n offscreenMask.mask = target; // 应用mask用到\n offscreenMask.isClip = node.isClip;\n // 定位到最后一个mask元素上的末尾\n let j = i + (total || 0) + 1;\n while(--n) {\n let { [STRUCT_TOTAL]: total } = __structs[j];\n j += (total || 0) + 1;\n }\n j--;\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([idx, lv, OFFSCREEN_MASK, offscreenMask]);\n list.push([j, lv, OFFSCREEN_MASK2, {\n ctx, // 保存等待OFFSCREEN_MASK2时还原\n target,\n }]);\n ctx = target.ctx;\n }\n // 有cache声明从而有total的可以直接绘制并跳过子节点索,total生成可能会因超限而失败\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal]);\n if(target) {\n let j = i;\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n // total的none直接跳过\n if(display === 'none') {\n continue;\n }\n if(isValidMbm(mixBlendMode)) {\n ctx.globalCompositeOperation = mbmName(mixBlendMode);\n }\n else {\n ctx.globalCompositeOperation = 'source-over';\n }\n // cache需要计算matrixEvent,因为局部根节点临时视为E,根据refreshLevel决定\n let matrix = __config[NODE_MATRIX], matrixEvent = __config[NODE_MATRIX_EVENT];\n let old = matrixEvent.slice(0);\n let parentMatrix = __config[NODE_DOM_PARENT].matrixEvent;\n if(parentMatrix && !isE(parentMatrix)) {\n matrix = multiply(parentMatrix, matrix);\n }\n util.assignMatrix(matrixEvent, matrix);\n Cache.draw(ctx, opacity, matrixEvent, target);\n // total应用后记得设置回来\n ctx.globalCompositeOperation = 'source-over';\n // 父超限但子有total的时候,i此时已经增加到了末尾,也需要检查\n if(offscreenHash.hasOwnProperty(i)) {\n ctx = applyOffscreen(ctx, offscreenHash[i], width, height);\n }\n // 有cache的可以跳过子节点,但如果matrixEvent变化还是需要遍历计算一下的,虽然跳过了渲染\n // 如果cache是新的,则需要完整遍历设置一次\n // 如果isNew为false,则计算下局部根节点再对比下看是否有变化,无变化可省略\n let needReset = __cacheTotal.isNew;\n if(!needReset && !util.equalArr(old, matrixEvent)) {\n needReset = true;\n }\n if(needReset) {\n resetMatrixCacheTotal(__structs, j, total || 0, lv, matrixEvent);\n }\n __cacheTotal.__isNew = false;\n }\n // 没有cacheTotal是普通节点绘制\n else {\n let res = node.render(renderMode, refreshLevel, ctx, NA, 0, 0);\n let { offscreenBlend, offscreenMask, offscreenFilter, offscreenOverflow } = res || {};\n // 这里离屏顺序和xom里返回的一致,和下面应用离屏时的list相反\n if(offscreenBlend) {\n let j = i + (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([i, lv, OFFSCREEN_BLEND, offscreenBlend]);\n ctx = offscreenBlend.target.ctx;\n }\n // 被遮罩的节点要为第一个遮罩和最后一个遮罩的索引打标,被遮罩的本身在一个离屏canvas,遮罩的元素在另外一个\n // 最后一个遮罩索引因数量不好计算,放在maskStartHash做\n if(offscreenMask) {\n let j = i + (total || 0);\n maskStartHash[j + 1] = [i, hasMask, offscreenMask];\n ctx = offscreenMask.target.ctx;\n }\n // filter造成的离屏,需要将后续一段孩子节点区域的ctx替换,并在结束后应用结果,再替换回来\n if(offscreenFilter) {\n let j = i + (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([i, lv, OFFSCREEN_FILTER, offscreenFilter]);\n ctx = offscreenFilter.target.ctx;\n }\n // overflow:hidden的离屏,最后孩子进行截取\n if(offscreenOverflow) {\n let j = i + (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([i, lv, OFFSCREEN_OVERFLOW, offscreenOverflow]);\n ctx = offscreenOverflow.target.ctx;\n }\n // 离屏应用,按照lv从大到小即子节点在前先应用,同一个节点多个效果按offscreen优先级从小到大来,\n // 由于mask特殊索引影响,所有离屏都在最后一个mask索引判断,此时mask本身优先结算,以index序大到小判断\n if(offscreenHash.hasOwnProperty(i)) {\n ctx = applyOffscreen(ctx, offscreenHash[i], width, height);\n }\n // render后判断可见状态,此时computedStyle才有值\n if(display === 'none') {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n }\n }\n }\n }\n}\n\nexport default {\n renderCanvas,\n renderSvg,\n renderWebgl,\n};\n\n","import webgl from './webgl';\nimport MockPage from './MockPage';\nimport inject from '../util/inject';\n\nclass TexCache {\n constructor(units) {\n this.__units = units; // 通道数量限制,8~16\n this.__pages = []; // 存当前page列表,通道数量8~16,缓存收留尽可能多的page\n this.__list = []; // 本次渲染暂存的数据,[cache, opacity, matrix, dx, dy]\n this.__channels = []; // 每个纹理通道记录还是个数组,下标即纹理单元,内容为Page\n this.__locks = []; // 锁定纹理单元列表,下标即纹理单元,内容true为锁定\n this.__lockUnits = 0;\n }\n\n /**\n * webgl每次绘制为添加纹理并绘制,此处尝试尽可能收集所有纹理贴图,以达到尽可能多的共享纹理,再一次性绘制\n * 收集的是Page对象(从cache中取得),里面包含了若干个节点的贴图,canvas本身是2的幂次方大小\n * webgl最少有8个纹理单元最多16个,因此存了一个列表来放这些Page的canvas,刷新后清空,但纹理通道映射记录保留\n * 当8个纹理单元全部满了,进行绘制并清空这个队列,外部主循环结束时也会检查队列是否还有余留并绘制\n * 初始调用队列为空,存入Page对象,后续调用先查看是否存在以便复用,再决定是否存入Page,直到8个满了\n * Page上存有update表示是否更新,每次cache绘制时会变true,以此表示是否有贴图更新,删除可以忽视\n * 还需要一个记录上次纹理通道使用哪个Page的canvas的地方,即映射,清空后队列再次添加时,如果Page之前被添加过,\n * 此次又被添加且没有变更update,可以直接复用上次的纹理单元号且无需再次上传纹理,节省性能\n * 后续接入局部纹理更新也是复用单元号,如果update变更可以选择局部上传纹理而非整个重新上传\n * 判断上传的逻辑在收集满8个后绘制前进行,因为添加队列过程中可能会变更Page及其update\n * @param gl\n * @param cache\n * @param opacity\n * @param matrix\n * @param cx\n * @param cy\n * @param dx\n * @param dy\n * @param revertY\n */\n addTexAndDrawWhenLimit(gl, cache, opacity, matrix, cx, cy, dx = 0, dy = 0, revertY) {\n let pages = this.__pages;\n let list = this.__list;\n let page = cache.page;\n let i = pages.indexOf(page);\n // 找到说明已有page在此索引的通道中,记录下来info\n if(i > -1) {\n list.push([cache, opacity, matrix, dx, dy]);\n }\n // 找不到说明是新的纹理贴图,此时看是否超过纹理单元限制,超过则刷新绘制并清空,然后/否则 存入纹理列表\n else {\n i = pages.length;\n if(i >= this.__units - this.__lockUnits) {\n // 绘制且清空,队列索引重新为0\n this.refresh(gl, cx, cy, revertY);\n }\n pages.push(page);\n list.push([cache, opacity, matrix, dx, dy]);\n }\n }\n\n /**\n * 刷新\n * @param gl\n * @param cx\n * @param cy\n * @param revertY\n */\n refresh(gl, cx, cy, revertY) {\n let pages = this.__pages;\n let list = this.__list;\n // 防止空调用刷新,struct循环结尾会强制调用一次防止有未渲染的\n if(pages.length) {\n let channels = this.channels;\n let locks = this.locks;\n // 先将上次渲染的纹理单元使用的Page形成一个hash,键为page的uuid,值为纹理单元\n let lastHash = {};\n channels.forEach((item, i) => {\n if(item) {\n let uuid = item.uuid;\n lastHash[uuid] = i;\n }\n });\n let units = this.__units;\n // 再遍历,查找相同的Page并保持其使用的纹理单元不变,存入相同索引下标oldList,不同的按顺序收集放newList\n let oldList = new Array(units), newList = [];\n pages.forEach(page => {\n let uuid = page.uuid;\n if(lastHash.hasOwnProperty(uuid)) {\n let index = lastHash[uuid];\n oldList[index] = page;\n }\n else {\n newList.push(page);\n }\n });\n /**\n * 以oldList为基准,将newList依次存入oldList中\n * 优先使用未用过的纹理单元,以便用过的可能下次用到无需重新上传\n * 找不到未用过的后,尝试NRU算法,优先淘汰最近未使用的Page,相等则尺寸小的\n */\n if(newList.length) {\n // 先循环找空的,oldList空且channels空且locks空\n for(let i = 0; i < units; i++) {\n if(!oldList[i] && !channels[i] &&!locks[i]) {\n oldList[i] = newList.shift();\n if(!newList.length) {\n break;\n }\n }\n }\n let len = newList.length;\n if(len) {\n // 按时间排序已使用channel且未被当前占用的,以便淘汰最久未使用的\n let cl = [];\n for(let i = 0; i < units; i++) {\n if(!oldList[i] && !locks[i]) {\n cl.push([i, channels[i]]);\n }\n }\n cl.sort(function(a, b) {\n if(a[1].time !== b[1].time) {\n return (a[1].time || 0) - (b[1].time || 0);\n }\n if(a[1].fullSize !== b[1].fullSize) {\n return a[1].fullSize - b[1].fullSize;\n }\n return a[0] - b[0];\n });\n // cl靠前是时间小尺寸小的,优先使用替换\n for(let i = 0; i < len; i++) {\n oldList[cl[i][0]] = newList[i];\n }\n }\n }\n /**\n * 对比上帧渲染的和这次纹理单元情况,Page相同且!update可以省略更新,其它均重新赋值纹理\n * 后续局部更新Page相同但有update,会出现没有上帧的情况如初始渲染,此时先创建纹理单元再更新\n * 将新的数据赋给老的,可能新的一帧使用的少于上一帧,老的没用到的需继续保留\n */\n let hash = {};\n for(let i = 0, len = oldList.length; i < len; i++) {\n let page = oldList[i];\n // 可能为空,不满的情况下前面单元保留老tex先用的后面的单元\n if(!page) {\n continue;\n }\n let last = channels[i];\n if(!last || last !== page || page.update) {\n // page可能为一个已有fbo纹理,或者贴图\n if(page instanceof MockPage) {\n webgl.bindTexture(gl, page.texture, i);\n }\n else {\n // 可能老的先删除,注意只删Page,MockPage是fbo生成的texture即total缓存不能自动清除\n if(last && !(last instanceof MockPage)) {\n gl.deleteTexture(last.texture);\n }\n page.texture = webgl.createTexture(gl, page.canvas, i);\n }\n channels[i] = page;\n }\n hash[page.uuid] = i;\n // 标识没有更新,以及最后使用时间\n page.update = false;\n page.time = inject.now();\n }\n // 再次遍历开始本次渲染并清空\n webgl.drawTextureCache(gl, list, hash, cx, cy, revertY);\n pages.splice(0);\n list.splice(0);\n }\n }\n\n findExistTexChannel(page) {\n return this.channels.indexOf(page);\n }\n\n /**\n * 获取并锁定一个纹理单元优先使用空的,其次最久未使用的\n * @returns {number|*}\n */\n lockOneChannel() {\n // 优先返回空单元\n let channels = this.channels;\n let locks = this.locks;\n for(let i = 0; i < this.__units; i++) {\n if(!channels[i] && !locks[i]) {\n locks[i] = true;\n this.__lockUnits++;\n return i;\n }\n }\n // 根据NRU返回最久未使用的\n let units = this.__units;\n let cl = [];\n for(let i = 0; i < units; i++) {\n if(!locks[i]) {\n cl.push([i, channels[i]]);\n }\n }\n if(cl.length) {\n cl.sort(function(a, b) {\n if(a[1].time !== b[1].time) {\n return (a[1].time || 0) - (b[1].time || 0);\n }\n if(a[1].fullSize !== b[1].fullSize) {\n return a[1].fullSize - b[1].fullSize;\n }\n return a[0] - b[0];\n });\n let i = cl[0][0];\n channels[i] = null;\n locks[i] = true;\n this.__lockUnits++;\n return i;\n }\n throw new Error('No free texture unit');\n }\n\n /**\n * 释放掉i单元,并且设置内容到缓存channel中\n * @param i\n * @param setToChannel\n */\n releaseLockChannel(i, setToChannel) {\n if(this.locks[i]) {\n this.locks[i] = false;\n this.__lockUnits--;\n if(setToChannel) {\n this.channels[i] = setToChannel;\n }\n }\n }\n\n // 指定锁定一个单元\n lockChannel(i) {\n let channels = this.channels;\n let locks = this.locks;\n if(!locks[i]) {\n channels[i] = null;\n locks[i] = true;\n this.__lockUnits++;\n }\n }\n\n /**\n * 释放纹理单元\n * @param gl\n */\n release(gl) {\n this.channels.forEach(item => {\n if(item) {\n gl.deleteTexture(item.texture);\n }\n });\n }\n\n get channels() {\n return this.__channels;\n }\n\n get locks() {\n return this.__locks;\n }\n\n get last() {\n let list = this.__list, len = list.length;\n if(len) {\n return list[len - 1];\n }\n }\n}\n\nexport default TexCache;\n","import Dom from './Dom';\nimport Text from './Text';\nimport Xom from './Xom';\nimport Component from './Component';\nimport Defs from './Defs';\nimport Geom from './geom/Geom';\nimport builder from '../util/builder';\nimport updater from '../util/updater';\nimport util from '../util/util';\nimport domDiff from '../util/diff';\nimport css from '../style/css';\nimport unit from '../style/unit';\nimport geom from '../math/geom';\nimport enums from '../util/enums';\nimport inject from '../util/inject';\nimport Event from '../util/Event';\nimport frame from '../animate/frame';\nimport Controller from '../animate/Controller';\nimport mode from '../refresh/mode';\nimport change from '../refresh/change';\nimport level from '../refresh/level';\nimport struct from '../refresh/struct';\nimport reflow from '../refresh/reflow';\nimport vertex from '../gl/main.vert';\nimport fragment from '../gl/main.frag';\nimport vertexMask from '../gl/mask.vert';\nimport fragmentMask from '../gl/mask.frag';\nimport fragmentClip from '../gl/clip.frag';\nimport fragmentOverflow from '../gl/overflow.frag';\nimport vertexCm from '../gl/filter/cm.vert';\nimport fragmentCm from '../gl/filter/cm.frag';\nimport webgl from '../gl/webgl';\nimport ca from '../gl/ca';\nimport TexCache from '../gl/TexCache';\n\nconst {\n STYLE_KEY: {\n TOP,\n RIGHT,\n BOTTOM,\n LEFT,\n POSITION,\n DISPLAY,\n VISIBILITY,\n COLOR,\n WIDTH,\n HEIGHT,\n Z_INDEX,\n MARGIN_TOP,\n MARGIN_LEFT,\n MARGIN_BOTTOM,\n PADDING_TOP,\n PADDING_LEFT,\n PADDING_BOTTOM,\n BORDER_TOP_WIDTH,\n BORDER_LEFT_WIDTH,\n BORDER_BOTTOM_WIDTH,\n POINTER_EVENTS,\n },\n UPDATE_KEY: {\n UPDATE_NODE,\n UPDATE_STYLE,\n UPDATE_KEYS,\n UPDATE_COMPONENT,\n UPDATE_FOCUS,\n UPDATE_MEASURE,\n UPDATE_OVERWRITE,\n UPDATE_LIST,\n UPDATE_CONFIG,\n UPDATE_ADD_DOM,\n UPDATE_REMOVE_DOM,\n },\n NODE_KEY: {\n NODE_TAG_NAME,\n NODE_CACHE_STYLE,\n NODE_CACHE_PROPS,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_CURRENT_PROPS,\n NODE_DOM_PARENT,\n NODE_IS_MASK,\n NODE_REFRESH_LV,\n NODE_IS_DESTROYED,\n NODE_STYLE,\n NODE_UPDATE_HASH,\n NODE_UNIQUE_UPDATE_ID,\n NODE_CACHE,\n NODE_CACHE_TOTAL,\n NODE_CACHE_FILTER,\n NODE_CACHE_OVERFLOW,\n NODE_CACHE_MASK,\n NODE_STRUCT,\n },\n STRUCT_KEY: {\n STRUCT_INDEX,\n STRUCT_TOTAL,\n STRUCT_NODE,\n }\n} = enums;\nconst DIRECTION_HASH = {\n [TOP]: true,\n [RIGHT]: true,\n [BOTTOM]: true,\n [LEFT]: true,\n};\nconst { isNil, isObject, isFunction } = util;\nconst { AUTO, PX, PERCENT, INHERIT } = unit;\nconst { isRelativeOrAbsolute, equalStyle } = css;\nconst { contain, getLevel, isRepaint, NONE, FILTER, PERSPECTIVE, REPAINT, REFLOW, REBUILD } = level;\nconst { isIgnore, isGeom, isMeasure } = change;\n\nconst ROOT_DOM_NAME = {\n canvas: 'canvas',\n svg: 'svg',\n webgl: 'canvas',\n};\n\nfunction getDom(dom) {\n if(util.isString(dom) && dom) {\n let o = document.querySelector(dom);\n if(!o) {\n throw new Error('Can not find dom of selector: ' + dom);\n }\n return o;\n }\n if(!dom) {\n throw new Error('Can not find dom: ' + dom);\n }\n return dom;\n}\n\nfunction renderProp(k, v) {\n let s = Array.isArray(v) ? util.joinSourceArray(v) : util.stringify(v);\n if(k === 'className') {\n k = 'class';\n }\n else if(k === 'style') {\n return '';\n }\n return ' ' + k + '=\"' + util.encodeHtml(s, true) + '\"';\n}\n\nconst EVENT_LIST = ['click', 'dblclick', 'mousedown', 'mousemove', 'mouseup', 'touchstart', 'touchmove', 'touchend', 'touchcancel'];\n\nfunction initEvent(dom, Root) {\n let list = [];\n EVENT_LIST.forEach(type => {\n function cb(e) {\n let root = dom.__root;\n if(root && root instanceof Root) {\n if(['touchend', 'touchcancel', 'touchmove'].indexOf(type) > -1) {\n let target = root.__touchstartTarget;\n let event = root.__wrapEvent(e);\n event.target = target;\n while(target) {\n target.__emitEvent(event, true);\n target = target.domParent;\n }\n }\n else {\n root.__cb(e);\n }\n }\n }\n dom.addEventListener(type, cb);\n list.push([type, cb]);\n });\n return list;\n}\n\nfunction removeEvent(dom, list) {\n list.forEach(item => {\n dom.removeEventListener(item[0], item[1]);\n });\n}\n\n// 提取出对比节点尺寸是否固定非AUTO\nfunction isFixedWidthOrHeight(node, k) {\n let c = node.currentStyle[k];\n return c[1] !== AUTO;\n}\n// 除了固定尺寸,父级也不能是flex或变化flex\nfunction isFixedSize(node, includeParentFlex) {\n let res = isFixedWidthOrHeight(node, WIDTH) && isFixedWidthOrHeight(node, HEIGHT);\n if(res && includeParentFlex) {\n let parent = node.domParent;\n if(parent) {\n if(parent.currentStyle[DISPLAY] === 'flex' || parent.computedStyle[DISPLAY] === 'flex') {\n return false;\n }\n }\n }\n return res;\n}\n\nfunction isLAYOUT(node) {\n return node.hasOwnProperty('__uniqueReflowId');\n}\n\nlet __uniqueReflowId = 0;\nfunction setLAYOUT(node, hash, component, addDom) {\n if(!node.hasOwnProperty('__uniqueReflowId')) {\n node.__uniqueReflowId = __uniqueReflowId;\n hash[__uniqueReflowId++] = {\n node,\n component,\n addDom,\n };\n }\n}\n\n/**\n * 单独提出共用检测影响的函数,从节点本身开始向上分析影响,找到最上层的影响节点设置其重新布局\n * 过程即__checkReflow中所提及的,各种情况\n * 将影响升至最近的父级节点,并添加布局标识,这样后面的深度遍历会以父级为准忽略本身\n * 如果最终是root,则返回true标识,直接整个重新开始布局\n * ====\n * addDom情况下的特殊影响检测,类似checkInfluence\n * 添加的是absolute则只影响自己,大部分交互游戏情况属于此类型优化\n * 添加的是inline/inlineBlock的话,影响最近非inline父节点\n * 父为flex则直接影响父节点,不管添加情况如何\n * 添加block/flex的话,上下都block/flex则只影响自己,否则还是影响父节点\n * 如果最终是root,则返回true标识,直接整个重新开始布局\n * @returns {boolean}\n */\nfunction checkInfluence(root, reflowHash, node, component, addDom) {\n // add情况abs节点特殊对待不影响其它节点,不能判断display,因为inline会强制block\n if(addDom && node.currentStyle[POSITION] === 'absolute') {\n return;\n }\n let target = node;\n // inline新老都影响,节点变为最近的父非inline\n if(['inline', 'inlineBlock', 'inline-block'].indexOf(target.currentStyle[DISPLAY]) > -1\n || ['inline', 'inlineBlock', 'inline-block'].indexOf(target.computedStyle[DISPLAY]) > -1) {\n do {\n target = target.domParent;\n // 父到root提前跳出\n if(target === root) {\n return true;\n }\n // 父已有LAYOUT跳出防重\n if(isLAYOUT(target)) {\n return;\n }\n // 遇到absolute跳出,设置其布局;如果absolute不变化普通处理,如果absolute发生变化,一定会存在于列表中,不用考虑\n if(target.currentStyle[POSITION] === 'absolute' || target.computedStyle[POSITION] === 'absolute') {\n setLAYOUT(target, reflowHash, component, addDom);\n return;\n }\n }\n while(target && (['inline', 'inlineBlock', 'inline-block'].indexOf(target.currentStyle[DISPLAY]) > -1\n || ['inline', 'inlineBlock', 'inline-block'].indexOf(target.computedStyle[DISPLAY]) > -1));\n // target已不是inline,父固定宽高跳出直接父进行LAYOUT即可,不影响上下文,但不能是flex孩子,此时固定尺寸无用\n if(isFixedSize(target, true)) {\n setLAYOUT(target, reflowHash, component, addDom);\n return;\n }\n }\n // 此时target指向node,如果原本是inline则是其flow的非inline父\n let parent = target.domParent;\n // parent有LAYOUT跳出,已被包含\n if(isLAYOUT(parent)) {\n return;\n }\n // 向上检查flex,如果父级中有flex,以最上层的flex视作其更改,node本身flex不进入\n let topFlex;\n do {\n // 父已有LAYOUT跳出防重\n if(isLAYOUT(parent)) {\n return;\n }\n // flex相关,包含变化或不变化\n if(parent.computedStyle[DISPLAY] === 'flex' || parent.currentStyle[DISPLAY] === 'flex') {\n topFlex = parent;\n }\n // 遇到absolute跳出,如果absolute不变化普通处理,如果absolute发生变化,一定会存在于列表中,不用考虑\n if(parent.currentStyle[POSITION] === 'absolute' || parent.computedStyle[POSITION] === 'absolute') {\n break;\n }\n // 父固定宽高跳出\n if(isFixedSize(parent, true)) {\n break;\n }\n parent = parent.domParent;\n }\n while(parent);\n // 找到最上层flex,视作其更改\n if(topFlex) {\n target = topFlex;\n }\n if(target === root) {\n return true;\n }\n parent = target;\n // 向上检查非固定尺寸的absolute,找到则视为其变更,上面过程中一定没有出现absolute\n while(parent) {\n // 无论新老absolute,不变化则设置,变化一定会出现在列表中\n if(parent.currentStyle[POSITION] === 'absolute' || parent.computedStyle[POSITION] === 'absolute') {\n if(parent === root) {\n break;\n }\n // 固定尺寸的不用设置,需要跳出循环\n if(isFixedSize(parent)) {\n break;\n }\n else {\n setLAYOUT(parent, reflowHash, component, addDom);\n return;\n }\n }\n parent = parent.domParent;\n }\n // 向上查找了并且没提前跳出的target如果不等于自身则重新布局,自身外面设置过了\n if(target !== node) {\n setLAYOUT(target, reflowHash, component, addDom);\n }\n else if(addDom) {\n // 前后必须都是block,否则还是视为父布局\n let isSiblingBlock = true;\n let { prev, next } = node;\n if(prev && ['inline', 'inline-block', 'inlineBlock'].indexOf(prev.currentStyle[DISPLAY]) > -1) {\n isSiblingBlock = false;\n }\n else if(next && ['inline', 'inline-block', 'inlineBlock'].indexOf(next.currentStyle[DISPLAY]) > -1) {\n isSiblingBlock = false;\n }\n if(!isSiblingBlock) {\n target = node.domParent;\n if(target === root) {\n return true;\n }\n setLAYOUT(target, reflowHash, false, true);\n }\n }\n}\n\nlet uniqueUpdateId = 0;\nfunction parseUpdate(renderMode, root, target, reflowList, measureList, cacheHash, cacheList, zHash, zList) {\n let {\n [UPDATE_NODE]: node,\n [UPDATE_STYLE]: style,\n [UPDATE_OVERWRITE]: overwrite,\n [UPDATE_FOCUS]: focus,\n [UPDATE_COMPONENT]: component,\n [UPDATE_MEASURE]: measure,\n [UPDATE_LIST]: list,\n [UPDATE_KEYS]: keys,\n [UPDATE_CONFIG]: __config,\n [UPDATE_ADD_DOM]: addDom,\n [UPDATE_REMOVE_DOM]: removeDom,\n } = target;\n if(__config[NODE_IS_DESTROYED]) {\n return;\n }\n // updateStyle()这样的调用需要覆盖原有样式,因为是按顺序遍历,后面的优先级自动更高不怕重复\n if(overwrite) {\n Object.assign(__config[NODE_STYLE], overwrite);\n }\n // 多次调用更新才会有list,一般没有,优化;component无需,因为多次都是它自己\n if(list && !component) {\n keys = (keys || []).slice(0); // 防止原始值被更改\n let hash = {};\n keys.forEach(k => {\n hash[k] = true;\n });\n list.forEach(item => {\n let { [UPDATE_STYLE]: style2, [UPDATE_OVERWRITE]: overwrite, [UPDATE_KEYS]: keys2 } = item;\n (keys2 || []).forEach(k2 => {\n if(!hash.hasOwnProperty(k2)) {\n hash[k2] = true;\n keys.push(k2);\n }\n });\n if(overwrite) {\n Object.assign(__config[NODE_STYLE], overwrite);\n }\n if(style2) {\n if(style) {\n Object.assign(style, style2);\n }\n else {\n style = style2;\n }\n }\n });\n }\n // 按节点合并完style后判断改变等级\n let {\n [NODE_TAG_NAME]: tagName,\n [NODE_CACHE_STYLE]: __cacheStyle,\n [NODE_CACHE_PROPS]: __cacheProps,\n [NODE_CURRENT_STYLE]: currentStyle,\n [NODE_COMPUTED_STYLE]: computedStyle,\n [NODE_CURRENT_PROPS]: currentProps,\n [NODE_DOM_PARENT]: domParent,\n [NODE_IS_MASK]: isMask,\n } = __config;\n let lv = focus || NONE;\n let hasMeasure = measure;\n let hasZ, hasVisibility, hasColor, hasDisplay;\n // component无需遍历直接赋值,img重新加载等情况没有样式更新\n if(!component && style && keys) {\n for(let i = 0, len = keys.length; i < len; i++) {\n let k = keys[i];\n let v = style[k];\n // 只有geom的props和style2种可能\n if(node instanceof Geom && isGeom(tagName, k)) {\n if(!equalStyle(k, v, currentProps[k], node)) {\n lv |= REPAINT;\n __cacheProps[k] = undefined;\n currentProps[k] = v;\n }\n }\n else {\n // 需和现在不等,且不是pointerEvents这种无关的\n if(!equalStyle(k, v, currentStyle[k], node)) {\n // pointerEvents这种无关的只需更新\n if(isIgnore(k)) {\n __cacheStyle[k] = undefined;\n currentStyle[k] = v;\n }\n else {\n // TRBL变化只对relative/absolute起作用,其它忽视\n if(DIRECTION_HASH.hasOwnProperty(k)) {\n let position = currentStyle[POSITION];\n if(position !== 'relative' && position !== 'absolute') {\n delete style[k];\n continue;\n }\n }\n else if(k === DISPLAY) {\n hasDisplay = true;\n }\n // repaint细化等级,reflow在checkReflow()\n lv |= getLevel(k);\n if(isMeasure(k)) {\n hasMeasure = true;\n }\n // repaint置空,如果reflow会重新生成空的\n __cacheStyle[k] = undefined;\n currentStyle[k] = v;\n if(k === Z_INDEX && node !== root) {\n hasZ = true;\n }\n if(k === VISIBILITY) {\n hasVisibility = true;\n }\n if(k === COLOR) {\n hasColor = true;\n }\n }\n }\n }\n }\n }\n // 无任何改变处理的去除记录,如pointerEvents、无效的left\n // 但是perspective需考虑进来,虽然不影响自己但影响别人,要返回true表明有变更\n if(lv === NONE && !component) {\n delete __config[NODE_UNIQUE_UPDATE_ID];\n return;\n }\n // 由于父节点中有display:none,或本身节点也为none,执行普通动画是无效的,此时没有display变化\n if(computedStyle[DISPLAY] === 'none' && !hasDisplay) {\n return;\n }\n // 记录下来清除parent的zIndexChildren缓存\n if(hasZ && domParent) {\n delete domParent.__zIndexChildren;\n }\n // visibility/color变化,影响子继承\n if(hasVisibility || hasColor) {\n for(let __structs = root.__structs, __struct = node.__config[NODE_STRUCT], i = __struct[STRUCT_INDEX] + 1, len = i + __struct[STRUCT_TOTAL]; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_TOTAL]: total,\n } = __structs[i];\n let __config = node.__config;\n let currentStyle = __config[NODE_CURRENT_STYLE];\n let need;\n // text的style指向parent,因此text一定变更\n if(hasVisibility && (node instanceof Text || currentStyle[VISIBILITY][1] === INHERIT)) {\n need = true;\n }\n if(hasColor && (node instanceof Text || currentStyle[COLOR][1] === INHERIT)) {\n need = true;\n }\n if(need) {\n __config[NODE_REFRESH_LV] |= REPAINT;\n if(node instanceof Xom) {\n node.clearCache();\n }\n }\n else {\n i += total || 0;\n }\n }\n }\n // mask需清除遮罩对象的缓存\n if(isMask) {\n let prev = node.prev;\n while(prev && (prev.isMask)) {\n prev = prev.prev;\n }\n if(prev && prev.__config[NODE_CACHE_MASK]) {\n prev.__config[NODE_CACHE_MASK].release();\n }\n }\n // 特殊情况,父节点display:none,子节点进行任意变更,应视为无效\n // 如果父节点由none变block,这里也return false,因为父节点会重新layout+render\n // 如果父节点由block变none,同上,所以只要current/computed里有none就return false\n let parent = domParent;\n if(hasDisplay && parent) {\n let __config = parent.__config;\n if(__config[NODE_CURRENT_STYLE][DISPLAY] === 'none' || __config[NODE_COMPUTED_STYLE][DISPLAY] === 'none') {\n computedStyle[DISPLAY] = 'none';\n return;\n }\n }\n // reflow/repaint/measure相关的记录下来\n let isRp = !component && isRepaint(lv);\n if(isRp) {\n // zIndex变化需清空svg缓存\n if(hasZ && renderMode === mode.SVG) {\n lv |= REPAINT;\n domParent && cleanSvgCache(domParent);\n }\n // z改变影响struct局部重排,它的数量不会变因此不影响外围,此处先收集,最后统一对局部根节点进行更新\n if(hasZ && !component && zHash) {\n if(domParent && !domParent.hasOwnProperty('__uniqueZId')) {\n zHash[uniqueUpdateId] = true;\n domParent.__uniqueZId = uniqueUpdateId++;\n zList.push(domParent);\n }\n }\n }\n // reflow在root的refresh中做\n else {\n reflowList.push({\n node,\n style,\n component,\n addDom,\n removeDom,\n });\n // measure需要提前先处理\n if(hasMeasure) {\n measureList.push(node);\n }\n }\n // 这里也需|运算,每次刷新会置0,但是如果父元素进行继承变更,会在此元素分析前更改,比如visibility,此时不能直接赋值\n __config[NODE_REFRESH_LV] |= lv;\n if(component || addDom || removeDom) {\n root.__rlv = REBUILD;\n }\n else {\n root.__rlv = Math.max(root.__rlv, lv);\n }\n // dom在>=REPAINT时total失效,svg的Geom比较特殊\n let need = lv >= REPAINT || renderMode === mode.SVG && node instanceof Geom;\n if(need) {\n if(__config[NODE_CACHE]) {\n __config[NODE_CACHE].release();\n }\n }\n // perspective也特殊只清空total的cache,和>=REPAINT清空total共用\n if(need || contain(lv, PERSPECTIVE)) {\n if(__config[NODE_CACHE_TOTAL]) {\n __config[NODE_CACHE_TOTAL].release();\n }\n if(__config[NODE_CACHE_MASK]) {\n __config[NODE_CACHE_MASK].release();\n }\n if(__config[NODE_CACHE_OVERFLOW]) {\n __config[NODE_CACHE_OVERFLOW].release();\n }\n }\n // 特殊的filter清除cache\n if((need || contain(lv, FILTER)) && __config[NODE_CACHE_FILTER]) {\n __config[NODE_CACHE_FILTER].release();\n }\n // 向上清除等级>=REPAINT的汇总缓存信息,过程中可能会出现重复,因此节点上记录一个临时标防止重复递归\n while(parent) {\n let __config = parent.__config;\n // 向上查找,出现重复跳出\n if(__config.hasOwnProperty(NODE_UNIQUE_UPDATE_ID)) {\n let id = __config[NODE_UNIQUE_UPDATE_ID];\n if(cacheHash.hasOwnProperty(id)) {\n break;\n }\n cacheHash[id] = true;\n }\n // 没有的需要设置一个标识\n else {\n cacheHash[uniqueUpdateId] = true;\n __config[NODE_UNIQUE_UPDATE_ID] = uniqueUpdateId++;\n cacheList.push(__config);\n }\n let lv = __config[NODE_REFRESH_LV];\n let need = lv >= REPAINT;\n if(need && __config[NODE_CACHE]) {\n __config[NODE_CACHE].release();\n }\n // 前面已经过滤了无改变NONE的,只要孩子有任何改变父亲就要清除\n if(__config[NODE_CACHE_TOTAL]) {\n __config[NODE_CACHE_TOTAL].release();\n }\n if(__config[NODE_CACHE_FILTER]) {\n __config[NODE_CACHE_FILTER].release();\n }\n if(__config[NODE_CACHE_MASK]) {\n __config[NODE_CACHE_MASK].release();\n }\n if(__config[NODE_CACHE_OVERFLOW]) {\n __config[NODE_CACHE_OVERFLOW].release();\n }\n parent = __config[NODE_DOM_PARENT];\n }\n return true;\n}\n\nfunction cleanSvgCache(node, child) {\n let __config = node.__config;\n if(child) {\n __config[NODE_REFRESH_LV] |= REPAINT;\n }\n else {\n __config[NODE_CACHE_TOTAL].release();\n }\n if(Array.isArray(node.children)) {\n node.children.forEach(child => {\n if(child instanceof Component) {\n child = child.shadowRoot;\n }\n if(!(child instanceof Text)) {\n cleanSvgCache(child, true);\n }\n });\n }\n}\n\nlet uuid = 0;\n\nclass Root extends Dom {\n constructor(tagName, props, children) {\n super(tagName, props);\n this.__cd = children || []; // 原始children,再初始化过程中生成真正的dom\n this.__dom = null; // 真实DOM引用\n this.__mw = 0; // 记录最大宽高,防止尺寸变化清除不完全\n this.__mh = 0;\n // this.__scx = 1; // 默认缩放,css改变canvas/svg缩放后影响事件坐标,有值手动指定,否则自动计算\n // this.__scy = 1;\n this.__taskUp = [];\n this.__taskCp = [];\n this.__ref = {};\n this.__reflowList = [{ node: this }]; // 初始化填自己,第一次布局时复用逻辑完全重新布局\n this.__animateController = new Controller();\n Event.mix(this);\n this.__config[NODE_UPDATE_HASH] = this.__updateHash = {};\n this.__uuid = uuid++;\n this.__rlv = REBUILD; // 每次刷新最大lv\n }\n\n __initProps() {\n let w = this.props.width;\n if(!isNil(w)) {\n let value = parseFloat(w) || 0;\n if(value > 0) {\n this.__width = value;\n }\n }\n let h = this.props.height;\n if(!isNil(h)) {\n let value = parseFloat(h) || 0;\n if(value > 0) {\n this.__height = value;\n }\n }\n }\n\n __genHtml(domName) {\n let res = `<${domName}`;\n // 拼接处理属性\n Object.keys(this.props).forEach(k => {\n let v = this.props[k];\n // 忽略事件\n if(!/^on[a-zA-Z]/.test(k)) {\n res += renderProp(k, v);\n }\n });\n res += `>${domName}>`;\n return res;\n }\n\n __wrapEvent(e) {\n let x, y;\n // 触摸结束取消特殊没有touches\n if(['touchend', 'touchcancel'].indexOf(e.type) === -1) {\n let { dom, __scx, __scy } = this;\n let { x: x2, y: y2, left, top, width, height } = dom.getBoundingClientRect();\n x = x2 || left || 0;\n y = y2 || top || 0;\n let { clientX, clientY } = e.touches ? e.touches[0] : e;\n x = clientX - x;\n y = clientY - y;\n // 外边的scale影响元素事件响应,根据倍数计算真实的坐标,优先手动指定,否则自动计算\n if(!isNil(__scx)) {\n x /= __scx;\n }\n else {\n x *= this.width / width;\n }\n if(!isNil(__scy)) {\n y /= __scy;\n }\n else {\n y *= this.height / height;\n }\n }\n return {\n event: e,\n stopPropagation() {\n this.__stopPropagation = true;\n e.stopPropagation();\n },\n stopImmediatePropagation() {\n this.__stopPropagation = true;\n this.__stopImmediatePropagation = true;\n e.stopImmediatePropagation();\n },\n preventDefault() {\n e.preventDefault();\n },\n x,\n y,\n __hasEmitted: false,\n };\n }\n\n // 类似touchend/touchcancel/touchmove这种无需判断是否发生于元素上,直接响应\n __cb(e) {\n if(e.type === 'touchmove' && !this.__touchstartTarget) {\n return;\n }\n let data = this.__wrapEvent(e);\n this.__emitEvent(data);\n return data;\n }\n\n /**\n * 添加到真实Dom上,优先已存在的同名canvas/svg节点,没有则dom下生成新的\n * @param dom\n */\n appendTo(dom) {\n dom = getDom(dom);\n this.__children = builder.initRoot(this.__cd, this);\n this.__initProps();\n this.__root = this;\n let tagName = this.tagName;\n let domName = ROOT_DOM_NAME[tagName];\n // OffscreenCanvas兼容,包含worker的\n if(typeof window !== 'undefined' && window.OffscreenCanvas && (dom instanceof window.OffscreenCanvas)\n || typeof self !== 'undefined' && self.OffscreenCanvas && (dom instanceof self.OffscreenCanvas)) {\n this.__dom = dom;\n this.__width = dom.width;\n this.__height = dom.height;\n }\n // 已有root节点\n else if(dom.nodeName.toLowerCase() === domName) {\n this.__dom = dom;\n if(this.width) {\n dom.setAttribute('width', this.width);\n }\n if(this.height) {\n dom.setAttribute('height', this.height);\n }\n }\n // 没有canvas/svg节点则生成一个新的\n else {\n this.__dom = dom.querySelector(domName);\n if(!this.__dom) {\n dom.innerHTML = this.__genHtml(domName);\n this.__dom = dom.querySelector(domName);\n }\n }\n this.__defs = this.dom.__defs || Defs.getInstance(this.__uuid);\n // 没有设置width/height则采用css计算形式\n if(!this.width || !this.height) {\n let domCss = window.getComputedStyle(dom, null);\n if(!this.width) {\n this.__width = parseFloat(domCss.getPropertyValue('width')) || 0;\n dom.setAttribute('width', this.width);\n }\n if(!this.height) {\n this.__height = parseFloat(domCss.getPropertyValue('height')) || 0;\n dom.setAttribute('height', this.height);\n }\n }\n // 最终无宽高给出警告\n if(!this.width || !this.height) {\n inject.warn('Karas render target with a width or height of 0.')\n }\n let params = Object.assign({}, ca, this.props.contextAttributes);\n // 只有canvas有ctx,svg用真实dom\n if(this.tagName === 'canvas') {\n this.__ctx = this.__dom.getContext('2d', params);\n this.__renderMode = mode.CANVAS;\n }\n else if(this.tagName === 'svg') {\n this.__renderMode = mode.SVG;\n }\n else if(this.tagName === 'webgl') {\n let gl = this.__ctx = this.__dom.getContext('webgl', params);\n this.__renderMode = mode.WEBGL;\n gl.program = webgl.initShaders(gl, vertex, fragment);\n gl.programMask = webgl.initShaders(gl, vertexMask, fragmentMask);\n gl.programClip = webgl.initShaders(gl, vertexMask, fragmentClip);\n gl.programOverflow = webgl.initShaders(gl, vertexMask, fragmentOverflow);\n gl.programCm = webgl.initShaders(gl, vertexCm, fragmentCm);\n gl.useProgram(gl.program);\n // 第一次渲染生成纹理缓存管理对象,收集渲染过程中生成的纹理并在gl纹理单元满了时进行绘制和清空,减少texImage2d耗时问题\n const MAX_TEXTURE_IMAGE_UNITS = Math.min(16, gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS));\n this.__texCache = new TexCache(MAX_TEXTURE_IMAGE_UNITS);\n }\n this.refresh(null, true);\n // 第一次节点没有__root,渲染一次就有了才能diff\n if(this.dom.__root && this.dom.__root instanceof Root) {\n this.dom.__root.destroy();\n }\n this.__eventCbList = initEvent(this.dom, Root);\n this.dom.__root = this;\n }\n\n refresh(cb, isFirst) {\n this.__hookTask = null;\n let { isDestroyed, renderMode, ctx, defs, width, height } = this;\n if(isDestroyed) {\n return;\n }\n defs.clear();\n // 首次递归测量整树的继承,后续更改各自更新机制做,防止每次整树遍历;root检查首次直接做,后续在checkUpdate()中插入\n if(isFirst) {\n this.__checkRoot(renderMode, width, height);\n this.__computeMeasure(renderMode, ctx);\n }\n // 非首次刷新如果没有更新则无需继续\n else if(!this.__checkUpdate(renderMode, ctx, width, height)) {\n return;\n }\n // 获取所有字体和大小测量,仅svg需要,canvas直接做\n inject.measureText();\n this.__checkReflow(width, height);\n if(renderMode === mode.CANVAS && !this.props.noRender) {\n this.__clear(ctx, renderMode);\n struct.renderCanvas(renderMode, ctx, this);\n }\n // svg的特殊diff需要\n else if(renderMode === mode.SVG && !this.props.noRender) {\n struct.renderSvg(renderMode, defs, this, isFirst);\n let nvd = this.virtualDom;\n nvd.defs = defs.value;\n if(this.dom.__vd) {\n // console.log(this.dom.__vd);\n // console.log(nvd);\n domDiff(this.dom, this.dom.__vd, nvd);\n }\n else {\n this.dom.innerHTML = util.joinVirtualDom(nvd);\n }\n this.dom.__vd = nvd;\n this.dom.__defs = defs;\n }\n else if(renderMode === mode.WEBGL && !this.props.noRender) {\n this.__clear(ctx, renderMode);\n struct.renderWebgl(renderMode, ctx, this);\n }\n // 特殊cb,供小程序绘制完回调使用\n if(isFunction(cb)) {\n cb();\n }\n this.emit(Event.REFRESH, this.__rlv);\n this.__rlv = NONE;\n }\n\n destroy() {\n this.__destroy();\n this.animateController.__destroy();\n let n = this.dom;\n if(n) {\n removeEvent(n, this.__eventCbList || []);\n n.__root = null;\n }\n let gl = this.ctx;\n if(this.__texCache && gl) {\n this.__texCache.release(gl);\n if(gl.program) {\n gl.deleteShader(gl.program.vertexShader);\n gl.deleteShader(gl.program.fragmentShader);\n gl.deleteProgram(gl.program);\n }\n if(gl.programMask) {\n gl.deleteShader(gl.programMask.vertexShader);\n gl.deleteShader(gl.programMask.fragmentShader);\n gl.deleteProgram(gl.programMask);\n }\n if(gl.programOverflow) {\n gl.deleteShader(gl.programOverflow.vertexShader);\n gl.deleteShader(gl.programOverflow.fragmentShader);\n gl.deleteProgram(gl.programOverflow);\n }\n }\n }\n\n scale(x = 1, y = x) {\n this.__scx = x;\n this.__scy = y;\n }\n\n resize(w, h, cb) {\n let self = this;\n if(w !== self.width || h !== self.height) {\n self.__width = w;\n self.__height = h;\n self.updateStyle({\n width: w,\n height: h,\n }, cb);\n }\n else if(isFunction(cb)) {\n cb(-1);\n }\n }\n\n addRefreshTask(cb) {\n let { taskUp, isDestroyed } = this;\n if(isDestroyed) {\n return;\n }\n // 第一个添加延迟侦听,后续放队列等待一并执行\n if(!taskUp.length) {\n let clone;\n frame.nextFrame({\n __before: diff => {\n if(this.isDestroyed) {\n return;\n }\n clone = taskUp.splice(0);\n // 前置一般是动画计算此帧样式应用,然后刷新后出发frame事件,图片加载等同\n if(clone.length) {\n clone.forEach((item, i) => {\n if(isObject(item) && isFunction(item.__before)) {\n item.__before(diff);\n }\n });\n }\n },\n __after: diff => {\n if(this.isDestroyed) {\n return;\n }\n clone.forEach(item => {\n if(isObject(item) && isFunction(item.__after)) {\n item.__after(diff);\n }\n else if(isFunction(item)) {\n item(diff);\n }\n });\n }\n });\n this.__frameHook();\n }\n if(taskUp.indexOf(cb) === -1) {\n taskUp.push(cb);\n }\n }\n\n addForceRefreshTask(cb) {\n this.__hasRootUpdate = true;\n this.addRefreshTask(cb);\n }\n\n delRefreshTask(cb) {\n if(!cb) {\n return;\n }\n let { taskUp } = this;\n for(let i = 0, len = taskUp.length; i < len; i++) {\n if(taskUp[i] === cb) {\n taskUp.splice(i, 1);\n break;\n }\n }\n }\n\n /**\n * 为component的setState更新专门开辟个独立的流水线,root/frame中以taskCp存储更新列表\n * 普通的动画、img加载等都走普通的refresh的task,component走这里,frame中的结构同样\n * 在frame的每帧调用中,先执行普通的动画task,再执行component的task\n * 这样动画执行完后,某个cp的sr及子节点依旧先进行了动画变更,进入__addUpdate()环节\n * 然后此cp再更新sr及子节点,这样会被__addUpdate()添加到尾部,依赖目前浏览器默认实现\n * 上一行cp更新过程中是updater.check()进行的,如果有新老交换且有动画,动画的assigning是true,进行继承\n * root刷新parseUpdate()时,老的sr及子节点先进行,随后新的sr后进行且有component标识,sr子节点不会有更新\n * @param cb\n */\n addRefreshCp(cb) {\n let { taskCp, isDestroyed } = this;\n if(isDestroyed) {\n return;\n }\n // 每次只执行1次\n if(!taskCp.length) {\n let clone;\n frame.__nextFrameCp({\n __before: diff => {\n if(this.isDestroyed) {\n return;\n }\n clone = taskCp.splice(0);\n if(clone.length) {\n clone.forEach(item => {\n item.__before(diff);\n });\n updater.check(this);\n let len = updater.updateList.length;\n if(len) {\n updater.updateList.forEach(cp => {\n let root = cp.root; // 多个root并存时可能cp的引用不相同,需分别获取\n let sr = cp.shadowRoot;\n // 可能返回text,需视为其parentNode\n if(sr instanceof Text) {\n sr = sr.domParent;\n }\n let res = {};\n res[UPDATE_NODE] = sr;\n res[UPDATE_STYLE] = sr.currentStyle;\n res[UPDATE_FOCUS] = REFLOW;\n res[UPDATE_MEASURE] = true;\n res[UPDATE_COMPONENT] = cp;\n res[UPDATE_CONFIG] = sr.__config;\n this.__addUpdate(sr, sr.__config, root, root.__config, res);\n });\n }\n }\n },\n __after: diff => {\n if(this.isDestroyed) {\n return;\n }\n clone.forEach(item => {\n item.__after(diff);\n });\n // 触发didUpdate\n updater.did();\n },\n });\n this.__frameHook();\n }\n if(taskCp.indexOf(cb) === -1) {\n taskCp.push(cb);\n }\n }\n\n getTargetAtPoint(x, y, includeIgnore) {\n function scan(vd, x, y, path, zPath) {\n let { __sx1, __sy1, offsetWidth, offsetHeight, matrixEvent, children, zIndexChildren,\n computedStyle: { [DISPLAY]: display, [POINTER_EVENTS]: pointerEvents } } = vd;\n if(!includeIgnore && display === 'none') {\n return;\n }\n if(Array.isArray(zIndexChildren)) {\n for(let i = 0, len = children.length; i < len; i++) {\n children[i].__index__ = i;\n }\n for(let i = zIndexChildren.length - 1; i >= 0; i--) {\n let item = zIndexChildren[i];\n if(item instanceof karas.Text) {\n continue;\n }\n let path2 = path.slice();\n path2.push(item.__index__);\n let zPath2 = zPath.slice();\n zPath2.push(i);\n let res = scan(item, x, y, path2, zPath2);\n if(res) {\n return res;\n }\n }\n }\n if(!includeIgnore && pointerEvents === 'none') {\n return;\n }\n let inThis = geom.pointInQuadrilateral(\n x, y,\n __sx1, __sy1,\n __sx1 + offsetWidth, __sy1,\n __sx1 + offsetWidth, __sy1 + offsetHeight,\n __sx1, __sy1 + offsetHeight,\n matrixEvent\n );\n if(inThis) {\n return {\n target: vd,\n path,\n zPath,\n };\n }\n }\n return scan(this, x, y, [], []);\n }\n\n /**\n * 每次刷新前检查root节点的样式,有些固定的修改无效,有些继承的作为根初始化\n * @param renderMode\n * @param width\n * @param height\n * @private\n */\n __checkRoot(renderMode, width, height) {\n let { dom, currentStyle, computedStyle } = this;\n // canvas/svg作为根节点一定是block或flex,不会是inline\n if(['flex', 'block'].indexOf(currentStyle[DISPLAY]) === -1) {\n computedStyle[DISPLAY] = currentStyle[DISPLAY] = 'block';\n }\n // 同理position不能为absolute\n if(currentStyle[POSITION] === 'absolute') {\n computedStyle[POSITION] = currentStyle[POSITION] = 'static';\n }\n // 根节点满宽高\n currentStyle[WIDTH] = [width, PX];\n currentStyle[HEIGHT] = [height, PX];\n computedStyle[WIDTH] = width;\n computedStyle[HEIGHT] = height;\n // 可能调用resize()导致变更,要重设,canvas无论离屏与否都可使用直接赋值,svg则按dom属性api\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n if(dom.width !== width) {\n dom.width = width;\n }\n if(dom.height !== height) {\n dom.height = height;\n }\n }\n else if(renderMode === mode.SVG) {\n dom.setAttribute('width', width);\n dom.setAttribute('height', height);\n }\n }\n\n /**\n * 添加更新入口,按节点汇总更新信息\n * @private\n */\n __addUpdate(node, nodeConfig, root, rootConfig, o) {\n let updateHash = rootConfig[NODE_UPDATE_HASH];\n // root特殊处理,检查变更时优先看继承信息\n if(node === root) {\n updateHash = root.__updateRoot;\n if(updateHash) {\n if(o[UPDATE_FOCUS]) {\n updateHash[UPDATE_FOCUS] |= o[UPDATE_FOCUS];\n }\n if(o[UPDATE_MEASURE]) {\n updateHash[UPDATE_MEASURE] = true;\n }\n // 后续存在新建list上,需增加遍历逻辑\n if(o[UPDATE_STYLE]) {\n let list = updateHash[UPDATE_LIST] = updateHash[UPDATE_LIST] || [];\n list.push({\n [UPDATE_STYLE]: o[UPDATE_STYLE],\n [UPDATE_OVERWRITE]: o[UPDATE_OVERWRITE],\n [UPDATE_KEYS]: o[UPDATE_KEYS],\n });\n }\n }\n else {\n root.__updateRoot = o;\n }\n }\n else if(!nodeConfig.hasOwnProperty(NODE_UNIQUE_UPDATE_ID)) {\n nodeConfig[NODE_UNIQUE_UPDATE_ID] = uniqueUpdateId;\n // 大多数情况节点都只有一次更新,所以优化首次直接存在style上,后续存在list\n updateHash[uniqueUpdateId++] = o;\n }\n else if(updateHash.hasOwnProperty(nodeConfig[NODE_UNIQUE_UPDATE_ID])) {\n let target = updateHash[nodeConfig[NODE_UNIQUE_UPDATE_ID]];\n if(o[UPDATE_FOCUS]) {\n target[UPDATE_FOCUS] |= o[UPDATE_FOCUS];\n }\n if(o[UPDATE_MEASURE]) {\n target[UPDATE_MEASURE] = true;\n }\n // 后续存在新建list上,需增加遍历逻辑\n if(o[UPDATE_STYLE]) {\n let list = target[UPDATE_LIST] = target[UPDATE_LIST] || [];\n list.push({\n [UPDATE_STYLE]: o[UPDATE_STYLE],\n [UPDATE_OVERWRITE]: o[UPDATE_OVERWRITE],\n [UPDATE_KEYS]: o[UPDATE_KEYS],\n });\n }\n }\n else {\n inject.error('Update process miss uniqueUpdateId');\n }\n }\n\n /**\n * 除首次外每次刷新前检查更新列表,计算样式变化,以及测量信息\n * @private\n */\n __checkUpdate(renderMode, ctx, width, height) {\n let root = this;\n let measureList = [];\n let reflowList = [];\n let cacheHash = {};\n let cacheList = [];\n let zHash = {};\n let zList = [];\n let updateRoot = root.__updateRoot;\n let updateHash = root.__updateHash;\n // 给个方式使得外部可以强制刷新\n let hasUpdate = root.__hasRootUpdate;\n root.__hasRootUpdate = false;\n // root更新特殊提前,因为有继承因素\n if(updateRoot) {\n root.__updateRoot = null;\n hasUpdate = parseUpdate(renderMode, root, updateRoot,\n reflowList, measureList, cacheHash, cacheList);\n // 此时做root检查,防止root出现继承等无效样式,或者发生resize()\n if(hasUpdate) {\n root.__checkRoot(renderMode, width, height);\n }\n }\n // 汇总处理每个节点,k是递增数字直接循环遍历\n let keys = Object.keys(updateHash);\n for(let i = 0, len = keys.length; i < len; i++) {\n let t = parseUpdate(renderMode, root, updateHash[keys[i]],\n reflowList, measureList, cacheHash, cacheList, zHash, zList);\n hasUpdate = hasUpdate || t;\n }\n // 先做一部分reset避免下面measureList干扰,cacheList的是专门收集新增的额外节点\n root.__reflowList = reflowList;\n uniqueUpdateId = 0;\n root.__updateHash = root.__config[NODE_UPDATE_HASH] = {};\n cacheList.forEach(__config => {\n delete __config[NODE_UNIQUE_UPDATE_ID];\n });\n // zIndex改变的汇总修改,防止重复操作\n zList.forEach(item => {\n if(item.hasOwnProperty('__uniqueZId')) {\n delete item.__uniqueZId;\n item.__updateStruct(root.__structs);\n }\n });\n /**\n * 遍历每项节点,计算测量信息,节点向上向下查找继承信息,如果parent也是继承,先计算parent的\n * 过程中可能会出现重复,因此节点上记录一个临时标防止重复递归\n */\n let measureHash = {};\n measureList.forEach(node => {\n let { __config:{ [NODE_UNIQUE_UPDATE_ID]: __uniqueUpdateId, [NODE_DOM_PARENT]: parent } } = node;\n // 在root下的component变更时root会进入,但其没有__uniqueUpdateId\n if(node !== root) {\n if(measureHash.hasOwnProperty(__uniqueUpdateId)) {\n return;\n }\n measureHash[__uniqueUpdateId] = true;\n }\n let last = node;\n // 检查measure的属性是否是inherit,在root下的component变更时root会进入,但其没有__uniqueUpdateId\n // 另外dom标识表明有dom变更强制进入\n let isInherit = node !== root\n && (updateHash[__uniqueUpdateId][UPDATE_ADD_DOM]\n || change.isMeasureInherit(updateHash[__uniqueUpdateId][UPDATE_STYLE]));\n // 是inherit,需要向上查找,从顶部向下递归计算继承信息\n if(isInherit) {\n while(parent && parent !== root) {\n let { __config: {\n [NODE_UNIQUE_UPDATE_ID]: __uniqueUpdateId,\n }, currentStyle } = parent;\n let isInherit;\n if(parent.__config.hasOwnProperty(NODE_UNIQUE_UPDATE_ID)) {\n let style = updateHash[__uniqueUpdateId][UPDATE_STYLE];\n measureHash[__uniqueUpdateId] = true;\n let temp = change.measureInheritList(style);\n isInherit = !!temp.length;\n }\n else {\n isInherit = change.isMeasureInherit(currentStyle);\n }\n // 如果parent有inherit存入列表且继续向上,否则跳出循环\n if(isInherit) {\n last = parent;\n }\n else {\n break;\n }\n // 考虑component下的继续往上继承\n parent = parent.domParent;\n }\n }\n // 自顶向下查找inherit的,利用已有的方法+回调,当递归包含重复时标记防止重复\n last.__computeMeasure(renderMode, ctx, function(target) {\n if(target.__config.hasOwnProperty(NODE_UNIQUE_UPDATE_ID)) {\n measureHash[target.__config[NODE_UNIQUE_UPDATE_ID]] = true;\n }\n });\n });\n // 做完清空留待下次刷新重来\n for(let i = 0, len = keys.length; i < len; i++) {\n delete updateHash[keys[i]][UPDATE_CONFIG][NODE_UNIQUE_UPDATE_ID];\n }\n return hasUpdate;\n }\n\n /**\n * 除首次外每次刷新前检查reflow列表,计算需要reflow的节点局部重新布局\n * 当一个元素absolute不变时,其变化不会影响父元素和兄弟元素,直接自己重新局部LAYOUT包含子节点\n * 当absolute发生改变时,其变化会影响父和兄弟,视作父重新布局\n * 当inline变化时,视为其最近block/flex父变化\n * 当block变化时,往上查找最上层flex视为其变化,如不是则影响后面兄弟offset和父resize\n * 当flex变化时,往上查找最上层flex视为其变化,如不是则影响所有递归子节点layout和父resize\n * 以上3种情况向上查找时遇到absolute父均提前跳出,并标记absolute父LAYOUT\n * 上面所有情况即便结束还得额外看是否处于absolute中,是还是标记absolute重新布局\n * 当relative只变化left/top/right/bottom时,自己重新layout\n * 检测节点时记录影响的所有节点,最终形成一棵或n棵局部树\n * 需要重新布局的记作LAYOUT,被兄弟影响只需偏移的记作OFFSET,OFFSET可能会重复变为LAYOUT\n * 上述情况倘若发生包含重复,去掉子树,因子树视为被包含的重新布局\n * 如果有从root开始的,直接重新布局像首次那样即可\n * 如果非root,所有树根按先根顺序记录下来,依次执行局部布局\n * =========================\n * addDom比较特殊,是向已有节点中添加新的节点,检查影响与普通domDiff变化不同\n * @private\n */\n __checkReflow(width, height) {\n let { __reflowList: reflowList } = this;\n if(!reflowList.length) {\n return;\n }\n let root = this;\n let uniqueList = [];\n let hasRoot;\n __uniqueReflowId = 0;\n let reflowHash = {};\n // 遍历检查发生布局改变的节点列表,此时computedStyle还是老的,currentStyle是新的\n for(let i = 0, len = reflowList.length; i < len; i++) {\n let item = reflowList[i];\n let { node, component, addDom, removeDom } = item;\n // root提前跳出,完全重新布局\n if(node === this) {\n hasRoot = true;\n break;\n }\n // 添加时如果是cp则node取sr来布局\n if(addDom && node instanceof Component) {\n node = node.shadowRoot;\n }\n // 每个节点生成唯一的布局识别id存入hash防止重复\n if(!node.hasOwnProperty('__uniqueReflowId')) {\n node.__uniqueReflowId = __uniqueReflowId;\n reflowHash[__uniqueReflowId++] = item;\n }\n // 每个节点都向上检查影响,以及是否从root开始完全重新,remove特殊对待,影响父节点视为普通父节点relay\n if(checkInfluence(root, reflowHash, node, component, addDom)) {\n hasRoot = true;\n if(addDom) {\n this.__zIndexChildren = null;\n }\n break;\n }\n // remove的要特殊对待,因为提前删除了父子兄弟关系,下面deepScan不会出现\n else if(removeDom) {\n uniqueList.push(item);\n }\n }\n __uniqueReflowId = 0;\n this.__reflowList = [];\n // 有root提前跳出\n if(hasRoot) {\n reflow.clearUniqueReflowId(reflowHash);\n // 布局分为两步,普通流和定位流,互相递归\n this.__layout({\n x: 0,\n y: 0,\n w: width,\n h: height,\n }, false, false);\n // 绝对布局需要从根开始保存相对坐标系的容器引用,并根据relative/absolute情况变更\n this.__layoutAbs(this, {\n x: 0,\n y: 0,\n w: width,\n h: height,\n });\n this.__structs = this.__structure(0, 0);\n return true;\n }\n /**\n * 修剪树,自顶向下深度遍历\n * LAYOUT节点作为局部根,其递归子节点无需重复任何操作,直接去重\n * OFFSET节点作为局部根,其递归子节点先执行任何操作,后续根节点再偏移一次\n */\n else {\n this.__deepScan(function(node, options) {\n if(node.hasOwnProperty('__uniqueReflowId')) {\n let o = reflowHash[node.__uniqueReflowId];\n options.uniqueList.push(o);\n // 返回true即可提前结束深度遍历,在reflowHash有记录时提前跳出,子节点交由上面逻辑执行\n return true;\n }\n // reflowHash没有记录则无返回继续递归执行\n }, { uniqueList });\n /**\n * 按顺序执行列表即可,上层LAYOUT先执行且停止递归子节点,上层OFFSET后执行等子节点先LAYOUT/OFFSET\n * 同级按先后顺序排列,过程中记录diff在结束后进行structs更新\n * 这里要注意margin合并的逻辑,因为最终都是block(flex等同),需要进行合并\n * 在处理一个block时,先判断是否是空block,同时看后面紧邻的有没有在uniqueList的下一个\n * 单独空block处理、2个相邻的非block处理直接可以进行判断\n * 中间的空block(即非空block的下一个是空block,且下一个不是最后一个),先记录下来list,合并后一并offset\n * 合并margin和Dom的逻辑一样,抽离共有方法\n **/\n let diffList = [];\n let diffI = 0;\n let mergeOffsetList = [];\n let __uniqueMergeOffsetId = 0;\n uniqueList.forEach(item => {\n let { node, component, addDom, removeDom } = item;\n // 重新layout的w/h数据使用之前parent暂存的,x使用parent,y使用prev或者parent的\n let cps = node.computedStyle, cts = node.currentStyle;\n let zIndex = cps[Z_INDEX], position = cps[POSITION], display = cps[DISPLAY];\n let isLastAbs = position === 'absolute';\n let isNowAbs = cts[POSITION] === 'absolute';\n let isLastNone = display === 'none';\n let isNowNone = cts[DISPLAY] === 'none';\n // none不可见布局无效可以无视\n if(isLastNone && isNowNone) {\n return;\n }\n let parent = node.domParent;\n let { __layoutData: { x, y, h }, width, computedStyle } = parent;\n let current = node;\n // cp的shadowRoot要向上到cp本身,考虑高阶组件在内到真正的顶层cp\n if(current.isShadowRoot) {\n current = current.hostRoot;\n }\n // y使用prev或者parent的,首个节点无prev,prev要忽略absolute的和display:none的\n let ref = current.prev;\n let hasFlowPrev;\n while(ref) {\n if(ref instanceof Text\n || (ref.computedStyle[POSITION] !== 'absolute' && ref.computedStyle[DISPLAY] !== 'none')) {\n y = ref.y + ref.outerHeight;\n hasFlowPrev = true;\n break;\n }\n ref = ref.prev;\n }\n // 找不到prev以parent为基准,找到则增加自身,排除remove\n if(!removeDom) {\n if(!hasFlowPrev) {\n y += computedStyle[MARGIN_TOP] + computedStyle[BORDER_TOP_WIDTH] + computedStyle[PADDING_TOP];\n }\n x += computedStyle[MARGIN_LEFT] + computedStyle[BORDER_LEFT_WIDTH] + computedStyle[PADDING_LEFT];\n }\n // 找到最上层容器,如果是组件的子节点,以sr为container,sr本身往上找\n let container = node;\n // remove的节点本身无需再次布局\n if(!removeDom) {\n if(isNowAbs) {\n container = container.domParent;\n while(container && container !== root) {\n if(isRelativeOrAbsolute(container)) {\n break;\n }\n // 不能用domParent,必须在组件环境内\n if(container.parent) {\n container = container.parent;\n }\n else if(container.host) {\n break;\n }\n }\n if(!container) {\n container = root;\n }\n // 由setState引发的要检查是cp自身还是更上层,如果cp被abs包含,那么node是cp的父亲,否则node是cp的sr\n // 而这种情况下传cp或node都一样,所以最终统一传node\n parent.__layoutAbs(container, parent.__layoutData, node);\n // 优先判断dom变更\n if(addDom) {\n let arr = parent.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n parent.__updateStruct(root.__structs);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(parent);\n }\n return;\n }\n // 前后都是abs无需偏移后面兄弟和parent调整,component变化节点需更新struct\n else if(isLastAbs) {\n if(component) {\n let arr = node.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n if((position !== cts[POSITION] && (position === 'static' || cts[POSITION] === 'static'))\n || zIndex !== cts[Z_INDEX]) {\n parent.__updateStruct(root.__structs);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(parent);\n }\n }\n }\n else if(isLastNone || isNowNone) {\n node.__zIndexChildren = null;\n let arr = node.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n }\n return;\n }\n // 标识flow变abs,可能引发zIndex变更,重设struct和svg\n parent.__updateStruct(root.__structs);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(parent);\n }\n }\n // 现在是普通流,不管之前是啥直接布局,排除remove删除的\n else {\n node.__layout({\n x,\n y,\n w: width,\n h,\n }, false, false);\n y += node.outerHeight;\n if(component) {\n container = node;\n }\n else {\n container = container.domParent;\n while(container && container !== root) {\n if(isRelativeOrAbsolute(container)) {\n break;\n }\n // 不能用domParent,必须在组件环境内\n if(container.parent) {\n container = container.parent;\n }\n else if(container.host) {\n break;\n }\n }\n }\n if(!container) {\n container = root;\n }\n // 防止geom\n if(node instanceof Dom) {\n node.__layoutAbs(container, {\n x,\n y,\n w: width,\n h,\n });\n }\n }\n }\n\n // 向上查找最近的parent是relative,需再次累加ox/oy,无需继续向上递归,因为parent已经递归包含了\n // 这样node重新布局后再次设置其使用parent的偏移\n let p = node;\n while(p && p !== root) {\n p = p.domParent;\n computedStyle = p.computedStyle;\n if(computedStyle[POSITION] === 'relative') {\n let { ox, oy } = p;\n ox && node.__offsetX(ox);\n oy && node.__offsetY(oy);\n break;\n }\n }\n\n // 向下调整next的flow位置,遇到重复LAYOUT的跳出等待其调用并处理其next,忽视掉abs,margin和abs在merge中做\n if(node.isShadowRoot) {\n node = node.hostRoot;\n }\n let next = node.next;\n while(next && !next.hasOwnProperty('__uniqueReflowId')) {\n if(next.computedStyle[POSITION] === 'absolute') {\n next = next.next;\n continue;\n }\n let { y: oy } = next;\n let diff = y - oy;\n if(diff) {\n while(next && !next.hasOwnProperty('__uniqueReflowId')) {\n let target = next;\n if(target instanceof Component) {\n target = target.shadowRoot;\n }\n let cs = target.computedStyle;\n if(cs[POSITION] !== 'absolute' && cs[DISPLAY] !== 'none') {\n target.__offsetY(diff, true, REPAINT);\n }\n next = next.next;\n }\n }\n break;\n }\n\n // 去重防止abs并记录parent,整个结束后按先序顺序进行margin合并以及偏移,注意忽略有display:none变block同时为absolute的\n if(!parent.hasOwnProperty('__uniqueMergeOffsetId') && !(isNowAbs && isLastNone)) {\n parent.__uniqueMergeOffsetId = __uniqueMergeOffsetId++;\n mergeOffsetList.push(parent);\n }\n\n // add和remove都需父节点重新生成struct,zIndexChildren已在对应api操作的before()侦听做了\n if(addDom || removeDom) {\n let arr = parent.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(parent);\n }\n }\n // component未知dom变化,所以强制重新struct,text则为其父节点,同时防止zIndex变更影响父节点\n else if(component) {\n let arr = node.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n if((position !== cts[POSITION] && (position === 'static' || cts[POSITION] === 'static'))\n || zIndex !== cts[Z_INDEX]) {\n node.domParent.__updateStruct(root.__structs);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(node.domParent);\n }\n }\n }\n // display有none变化,重置struct和zIndexChildren\n else if(isLastNone || isNowNone) {\n node.__zIndexChildren = null;\n let arr = node.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n }\n });\n /**\n * mergeMargin后续调整,记录的是变更节点的父节点,因此每个节点内部直接遍历孩子进行\n * 由于保持先根遍历的顺序,因此会从最上最里的节点开始,先进行margin合并\n * 由于之前忽略掉abs节点,因此再检查直接abs是否要调整\n * 完成后对此父节点的后续兄弟节点进行调整,多次不会干扰影响\n * 然后继续往上循环,直到root结束\n */\n let inDirectAbsList = [];\n mergeOffsetList.forEach(parent => {\n delete parent.__uniqueMergeOffsetId;\n let flowChildren = parent.flowChildren, absChildren = parent.absChildren;\n let mergeMarginBottomList = [], mergeMarginTopList = [];\n let length = flowChildren.length, lastChild;\n let isStart, startIndex, startNode;\n // 遍历flow孩子,从开始变化的节点开始,看变化造成的影响,对其后面节点进行偏移,并统计总偏移量\n for(let i = 0; i < length; i++) {\n let item = flowChildren[i];\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n let isXom = item instanceof Xom;\n // 忽略掉前面没有变更的节点,不能合并\n if(!isStart && isXom) {\n if(item.hasOwnProperty('__uniqueReflowId')) {\n isStart = true;\n startIndex = i;\n startNode = item;\n }\n }\n // 开始变更的节点,至少不是第0个\n let cs = isXom && item.currentStyle;\n let isInline = isXom && cs[DISPLAY] === 'inline';\n let isInlineBlock = isXom && ['inlineBlock', 'inline-block'].indexOf(cs[DISPLAY]) > -1;\n lastChild = item;\n // 每次循环开始前,这次不是block的话,看之前遗留的,可能是以空block结束,需要特殊处理,单独一个空block也包含\n if((!isXom || isInline || isInlineBlock)) {\n if(mergeMarginBottomList.length && mergeMarginTopList.length && isStart) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n for(let j = Math.max(startIndex, i - mergeMarginBottomList.length + 1); j < length; j++) {\n flowChildren[j].__offsetY(diff, true, REPAINT);\n }\n }\n }\n mergeMarginTopList = [];\n mergeMarginBottomList = [];\n }\n // 和普通布局类似,只是不用重新布局只需处理合并margin再根据差值偏移\n if(isXom && !isInline) {\n let isNone = isXom && cs[DISPLAY] === 'none';\n let isEmptyBlock;\n if(!isNone && item.flowChildren && item.flowChildren.length === 0) {\n let {\n [MARGIN_TOP]: marginTop,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_TOP]: paddingTop,\n [PADDING_BOTTOM]: paddingBottom,\n [HEIGHT]: height,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n } = item.computedStyle;\n // 无内容高度为0的空block特殊情况,记录2个margin下来等后续循环判断处理\n if(paddingTop <= 0 && paddingBottom <= 0 && height <= 0 && borderTopWidth <= 0 && borderBottomWidth <= 0) {\n mergeMarginBottomList.push(marginBottom);\n mergeMarginTopList.push(marginTop);\n isEmptyBlock = true;\n }\n }\n // 空block要留下轮循环看,除非是最后一个,非空本轮处理掉看是否要合并\n if(!isNone && !isEmptyBlock) {\n let { [MARGIN_TOP]: marginTop, [MARGIN_BOTTOM]: marginBottom } = item.computedStyle;\n // 有bottom值说明之前有紧邻的block,任意个甚至空block,自己有个top所以无需判断top\n // 如果是只有紧邻的2个非空block,也被包含在情况内,取上下各1合并\n if(mergeMarginBottomList.length) {\n mergeMarginTopList.push(marginTop);\n if(isStart) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n // 需要合并的情况,根据记录数和索引向上向下遍历节点设置偏移,同时设置总偏移量供父级使用\n if(diff) {\n for(let j = Math.max(startIndex, i - mergeMarginBottomList.length + 1); j < length; j++) {\n flowChildren[j].__offsetY(diff, true, REPAINT);\n }\n }\n }\n }\n // 同时自己保存bottom,为后续block准备\n mergeMarginTopList = [];\n mergeMarginBottomList = [marginBottom];\n }\n // 最后一个空block当是正正和负负时要处理,正负在outHeight处理了结果是0,最后一个一定有不必判断isStart\n else if(i === length - 1) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n for(let j = Math.max(startIndex, i - mergeMarginBottomList.length + 1); j < length; j++) {\n flowChildren[j].__offsetY(diff, true, REPAINT);\n }\n }\n }\n }\n }\n // 先检查parent的尺寸是否发生了变化,从而决定是否调整next以及向上递归调整\n let cs = parent.currentStyle;\n let height = cs[HEIGHT];\n let isContainer = parent === root || parent.isShadowRoot || cs[POSITION] === 'absolute' || cs[POSITION] === 'relative';\n if(height[1] === AUTO && lastChild) {\n let oldH = parent.height + parent.computedStyle[PADDING_TOP];\n let nowH = lastChild.y + lastChild.outerHeight - parent.y;\n let diff = nowH - oldH;\n // 调整next以及非固定PX的abs,再递归向上\n if(diff) {\n parent.__resizeY(diff, REPAINT);\n let container;\n for(let i = 0, len = absChildren.length; i < len; i++) {\n let item = absChildren[i];\n let { [TOP]: top, [BOTTOM]: bottom, [HEIGHT]: height } = item.currentStyle;\n // 是容器,所有的都调整,不是容器,其偏移是上级parent的某一个,根据情况具体不同\n if(top[1] === AUTO) {\n if(bottom[1] === AUTO) {\n let prev = item.prev;\n while(prev) {\n let target = prev;\n if(target instanceof Component) {\n target = target.shadowRoot;\n }\n let isXom = target instanceof Xom;\n let cs = isXom && target.currentStyle;\n let isAbs = isXom && cs[POSITION] === 'absolute';\n if(!isAbs) {\n let y = target.y + target.outerHeight;\n let d = y - item.y;\n if(d) {\n item.__offsetY(d, true, REPAINT);\n }\n break;\n }\n prev = prev.prev;\n }\n }\n else if(bottom[1] === PX) {\n item.__offsetY(diff, true, REPAINT);\n }\n else if(bottom[1] === PERCENT) {\n let v = (1 - bottom[0] * 0.01) * diff;\n item.__offsetY(v, true, REPAINT);\n }\n }\n else if(top[1] === PERCENT) {\n if(isContainer) {\n let v = top[0] * 0.01 * diff;\n item.__offsetY(v, true, REPAINT);\n }\n // 非容器的特殊处理\n else {\n if(!container) {\n container = parent.domParent;\n while(container) {\n if(container === root || container.isShadowRoot) {\n break;\n }\n let cs = container.currentStyle;\n if(cs[POSITION] === 'absolute' || cs[POSITION] === 'relative') {\n break;\n }\n container = container.domParent;\n }\n }\n if(container.currentStyle[HEIGHT][1] !== PX) {\n let v = top[0] * 0.01 * diff;\n item.__offsetY(v, true, REPAINT);\n }\n }\n }\n // 高度百分比需发生变化的重新布局,需要在容器内\n if(height[1] === PERCENT) {\n if(isContainer) {\n parent.__layoutAbs(parent, parent.__layoutData, item);\n }\n // 不在容器内说明在上级,存入等结束后统一重新布局\n else {\n if(!container) {\n container = parent.domParent;\n while(container) {\n if(container === root || container.isShadowRoot) {\n break;\n }\n let cs = container.currentStyle;\n if(cs[POSITION] === 'absolute' || cs[POSITION] === 'relative') {\n break;\n }\n container = container.domParent;\n }\n }\n inDirectAbsList.push([parent, container, item]);\n }\n }\n }\n reflow.offsetAndResizeByNodeOnY(parent, root, reflowHash, diff, inDirectAbsList);\n return;\n }\n }\n // 没有diff变化或者固定尺寸,可能内部发生变化,调整AUTO的abs,不递归向上\n for(let i = 0, len = absChildren.length; i < len; i++) {\n let item = absChildren[i];\n let { [TOP]: top, [BOTTOM]: bottom } = item.currentStyle;\n if(top[1] === AUTO && bottom[1] === AUTO) {\n let prev = item.prev;\n while(prev) {\n let target = prev;\n if(target instanceof Component) {\n target = target.shadowRoot;\n }\n let isXom = target instanceof Xom;\n let cs = isXom && target.currentStyle;\n let isAbs = isXom && cs[POSITION] === 'absolute';\n if(!isAbs) {\n let y = target.y + target.outerHeight;\n let d = y - item.y;\n if(d) {\n item.__offsetY(d, true, REPAINT);\n }\n break;\n }\n prev = prev.prev;\n }\n }\n }\n });\n // merge过程中需要重新布局的abs\n inDirectAbsList.forEach(arr => {\n arr[0].__layoutAbs(arr[1], arr[0].__layoutData, arr[2]);\n });\n\n // 调整因reflow造成的原struct数据索引数量偏差,纯zIndex的已经在repaint里面重新生成过了\n // 这里因为和update保持一致的顺序,因此一定是先根顺序且互不包含\n let diff = 0, lastIndex = 0, isFirst = true, structs = root.__structs;\n diffList.forEach(item => {\n let [ns, d] = item;\n // 第一个有变化的,及后面无论有无变化都需更新\n // 第1个变化区域无需更改前面一段\n if(isFirst) {\n isFirst = false;\n lastIndex = ns[STRUCT_INDEX] + (ns[STRUCT_TOTAL] || 0) + 1;\n diff += d;\n }\n // 第2+个变化区域看是否和前面一个相连,有不变的段则先偏移它,然后再偏移自己\n else {\n let j = ns[STRUCT_INDEX] + (ns[STRUCT_TOTAL] || 0) + 1 + diff;\n for(let i = lastIndex; i < j; i++) {\n structs[i][STRUCT_INDEX] += diff;\n }\n lastIndex = j;\n diff += d;\n }\n });\n // 后面的要根据偏移量校正索引\n if(diff) {\n for(let i = lastIndex, len = structs.length; i < len; i++) {\n structs[i][STRUCT_INDEX] += diff;\n }\n }\n // 清除id\n reflow.clearUniqueReflowId(reflowHash);\n }\n }\n\n // 特殊覆盖方法,不需要super()计算自己,因为无需第3个参数cb且自己是root\n __computeMeasure(renderMode, ctx) {\n css.computeMeasure(this, true);\n this.children.forEach(item => {\n item.__computeMeasure(renderMode, ctx);\n });\n }\n\n // 每个root拥有一个刷新hook,多个root塞到frame的__hookTask里\n // frame在所有的帧刷新逻辑执行后检查hook列表,进行root刷新操作\n __frameHook() {\n if(!this.__hookTask) {\n let r = this.__hookTask = (() => {\n this.refresh();\n });\n frame.__hookTask.push(r);\n }\n }\n\n __clear(ctx, renderMode) {\n if(renderMode === mode.CANVAS) {\n // 可能会调整宽高,所以每次清除用最大值\n this.__mw = Math.max(this.__mw, this.width);\n this.__mh = Math.max(this.__mh, this.height);\n // 清除前得恢复默认matrix,防止每次布局改变了属性\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.clearRect(0, 0, this.__mw, this.__mh);\n }\n else if(renderMode === mode.WEBGL) {\n ctx.clearColor(0, 0, 0, 0);\n ctx.clear(ctx.COLOR_BUFFER_BIT);\n }\n }\n\n get dom() {\n return this.__dom;\n }\n\n get uuid() {\n return this.__uuid;\n }\n\n get renderMode() {\n return this.__renderMode;\n }\n\n get ctx() {\n return this.__ctx;\n }\n\n get defs() {\n return this.__defs;\n }\n\n get taskUp() {\n return this.__taskUp;\n }\n\n get taskCp() {\n return this.__taskCp;\n }\n\n get ref() {\n return this.__ref;\n }\n\n get animateController() {\n return this.__animateController;\n }\n\n get texCache() {\n return this.__texCache;\n }\n}\n\nexport default Root;\n","import Geom from './Geom';\nimport mode from '../../refresh/mode';\nimport painter from '../../util/painter';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n FILTER,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH, VMAX, VMIN } = unit;\n\nfunction reBuild(target, origin, base, isMulti) {\n if(isMulti) {\n return target.map(item => origin + item * base);\n }\n else {\n return origin + target * base;\n }\n}\n\nfunction reBuildC(target, originX, originY, width, height, isMulti) {\n if(isMulti) {\n if(target) {\n return target.map(item => reBuildC(item, originX, originY, width, height));\n }\n }\n else {\n if(target && target.length >= 2) {\n return [\n originX + target[0] * width,\n originY + target[1] * height,\n ];\n }\n }\n return [];\n}\n\nfunction curveNum(controlA, controlB) {\n let num = 0;\n if(controlA && controlA.length >= 2) {\n num++;\n }\n if(controlB && controlB.length >= 2) {\n num += 2;\n }\n return num;\n}\n\nfunction getNewPoint(x1, y1, x2, y2, controlA, controlB, num, start = 0, end = 1) {\n if(start === 0 && end === 1) {\n return [x1, y1, x2, y2, controlA, controlB];\n }\n if(start === end) {\n return [];\n }\n if(start > end) {\n [start, end] = [end, start];\n }\n start = Math.max(0, start);\n end = Math.min(1, end);\n if(num === 3) {\n [[x1, y1], controlA, controlB, [x2, y2]] = geom.sliceBezier2Both([[x1, y1], controlA, controlB, [x2, y2]], start, end);\n }\n else if(num === 2) {\n [[x1, y1], controlB, [x2, y2]] = geom.sliceBezier2Both([[x1, y1], controlB, [x2, y2]], start, end);\n }\n else if(num === 1) {\n [[x1, y1], controlA, [x2, y2]] = geom.sliceBezier2Both([[x1, y1], controlA, [x2, y2]], start, end);\n }\n else {\n let a = x2 - x1;\n let b = y2 - y1;\n x1 += a * start;\n y1 += b * start;\n x2 += a * (1 - end);\n y2 += b * (1 - end);\n }\n return [x1, y1, x2, y2, controlA, controlB];\n}\n\nclass Line extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // x1,y1和x2,y2表明线段的首尾坐标,control表明控制点坐标\n if(this.isMulti) {\n this.__x1 = [0];\n this.__y1 = [0];\n this.__x2 = [1];\n this.__y2 = [1];\n this.__controlA = [[]];\n this.__controlB = [[]];\n this.__start = [0];\n this.__end = [1];\n if(Array.isArray(props.x1)) {\n this.__x1 = props.x1.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.x1)) {\n this.__x1 = [parseFloat(props.x1) || 0];\n }\n if(Array.isArray(props.y1)) {\n this.__y1 = props.y1.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.y1)) {\n this.__y1 = [parseFloat(props.y1) || 0];\n }\n if(Array.isArray(props.x2)) {\n this.__x2 = props.x2.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.x2)) {\n this.__x2 = [parseFloat(props.x2) || 0];\n }\n if(Array.isArray(props.y2)) {\n this.__y2 = props.y2.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.y2)) {\n this.__y2 = [parseFloat(props.y2) || 0];\n }\n if(Array.isArray(props.controlA)) {\n this.__controlA = props.controlA.map(item => {\n if(Array.isArray(item)) {\n return item;\n }\n return [];\n });\n }\n if(Array.isArray(props.controlB)) {\n this.__controlB = props.controlB.map(item => {\n if(Array.isArray(item)) {\n return item;\n }\n return [];\n });\n }\n if(Array.isArray(props.start)) {\n this.__start = props.start.map(i => parseFloat(i) || 0);\n for(let i = this.__start.length; i < this.__x1.length; i++) {\n this.__start.push(0);\n }\n }\n else if(!isNil(props.start)) {\n let v = parseFloat(props.start) || 0;\n this.__start = this.__x1.map(() => v);\n }\n if(Array.isArray(props.end)) {\n this.__end = props.end.map(i => {\n let v = parseFloat(i);\n if(isNaN(v)) {\n v = 1;\n }\n return v;\n });\n for(let i = this.__end.length; i < this.__x1.length; i++) {\n this.__end.push(1);\n }\n }\n else if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n v = v;\n this.__end = this.__x1.map(() => v);\n }\n }\n else {\n this.__x1 = this.__y1 = this.__start = 0;\n this.__x2 = this.__y2 = this.__end = 1;\n this.__controlA = [];\n this.__controlB = [];\n if(!isNil(props.x1)) {\n this.__x1 = parseFloat(props.x1) || 0;\n }\n if(!isNil(props.y1)) {\n this.__y1 = parseFloat(props.y1) || 0;\n }\n if(!isNil(props.x2)) {\n this.__x2 = parseFloat(props.x2) || 0;\n }\n if(!isNil(props.y2)) {\n this.__y2 = parseFloat(props.y2) || 0;\n }\n if(!isNil(props.start)) {\n this.__start = parseFloat(props.start) || 0;\n }\n if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n this.__end = v;\n }\n if(Array.isArray(props.controlA)) {\n this.__controlA = props.controlA;\n }\n if(Array.isArray(props.controlB)) {\n this.__controlB = props.controlB;\n }\n }\n }\n\n buildCache(originX, originY, focus) {\n let { width, height, __cacheProps, isMulti } = this;\n let rebuild;\n ['x1', 'x2'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = reBuild(this[k], originX, width, isMulti);\n }\n });\n ['y1', 'y2'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = reBuild(this[k], originY, height, isMulti);\n }\n });\n ['controlA', 'controlB'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = reBuildC(this[k], originX, originY, width, height, isMulti);\n }\n });\n ['start', 'end'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = this[k];\n }\n });\n return rebuild;\n }\n\n render(renderMode, lv, ctx, cache, dx2, dy2) {\n let res = super.render(renderMode, lv, ctx, cache, dx2, dy2);\n if(res.break) {\n return res;\n }\n ctx = res.ctx;\n let {\n sx3,\n sy3,\n stroke: strokes,\n strokeWidth: strokeWidths,\n strokeDasharray: strokeDasharrays,\n strokeDasharrayStr: strokeDasharrayStrs,\n strokeLinecap: strokeLinecaps,\n strokeLinejoin: strokeLinejoins,\n strokeMiterlimit: strokeMiterlimits,\n dx,\n dy,\n } = res;\n let { __cacheProps, isMulti } = this;\n let rebuild = this.buildCache(sx3, sy3);\n if(rebuild && renderMode === mode.SVG) {\n let d = '';\n if(isMulti) {\n __cacheProps.x1.forEach((xa, i) => {\n let xb = __cacheProps.x2[i];\n let ya = __cacheProps.y1[i];\n let yb = __cacheProps.y2[i];\n let ca = __cacheProps.controlA[i];\n let cb = __cacheProps.controlB[i];\n let start = __cacheProps.start[i];\n let end = __cacheProps.end[i];\n let curve = curveNum(ca, cb);\n if(start !== 0 || end !== 1) {\n [xa, ya, xb, ya, ca, cb] = getNewPoint(xa, ya, xb, ya, ca, cb, curve, start, end, __cacheProps.len);\n }\n d += painter.svgLine(xa, ya, xb, yb, ca, cb, curve);\n });\n }\n else {\n let curve = curveNum(__cacheProps.controlA, __cacheProps.controlB);\n let { x1, y1, x2, y2, controlA, controlB, start, end } = __cacheProps;\n if(start !== 0 || end !== 1) {\n [x1, y1, x2, y2, controlA, controlB] = getNewPoint(x1, y1, x2, y2, controlA, controlB, curve, start, end, __cacheProps.len);\n }\n d = painter.svgLine(x1, y1, x2, y2, controlA, controlB, curve);\n }\n __cacheProps.d = d;\n }\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n strokes.forEach((stroke, i) => {\n let strokeWidth = strokeWidths[i];\n let isStrokeRE = strokeWidth > 0 && stroke.k === 'radial' && Array.isArray(stroke.v);\n if(strokeWidth > 0 && stroke !== 'none') {\n this.__preSetCanvas(renderMode, ctx, {\n stroke,\n strokeWidth,\n strokeDasharray: strokeDasharrays[i],\n strokeLinecap: strokeLinecaps[i],\n strokeLinejoin: strokeLinejoins[i],\n strokeMiterlimit: strokeMiterlimits[i],\n });\n if(isStrokeRE) {\n ctx.strokeStyle = stroke.v[0];\n }\n ctx.beginPath();\n if(isMulti) {\n __cacheProps.x1.forEach((xa, i) => {\n let xb = __cacheProps.x2[i];\n let ya = __cacheProps.y1[i];\n let yb = __cacheProps.y2[i];\n let ca = __cacheProps.controlA[i];\n let cb = __cacheProps.controlB[i];\n let start = __cacheProps.start[i];\n let end = __cacheProps.end[i];\n let curve = curveNum(ca, cb);\n if(start !== 0 || end !== 1) {\n [xa, ya, xb, ya, ca, cb] = getNewPoint(xa, ya, xb, ya, ca, cb, curve, start, end, __cacheProps.len);\n }\n painter.canvasLine(ctx, xa, ya, xb, yb, ca, cb, curve, dx, dy);\n });\n }\n else {\n let curve = curveNum(__cacheProps.controlA, __cacheProps.controlB);\n let { x1, y1, x2, y2, controlA, controlB, start, end } = __cacheProps;\n if(start !== 0 || end !== 1) {\n [x1, y1, x2, y2, controlA, controlB] = getNewPoint(x1, y1, x2, y2, controlA, controlB, curve, start, end, __cacheProps.len);\n }\n painter.canvasLine(ctx, x1, y1, x2, y2, controlA, controlB, curve, dx, dy);\n }\n ctx.stroke();\n ctx.closePath();\n }\n });\n }\n else if(renderMode === mode.SVG) {\n strokes.forEach((stroke, i) => {\n let strokeWidth = strokeWidths[i];\n let isStrokeRE = strokeWidth > 0 && stroke.k === 'radial' && Array.isArray(stroke.v);\n let props = [\n ['d', __cacheProps.d],\n ['fill', 'none'],\n ['stroke', isStrokeRE ? stroke.v[0] : (stroke.v || stroke)],\n ['stroke-width', strokeWidth]\n ];\n this.__propsStrokeStyle(props, strokeDasharrayStrs[i], strokeLinecaps[i], strokeLinejoins[i], strokeMiterlimits[i]);\n this.addGeom('path', props);\n });\n }\n return res;\n }\n\n get x1() {\n return this.getProps('x1');\n }\n\n get y1() {\n return this.getProps('y1');\n }\n\n get x2() {\n return this.getProps('x2');\n }\n\n get y2() {\n return this.getProps('y2');\n }\n\n get controlA() {\n return this.getProps('controlA');\n }\n\n get controlB() {\n return this.getProps('controlB');\n }\n\n get start() {\n return this.getProps('start');\n }\n\n get end() {\n return this.getProps('end');\n }\n\n get bbox() {\n let {\n isMulti, __cacheProps, root,\n __sx3: originX, __sy3: originY,\n currentStyle: {\n [STROKE_WIDTH]: strokeWidth,\n [BOX_SHADOW]: boxShadow,\n [FILTER]: filter,\n },\n } = this;\n this.buildCache(originX, originY);\n let { x1, y1, x2, y2, controlA, controlB } = __cacheProps;\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE], half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else {\n half = Math.max(item[0], half);\n }\n });\n let [x1s, y1s, x2s, y2s] = this.__spreadBbox(boxShadow, filter);\n x1s -= half;\n y1s -= half;\n x2s += half;\n y2s += half;\n if(!isMulti) {\n x1 = [x1];\n x2 = [x2];\n y1 = [y1];\n y2 = [y2];\n controlA = [controlA];\n controlB = [controlB];\n }\n x1.forEach((xa, i) => {\n let ya = y1[i];\n let xb = x2[i];\n let yb = y2[i];\n let ca = controlA[i];\n let cb = controlB[i];\n if((isNil(ca) || ca.length < 2) && (isNil(cb) || cb.length < 2)) {\n bbox[0] = Math.min(bbox[0], xa + x1s);\n bbox[0] = Math.min(bbox[0], xb + x1s);\n bbox[1] = Math.min(bbox[1], ya + y1s);\n bbox[1] = Math.min(bbox[1], yb + y1s);\n bbox[2] = Math.max(bbox[2], xa + x2s);\n bbox[2] = Math.max(bbox[2], xb + x2s);\n bbox[3] = Math.max(bbox[3], ya + y2s);\n bbox[3] = Math.max(bbox[3], yb + y2s);\n }\n else if(isNil(ca) || ca.length < 2) {\n let bezierBox = geom.bboxBezier(xa, ya, cb[0], cb[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] + x1s);\n bbox[0] = Math.min(bbox[0], bezierBox[2] + x1s);\n bbox[1] = Math.min(bbox[1], bezierBox[1] + y1s);\n bbox[1] = Math.min(bbox[1], bezierBox[3] + y1s);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + x2s);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + x2s);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + y2s);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + y2s);\n }\n else if(isNil(cb) || cb.length < 2) {\n let bezierBox = geom.bboxBezier(xa, ya, ca[0], ca[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] + x1s);\n bbox[0] = Math.min(bbox[0], bezierBox[2] + x1s);\n bbox[1] = Math.min(bbox[1], bezierBox[1] + y1s);\n bbox[1] = Math.min(bbox[1], bezierBox[3] + y1s);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + x2s);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + x2s);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + y2s);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + y2s);\n }\n else {\n let bezierBox = geom.bboxBezier(xa, ya, ca[0], ca[1], cb[0], cb[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] + x1s);\n bbox[0] = Math.min(bbox[0], bezierBox[2] + x1s);\n bbox[1] = Math.min(bbox[1], bezierBox[1] + y1s);\n bbox[1] = Math.min(bbox[1], bezierBox[3] + y1s);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + x2s);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + x2s);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + y2s);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + y2s);\n }\n });\n return bbox;\n }\n}\n\nexport default Line;\n","import Geom from './Geom';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n FILTER,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH, VMAX, VMIN } = unit;\n\nfunction concatPointAndControl(point, control) {\n if(Array.isArray(control) && (control.length === 2 || control.length === 4)\n && Array.isArray(point) && point.length === 2) {\n return control.concat(point);\n }\n return point;\n}\n\nfunction getLength(list, isMulti) {\n let res = [];\n let total = 0;\n let increase = [];\n if(isMulti) {\n total = [];\n list.forEach(list => {\n let temp = getLength(list);\n res.push(temp.list);\n total.push(temp.total);\n increase.push([0].concat(temp.increase));\n });\n }\n else if(Array.isArray(list)) {\n total = 0;\n increase.push(0);\n let start = 0;\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(Array.isArray(item)) {\n start = i;\n break;\n }\n }\n let prev = list[start];\n for(let i = start + 1, len = list.length; i < len; i++) {\n let item = list[i];\n if(!Array.isArray(item)) {\n continue;\n }\n if(item.length === 2) {\n let a = Math.abs(item[0] - prev[0]);\n let b = Math.abs(item[1] - prev[1]);\n let c = Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2));\n res.push(c);\n total += c;\n increase.push(total);\n prev = item;\n }\n else if(item.length === 4) {\n let c = geom.bezierLength([prev, [item[0], item[1]], [item[2], item[3]]], 2);\n res.push(c);\n total += c;\n increase.push(total);\n prev = [item[2], item[3]];\n }\n else if(item.length === 6) {\n let c = geom.bezierLength([prev, [item[0], item[1]], [item[2], item[3]], [item[4], item[5]]], 3);\n res.push(c);\n total += c;\n increase.push(total);\n prev = [item[4], item[5]];\n }\n }\n }\n return {\n list: res,\n total,\n increase,\n };\n}\n\nfunction getIndex(list, t, i, j) {\n if(i === j) {\n if(list[i] > t) {\n return i - 1;\n }\n return i;\n }\n let middle = i + ((j - i) >> 1);\n if(list[middle] === t) {\n return middle;\n }\n else if(list[middle] > t) {\n return getIndex(list, t, i, Math.max(middle - 1, i));\n }\n else {\n return getIndex(list, t, Math.min(middle + 1, j), j);\n }\n}\n\nfunction getNewList(list, len, start = 0, end = 1) {\n if(start === 0 && end === 1) {\n return list;\n }\n if(start === end) {\n return [];\n }\n if(start > end) {\n [start, end] = [end, start];\n }\n // start和end只能相差<=1,如果>1则校正\n while(end - start > 1) {\n end--;\n }\n // 将start和end统一至最接近0的正值\n while(end < 0 || start < 0) {\n end++;\n start++;\n }\n while(end >= 1 && start >= 1) {\n end--;\n start--;\n }\n // clone出原本顶点列表,防止干扰\n let length = list.length;\n list = util.clone(list);\n let res = [];\n let start2 = start > 1 ? (start - 1) : start;\n let end2 = end > 1 ? (end - 1) : end;\n let i = getIndex(len.increase, start2 * len.total, 0, length - 1);\n let j = getIndex(len.increase, end2 * len.total, 0, length - 1);\n // start<0或者end>1或者普通情况,一共3种,start和end不可能同时超限\n let isStartLt0 = start < 0;\n let isEndGt1 = end > 1;\n end2 *= len.total;\n let prePercent = 1;\n let endPoint;\n if(end2 > len.increase[j]) {\n let prev = list[j].slice(list[j].length - 2); // 最后2个点是x,y,前面是control\n let current = list[j + 1];\n let l = len.list[j];\n let diff = end2 - len.increase[j];\n let t = diff / l;\n prePercent = t;\n if(current.length === 2) {\n let a = current[0] - prev[0];\n let b = current[1] - prev[1];\n if(isEndGt1) {\n endPoint = [prev[0] + t * a, prev[1] + t * b];\n }\n else {\n t = 1 - t;\n endPoint = [current[0] - t * a, current[1] - t * b];\n }\n }\n else if(current.length === 4) {\n let r = geom.sliceBezier([prev, [current[0], current[1]], [current[2], current[3]]], t);\n endPoint = [r[1][0], r[1][1], r[2][0], r[2][1]];\n }\n else if(current.length === 6) {\n let r = geom.sliceBezier([prev, [current[0], current[1]], [current[2], current[3]], [current[4], current[5]]], t);\n endPoint = [r[1][0], r[1][1], r[2][0], r[2][1], r[3][0], r[3][1]];\n }\n }\n start2 *= len.total;\n if(start2 > len.increase[i]) {\n let current;\n let prev = list[i].slice(list[i].length - 2);\n let l = len.list[i];\n // 同一条线段时如果有end裁剪,会影响start长度,这里还要防止头尾绕了一圈的情况\n if(i === j && !isStartLt0 && !isEndGt1 && prePercent !== 1) {\n l *= prePercent;\n if(endPoint) {\n current = endPoint;\n }\n }\n if(!current) {\n current = list[i + 1];\n }\n let diff = start2 - len.increase[i];\n let t = diff / l;\n if(current.length === 2) {\n let a = current[0] - prev[0];\n let b = current[1] - prev[1];\n if(isStartLt0) {\n t = 1 - t;\n res.push([current[0] - t * a, current[1] - t * b]);\n }\n else {\n res.push([prev[0] + t * a, prev[1] + t * b]);\n }\n res.push(current);\n }\n else if(current.length === 4) {\n let r = geom.sliceBezier([[current[2], current[3]], [current[0], current[1]], prev], 1 - t).reverse();\n res.push(r[0]);\n res.push([r[1][0], r[1][1], r[2][0], r[2][1]]);\n // 同一条线段上去除end冲突\n if(i === j && !isStartLt0 && !isEndGt1) {\n endPoint = null;\n }\n }\n else if(current.length === 6) {\n let r = geom.sliceBezier([[current[4], current[5]], [current[2], current[3]], [current[0], current[1]], prev], 1 - t).reverse();\n res.push(r[0])\n res.push([r[1][0], r[1][1], r[2][0], r[2][1], current[4], current[5]]);\n if(i === j && !isStartLt0 && !isEndGt1) {\n endPoint = null;\n }\n }\n }\n // start和end之间的线段,注意头尾饶了一圈的情况,以及起始点被上方考虑过了\n for(let k = i + 2; k <= j + (!isStartLt0 && !isEndGt1 ? 0 : length); k++) {\n res.push(list[k % length]);\n }\n if(endPoint) {\n res.push(endPoint);\n }\n return res;\n}\n\nclass Polyline extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 所有点的列表\n if(this.isMulti) {\n this.__points = [[]];\n this.__controls = [[]];\n this.__start = [0];\n this.__end = [1];\n if(Array.isArray(props.start)) {\n this.__start = props.start.map(i => parseFloat(i) || 0);\n for(let i = this.__start.length; i < this.__points.length; i++) {\n this.__start.push(0);\n }\n }\n else if(!isNil(props.start)) {\n let v = parseFloat(props.start) || 0;\n this.__start = this.__points.map(() => v);\n }\n if(Array.isArray(props.end)) {\n this.__end = props.end.map(i => {\n let v = parseFloat(i);\n if(isNaN(v)) {\n v = 1;\n }\n return v;\n });\n for(let i = this.__end.length; i < this.__points.length; i++) {\n this.__end.push(1);\n }\n }\n else if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n this.__end = this.__points.map(() => v);\n }\n }\n else {\n this.__points = [];\n // 控制点\n this.__controls = [];\n this.__start = 0;\n this.__end = 1;\n if(!isNil(props.start)) {\n this.__start = parseFloat(props.start) || 0;\n }\n if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n this.__end = v;\n }\n }\n if(Array.isArray(props.controls)) {\n this.__controls = props.controls;\n }\n if(Array.isArray(props.points)) {\n this.__points = props.points;\n }\n }\n\n __getPoints(originX, originY, width, height, points, isControl) {\n return points.map((item, i) => {\n if(!Array.isArray(item)) {\n return;\n }\n let len = item.length;\n if(isControl) {\n if(len !== 0 && len !== 2 && len !== 4) {\n return;\n }\n }\n else {\n if(len !== 0 && len !== 2) {\n return;\n }\n }\n let res = [];\n for(let i = 0; i < len; i++) {\n if(i % 2 === 0) {\n res.push(originX + item[i] * width);\n }\n else {\n res.push(originY + item[i] * height);\n }\n }\n return res;\n });\n }\n\n // 供polygon覆盖,后处理booleanOperations\n __reprocessing(list) {\n return list;\n }\n\n // 同polygon覆盖,booleanOperations改变时需刷新缓冲顶点坐标\n __needRebuildSE() {}\n\n buildCache(originX, originY) {\n let { width, height, points, controls, start, end, __cacheProps, isMulti } = this;\n let rebuild, rebuildSE;\n if(isNil(__cacheProps.points)) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.points = points.map(item => {\n if(Array.isArray(item)) {\n return this.__getPoints(originX, originY, width, height, item);\n }\n });\n }\n else {\n __cacheProps.points = this.__getPoints(originX, originY, width, height, points);\n }\n }\n if(isNil(__cacheProps.controls)) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.controls = controls.map(item => {\n if(Array.isArray(item)) {\n return this.__getPoints(originX, originY, width, height, item, true);\n }\n return item;\n });\n }\n else {\n __cacheProps.controls = this.__getPoints(originX, originY, width, height, controls, true);\n }\n }\n if(isNil(__cacheProps.start)) {\n rebuildSE = true;\n __cacheProps.start = start;\n }\n if(isNil(__cacheProps.end)) {\n rebuildSE = true;\n __cacheProps.end = end;\n }\n // polygon会覆盖检查booleanOperations缓存\n if(this.__needRebuildSE(__cacheProps)) {\n rebuildSE = true;\n }\n // points/controls有变化就需要重建顶点\n if(rebuild) {\n let { points, controls } = __cacheProps;\n if(isMulti) {\n __cacheProps.list2 = points.map((item, i) => {\n let cl = controls[i];\n if(Array.isArray(item)) {\n return item.map((point, j) => {\n if(j) {\n return concatPointAndControl(point, cl && cl[j - 1]);\n }\n return point;\n });\n }\n });\n __cacheProps.len = getLength(__cacheProps.list2, isMulti);\n }\n else {\n __cacheProps.list2 = points.map((point, i) => {\n if(i) {\n return concatPointAndControl(point, controls[i - 1]);\n }\n return point;\n });\n __cacheProps.len = getLength(__cacheProps.list2, isMulti);\n }\n }\n if(rebuild || rebuildSE) {\n if(isMulti) {\n __cacheProps.list = __cacheProps.list2.map((item, i) => {\n if(Array.isArray(item)) {\n let len = __cacheProps.len;\n return getNewList(item, {\n list: len.list[i],\n total: len.total[i],\n increase: len.increase[i],\n }, __cacheProps.start[i], __cacheProps.end[i]);\n }\n });\n }\n else {\n __cacheProps.list = getNewList(__cacheProps.list2, __cacheProps.len, __cacheProps.start, __cacheProps.end);\n }\n // 后处理一次,让polygon支持布尔运算\n __cacheProps.list = this.__reprocessing(__cacheProps.list, isMulti);\n }\n return rebuild || rebuildSE;\n }\n\n render(renderMode, lv, ctx, cache, dx, dy) {\n let res = super.render(renderMode, lv, ctx, cache, dx, dy);\n if(res.break) {\n return res;\n }\n this.buildCache(res.sx3, res.sy3);\n ctx = res.ctx;\n this.__renderPolygon(renderMode, ctx, res);\n return res;\n }\n\n get points() {\n return this.getProps('points');\n }\n\n get controls() {\n return this.getProps('controls');\n }\n\n get start() {\n return this.getProps('start');\n }\n\n get end() {\n return this.getProps('end');\n }\n\n get bbox() {\n if(!this.__bbox) {\n let {\n isMulti, __cacheProps, root,\n __sx3: originX, __sy3: originY,\n currentStyle: {\n [STROKE_WIDTH]: strokeWidth,\n [BOX_SHADOW]: boxShadow,\n [FILTER]: filter,\n },\n } = this;\n this.buildCache(originX, originY);\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE], half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else {\n half = Math.max(item[0], half);\n }\n });\n let [x1, y1, x2, y2] = this.__spreadBbox(boxShadow, filter);\n x1 -= half;\n y1 -= half;\n x2 += half;\n y2 += half;\n let { points, controls } = __cacheProps;\n if(!isMulti) {\n points = [points];\n controls = [controls];\n }\n points.forEach((pointList, i) => {\n if(!pointList || pointList.length < 2 || !pointList[0] || !pointList[1]\n || pointList[0].length < 2 || pointList[1].length < 2) {\n return;\n }\n let controlList = controls[i] || [];\n let [xa, ya] = pointList[0];\n for(let i = 1, len = pointList.length; i < len; i++) {\n let [xb, yb] = pointList[i];\n let c = controlList[i - 1];\n if(c && c.length === 4) {\n let bezierBox = geom.bboxBezier(xa, ya, c[0], c[1], c[2], c[3], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] + x1);\n bbox[1] = Math.min(bbox[1], bezierBox[1] + y1);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + x2);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + y2);\n }\n else if(c && c.length === 2) {\n let bezierBox = geom.bboxBezier(xa, ya, c[0], c[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] + x1);\n bbox[1] = Math.min(bbox[1], bezierBox[1] + y1);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + x2);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + y2);\n }\n else {\n bbox[0] = Math.min(bbox[0], xa + x1);\n bbox[1] = Math.min(bbox[1], ya + y1);\n bbox[2] = Math.max(bbox[2], xa + x2);\n bbox[3] = Math.max(bbox[3], ya + y2);\n }\n xa = xb;\n ya = yb;\n }\n });\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Polyline;\n","import Polyline from './Polyline';\nimport util from '../../util/util';\nimport { union, diff, intersection, xor } from '../../math/martinez';\n\nclass Polygon extends Polyline {\n constructor(tagName, props) {\n super(tagName, props);\n if(props.booleanOperations) {\n this.__booleanOperations = props.booleanOperations;\n }\n }\n\n __getPoints(originX, originY, width, height, points, isControl) {\n let res = super.__getPoints(originX, originY, width, height, points, isControl);\n if(!isControl) {\n res.push(res[0]);\n }\n return res;\n }\n\n // 布尔运算覆盖,仅multi才发生,因为需要多个多边形数据\n __reprocessing(list, isMulti) {\n if(!isMulti) {\n return list;\n }\n let bo = this.booleanOperations, len = list.length;\n if(!Array.isArray(bo) && bo) {\n let old = bo;\n bo = [bo];\n for(let i = 1; i < len - 1; i++) {\n bo.push(old);\n }\n }\n if(Array.isArray(bo) && bo.length) {\n let res = [];\n let last;\n for(let i = 0; i < len - 1; i++) {\n let a = list[i], b = list[i + 1];\n switch(bo[i]) {\n case 'intersection':\n if(!a || !a.length || !b || !b.length) {\n res.push(null);\n }\n else {\n intersection([a], [b]).forEach(item => {\n res.push(item[0]);\n });\n }\n last = true;\n break;\n case 'union':\n if((!a || !a.length) && (!b || !b.length)) {\n res.push(null);\n }\n else if(!a || !a.length) {\n res.push(b);\n }\n else if(!b || !b.length) {\n res.push(a);\n }\n else {\n union([a], [b]).forEach(item => {\n res.push(item[0]);\n });\n }\n last = true;\n break;\n case 'diff':\n if(!a || !a.length) {\n res.push(null);\n }\n else if(!b || !b.length) {\n res.push(a);\n }\n else {\n diff([a], [b]).forEach(item => {\n res.push(item[0]);\n });\n }\n last = true;\n break;\n case 'xor':\n if((!a || !a.length) && (!b || !b.length)) {\n res.push(null);\n }\n else if(!a || !a.length) {\n res.push(b);\n }\n else if(!b || !b.length) {\n res.push(a);\n }\n else {\n xor([a], [b]).forEach(item => {\n res.push(item[0]);\n });\n }\n last = true;\n break;\n default:\n res.push(list[i]);\n last = false;\n break;\n }\n }\n // 最后一个没参与布尔运算,原封不动装载\n if(!last) {\n res.push(list[len - 1]);\n }\n return res;\n }\n return list;\n }\n\n // 覆盖,当booleanOperations动画改变时刷新顶点缓存\n __needRebuildSE(__cacheProps) {\n if(util.isNil(__cacheProps.booleanOperations)) {\n __cacheProps.booleanOperations = true;\n return true;\n }\n }\n\n get booleanOperations() {\n return this.getProps('booleanOperations');\n }\n}\n\nexport default Polygon;\n","import Geom from './Geom';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport inject from '../../util/inject';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n FILTER,\n} } = enums;\nconst { isNil } = util;\nconst { sectorPoints } = geom;\nconst { REM, VW, VH, VMAX, VMIN } = unit;\n\nfunction getR(v, dft) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = dft;\n }\n return v;\n}\n\nclass Sector extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 角度\n if(this.isMulti) {\n this.__begin = [0];\n this.__end = [0];\n this.__r = [1];\n if(Array.isArray(props.begin)) {\n this.__begin = props.begin.map(i => getR(i, 0));\n }\n if(Array.isArray(props.end)) {\n this.__end = props.end.map(i => getR(i, 0));\n }\n if(Array.isArray(props.r)) {\n this.__r = props.r.map(i => getR(i, 1));\n }\n if(Array.isArray(props.edge)) {\n this.__edge = props.edge.map(i => !!i);\n }\n if(Array.isArray(props.closure)) {\n this.__closure = props.closure.map(i => !!i);\n }\n }\n else {\n this.__begin = this.__end = 0;\n // 半径[0, ∞),默认1\n this.__r = 1;\n // 扇形两侧是否有边\n this.__edge = false;\n // 扇形大于180°时,是否闭合两端\n this.__closure = false;\n if(!isNil(props.begin)) {\n this.__begin = getR(props.begin, 0);\n }\n if(!isNil(props.end)) {\n this.__end = getR(props.end, 0);\n }\n if(!isNil(props.r)) {\n this.__r = getR(props.r, 1);\n }\n if(!isNil(props.edge)) {\n this.__edge = !!props.edge;\n }\n if(!isNil(props.closure)) {\n this.__closure = !!props.closure;\n }\n }\n }\n\n buildCache(cx, cy, focus) {\n let { width, begin, end, r, edge, closure, __cacheProps, isMulti } = this;\n let rebuild;\n if(isNil(__cacheProps.begin) || focus) {\n rebuild = true;\n __cacheProps.begin = (begin || 0) % 360;\n }\n if(isNil(__cacheProps.end) || focus) {\n rebuild = true;\n __cacheProps.end = (end || 0) % 360;\n }\n if(isNil(__cacheProps.r) || focus) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.r = r.map(r => r * width * 0.5);\n }\n else {\n __cacheProps.r = r * width * 0.5;\n }\n }\n r = __cacheProps.r;\n if(isNil(__cacheProps.edge) || focus) {\n rebuild = true;\n __cacheProps.edge = edge;\n }\n if(isNil(__cacheProps.closure) || focus) {\n rebuild = true;\n __cacheProps.closure = closure;\n }\n if(rebuild) {\n if(isMulti) {\n __cacheProps.list = [];\n __cacheProps.sList = [];\n begin.forEach((begin, i) => {\n let r2 = isNil(r[i]) ? width * 0.5 : r[i];\n let list = sectorPoints(cx, cy, r2, parseFloat(begin || 0) % 360, parseFloat(end[i] || 0) % 360);\n let sList = list.slice(0);\n if(closure[i]) {\n list.push(list[0].slice(0));\n if(edge) {\n sList.push(sList[0].slice(0));\n }\n }\n else {\n list.unshift([cx, cy]);\n list.push([cx, cy]);\n if(edge) {\n sList.unshift([cx, cy]);\n sList.push([cx, cy]);\n }\n }\n __cacheProps.list.push(list);\n __cacheProps.sList.push(sList);\n });\n }\n else {\n let list = sectorPoints(cx, cy, r, parseFloat(begin || 0), parseFloat(end || 0));\n let sList = list.slice(0);\n if(closure) {\n list.push(list[0].slice(0));\n if(edge) {\n sList.push(sList[0].slice(0));\n }\n }\n else {\n list.unshift([cx, cy]);\n list.push([cx, cy]);\n if(edge) {\n sList.unshift([cx, cy]);\n sList.push([cx, cy]);\n }\n }\n __cacheProps.list = list;\n __cacheProps.sList = sList;\n }\n }\n return rebuild;\n }\n\n render(renderMode, lv, ctx, cache, dx2, dy2) {\n let res = super.render(renderMode, lv, ctx, cache, dx2, dy2);\n if(res.break) {\n return res;\n }\n this.buildCache(res.cx, res.cy);\n ctx = res.ctx;\n let {\n fill: fills,\n fillRule: fillRules,\n stroke: strokes,\n strokeWidth: strokeWidths,\n strokeDasharray: strokeDasharrays,\n strokeDasharrayStr: strokeDasharrayStrs,\n strokeLinecap: strokeLinecaps,\n strokeLinejoin: strokeLinejoins,\n strokeMiterlimit: strokeMiterlimits,\n dx,\n dy,\n } = res;\n let { __cacheProps: { list, sList }, isMulti } = this;\n // 普通情况下只有1个,按普通情况走\n if(fills.length <= 1 && strokes.length <= 1) {\n let o = {\n fill: fills[0],\n fillRule: fillRules[0],\n stroke: strokes[0],\n strokeWidth: strokeWidths[0],\n strokeDasharray: strokeDasharrays[0],\n strokeDasharrayStr: strokeDasharrayStrs[0],\n strokeLinecap: strokeLinecaps[0],\n strokeLinejoin: strokeLinejoins[0],\n strokeMiterlimit: strokeMiterlimits[0],\n dx,\n dy,\n };\n this.__renderOneSector(renderMode, ctx, isMulti, list, sList, o);\n }\n // 多个需要fill在下面,stroke在上面,依次循环\n else {\n for(let i = 0, len = fills.length; i < len; i++) {\n let fill = fills[i];\n if(fill) {\n let o = {\n fill,\n fillRule: fillRules[i],\n dx,\n dy,\n };\n this.__renderOneSector(renderMode, ctx, isMulti, list, sList, o);\n }\n }\n for(let i = 0, len = strokes.length; i < len; i++) {\n let stroke = strokes[i];\n if(stroke) {\n let o = {\n stroke,\n strokeWidth: strokeWidths[i],\n strokeDasharray: strokeDasharrays[i],\n strokeDasharrayStr: strokeDasharrayStrs[i],\n strokeLinecap: strokeLinecaps[i],\n strokeLinejoin: strokeLinejoins[i],\n strokeMiterlimit: strokeMiterlimits[i],\n dx,\n dy,\n };\n this.__renderOnePolygon(renderMode, ctx, isMulti, list, sList, o);\n }\n }\n }\n return res;\n }\n\n __renderOneSector(renderMode, ctx, isMulti, list, sList, res) {\n let {\n fill,\n stroke,\n strokeWidth,\n } = res;\n let isFillCE = fill.k === 'conic';\n let isStrokeCE = stroke.k === 'conic';\n let isFillRE = fill.k === 'radial' && Array.isArray(fill.v);\n let isStrokeRE = strokeWidth > 0 && stroke.k === 'radial' && Array.isArray(stroke.v);\n if(isFillCE || isStrokeCE) {\n if(isFillCE) {\n this.__conicGradient(renderMode, ctx, list, isMulti, res);\n }\n else if(fill && fill !== 'none') {\n this.__drawPolygon(renderMode, ctx, isMulti, list, res, true);\n }\n if(strokeWidth > 0 && isStrokeCE) {\n inject.warn('Stroke style can not use conic-gradient');\n }\n else if(strokeWidth > 0 && stroke && stroke !== 'none') {\n this.__drawPolygon(renderMode, ctx, isMulti, sList, res, false, true);\n }\n }\n else if(isFillRE || isStrokeRE) {\n if(isFillRE) {\n this.__radialEllipse(renderMode, ctx, list, isMulti, res, 'fill');\n }\n else if(fill && fill !== 'none') {\n this.__drawPolygon(renderMode, ctx, isMulti, list, res, true);\n }\n // stroke椭圆渐变matrix会变形,降级为圆\n if(strokeWidth > 0 && isStrokeRE) {\n inject.warn('Stroke style can not use radial-gradient for ellipse');\n res.stroke = res.stroke.v[0];\n this.__drawPolygon(renderMode, ctx, isMulti, sList, res, false, true);\n }\n else if(strokeWidth > 0 && stroke && stroke !== 'none') {\n this.__drawPolygon(renderMode, ctx, isMulti, sList, res, false, true);\n }\n }\n else {\n if(fill && fill !== 'none') {\n this.__drawPolygon(renderMode, ctx, isMulti, list, res, true, false);\n }\n if(strokeWidth > 0 && stroke && stroke !== 'none') {\n this.__drawPolygon(renderMode, ctx, isMulti, sList, res, false, true);\n }\n }\n }\n\n __genSector(edge, d, fill, stroke, strokeWidth, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit) {\n if(edge) {\n let props = [\n ['d', d[0]],\n ['fill', fill.v || fill],\n ['stroke', stroke.v || stroke],\n ['stroke-width', strokeWidth],\n ];\n this.__propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit);\n this.addGeom('path', props);\n }\n else {\n this.addGeom('path', [\n ['d', d[0]],\n ['fill', fill.v || fill],\n ]);\n if(strokeWidth > 0) {\n let props = [\n ['d', d[1]],\n ['fill', 'none'],\n ['stroke', stroke.v || stroke],\n ['stroke-width', strokeWidth],\n ];\n this.__propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit);\n this.addGeom('path', props);\n }\n }\n }\n\n get begin() {\n return this.getProps('begin');\n }\n\n get end() {\n return this.getProps('end');\n }\n\n get r() {\n return this.getProps('r');\n }\n\n get edge() {\n return this.getProps('edge');\n }\n\n // >180°时是否链接端点\n get closure() {\n return this.getProps('closure');\n }\n\n get bbox() {\n if(!this.__bbox) {\n let {\n isMulti, __cacheProps, root,\n __sx3: originX, __sy3: originY, width, height,\n currentStyle: {\n [STROKE_WIDTH]: strokeWidth,\n [BOX_SHADOW]: boxShadow,\n [FILTER]: filter,\n }\n } = this;\n let cx = originX + width * 0.5;\n let cy = originY + height * 0.5;\n this.buildCache(cx, cy);\n let r = 0;\n if(isMulti) {\n let max = 0;\n __cacheProps.r.forEach(r => {\n max = Math.max(r, max);\n });\n r = max;\n }\n else {\n r = __cacheProps.r;\n }\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE], half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else {\n half = Math.max(item[0], half);\n }\n });\n let [x1, y1, x2, y2] = this.__spreadBbox(boxShadow, filter);\n x1 -= half;\n y1 -= half;\n x2 += half;\n y2 += half;\n let xa = cx - r + x1;\n let xb = cx + r + x2;\n let ya = cy - r + y1;\n let yb = cy + r + y2;\n bbox[0] = Math.min(bbox[0], xa);\n bbox[1] = Math.min(bbox[1], ya);\n bbox[2] = Math.max(bbox[2], xb);\n bbox[3] = Math.max(bbox[3], yb);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Sector;\n","import Geom from './Geom';\nimport util from \"../../util/util\";\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n FILTER,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH, VMAX, VMIN } = unit;\n\nfunction genVertex(x, y, width, height, rx = 0, ry = 0) {\n if(rx === 0 || ry === 0) {\n return [\n [x, y],\n [x + width, y],\n [x + width, y + height],\n [x, y + height],\n [x, y],\n ];\n }\n let ox = rx * geom.H;\n let oy = ry * geom.H;\n return [\n [x + rx, y],\n [x + width - rx, y],\n [x + width + ox - rx, y, x + width, y + ry - oy, x + width, y + ry],\n [x + width, y + height - ry],\n [x + width, y + height + oy - ry, x + width + ox - rx, y + height, x + width - rx, y + height],\n [x + rx, y + height],\n [x + rx - ox, y + height, x, y + height + oy - ry, x, y + height - ry],\n [x, y + ry],\n [x, y + ry - oy, x + rx - ox, y, x + rx, y]\n ];\n}\n\n\nfunction getR(v) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = 0;\n }\n return v;\n}\n\nclass Rect extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 圆角\n if(this.isMulti) {\n this.__rx = [0];\n this.__ry = [0];\n if(Array.isArray(props.rx)) {\n this.__rx = props.rx.map(i => getR(i));\n }\n if(Array.isArray(props.ry)) {\n this.__ry = props.ry.map(i => getR(i));\n }\n }\n else {\n this.__rx = this.__ry = 0;\n if(!isNil(props.rx)) {\n this.__rx = getR(props.rx);\n }\n if(!isNil(props.ry)) {\n this.__ry = getR(props.ry);\n }\n }\n }\n\n buildCache(originX, originY, focus) {\n let { width, height, rx, ry, __cacheProps, isMulti } = this;\n let rebuild;\n if(isNil(__cacheProps.rx) || focus) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.rx = rx.map(rx => Math.min(rx, 0.5) * width);\n }\n else {\n __cacheProps.rx = Math.min(rx, 0.5) * width;\n }\n }\n if(isNil(__cacheProps.ry) || focus) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.ry = rx.map(ry => Math.min(ry, 0.5) * height);\n }\n else {\n __cacheProps.ry = Math.min(ry, 0.5) * height;\n }\n }\n if(rebuild) {\n let { rx, ry } = __cacheProps;\n if(isMulti) {\n __cacheProps.list = rx.map((rx, i) => genVertex(originX, originY, width, height, rx, ry[i]));\n }\n else {\n __cacheProps.list = genVertex(originX, originY, width, height, rx, ry);\n }\n }\n return rebuild;\n }\n\n render(renderMode, lv, ctx, cache, dx, dy) {\n let res = super.render(renderMode, lv, ctx, cache, dx, dy);\n if(res.break) {\n return res;\n }\n this.buildCache(res.sx3, res.sy3);\n ctx = res.ctx;\n this.__renderPolygon(renderMode, ctx, res);\n return res;\n }\n\n get rx() {\n return this.getProps('rx');\n }\n\n get ry() {\n return this.getProps('ry');\n }\n\n get bbox() {\n if(!this.__bbox) {\n let {\n root,\n __sx3: originX, __sy3: originY, width, height,\n currentStyle: {\n [STROKE_WIDTH]: strokeWidth,\n [BOX_SHADOW]: boxShadow,\n [FILTER]: filter,\n }\n } = this;\n this.buildCache(originX, originY);\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE], half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else {\n half = Math.max(item[0], half);\n }\n });\n let [x1, y1, x2, y2] = this.__spreadBbox(boxShadow, filter);\n x1 -= half;\n y1 -= half;\n x2 += half;\n y2 += half;\n bbox[0] = Math.min(bbox[0], originX + x1);\n bbox[1] = Math.min(bbox[1], originY + y1);\n bbox[2] = Math.max(bbox[2], originX + width + x2);\n bbox[3] = Math.max(bbox[3], originY + height + y2);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Rect;\n","import Geom from './Geom';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n FILTER,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH, VMAX, VMIN } = unit;\n\nfunction getR(v) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = 1;\n }\n return v;\n}\n\nclass Circle extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 半径[0, ∞),默认1\n if(this.isMulti) {\n this.__r = [1];\n if(Array.isArray(props.r)) {\n this.__r = props.r.map(i => getR(i));\n }\n else if(!isNil(props.r)) {\n this.__r = getR(props.r);\n }\n }\n else {\n this.__r = 1;\n if(!isNil(props.r)) {\n this.__r = getR(props.r);\n }\n }\n }\n\n buildCache(cx, cy, focus) {\n let { width, r, __cacheProps, isMulti } = this;\n if(isNil(__cacheProps.r) || focus) {\n if(isMulti) {\n __cacheProps.r = r.map(i => i * width * 0.5);\n __cacheProps.list = __cacheProps.r.map(r => geom.ellipsePoints(cx, cy, r, r));\n }\n else {\n __cacheProps.r = r * width * 0.5;\n __cacheProps.list = geom.ellipsePoints(cx, cy, __cacheProps.r, __cacheProps.r);\n }\n }\n }\n\n render(renderMode, lv, ctx, cache, dx, dy) {\n let res = super.render(renderMode, lv, ctx, cache, dx, dy);\n if(res.break) {\n return res;\n }\n this.buildCache(res.cx, res.cy);\n ctx = res.ctx;\n this.__renderPolygon(renderMode, ctx, res);\n return res;\n }\n\n get r() {\n return this.getProps('r');\n }\n\n get bbox() {\n if(!this.__bbox) {\n let {\n isMulti, __cacheProps, root,\n __sx3: originX, __sy3: originY, width, height,\n currentStyle: {\n [STROKE_WIDTH]: strokeWidth,\n [BOX_SHADOW]: boxShadow,\n [FILTER]: filter,\n }\n } = this;\n let cx = originX + width * 0.5;\n let cy = originY + height * 0.5;\n this.buildCache(cx, cy);\n let r = 0;\n if(isMulti) {\n let max = 0;\n __cacheProps.r.forEach(r => {\n max = Math.max(r, max);\n });\n r = max;\n }\n else {\n r = __cacheProps.r;\n }\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE], half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else {\n half = Math.max(item[0], half);\n }\n });\n let [x1, y1, x2, y2] = this.__spreadBbox(boxShadow, filter);\n x1 -= half;\n y1 -= half;\n x2 += half;\n y2 += half;\n let xa = cx - r + x1;\n let xb = cx + r + x2;\n let ya = cy - r + y1;\n let yb = cy + r + y2;\n bbox[0] = Math.min(bbox[0], xa);\n bbox[1] = Math.min(bbox[1], ya);\n bbox[2] = Math.max(bbox[2], xb);\n bbox[3] = Math.max(bbox[3], yb);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Circle;\n","import Geom from './Geom';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n FILTER,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH, VMAX, VMIN } = unit;\n\nfunction getR(v) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = 1;\n }\n return v;\n}\n\nclass Ellipse extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 半径[0, ∞),默认1\n if(this.isMulti) {\n this.__rx = [1];\n this.__ry = [1];\n if(Array.isArray(props.rx)) {\n this.__rx = props.rx.map(i => getR(i));\n }\n else if(!isNil(props.rx)) {\n this.__rx = [getR(props.rx)];\n }\n if(Array.isArray(props.ry)) {\n this.__ry = props.ry.map(i => getR(i));\n }\n else if(!isNil(props.ry)) {\n this.__ry = [getR(props.ry)];\n }\n }\n else {\n this.__rx = 1;\n if(!isNil(props.rx)) {\n this.__rx = getR(props.rx);\n }\n this.__ry = 1;\n if(!isNil(props.ry)) {\n this.__ry = getR(props.ry);\n }\n }\n }\n\n buildCache(cx, cy, focus) {\n let { width, height, rx, ry, __cacheProps, isMulti } = this;\n let rebuild;\n if(isNil(__cacheProps.rx) || focus) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.rx = rx.map(i => i * width * 0.5);\n }\n else {\n __cacheProps.rx = rx * width * 0.5;\n }\n }\n if(isNil(__cacheProps.ry) || focus) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.ry = ry.map(i => i * height * 0.5);\n }\n else {\n __cacheProps.ry = ry * height * 0.5;\n }\n }\n if(rebuild) {\n let { rx, ry } = __cacheProps;\n if(isMulti) {\n __cacheProps.list = rx.map((rx, i) => geom.ellipsePoints(cx, cy, rx, ry[i]));\n }\n else {\n __cacheProps.list = geom.ellipsePoints(cx, cy, rx, ry);\n }\n }\n return rebuild;\n }\n\n render(renderMode, lv, ctx, cache, dx, dy) {\n let res = super.render(renderMode, lv, ctx, cache, dx, dy);\n if(res.break) {\n return res;\n }\n this.buildCache(res.cx, res.cy);\n ctx = res.ctx;\n this.__renderPolygon(renderMode, ctx, res);\n return res;\n }\n\n get rx() {\n return this.getProps('rx');\n }\n\n get ry() {\n return this.getProps('ry');\n }\n\n get bbox() {\n if(!this.__bbox) {\n let {\n isMulti, __cacheProps, root,\n __sx3: originX, __sy3: originY, width, height,\n currentStyle: {\n [STROKE_WIDTH]: strokeWidth,\n [BOX_SHADOW]: boxShadow,\n [FILTER]: filter,\n }\n } = this;\n let cx = originX + width * 0.5;\n let cy = originY + height * 0.5;\n this.buildCache(cx, cy);\n let rx = 0, ry = 0;\n if(isMulti) {\n let mx = 0, my = 0;\n __cacheProps.rx.forEach((rx, i) => {\n mx = Math.max(rx, mx);\n my = Math.max(ry, __cacheProps.ry[i]);\n });\n rx = mx;\n ry = my;\n }\n else {\n rx = __cacheProps.rx;\n ry = __cacheProps.ry;\n }\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE], half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else {\n half = Math.max(item[0], half);\n }\n });\n let [x1, y1, x2, y2] = this.__spreadBbox(boxShadow, filter);\n x1 -= half;\n y1 -= half;\n x2 += half;\n y2 += half;\n let xa = cx - rx + x1;\n let xb = cx + rx + x2;\n let ya = cy - ry + y1;\n let yb = cy + ry + y2;\n bbox[0] = Math.min(bbox[0], xa);\n bbox[1] = Math.min(bbox[1], ya);\n bbox[2] = Math.max(bbox[2], xb);\n bbox[3] = Math.max(bbox[3], yb);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Ellipse;\n","import reset from '../style/reset';\n\nlet fullCssProperty = {\n skewX: 'kx',\n skewY: 'ky',\n transform: 'tf',\n fontSize: 'fz',\n offset: 'os',\n easing: 'e',\n filter: 'ft',\n boxShadow: 'bd',\n overflow: 'of',\n backgroundClip: 'bp',\n textOverflow: 'tof',\n flexWrap: 'fp',\n perspective: 'ppt',\n rotate3d: 'r3',\n};\n\nlet abbrCssProperty = {\n os: 'offset', // 非css属性不会被下面反向遍历插入,手动\n e: 'easing',\n};\n\nlet fullAnimate = {\n value: 'v',\n options: 'o',\n};\n\nlet abbrAnimate = {};\n\nlet fullAnimateOption = {\n duration: 'dt',\n delay: 'd',\n endDelay: 'ed',\n iterations: 'i',\n direction: 'dc',\n fill: 'f',\n fps: 'fp',\n playbackRate: 'p',\n spfLimit: 'sl',\n};\n\nlet abbrAnimateOption = {};\n\nreset.DOM_KEY_SET.concat(reset.GEOM_KEY_SET).forEach(k => {\n if(fullCssProperty.hasOwnProperty(k)) {\n abbrCssProperty[fullCssProperty[k]] = k;\n return;\n }\n let v = k.charAt(0) + k.replace(/[a-z]/g, '').toLowerCase();\n fullCssProperty[k] = v;\n abbrCssProperty[v] = k;\n});\n\nObject.keys(fullAnimate).forEach(k => {\n abbrAnimate[fullAnimate[k]] = k;\n});\n\nObject.keys(fullAnimateOption).forEach(k => {\n abbrAnimateOption[fullAnimateOption[k]] = k;\n});\n\nexport default {\n fullCssProperty,\n abbrCssProperty,\n fullAnimate,\n abbrAnimate,\n fullAnimateOption,\n abbrAnimateOption,\n};\n","import abbr from './abbr';\nimport Node from '../node/Node';\nimport Component from '../node/Component';\nimport $$type from '../util/$$type';\nimport util from '../util/util';\nimport inject from '../util/inject';\n\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet { isNil, isFunction, isPrimitive, clone, extend } = util;\nlet { abbrCssProperty, abbrAnimateOption, abbrAnimate } = abbr;\n\n/**\n * 还原缩写到全称,涉及样式和动画属性\n * @param target 还原的对象\n * @param hash 缩写映射\n */\nfunction abbr2full(target, hash) {\n // 也许节点没写样式\n if(target) {\n Object.keys(target).forEach(k => {\n // var-attr格式特殊考虑,仅映射attr部分,var-还要保留\n if(k.indexOf('var-') === 0) {\n let k2 = k.slice(4);\n if(hash.hasOwnProperty(k2)) {\n let fk = hash[k2];\n target['var-' + fk] = target[k];\n // delete target[k];\n }\n }\n // 普通样式缩写还原\n else if(hash.hasOwnProperty(k)) {\n let fk = hash[k];\n target[fk] = target[k];\n // 删除以免二次解析\n delete target[k];\n }\n });\n }\n}\n\nfunction replaceVars(json, vars) {\n if(json && vars) {\n // 新版vars语法\n if(json.hasOwnProperty('vars')) {\n let slot = json.vars;\n if(!Array.isArray(slot)) {\n slot = [slot];\n }\n if(Array.isArray(slot)) {\n slot.forEach(item => {\n let { id, member } = item;\n if(!Array.isArray(member)) {\n member = [member];\n }\n // 排除特殊的library\n if(Array.isArray(member) && member.length && member[0] !== 'library' && vars.hasOwnProperty(id)) {\n let target = json;\n for(let i = 0, len = member.length; i < len; i++) {\n let k = member[i];\n // 最后一个属性可以为空\n if(target.hasOwnProperty(k) || i === len - 1) {\n // 最后一个member表达式替换\n if(i === len - 1) {\n let v = vars[id];\n // undefined和null意义不同\n if(v === undefined) {\n return;\n }\n // 支持函数模式和值模式\n if(isFunction(v)) {\n v = v(target(k));\n }\n target[k] = v;\n }\n else {\n target = target[k];\n }\n }\n else {\n inject.error('Slot miss ' + k);\n return;\n }\n }\n }\n });\n }\n }\n else {\n Object.keys(json).forEach(k => {\n if(k.indexOf('var-') === 0) {\n let v = json[k];\n if(!v) {\n return;\n }\n let k2 = k.slice(4);\n // 有id且变量里面传入了替换的值,值可为null,因为某些情况下空为自动\n if(k2 && v.id && vars.hasOwnProperty(v.id)) {\n let value = vars[v.id];\n // undefined和null意义不同\n if(value === undefined) {\n return;\n }\n let target = json;\n // 如果有.则特殊处理子属性\n if(k2.indexOf('.') > -1) {\n let list = k2.split('.');\n let len = list.length;\n for(let i = 0; i < len - 1; i++) {\n k2 = list[i];\n // 避免异常\n if(target[k2]) {\n target = target[k2];\n }\n else {\n inject.warn('parseJson vars is not exist: ' + v.id + ', ' + k + ', ' + list.slice(0, i).join('.'));\n return;\n }\n }\n k2 = list[len - 1];\n }\n // 支持函数模式和值模式\n if(isFunction(value)) {\n value = value(v);\n }\n target[k2] = value;\n }\n }\n });\n }\n }\n}\n\nfunction replaceAnimateOptions(options, opt) {\n ['iterations', 'fill', 'duration', 'direction', 'easing', 'fps', 'delay', 'endDelay', 'playbackRate', 'spfLimit'].forEach(k => {\n if(opt.hasOwnProperty(k)) {\n options[k] = opt[k];\n }\n });\n}\n\nfunction replaceLibraryVars(json, hash, vars) {\n if(vars) {\n // 新版同级vars语法\n if(json.hasOwnProperty('vars')) {\n let slot = json.vars;\n if(!Array.isArray(slot)) {\n slot = [slot];\n }\n if(Array.isArray(slot)) {\n slot.forEach(item => {\n let { id, member } = item;\n if(!Array.isArray(member)) {\n member = [member];\n }\n // library.xxx,需要>=2的长度\n if(Array.isArray(member) && member.length > 1 && vars.hasOwnProperty(id)) {\n if(member[0] === 'library') {\n let target = hash;\n for(let i = 1, len = member.length; i < len; i++) {\n let k = member[i];\n // 最后一个属性可以为空\n if(target.hasOwnProperty(k) || i === len - 1) {\n // 最后一个member表达式替换\n if(i === len - 1) {\n let v = vars[id];\n // 支持函数模式和值模式\n if(isFunction(v)) {\n v = v(target(k));\n }\n let old = target[k];\n // 直接替换library的子对象,需补充id和tagName\n if(i === 1) {\n target[k] = Object.assign({ id: old.id, tagName: old.tagName }, v);\n }\n // 替换library中子对象的一个属性直接赋值\n else {\n target[k] = v;\n }\n }\n else {\n target = target[k];\n }\n }\n else {\n inject.error('Library slot miss ' + k);\n return;\n }\n }\n }\n }\n });\n }\n }\n // 兼容老版var-\n else {\n Object.keys(json).forEach(k => {\n if(k.indexOf('var-library.') === 0) {\n let v = json[k];\n // 直接移除library插槽,防止下面调用replaceVars(json, vars)时报错\n delete json[k];\n if(!v) {\n return;\n }\n let k2 = k.slice(12);\n // 有id且变量里面传入了替换的值\n if(k2 && v.id && vars.hasOwnProperty(v.id)) {\n let value = vars[v.id];\n if(isFunction(value)) {\n value = value(v);\n }\n // 替换图层的值必须是一个有tagName的对象\n if(!value || !value.tagName) {\n return;\n }\n // library对象也要加上id,与正常的library保持一致\n hash[k2] = Object.assign({ id: k2 }, value);\n }\n }\n });\n }\n }\n}\n\n/**\n * 遍历一遍library的一级,将一级的id存到hash上,无需递归二级,\n * 因为顺序前提要求排好且无循环依赖,所以被用到的一定在前面出现,\n * 一般是无children的元件在前,包含children的div在后\n * 即便library中的元素有children或library,在linkChild时将其link过去,parse递归会继续处理\n * @param item:library的一级孩子\n * @param hash:存放library的key/value引用\n */\nfunction linkLibrary(item, hash) {\n let id = item.id;\n // library中一定有id,因为是一级,二级+特殊需求才会出现放开\n if(isNil(id)) {\n throw new Error('Library item miss id: ' + JSON.stringify(item));\n }\n else {\n hash[id] = item;\n }\n}\n\n/**\n * 链接child到library文件,\n * props需要是clone的,因为防止多个child使用同一个库文件\n * children则直接引用,无需担心多个使用同一个\n * library也需要带上,在library直接子元素还包含library时会用到\n * @param child\n * @param libraryItem\n */\nfunction linkChild(child, libraryItem) {\n // 规定图层child只有init和动画,属性和子图层来自库\n child.tagName = libraryItem.tagName;\n child.props = clone(libraryItem.props);\n child.children = libraryItem.children;\n child.library = libraryItem.library;\n // library的var-也要继承过来,本身的var-优先级更高,目前只有children会出现优先级情况\n Object.keys(libraryItem).forEach(k => {\n if(k.indexOf('var-') === 0 && !child.hasOwnProperty(k)) {\n child[k] = libraryItem[k];\n }\n });\n // 删除以免二次解析\n child.libraryId = null;\n // 规定图层实例化的属性和样式在init上,优先使用init,然后才取原型链的props\n let { init } = child;\n if(init) {\n let props = child.props = child.props || {};\n let style = props.style;\n extend(props, init);\n // style特殊处理,防止被上面覆盖丢失原始值\n if(style) {\n extend(style, init.style);\n props.style = style;\n }\n // 删除以免二次解析\n child.init = null;\n }\n}\n\nfunction parse(karas, json, animateRecords, opt, hash = {}) {\n if(isPrimitive(json) || json instanceof Node || json instanceof Component) {\n return json;\n }\n if(Array.isArray(json)) {\n return json.map(item => {\n return parse(karas, item, animateRecords, opt, hash);\n });\n }\n // 先判断是否是个链接到库的节点,是则进行链接操作\n let libraryId = json.libraryId;\n if(!isNil(libraryId)) {\n let libraryItem = hash[libraryId];\n // 规定图层child只有init和动画,tagName和属性和子图层来自库\n if(libraryItem) {\n linkChild(json, libraryItem);\n }\n else {\n throw new Error('Link library miss id: ' + libraryId);\n }\n json.libraryId = null;\n }\n // 再判断是否有library形成一个新的作用域,会出现library下的library使得一个链接节点链接后出现library的情况\n let library = json.library;\n if(Array.isArray(library)) {\n hash = {};\n library.forEach(item => {\n linkLibrary(item, hash);\n });\n // 替换library插槽\n replaceLibraryVars(json, hash, opt.vars);\n json.library = null;\n }\n let { tagName, props = {}, children = [], animate = [] } = json;\n if(!tagName) {\n throw new Error('Dom must have a tagName: ' + JSON.stringify(json));\n }\n let style = props.style;\n (opt.abbr !== false) && abbr2full(style, abbrCssProperty);\n // 先替换style的\n replaceVars(style, opt.vars);\n // 再替换静态属性,style也作为属性的一种,目前尚未被设计为被替换\n replaceVars(props, opt.vars);\n // 替换children里的内容,如文字,无法直接替换tagName/props/children/animate本身,因为下方用的还是原引用\n replaceVars(json, opt.vars);\n if(!Array.isArray(children)) {\n throw new Error('children must be an array');\n }\n let vd;\n if(tagName.charAt(0) === '$') {\n vd = karas.createGm(tagName, props);\n }\n else if(/^[A-Z]/.test(tagName)) {\n let cp = Component.getRegister(tagName);\n vd = karas.createCp(cp, props, children.map(item => {\n if(item && [TYPE_VD, TYPE_GM, TYPE_CP].indexOf(item.$$type) > -1) {\n return item;\n }\n return parse(karas, item, animateRecords, opt, hash);\n }));\n }\n else {\n vd = karas.createVd(tagName, props, children.map(item => {\n if(item && [TYPE_VD, TYPE_GM, TYPE_CP].indexOf(item.$$type) > -1) {\n return item;\n }\n return parse(karas, item, animateRecords, opt, hash);\n }));\n }\n if(animate) {\n if(!Array.isArray(animate)) {\n animate = [animate];\n }\n let has;\n animate.forEach(item => {\n (opt.abbr !== false) && abbr2full(item, abbrAnimate);\n let { value, options } = item;\n // 忽略空动画\n if(Array.isArray(value) && value.length) {\n has = true;\n value.forEach(item => {\n (opt.abbr !== false) && abbr2full(item, abbrCssProperty);\n replaceVars(item, opt.vars);\n });\n }\n if(options) {\n (opt.abbr !== false) && abbr2full(options, abbrAnimateOption);\n replaceVars(options, opt.vars);\n replaceAnimateOptions(options, opt);\n }\n });\n // 产生实际动画运行才存入列表供root调用执行\n if(has) {\n animateRecords.push({\n animate,\n target: vd,\n });\n }\n }\n return vd;\n}\n\nexport default parse;\n","import parse from './parse';\nimport abbr from './abbr';\nimport inject from '../util/inject';\nimport util from '../util/util';\nimport font from '../style/font';\nimport Controller from '../animate/Controller';\n\nlet o = {\n parse(karas, json, dom, options = {}) {\n if(!json) {\n return;\n }\n // 特殊单例声明无需clone加速解析\n if(!options.singleton && !json.singleton) {\n json = util.clone(json);\n }\n // 根节点的fonts字段定义字体信息\n let fonts = json.fonts;\n if(fonts) {\n if(!Array.isArray(fonts)) {\n fonts = [fonts];\n }\n fonts.forEach(item => {\n let { fontFamily, data } = item;\n if(fontFamily && data) {\n font.register(fontFamily, data);\n }\n });\n }\n // json中定义无abbr\n if(json.abbr === false) {\n options.abbr = false;\n }\n if(options.abbr !== false) {\n inject.warn('Abbr in json is deprecated');\n }\n // 重载,在确定dom传入选择器字符串或html节点对象时作为渲染功能,否则仅创建vd返回\n if(!inject.isDom(dom)) {\n options = dom || {};\n dom = null;\n }\n // 暂存所有动画声明,等root的生成后开始执行\n let animateRecords = [];\n let vd = parse(karas, json, animateRecords, options);\n // 有dom时parse作为根方法渲染\n if(dom) {\n let { tagName } = json;\n if(['canvas', 'svg', 'webgl'].indexOf(tagName) === -1) {\n throw new Error('Parse dom must be canvas/svg');\n }\n // parse直接(非递归)的动画记录\n let ac = options.controller instanceof Controller ? options.controller : vd.animateController;\n // 第一次render,收集递归json里面的animateRecords,它在xom的__layout最后生成\n karas.render(vd, dom);\n // 由于vd首先生成的都是json,根parse要特殊处理将target指向真正的vd引用,json的vd在builder中赋值\n animateRecords.forEach(item => {\n item.target = item.target.vd;\n });\n // 直接的json里的animateRecords,再加上递归的parse的json的(第一次render布局时处理)动画一并播放\n if(options.autoPlay !== false) {\n ac.__records = ac.__records.concat(animateRecords);\n ac.__playAuto();\n }\n // 不自动播放进入记录列表,初始化并等待手动调用\n else {\n ac.__records2 = ac.__records2.concat(animateRecords);\n ac.init(ac.__records2, ac.list2);\n }\n }\n // 递归的parse,如果有动画,此时还没root,先暂存下来,等上面的root的render第一次布局时收集\n else {\n if(animateRecords.length) {\n vd.__animateRecords = {\n options,\n list: animateRecords,\n controller: options.controller instanceof Controller ? options.controller : null,\n };\n }\n }\n return vd;\n },\n loadAndParse(karas, json, dom, options) {\n let { fonts, components, imgs } = json;\n let list1 = [];\n let list2 = [];\n let list3 = [];\n if(fonts) {\n if(!Array.isArray(fonts)) {\n fonts = [fonts];\n }\n fonts.forEach(item => {\n let url = item.url;\n if(url) {\n list1.push(item);\n }\n });\n }\n if(components) {\n if(!Array.isArray(components)) {\n components = [components];\n }\n components.forEach(item => {\n let { tagName, url, reload } = item;\n // 如果没申明reload且已经被注册,则无需重复加载\n if(tagName && karas.Component.hasRegister(tagName) && !reload) {\n return;\n }\n // 即便没有tagName也要加载,可能组件内部执行了注册逻辑\n if(url) {\n list2.push(item);\n }\n });\n }\n if(imgs) {\n if(!Array.isArray(imgs)) {\n imgs = [imgs];\n }\n imgs.forEach(item => {\n let url = item.url;\n if(url) {\n list3.push(url);\n }\n });\n }\n let a = list1.length, b = list2.length, c = list3.length;\n if(a || b || c) {\n let count = 0;\n let cb = function() {\n if(count === a + b + c) {\n let res = o.parse(karas, json, dom, options);\n if(options && util.isFunction(options.callback)) {\n options.callback(res);\n }\n }\n };\n karas.inject.loadFont(list1, function() {\n count += a;\n cb();\n });\n karas.inject.loadComponent(list2.map(item => item.url), function() {\n count += b;\n // 默认约定加载的js组件会在全局变量申明同名tagName,已有不覆盖,防止组件代码内部本身有register\n list2.forEach(item => {\n let tagName = item.tagName;\n if(tagName && window[tagName] && !karas.Component.hasRegister(tagName)) {\n karas.Component.register(tagName, window[tagName]);\n }\n });\n cb();\n });\n karas.inject.measureImg(list3, function() {\n count += c;\n cb();\n });\n }\n else {\n let res = o.parse(karas, json, dom, options);\n if(options && util.isFunction(options.callback)) {\n options.callback(res);\n }\n return res;\n }\n },\n abbr,\n};\n\nexport default o;\n","import css from './css';\nimport reset from './reset';\nimport unit from './unit';\nimport font from './font';\nimport abbr from './abbr';\nimport transform from './transform';\n\nexport default {\n css,\n reset,\n unit,\n font,\n abbr,\n transform,\n};\n","import Animation from './Animation';\nimport Controller from './Controller';\nimport easing from './easing';\nimport frame from './frame';\n\nexport default {\n Animation,\n Controller,\n easing,\n frame,\n};\n","import level from './level';\nimport change from './change';\nimport Page from './Page';\nimport Cache from './Cache';\n\nexport default {\n level,\n change,\n Page,\n Cache,\n};\n","import Node from './node/Node';\nimport Text from './node/Text';\nimport Xom from './node/Xom';\nimport Dom from './node/Dom';\nimport Img from './node/Img';\nimport Root from './node/Root';\nimport tag from './node/tag';\nimport mode from './refresh/mode';\nimport Geom from './node/geom/Geom';\nimport Line from './node/geom/Line';\nimport Polyline from './node/geom/Polyline';\nimport Polygon from './node/geom/Polygon';\nimport Sector from './node/geom/Sector';\nimport Rect from './node/geom/Rect';\nimport Circle from './node/geom/Circle';\nimport Ellipse from './node/geom/Ellipse';\nimport Component from './node/Component';\nimport Event from './util/Event';\nimport util from './util/util';\nimport $$type from './util/$$type';\nimport builder from './util/builder';\nimport updater from './util/updater';\nimport inject from './util/inject';\nimport enums from './util/enums';\nimport debug from './util/debug';\nimport parser from './parser/index';\nimport style from './style/index';\nimport animate from './animate/index';\nimport math from './math/index';\nimport refresh from './refresh/index';\nimport { version } from '../package.json';\n\nGeom.register('$line', Line);\nGeom.register('$polyline', Polyline);\nGeom.register('$polygon', Polygon);\nGeom.register('$sector', Sector);\nGeom.register('$rect', Rect);\nGeom.register('$circle', Circle);\nGeom.register('$ellipse', Ellipse);\n\nlet karas = {\n version,\n render(root, dom) {\n if(!(root instanceof Root)) {\n throw new Error('Render dom must be canvas/svg');\n }\n if(dom) {\n root.appendTo(dom);\n }\n return root;\n },\n createElement(tagName, props) {\n props = props || {};\n let children = [];\n for(let i = 2, len = arguments.length; i < len; i++) {\n children.push(arguments[i]);\n }\n if(util.isString(tagName)) {\n if(tagName.charAt(0) === '$') {\n return this.createGm(tagName, props);\n }\n else {\n return this.createVd(tagName, props, children);\n }\n }\n else if(tagName) {\n // 特殊的$匿名类\n if(tagName instanceof Geom) {\n return this.createGm(tagName, props);\n }\n return this.createCp(tagName, props, children);\n }\n },\n createVd(tagName, props, children = []) {\n if(['canvas', 'svg', 'webgl'].indexOf(tagName) > -1) {\n return new Root(tagName, props, children);\n }\n if(tag.TAG_NAME.hasOwnProperty(tagName)) {\n return {\n tagName,\n props,\n children,\n $$type: $$type.TYPE_VD,\n };\n }\n throw new Error(`Can not use <${tagName}>`);\n },\n createGm(tagName, props) {\n return {\n tagName,\n props,\n $$type: $$type.TYPE_GM,\n };\n },\n createCp(klass, props, children = []) {\n props.children = children;\n return {\n klass,\n props,\n $$type: $$type.TYPE_CP,\n };\n },\n parse(json, dom, options) {\n return parser.parse(this, json, dom, options);\n },\n loadAndParse(json, dom, options) {\n return parser.loadAndParse(this, json, dom, options);\n },\n mode,\n Component,\n Node,\n Text,\n Geom,\n Xom,\n Dom,\n Img,\n Root,\n Event,\n util,\n inject,\n style,\n parser,\n animate,\n math,\n builder,\n updater,\n refresh,\n enums,\n set debug(v) {\n debug.flag = !!v;\n },\n};\n\nbuilder.ref({\n Xom,\n Dom,\n Img,\n Geom,\n Component,\n});\n\nif(typeof window !== 'undefined') {\n window.karas = karas;\n}\nelse if(typeof self !== 'undefined') {\n self.karas = karas;\n}\n\nexport default karas;\n"],"names":["STYLE_KEY","POSITION","DISPLAY","TOP","RIGHT","BOTTOM","LEFT","MARGIN_TOP","MARGIN_RIGHT","MARGIN_BOTTOM","MARGIN_LEFT","PADDING_TOP","PADDING_RIGHT","PADDING_BOTTOM","PADDING_LEFT","FONT_SIZE","FONT_FAMILY","COLOR","FONT_STYLE","FONT_WEIGHT","LINE_HEIGHT","BACKGROUND_IMAGE","BACKGROUND_COLOR","BACKGROUND_SIZE","BACKGROUND_REPEAT","BACKGROUND_POSITION_X","BACKGROUND_POSITION_Y","BORDER_TOP_WIDTH","BORDER_RIGHT_WIDTH","BORDER_BOTTOM_WIDTH","BORDER_LEFT_WIDTH","BORDER_TOP_COLOR","BORDER_RIGHT_COLOR","BORDER_BOTTOM_COLOR","BORDER_LEFT_COLOR","BORDER_TOP_STYLE","BORDER_RIGHT_STYLE","BORDER_BOTTOM_STYLE","BORDER_LEFT_STYLE","BORDER_TOP_LEFT_RADIUS","BORDER_TOP_RIGHT_RADIUS","BORDER_BOTTOM_RIGHT_RADIUS","BORDER_BOTTOM_LEFT_RADIUS","WIDTH","HEIGHT","FLEX_GROW","FLEX_SHRINK","FLEX_BASIS","FLEX_DIRECTION","JUSTIFY_CONTENT","ALIGN_ITEMS","ALIGN_SELF","TEXT_ALIGN","TRANSFORM_ORIGIN","VISIBILITY","OPACITY","Z_INDEX","TRANSFORM","TRANSLATE_X","TRANSLATE_Y","TRANSLATE_Z","SCALE_X","SCALE_Y","SCALE_Z","SKEW_X","SKEW_Y","ROTATE_X","ROTATE_Y","ROTATE_Z","ROTATE_3D","PERSPECTIVE","PERSPECTIVE_ORIGIN","FILTER","BOX_SHADOW","POINTER_EVENTS","OVERFLOW","MIX_BLEND_MODE","BACKGROUND_CLIP","WHITE_SPACE","TEXT_OVERFLOW","LETTER_SPACING","LINE_CLAMP","ORDER","FLEX_WRAP","ALIGN_CONTENT","TEXT_STROKE_WIDTH","TEXT_STROKE_COLOR","TEXT_STROKE_OVER","FILL","STROKE","STROKE_WIDTH","STROKE_DASHARRAY","STROKE_DASHARRAY_STR","STROKE_LINECAP","STROKE_LINEJOIN","STROKE_MITERLIMIT","FILL_RULE","MATRIX","BORDER_TOP","BORDER_RIGHT","BORDER_BOTTOM","BORDER_LEFT","TRANSLATE_PATH","STYLE2LOWER_MAP","style2Lower","s","toLowerCase","replace","$0","$1","toUpperCase","STYLE2UPPER_MAP","style2Upper","$2","STYLE_R_KEY","STYLE_RV_KEY","STYLE_V_KEY","Object","keys","forEach","k","k2","l","UPDATE_KEY","UPDATE_NODE","UPDATE_STYLE","UPDATE_FOCUS","UPDATE_MEASURE","UPDATE_COMPONENT","UPDATE_OVERWRITE","UPDATE_KEYS","UPDATE_LIST","UPDATE_CONFIG","UPDATE_ADD_DOM","UPDATE_REMOVE_DOM","KEY_FRAME_KEY","FRAME_STYLE","FRAME_TIME","FRAME_EASING","FRAME_TRANSITION","NODE_KEY","NODE_DOM_PARENT","NODE_OPACITY","NODE_MATRIX","NODE_MATRIX_EVENT","NODE_CACHE","NODE_CACHE_TOTAL","NODE_CACHE_FILTER","NODE_CACHE_MASK","NODE_CACHE_OVERFLOW","NODE_STRUCT","NODE_TAG_NAME","NODE_CURRENT_STYLE","NODE_CURRENT_PROPS","NODE_COMPUTED_STYLE","NODE_CACHE_STYLE","NODE_CACHE_PROPS","NODE_LIMIT_CACHE","NODE_IS_MASK","NODE_IS_INLINE","NODE_HAS_CONTENT","NODE_REFRESH_LV","NODE_IS_DESTROYED","NODE_STYLE","NODE_UPDATE_HASH","NODE_UNIQUE_UPDATE_ID","NODE_DEFS_CACHE","NODE_PERSPECTIVE_MATRIX","NODE_VIRTUAL_DOM","NODE_CACHE_AS_BITMAP","STRUCT_KEY","STRUCT_NODE","STRUCT_INDEX","STRUCT_CHILD_INDEX","STRUCT_LV","STRUCT_NUM","STRUCT_TOTAL","STRUCT_HAS_MASK","ANIMATE_KEY","I_ASSIGNING","I_IN_FPS","I_IS_DELAY","I_BEGIN","I_END","I_FINISHED","I_NEXT_END","I_FIRST_PLAY","I_PLAY_CB","I_TARGET","I_ROOT","I_FRAMES","I_FRAMES_R","I_CURRENT_TIME","I_NEXT_TIME","I_STYLE","I_DURATION","I_ITERATIONS","I_FILL","I_PLAYBACK_RATE","I_PLAY_COUNT","I_PLAY_STATE","I_DESTROYED","I_START_TIME","I_FPS_TIME","I_EASING","I_ENTER_FRAME","I_DELAY","I_END_DELAY","I_KEYS","I_ORIGIN_STYLE","I_CURRENT_FRAMES","I_CURRENT_FRAME","I_SPF_LIMIT","I_FPS","I_DIRECTION","I_FIRST_ENTER","I_STAY_BEGIN","I_STAY_END","I_IS2","I_END_TIME","I_NODE_CONFIG","I_ROOT_CONFIG","I_OUT_BEGIN_DELAY","I_TIME_STAMP","enums","Node","__x","__y","__ox","__oy","__sx","__sy","__width","__height","__baseline","__config","__prev","__next","__parent","__domParent","__root","__host","i","lv","j","root","struct","diff","isLayout","x","ox","y","oy","__hostRoot","__virtualDom","CANVAS","SVG","WEBGL","o","AUTO","PX","PERCENT","NUMBER","INHERIT","DEG","STRING","RGBA","REM","EM","VW","VH","VMAX","VMIN","calUnit","v","n","parseFloat","test","info","arial","lhr","blr","lgr","padding","f","helvetica","verdana","tahoma","S","T","Z","c","t","georgia","simsun","support","fontFamily","hasOwnProperty","register","name","emSquare","ascent","descent","lineGap","addPadding","assign","position","gradient","img","identity","multiply","a","b","isE","a0","a1","a2","a3","calPoint","point","m","z","w","undefined","length","b1","c1","d1","b2","c2","d2","b3","c3","d3","a4","b4","c4","d4","d","e","inverse","inverse4","divisor","inv","det","m2m6","point2d","slice","dotProduct","x1","y1","x2","y2","crossProduct","H","Math","sqrt","vector","mx","h","deg","cos","sin","pointInPolygon","vertexes","xmax","ymax","xmin","ymin","len","max","min","pointInQuadrilateral","x4","y4","x3","y3","matrix","w1","w2","w3","w4","angleBySide","theta","pow","acos","sideByAngle","alpha","pointsDistance","triangleIncentre","ellipsePoints","sectorPoints","r","begin","end","list","floor","h2","d2r","abs","atan","rx","ry","p1","p2","p4","p3","push","concat","temp","res","getRectsIntersection","isRectsOverlap","ax1","ay1","ax4","ay4","bx1","by1","bx4","by4","isRectsInside","calCoordsInNode","px","py","node","computedStyle","width","height","calPercentInNode","ds","Infinity","PI","dt","r2d","bboxBezier2","x0","y0","minX","minY","maxX","maxY","tx","ty","sx","sy","qx","qy","bboxBezier3","cx","cy","bx","by","ax","ay","hx","hy","q","bboxBezier","arguments","norm","order","sum","reduce","simpson38","derivativeFunc","middleL","middleR","adaptiveSimpson38","eps","mid","st","sl","sr","ans","bezierLength","points","startT","endT","at","at3","p0","at2","bezierOrder","derivativeOrder","pointAtBezier","percent","maxIteration","pointAtBezierWithLength","targetLen","approachLen","approachT","preApproachT","derivative1","derivative2","numerator","denominator","sliceBezier","x12","y12","x23","y23","x123","y123","x34","y34","x234","y234","x1234","y1234","sliceBezier2Both","start","reverse","pointOnCircle","getConicGradientImage","originX","originY","stop","data","Error","getAngle","dx","dy","increasingList","map","item","color","angle","factor","idx","canvasPolygon","ctx","Array","isArray","moveTo","lineTo","quadraticCurveTo","bezierCurveTo","svgPolygon","canvasLine","controlA","controlB","num","svgLine","canvasFilter","filter","svgFilter","geom","unit","painter","calFitDashed","total","bs","be","smin","smax","dmin","dmax","ps","pd","outer","per","free","mo","calDashed","style","m1","m2","m3","m4","bw","calPoints","borderWidth","borderStyle","deg1","deg2","direction","beginRadius","endRadius","indexOf","isLast","main1","main2","cross1","cross2","tan","calTopRadiusPoints","calRightRadiusPoints","calBottomRadiusPoints","calLeftRadiusPoints","pointsList","brx","bry","erx","ery","oxl","oxr","beginList","centerList","endList","ya","yb","beginLength","needInner","crossDeg","rx1","ry1","sx1","oyl","rx2","ry2","sx2","xa","xb","ca","calBezierTopLeft","cb","controls1","controls2","limit","pop","endLength","oyr","calBezierTopRight","isStart","crossDx","p1x","p1y","p2x","p2y","dx1","dsx1","dx2","dsx2","cpx2","cpy2","cpx1","cpy1","crossDsx","beta","tanBetaDiv2Sqrt","tanAlphaHalf","degTg","degTg1","cdx1","cdy1","cx1","cy1","degTg2","cdx2","cdy2","cx2","cy2","isEnd","oyt","oyb","oxt","calBezierRightTop","oxb","calBezierRightBottom","calBezierBottomLeft","calBezierBottomRight","calBezierLeftTop","calBezierLeftBottom","calRadius","btlr","btrr","bbrr","bblr","need","btlx","btly","btrx","btry","bbrx","bbry","bblx","bbly","BR_KS","calBorderRadius","currentStyle","noRadius","target","prev","next","half","calBorderRadiusInline","contentBoxList","first","last","outerWidth","outerHeight","renderBorder","xom","renderMode","mode","beginPath","fillStyle","fill","closePath","virtualDom","bb","type","tagName","props","TYPE_VD","Symbol","TYPE_GM","TYPE_CP","toString","isType","obj","call","isObject","isString","isFunction","isNumber","isBoolean","isDate","hasOwn","fnToString","ObjectFunctionString","isNil","joinSourceArray","arr","stringify","encodeHtml","prop","joinVirtualDom","vd","defs","joinDef","joinVd","conClip","children","isMask","content","opacity","transform","visibility","mask","overflow","mixBlendMode","def","uuid","joinItem","rgba2int","charAt","parseInt","match","int2rgba","joinArr","int2invert","arr2hash","hash","hash2arr","clone","$$type","util","Date","isPlainObject","equalArr","ai","bi","isArrayA","isArrayB","equal","getTime","extend","source","split","extendAnimate","ovd","nvd","__animationList","animationList","splice","__setTarget","assigning","finished","__stayEnd","assignCurrentStyle","__frameAnimateList","transformBbox","bbox","proto","getPrototypeOf","Ctor","constructor","assignMatrix","isPrimitive","isAuto","flag","charWidth","ELLIPSIS","antialias","premultipliedAlpha","preserveDrawingBuffer","initShaders","gl","vshader","fshader","program","createProgram","enable","BLEND","blendFunc","ONE","ONE_MINUS_SRC_ALPHA","vertexShader","loadShader","VERTEX_SHADER","fragmentShader","FRAGMENT_SHADER","attachShader","linkProgram","linked","getProgramParameter","LINK_STATUS","error","getProgramInfoLog","deleteProgram","deleteShader","shader","createShader","shaderSource","compileShader","compiled","getShaderParameter","COMPILE_STATUS","getShaderInfoLog","convertCoords2Gl","revertY","createTexture","tex","texture","bindTexture","pixelStorei","UNPACK_PREMULTIPLY_ALPHA_WEBGL","texImage2D","TEXTURE_2D","UNSIGNED_BYTE","texParameteri","TEXTURE_WRAP_S","CLAMP_TO_EDGE","TEXTURE_WRAP_T","TEXTURE_MIN_FILTER","LINEAR","TEXTURE_MAG_FILTER","activeTexture","drawTextureCache","vtPoint","vtTex","vtOpacity","lastChannel","record","stack","cache","channel","page","tx1","ty1","tx2","ty2","pointBuffer","createBuffer","bindBuffer","ARRAY_BUFFER","bufferData","Float32Array","STATIC_DRAW","a_position","getAttribLocation","vertexAttribPointer","FLOAT","enableVertexAttribArray","texBuffer","a_texCoords","opacityBuffer","a_opacity","u_texture","getUniformLocation","count","uniform1i","drawArrays","TRIANGLES","deleteBuffer","disableVertexAttribArray","drawBlur","frameBuffer","texCache","tex1","tex2","spread","sigma","u_direction","uniform2f","ratio","recycle","tex3","framebufferTexture2D","FRAMEBUFFER","COLOR_ATTACHMENT0","tex4","deleteTexture","drawCm","u_m","uniform1fv","drawOverflow","programOverflow","drawMask","u_texture1","u_texture2","drawMbm","W","SPF","CANVAS_LIST","WEBGL_LIST","SUPPORT_OFFSCREEN_CANVAS","OffscreenCanvas","prototype","getContext","defaultFontFamilyData","key","message","debug","document","createElement","setAttribute","body","appendChild","canvas","draw","enabled","available","release","cacheCanvas","cacheWebgl","IMG","INIT","LOADING","LOADED","FONT","COMPONENT","inject","measureText","textCache","html","lengths","chars","ff","fs","fw","inline","char","div","left","top","innerHTML","cns","childNodes","index","css","window","getComputedStyle","text","__measureCb","removeChild","measureTextSync","measureImg","url","state","success","task","Image","onload","onerror","substr","host","exec","location","hostname","crossOrigin","src","warn","console","requestAnimationFrame","bind","setTimeout","cancelAnimationFrame","id","clearTimeout","now","performance","hasCacheCanvas","getCacheCanvas","releaseCacheCanvas","delCacheCanvas","hasCacheWebgl","getCacheWebgl","releaseCacheWebgl","delCacheWebgl","isDom","Element","self","getElementsByTagName","isWebGLTexture","WebGLTexture","checkSupportFontFamily","font","checked","context","textAlign","textBaseline","clearRect","fillText","getImageData","loadFont","FontFace","load","then","fonts","add","loadComponent","script","async","head","getLinearDeg","getRadialPosition","center","right","bottom","getColorStop","firstColor","p","dr","dg","db","da","unshift","calLinearCoords","calCircleCentre","iw","ih","positionX","positionY","calRadialRadius","shape","size","xl","yl","asin","parseGradient","reg","i5","i6","i7","getLinear","coords","l1","l2","l3","l4","r1","getRadial","scx","scy","getConic","calConicRadius","renderConic","isInline","border","offscreen","imgData","putImageData","save","clip","drawImage","restore","DOM","display","marginTop","marginRight","marginBottom","marginLeft","paddingTop","paddingRight","paddingBottom","paddingLeft","fontSize","fontStyle","fontWeight","lineHeight","backgroundImage","backgroundColor","backgroundSize","backgroundRepeat","backgroundPositionX","backgroundPositionY","backgroundClip","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","flexGrow","flexShrink","flexBasis","flexDirection","flexWrap","justifyContent","alignItems","alignSelf","alignContent","letterSpacing","transformOrigin","zIndex","translateX","translateY","translateZ","scaleX","scaleY","scaleZ","skewX","skewY","rotateX","rotateY","rotateZ","rotate3d","perspective","perspectiveOrigin","boxShadow","pointerEvents","whiteSpace","textOverflow","lineClamp","textStrokeWidth","textStrokeColor","textStrokeOver","GEOM","stroke","strokeWidth","strokeDasharray","strokeLinecap","strokeLinejoin","strokeMiterlimit","fillRule","DOM_ENTRY_SET","DOM_KEY_SET","GEOM_ENTRY_SET","GEOM_KEY_SET","INHERIT_KEY_SET","isValid","parseFlex","grow","shrink","basis","parseMarginPadding","parseOneBorder","margin","borderTop","borderRight","borderBottom","borderLeft","borderColor","borderRadius","background","backgroundPosition","flex","translate","translate3d","scale","scale3d","rotate","skew","textStroke","toFull","bgc","bgi","bgr","bgp","gd","repeat","join","isEmpty","v2","KEY_COLOR","KEY_LENGTH","KEY_GRADIENT","KEY_RADIUS","COLOR_HASH","LENGTH_HASH","RADIUS_HASH","GRADIENT_HASH","GRADIENT_TYPE","linear","radial","conic","KEY_EXPAND","EXPAND_HASH","RESET_DOM","reset","RESET_GEOM","IGNORE","REPAINT","MEASURE","addGeom","ks","isIgnore","isGeom","isRepaint","isMeasure","MEASURE_KEY_SET","isMeasureInherit","measureInheritList","change","TRANSFORM_HASH","compatibleTransform","normalize","abbr","flexFlow","k1","arr1","arr2","k3","arr3","isNaN","computeMeasure","isRoot","domParent","parentComputedStyle","getFontFamily","computeReflow","__hasComputeReflow","parent","rem","calNormalLineHeight","ph","setFontStyle","str","getBaseline","normal","calRelativePercent","calRelative","isWidth","calAbsolute","equalStyle","oa","ob","aa","av","bv","isMulti","isRelativeOrAbsolute","VALUE","ARRAY_0","ARRAY_0_1","cloneStyle","calAbsFixedSize","value","TextBox","wList","__index","__content","__wList","cacheStyle","__endX","__endY","overFill","strokeText","baseline","__parentLineBox","SIZE","MAX","HASH_CANVAS","Page","number","__size","__number","__free","__total","__canvas","__offscreen","__grid","__uuid","__update","time","grid","pos","calDeg","pointIndex","cross","pointByIndex","exchangeOrder","sy1","sy2","sx3","sy3","tx3","ty3","isOverflow","ls","lt","ls2","lt2","ax2","ay2","ax3","ay3","ab","ac","bc","AB","AC","BC","A","DEFAULT_COMPARE","SplayTree","compare","noDuplicates","_compare","_root","_size","_noDuplicates","prototypeAccessors","configurable","rotateLeft","rotateRight","_splay","splay","gp","ggp","u","minNode","maxNode","insert","comp","cmp","find","contains","comparator","remove","removeNode","erase","sMax","returnValue","successor","predecessor","callback","current","done","range","low","high","fn","Q","values","presort","sort","loadRecursive","get","createTree","defineProperties","middle","pivot","tmp","NORMAL","NON_CONTRIBUTING","SAME_TRANSITION","DIFFERENT_TRANSITION","INTERSECTION","UNION","DIFFERENCE","XOR","computeFields","event","operation","inOut","otherInOut","isSubject","isVertical","prevInResult","inResult","isInResult","resultTransition","determineResultTransition","thisIn","thatIn","isIn","SweepEvent","otherEvent","edgeType","otherPos","outputContourId","isExteriorRing","prototypeAccessors$1","isBelow","isAbove","copy","contourId","equals","epsilon","splitter","resulterrbound","elen","flen","Qnew","hh","bvirt","enow","fnow","eindex","findex","hindex","estimate","vec","Float64Array","ccwerrboundA","ccwerrboundB","ccwerrboundC","B","C1","C2","D","orient2dadapt","detsum","acxtail","acytail","bcxtail","bcytail","ahi","alo","bhi","blo","_i","_j","_0","s1","s0","t1","t0","u3","acx","bcx","acy","bcy","errbound","C1len","C2len","Dlen","orient2d","detleft","detright","signedArea","compareEvents","e1","e2","specialCases","divideSegment","se","queue","intersection","noEndpointTouch","va","vb","toPoint","kross","sqrKross","sqrLenA","sa","sb","possibleIntersection","se1","se2","inter","nintersections","events","leftCoincide","rightCoincide","compareSegments","le1","le2","subdivide","eventQueue","subject","clipping","sbbox","cbbox","sweepLine","sortedEvents","rightbound","prevEvent","prevprevEvent","prevprev","Contour","holeIds","holeOf","depth","isExterior","orderEvents","resultEvents","sorted","nextPos","processed","origPos","newPos","initializeContourFromContext","contours","contour","lowerContourId","lowerResultTransition","lowerContour","parentContourId","connectEdges","loop","markAsProcessed","initial","_tinyqueue_1_2_3_tinyqueue","TinyQueue","default_1","defaultCompare","_down","_up","peek","halfLength","best","processPolygon","contourOrHole","s2","fillQueue","polygonSet","ii","jj","EMPTY","trivialOperation","result","compareBBoxes","boolean","trivial","polygons","rings","holeId","union","xor","intersection$1","tar","booleanOperations","math","calSingle","rlen","nc","xy","yz","zx","xs","ys","zs","calMatrix","ow","oh","calMatrixByOrigin","calMatrixWithOrigin","normalizeSingle","calOrigin","tfo","calMatrixByPerspective","pm","calPerspectiveMatrix","ppt","po","isPerspectiveMatrix","kernelSize","outerSize","outerSizeByD","gaussianWeight","E","genSingle","dbx","dby","Cache","__init","__bbox","__page","__pos","getCoords","__appendData","__isNew","__enabled","setTransform","globalAlpha","update","__available","clear","del","ceil","getInstance","blur","cacheMask","isClip","__sx1","__sy1","tf","globalCompositeOperation","drawCache","xe","ye","cacheOverflow","rect","old","newCache","nx","ny","parentMatrix","dbx2","dby2","ENUM","NONE","TRANSFORM_ALL","REFLOW","REBUILD","TRANSFORMS","contain","getLevel","isReflow","isRebuild","Text","__textBoxes","__charWidthList","__charWidth","__textWidth","__bp","charWidthList","ffs","__ff","__key","wait","needMeasure","pff","pffs","pfs","pfw","pKey","__pKey","parentCache","mw","__cache","lx","lineBoxManager","endSpace","lineClampCount","isDestroyed","textBoxes","beginSpace","maxW","needReduce","lastChar","ew","bp","lineCount","isTextOverflow","__lineBack","textBox","addItem","cw","hasCache","needBack","setNewLine","__ellipsis","lineBox","tb","__offsetX","__offsetY","lineWidth","strokeColor","strokeStyle","render","endX","endY","__cacheStyle","delRefreshTask","__task","addRefreshTask","__before","level","__addUpdate","__after","__style","matrixEvent","__renderByMask","flattenJson","traverseJson","lastText","options","Xom","Dom","Img","Geom","Component","initRoot","cd","flatten","__json","build","relation","initDom","json","initCp","initCp2","klass","__tagName","hasP","__inheritAnimate","__animateRecords","__placeholder","__children","getRegister","ref","shadowRoot","Event","__eHash","handle","on","apply","off","__karasEventCb","once","emit","fns","REGISTER","setUpdateFlag","cp","__hasCpUpdate","__ref","__isMounted","__taskList","__nextState","addRefreshCp","builder","__cd","listener","__shadow","shadow","__shadowRoot","componentDidMount","REFRESH","__isDestroyed","componentWillUnmount","__destroy","force","__emitEvent","__state","hasRegister","defineProperty","matrixResize","imgWidth","imgHeight","targetWidth","targetHeight","renderBgc","method","me","calBackgroundSize","calBackgroundPosition","container","renderImage","loadBgi","bx2","by2","bgW","bgH","bgX","bgY","needMask","xnl","xnr","ynt","ynb","image","needResize","traversal","after","isPause","Frame","__hookTask","__taskCp","__now","taskCp","cloneCp","lengthCp","__karasFramecb","offFrame","onFrame","NEWTON_ITERATIONS","NEWTON_MIN_SLOPE","SUBDIVISION_PRECISION","SUBDIVISION_MAX_ITERATIONS","kSplineTableSize","kSampleStepSize","float32ArraySupported","aA1","aA2","C","calcBezier","aT","getSlope","binarySubdivide","aX","aA","aB","mX1","mX2","currentX","currentT","newtonRaphsonIterate","aGuessT","currentSlope","LinearEasing","bezier","mY1","mY2","sampleValues","getTForX","intervalStart","currentSample","lastSample","dist","guessForT","initialSlope","BezierEasing","easing","easeIn","easeOut","ease","easeInOut","cubicBezier","getEasing","v1","v3","timingFunction","NUM_CAL_HASH","unify","frames","getProps","inherit","genBeforeRefresh","__frameHook","framing","duration","es","offset","translatePath","calByUnit","calDiff","nm","pHash","nHash","keyHash","hasChange","nv","pv","pi","ni","has","pp","nn","clientWidth","eq","isArrP","isArrN","pz","nz","np","len2","pv2","nv2","len3","pv3","nv3","calFrame","ts","binarySearch","frame","ea","steps","stepsD","calIntermediateStyle","transition","st2","calIncrease","o2","n2","gotoOverload","calDiffTime","playbackRate","spfLimit","fps","frameCb","isDelay","FRAME","PLAY","Animation","__id","nl","__options","op","config","iterations","framesR","originStyle","delay","endDelay","isFinish","__cancelTask","__currentProps","__currentStyle","playState","__hasFin","__hasCancel","playCount","currentFrames","stayBegin","stayEnd","is2","endTime","currentTime","currentFrame","round","isAlternate","alternate","isEven","isLastCount","frameTime","isLastFrame","inEndDelay","needClean","playCb","__clean","BEGIN","END","FINISH","silence","pending","PAUSE","play","CANCEL","__goto","isFrame","excludeDelay","finish","currentProps","spf","animateController","backwards","both","forwards","__target","sync","removeControl","nextFrame","__checkModify","renderBoxShadow","inset","box","spreadBox","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","blurBox","MBM_HASH","screen","overlay","darken","lighten","difference","exclusion","hue","saturation","luminosity","mbmName","isValidMbm","getInlineBox","diffL","eyt","eyb","pbt","pbb","dom","getInlineWidth","contentBox","LOCAL","mbm","TF","TX","TY","TZ","getFirstEmptyInlineWidth","flowChildren","child","getLastEmptyInlineWidth","__computedStyle","__listener","__loadBgi","__cacheDefs","__isClip","__isMask","__contentBoxList","__cacheAsBitmap","cacheAsBitmap","__layoutData","__hasMask","__mpSize","mp","__clientWidth","__offsetWidth","__outerWidth","__clientHeight","__offsetHeight","__outerHeight","onlyFixedValue","isDirectionRow","isDirectItem","mbp","__calMp","isAbs","isColumn","clearCache","__layoutNone","__mp","__isRealInline","__layoutFlex","__layoutInline","__layoutBlock","__sx2","__sx3","__sx4","__sx5","__sx6","__sy2","__sy3","__sy4","__sy5","__sy6","__execAr","ar","controller","autoPlay","__records2","init","list2","__records","__playAuto","h3","nowrap","fixedWidth","fixedHeight","selfEndSpace","isReplaced","offsetWidth","offsetHeight","matrixCache","isScale","clientHeight","x5","x6","y5","y6","__calFilter","bg","bgI","item2","kw","__bx1","__bx2","__by1","__by2","rebuild","__hasContent","isRealInline","sx4","sx5","sx6","sy4","sy5","sy6","__calPerspective","__calMatrix","hasContent","__calContent","__releaseWhenEmpty","limitCache","__calCache","perspectiveMatrix","offscreenBlend","offscreenMask","hasFilter","offscreenFilter","offscreenOverflow","borderList","hasBgi","some","svgBgSymbol","__gradient","isFirst","lastContentBox","lastLineBox","parentLineBox","countW","ix1","iy1","ix2","iy2","symbol","clearAnimate","clearFrameAnimate","__stopPropagation","__stopImmediatePropagation","willResponseEvent","hasEmitMask","ignore","inThis","__touchstartTarget","__getLg","__getRg","__getCg","lg","createLinearGradient","addColorStop","rg","createRadialGradient","ec","dc","pc","cur","onlyTotal","__cacheTotal","__cacheFilter","__cacheMask","__cacheOverflow","formatStyle","animation","cancel","enter","yt","xr","includeBbox","isShadowRoot","hostRoot","pJson","zChildren","zIndexChildren","__spreadBbox","LineBox","__list","__lineHeight","increasedHeight","hasReplaced","isVerticalAlign","LineBoxManager","__lastX","__lastY","__maxX","__domList","__domStack","__isNewLine","__isEnd","__spreadYList","__setLB","nextNewLine","genLineBox","syl","verticalAlign","isNewLine","TAG_NAME","INLINE","BOLD","offsetAndResizeByNodeOnY","reflowHash","inDirectAbsList","isContainer","cs","__layoutAbs","__resizeY","clearUniqueReflowId","__uniqueReflowId","getMergeMarginTB","topList","bottomList","genZIndexChildren","hasMc","mcHash","lastMaskIndex","__iIndex","__zIndex","__aIndex","genOrderChildren","__order","block","inlineBlock","none","tag","__flexLine","__zIndexChildren","__structure","nss","__structs","structs","needSort","__tryLayInline","firstCharWidth","textWidth","isDirectChild","main","isFixed","isContent","fixedSize","countMin","countMax","isRow","__calBasis","min2","max2","__lineBoxManager","__layout","__addMBP","__preLayout","__ioSize","mergeMarginBottomList","mergeMarginTopList","isXom","isInlineBlock","reflow","__isIbFull","setNotEnd","lastX","lastY","isNone","isEmptyBlock","tw","th","spreadYList","isLastBlock","isBlock","horizonAlign","__inlineSize","domList","__marginAuto","growList","shrinkList","basisList","maxList","minList","orderChildren","containerSize","isMultiLine","line","hypotheticalList","hypothetical","maxCrossList","__layoutFlexLine","maxCross","crossSum","crossSumList","between","around","__crossAlign","flexLine","hypotheticalSum","targetMainList","factorSum","factorList","needReset","factorSum2","lbmList","needGenAr","firstBaseline","genLineBoxByInlineIfNewLine","setLbByInlineIfNotNewLine","pushContentBoxList","isIbFull","isInline2","isInlineBlock2","focusNoWrap","fw2","addX","popContentBoxList","maxCX","maxCY","minCX","minCY","maxFX","maxFY","minFX","minFY","maxOX","maxOY","minOX","minOY","absChildren","onlyRight","onlyBottom","fixedTop","fixedRight","fixedBottom","fixedLeft","widthLimit","heightLimit","__computeMeasure","__deepScan","loadImg","__loadImg","placeholder","loading","__loadAndRefresh","showError","pts","__addGeom","reload","Defs","cacheHash","__isMulti","multi","__cacheProps","isVirtual","strokeDasharrayStr","lineCap","lineJoin","miterLimit","getLineDash","setLineDash","preData","__preSet","fills","fillRules","strokes","strokeWidths","strokeDasharrays","strokeDasharrayStrs","strokeLinecaps","strokeLinejoins","strokeMiterlimits","__renderOnePolygon","isFillCE","isStrokeCE","isFillRE","isStrokeRE","__conicGradient","__drawPolygon","__radialEllipse","isFill","isStroke","__preSetCanvas","__propsStrokeStyle","__inversePtList","updateList","removeList","KEY_FLAG","check","checkCp","nextProps","forceCheckUpdate","shouldUpdate","shouldComponentUpdate","updateCp","oldS","oldSr","oldJson","diffSr","oj","nj","ojk","getKeyHash","njk","keyList","cpList","diffCp","diffChildren","diffChild","removeCpFromOldTree","oc","ol","of","nf","exist","ex","did","componentDidUpdate","elem","diffDefs","diffBb","diffD2D","od","nd","diffDef","removeAt","insertAt","insertAdjacentHTML","parentNode","removeAttribute","diffItem","diffD2G","replaceWith","diffT2T","diffG2D","diffG2G","diffItemSelf","diffX2X","diffByLessLv","firstChild","lastChild","obb","nbb","isText","svg","where","insertBefore","Controller","__list2","__onList","__lastTime","args","records","animate","onList","__action","__mergeAuto","__on","timestamp","__set","OFFSCREEN_OVERFLOW","OFFSCREEN_FILTER","OFFSCREEN_MASK","OFFSCREEN_BLEND","OFFSCREEN_MASK2","applyOffscreen","origin","MockPage","genUuid","MockCache","NA","CHILD","SELF","getCache","OP","FT","MBM","PPT","genBboxTotal","parentIndexHash","opacityHash","includeLimitCache","bboxTotal","matrixHash","parentIndex","node2","hasTotal","mergeBbox","genTotal","hasMask","cacheTotal","cacheFilter","needGen","baseMatrix","matrixList","opacityList","parentOpacity","lastConfig","lastLv","refreshLevel","countMaskNum","ctxTotal","lastMatrix","maskStartHash","offscreenHash","genOverflow","genFilter","genMask","lastOpacity","sbox","resetMatrixCacheTotal","isNew","genFrameBufferWithTexture","lockOneChannel","webgl","createFramebuffer","bindFramebuffer","checkFramebufferStatus","FRAMEBUFFER_COMPLETE","viewport","clearColor","COLOR_BUFFER_BIT","genTotalWebgl","hasMbm","getParameter","MAX_TEXTURE_SIZE","parentPm","totalLimitCache","addTexAndDrawWhenLimit","mockCache","refresh","releaseLockChannel","hookGlRender","frameBuffer2","texture2","genMbmWebgl","deleteFramebuffer","genFilterWebgl","genBlurWebgl","rotation","cosR","sinR","genColorMatrixWebgl","amount","oneMinusAmount","useProgram","MAX_VARYING_VECTORS","weights","vert","frag","vertexBlur","fragmentBlur","findExistTexChannel","lockChannel","programCm","genOverflowWebgl","overflowCache","genMaskWebgl","programClip","programMask","maskCache","fbo","fragmentMultiply","fragmentScreen","fragmentOverlay","fragmentDarken","fragmentLighten","fragmentColorDodge","fragmentColorBurn","fragmentHardLight","fragmentSoftLight","fragmentDifference","fragmentExclusion","fragmentHue","fragmentSaturation","fragmentColor","fragmentLuminosity","vertexMbm","renderSvg","maskEffectHash","defsCache","hasEffectMask","addCache","maskHash","vdList","parentVd","mChildren","ivs","hasTransform","renderWebgl","pmList","lastRefreshLevel","mergeList","hasRecordAsMask","validMbm","isPerspective","limitHash","pptHash","renderCanvas","TexCache","units","__units","__pages","__channels","__locks","__lockUnits","pages","channels","locks","lastHash","oldList","newList","shift","cl","fullSize","setToChannel","DIRECTION_HASH","ROOT_DOM_NAME","getDom","querySelector","renderProp","EVENT_LIST","initEvent","Root","__wrapEvent","__cb","addEventListener","removeEvent","removeEventListener","isFixedWidthOrHeight","isFixedSize","includeParentFlex","isLAYOUT","setLAYOUT","component","addDom","checkInfluence","topFlex","isSiblingBlock","uniqueUpdateId","parseUpdate","reflowList","measureList","cacheList","zHash","zList","overwrite","focus","measure","removeDom","style2","keys2","hasMeasure","hasZ","hasVisibility","hasColor","hasDisplay","__struct","isRp","cleanSvgCache","__uniqueZId","__rlv","__dom","__mw","__mh","__taskUp","__reflowList","__animateController","mix","__updateHash","domName","__scx","__scy","getBoundingClientRect","touches","clientX","clientY","stopPropagation","stopImmediatePropagation","preventDefault","__hasEmitted","__initProps","nodeName","__genHtml","__defs","domCss","getPropertyValue","params","contextAttributes","__ctx","__renderMode","vertex","fragment","vertexMask","fragmentMask","fragmentClip","fragmentOverflow","vertexCm","fragmentCm","MAX_TEXTURE_IMAGE_UNITS","__texCache","destroy","__eventCbList","__checkRoot","__checkUpdate","__checkReflow","noRender","__clear","__vd","domDiff","updateStyle","taskUp","__hasRootUpdate","__nextFrameCp","updater","includeIgnore","scan","path","zPath","__index__","karas","path2","zPath2","nodeConfig","rootConfig","updateHash","__updateRoot","updateRoot","hasUpdate","__updateStruct","measureHash","__uniqueUpdateId","isInherit","uniqueList","hasRoot","diffList","diffI","mergeOffsetList","__uniqueMergeOffsetId","cps","cts","isLastAbs","isNowAbs","isLastNone","isNowNone","hasFlowPrev","__modifyStruct","startIndex","startNode","oldH","nowH","lastIndex","ns","reBuild","base","reBuildC","curveNum","getNewPoint","Line","__x1","__y1","__x2","__y2","__controlA","__controlB","__start","__end","dy2","buildCache","curve","x1s","y1s","x2s","y2s","bezierBox","concatPointAndControl","control","getLength","increase","getIndex","getNewList","start2","end2","isStartLt0","isEndGt1","prePercent","endPoint","Polyline","__points","__controls","controls","isControl","rebuildSE","__getPoints","__needRebuildSE","__reprocessing","__renderPolygon","pointList","controlList","Polygon","__booleanOperations","bo","getR","dft","Sector","__begin","__r","edge","__edge","closure","__closure","sList","r2","__renderOneSector","genVertex","Rect","__rx","__ry","Circle","Ellipse","my","fullCssProperty","abbrCssProperty","os","fullAnimate","abbrAnimate","fullAnimateOption","abbrAnimateOption","abbr2full","fk","replaceVars","vars","slot","member","replaceAnimateOptions","opt","replaceLibraryVars","linkLibrary","JSON","linkChild","libraryItem","library","libraryId","parse","animateRecords","createGm","createCp","createVd","singleton","loadAndParse","components","imgs","list1","list3","version","appendTo","parser"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAMA,SAAS,GAAG;AAChBC,EAAAA,QAAQ,EAAE,CADM;AAEhBC,EAAAA,OAAO,EAAE,CAFO;AAGhBC,EAAAA,GAAG,EAAE,CAHW;AAIhBC,EAAAA,KAAK,EAAE,CAJS;AAKhBC,EAAAA,MAAM,EAAE,CALQ;AAMhBC,EAAAA,IAAI,EAAE,CANU;AAOhBC,EAAAA,UAAU,EAAE,CAPI;AAQhBC,EAAAA,YAAY,EAAE,CARE;AAShBC,EAAAA,aAAa,EAAE,CATC;AAUhBC,EAAAA,WAAW,EAAE,CAVG;AAWhBC,EAAAA,WAAW,EAAE,EAXG;AAYhBC,EAAAA,aAAa,EAAE,EAZC;AAahBC,EAAAA,cAAc,EAAE,EAbA;AAchBC,EAAAA,YAAY,EAAE,EAdE;AAehBC,EAAAA,SAAS,EAAE,EAfK;AAgBhBC,EAAAA,WAAW,EAAE,EAhBG;AAiBhBC,EAAAA,KAAK,EAAE,EAjBS;AAkBhBC,EAAAA,UAAU,EAAE,EAlBI;AAmBhBC,EAAAA,WAAW,EAAE,EAnBG;AAoBhBC,EAAAA,WAAW,EAAE,EApBG;AAqBhBC,EAAAA,gBAAgB,EAAE,EArBF;AAsBhBC,EAAAA,gBAAgB,EAAE,EAtBF;AAuBhBC,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,KAvFU;;AAwFV,MAAI6rB,KAAJ,CAAU3oB,CAAV,EAAa;AACX2oB,IAAAA,KAAK,CAACrI,IAAN,GAAa,CAAC,CAACtgB,CAAf;AACD;;AA1FS,CAAZ;AA6FAk8C,OAAO,CAACrB,GAAR,CAAY;AACVvB,EAAAA,GAAG,EAAHA,KADU;AAEVC,EAAAA,GAAG,EAAHA,KAFU;AAGVC,EAAAA,GAAG,EAAHA,KAHU;AAIVC,EAAAA,IAAI,EAAJA,MAJU;AAKVC,EAAAA,SAAS,EAATA;AALU,CAAZ;;AAQA,IAAG,OAAOzuB,MAAP,KAAkB,WAArB,EAAkC;AAChCA,EAAAA,MAAM,CAACysD,KAAP,GAAeA,OAAf;AACD,CAFD,MAGK,IAAG,OAAOhqD,IAAP,KAAgB,WAAnB,EAAgC;AACnCA,EAAAA,IAAI,CAACgqD,KAAL,GAAaA,OAAb;AACD;;;;"}
\ No newline at end of file
+{"version":3,"file":"index.es.js","sources":["src/util/enums.js","src/node/Node.js","src/refresh/mode.js","src/style/unit.js","src/style/font.js","src/style/reg.js","src/math/matrix.js","src/math/vector.js","src/math/geom.js","src/math/gradient.js","src/util/painter.js","src/node/Ellipsis.js","src/style/border.js","src/util/$$type.js","src/util/util.js","src/util/debug.js","src/gl/ca.js","src/gl/webgl.js","src/util/inject.js","src/style/gradient.js","src/style/reset.js","src/style/abbr.js","src/animate/key.js","src/refresh/change.js","src/style/css.js","src/node/TextBox.js","src/refresh/Page.js","src/math/tar.js","src/math/martinez.js","src/math/index.js","src/style/transform.js","src/math/blur.js","src/refresh/Cache.js","src/refresh/level.js","src/node/Text.js","src/util/flatten.js","src/util/builder.js","src/util/Event.js","src/node/Component.js","src/node/inline.js","src/style/image.js","src/style/bg.js","src/animate/frame.js","src/animate/easing.js","src/animate/Animation.js","src/style/bs.js","src/style/mbm.js","src/node/Xom.js","src/node/LineBox.js","src/node/LineBoxManager.js","src/node/tag.js","src/refresh/reflow.js","src/node/Dom.js","src/node/Img.js","src/node/Defs.js","src/node/geom/Geom.js","src/util/updater.js","src/util/diff.js","src/animate/Controller.js","src/refresh/offscreen.js","src/gl/MockPage.js","src/gl/MockCache.js","src/refresh/struct.js","src/gl/TexCache.js","src/node/Root.js","src/node/geom/Line.js","src/node/geom/Polyline.js","src/node/geom/Polygon.js","src/node/geom/Sector.js","src/node/geom/Rect.js","src/node/geom/Circle.js","src/node/geom/Ellipse.js","src/parser/abbr.js","src/parser/parse.js","src/parser/index.js","src/style/index.js","src/animate/index.js","src/refresh/index.js","src/index.js"],"sourcesContent":["const STYLE_KEY = {\n POSITION: 0,\n DISPLAY: 1,\n TOP: 2,\n RIGHT: 3,\n BOTTOM: 4,\n LEFT: 5,\n MARGIN_TOP: 6,\n MARGIN_RIGHT: 7,\n MARGIN_BOTTOM: 8,\n MARGIN_LEFT: 9,\n PADDING_TOP: 10,\n PADDING_RIGHT: 11,\n PADDING_BOTTOM: 12,\n PADDING_LEFT: 13,\n FONT_SIZE: 14,\n FONT_FAMILY: 15,\n COLOR: 16,\n FONT_STYLE: 17,\n FONT_WEIGHT: 18,\n LINE_HEIGHT: 19,\n BACKGROUND_IMAGE: 20,\n BACKGROUND_COLOR: 21,\n BACKGROUND_SIZE: 22,\n BACKGROUND_REPEAT: 23,\n BACKGROUND_POSITION_X: 24,\n BACKGROUND_POSITION_Y: 25,\n BORDER_TOP_WIDTH: 26,\n BORDER_RIGHT_WIDTH: 27,\n BORDER_BOTTOM_WIDTH: 28,\n BORDER_LEFT_WIDTH: 29,\n BORDER_TOP_COLOR: 30,\n BORDER_RIGHT_COLOR: 31,\n BORDER_BOTTOM_COLOR: 32,\n BORDER_LEFT_COLOR: 33,\n BORDER_TOP_STYLE: 34,\n BORDER_RIGHT_STYLE: 35,\n BORDER_BOTTOM_STYLE: 36,\n BORDER_LEFT_STYLE: 37,\n BORDER_TOP_LEFT_RADIUS: 38,\n BORDER_TOP_RIGHT_RADIUS: 39,\n BORDER_BOTTOM_RIGHT_RADIUS: 40,\n BORDER_BOTTOM_LEFT_RADIUS: 41,\n WIDTH: 42,\n HEIGHT: 43,\n FLEX_GROW: 44,\n FLEX_SHRINK: 45,\n FLEX_BASIS: 46,\n FLEX_DIRECTION: 47,\n JUSTIFY_CONTENT: 48,\n ALIGN_ITEMS: 49,\n ALIGN_SELF: 50,\n TEXT_ALIGN: 51,\n TRANSFORM_ORIGIN: 52,\n VISIBILITY: 53,\n OPACITY: 54,\n Z_INDEX: 55,\n TRANSFORM: 56,\n TRANSLATE_X: 57,\n TRANSLATE_Y: 58,\n TRANSLATE_Z: 59,\n SCALE_X: 60,\n SCALE_Y: 61,\n SCALE_Z: 62,\n SKEW_X: 63,\n SKEW_Y: 64,\n ROTATE_X: 65,\n ROTATE_Y: 66,\n ROTATE_Z: 67,\n ROTATE_3D: 68,\n PERSPECTIVE: 69,\n PERSPECTIVE_ORIGIN: 70,\n FILTER: 71,\n BOX_SHADOW: 72,\n POINTER_EVENTS: 73,\n OVERFLOW: 74,\n MIX_BLEND_MODE: 75,\n BACKGROUND_CLIP: 76,\n WHITE_SPACE: 77,\n TEXT_OVERFLOW: 78,\n LETTER_SPACING: 79,\n LINE_CLAMP: 80,\n ORDER: 81,\n FLEX_WRAP: 82,\n ALIGN_CONTENT: 83,\n TEXT_STROKE_WIDTH: 84,\n TEXT_STROKE_COLOR: 85,\n TEXT_STROKE_OVER: 86,\n // GEOM\n FILL: 87,\n STROKE: 88,\n STROKE_WIDTH: 89,\n STROKE_DASHARRAY: 90,\n STROKE_DASHARRAY_STR: 91,\n STROKE_LINECAP: 92,\n STROKE_LINEJOIN: 93,\n STROKE_MITERLIMIT: 94,\n FILL_RULE: 95,\n // 无此样式,仅cache或特殊情况需要\n MATRIX: 96,\n BORDER_TOP: 97,\n BORDER_RIGHT: 98,\n BORDER_BOTTOM: 99,\n BORDER_LEFT: 100,\n TRANSLATE_PATH: 101,\n};\n\nconst STYLE2LOWER_MAP = {};\nfunction style2Lower(s) {\n STYLE2LOWER_MAP[s] = STYLE2LOWER_MAP[s] || s.toLowerCase().replace(/_([a-z])/g, function($0, $1) {\n return $1.toUpperCase();\n });\n\n return STYLE2LOWER_MAP[s];\n}\n\nconst STYLE2UPPER_MAP = {};\nfunction style2Upper(s) {\n STYLE2UPPER_MAP[s] = STYLE2UPPER_MAP[s] || s.replace(/([a-z\\d_])([A-Z])/g, function($0, $1, $2) {\n return $1 + '_' + $2;\n }).toUpperCase();\n\n return STYLE2UPPER_MAP[s];\n}\n\nconst STYLE_R_KEY = {};\nconst STYLE_RV_KEY = {};\nconst STYLE_V_KEY = {};\nObject.keys(STYLE_KEY).forEach(k => {\n let k2 = STYLE_KEY[k];\n STYLE_R_KEY[k2] = k;\n let l = style2Lower(k);\n STYLE_RV_KEY[k2] = l;\n STYLE_V_KEY[l] = k2;\n});\n\n// Root的update过程使用\nconst UPDATE_KEY = {\n UPDATE_NODE: 0,\n UPDATE_STYLE: 1,\n UPDATE_FOCUS: 2,\n UPDATE_COMPONENT: 3,\n UPDATE_OVERWRITE: 4,\n UPDATE_KEYS: 5,\n UPDATE_LIST: 6,\n UPDATE_CONFIG: 7,\n UPDATE_ADD_DOM: 8,\n UPDATE_REMOVE_DOM: 9,\n};\n\n// animation计算每帧使用\nconst KEY_FRAME_KEY = {\n FRAME_STYLE: 0,\n FRAME_TIME: 1,\n FRAME_EASING: 2,\n FRAME_TRANSITION: 3,\n};\n\n// 节点使用\nconst NODE_KEY = {\n NODE_DOM_PARENT: 0,\n NODE_OPACITY: 1,\n NODE_MATRIX: 2,\n NODE_MATRIX_EVENT: 3,\n NODE_CACHE: 4,\n NODE_CACHE_TOTAL: 5,\n NODE_CACHE_FILTER: 6,\n NODE_CACHE_MASK: 7,\n NODE_CACHE_OVERFLOW: 8,\n NODE_STRUCT: 9,\n NODE_TAG_NAME: 10,\n NODE_CURRENT_STYLE: 11,\n NODE_CURRENT_PROPS: 12,\n NODE_COMPUTED_STYLE: 13,\n NODE_CACHE_STYLE: 14,\n NODE_CACHE_PROPS: 15,\n NODE_LIMIT_CACHE: 16,\n NODE_IS_MASK: 17,\n NODE_IS_INLINE: 18,\n NODE_HAS_CONTENT: 19,\n NODE_REFRESH_LV: 20,\n NODE_IS_DESTROYED: 21,\n NODE_STYLE: 22,\n NODE_UPDATE_HASH: 23,\n NODE_UNIQUE_UPDATE_ID: 24,\n NODE_DEFS_CACHE: 25,\n NODE_PERSPECTIVE_MATRIX: 26,\n NODE_VIRTUAL_DOM: 27,\n NODE_CACHE_AS_BITMAP: 28,\n};\n\n// struct用\nconst STRUCT_KEY = {\n STRUCT_NODE: 0,\n STRUCT_INDEX: 1,\n STRUCT_CHILD_INDEX: 2,\n STRUCT_LV: 3,\n STRUCT_NUM: 4,\n STRUCT_TOTAL: 5,\n STRUCT_HAS_MASK: 6,\n};\n\nconst ANIMATE_KEY = {\n I_ASSIGNING: 0,\n I_IN_FPS: 1,\n I_IS_DELAY: 2,\n I_BEGIN: 3,\n I_END: 4,\n I_FINISHED: 5,\n I_NEXT_END: 6,\n I_FIRST_PLAY: 7,\n I_PLAY_CB: 8,\n I_TARGET: 9,\n I_ROOT: 10,\n I_FRAMES: 11,\n I_FRAMES_R: 12,\n I_CURRENT_TIME: 13,\n I_NEXT_TIME: 14,\n I_STYLE: 15,\n I_DURATION: 16,\n I_ITERATIONS: 17,\n I_FILL: 18,\n I_PLAYBACK_RATE: 19,\n I_PLAY_COUNT: 20,\n I_PLAY_STATE: 21,\n I_DESTROYED: 22,\n I_START_TIME: 23,\n I_FPS_TIME: 24,\n I_EASING: 25,\n I_ENTER_FRAME: 26,\n I_DELAY: 27,\n I_END_DELAY: 28,\n I_KEYS: 29,\n I_ORIGIN_STYLE: 30,\n I_CURRENT_FRAMES: 31,\n I_CURRENT_FRAME: 32,\n I_SPF_LIMIT: 33,\n I_FPS: 34,\n I_DIRECTION: 35,\n I_FIRST_ENTER: 36,\n I_STAY_BEGIN: 37,\n I_STAY_END: 38,\n I_IS2: 39,\n I_END_TIME: 40,\n I_NODE_CONFIG: 41,\n I_ROOT_CONFIG: 42,\n I_OUT_BEGIN_DELAY: 43,\n I_TIME_STAMP: 44,\n};\n\nexport default {\n STYLE_KEY, // 大写常量为k,数字为值\n STYLE_R_KEY, // 数字为k,大写常量为值\n STYLE_RV_KEY, // 数字为k,小写为值\n STYLE_V_KEY, // 小写为k,数字为值\n style2Lower,\n style2Upper,\n UPDATE_KEY,\n KEY_FRAME_KEY,\n NODE_KEY,\n STRUCT_KEY,\n ANIMATE_KEY,\n ELLIPSIS: '…',\n};\n","import enums from '../util/enums';\n\nconst {\n STRUCT_KEY: {\n STRUCT_NODE,\n STRUCT_INDEX,\n STRUCT_CHILD_INDEX,\n STRUCT_LV,\n },\n NODE_KEY: {\n NODE_IS_DESTROYED,\n NODE_STRUCT,\n },\n} = enums;\n\nclass Node {\n constructor() {\n this.__x = 0;\n this.__y = 0;\n this.__ox = 0; // relative造成的偏移量\n this.__oy = 0;\n this.__sx = 0;\n this.__sy = 0;\n this.__width = 0;\n this.__height = 0;\n this.__baseline = 0;\n this.__config = {};\n this.__prev = null;\n this.__next = null;\n this.__parent = null;\n this.__domParent = null;\n this.__root = null;\n this.__host = null;\n this.__virtualDom = null;\n }\n\n __structure(i, lv, j) {\n return this.__config[NODE_STRUCT] = {\n [STRUCT_NODE]: this,\n [STRUCT_INDEX]: i,\n [STRUCT_CHILD_INDEX]: j,\n [STRUCT_LV]: lv,\n };\n }\n\n __modifyStruct(root, offset = 0) {\n let struct = this.__config[NODE_STRUCT];\n return [struct, 0];\n }\n\n __offsetX(diff, isLayout) {\n if(isLayout) {\n this.__x += diff;\n }\n else {\n this.__ox += diff;\n }\n this.__sx += diff;\n }\n\n __offsetY(diff, isLayout) {\n if(isLayout) {\n this.__y += diff;\n }\n else {\n this.__oy += diff;\n }\n this.__sy += diff;\n }\n\n __destroy() {\n this.__config[NODE_IS_DESTROYED] = true;\n }\n\n get x() {\n return this.__x;\n }\n\n get y() {\n return this.__y;\n }\n\n get ox() {\n return this.__ox;\n }\n\n get oy() {\n return this.__oy;\n }\n\n get sx() {\n return this.x + this.ox;\n }\n\n get sy() {\n return this.y + this.oy;\n }\n\n get width() {\n return this.__width;\n }\n\n get height() {\n return this.__height;\n }\n\n get outerWidth() {\n return this.__width;\n }\n\n get outerHeight() {\n return this.__height;\n }\n\n get prev() {\n return this.__prev;\n }\n\n get next() {\n return this.__next;\n }\n\n get parent() {\n return this.__parent;\n }\n\n get domParent() {\n return this.__domParent;\n }\n\n // canvas/svg根节点\n get root() {\n return this.__root;\n }\n\n // component根节点\n get host() {\n return this.__host;\n }\n\n // 考虑高阶组件在内的component根节点\n get hostRoot() {\n return this.__hostRoot;\n }\n\n get baseline() {\n return this.__baseline;\n }\n\n get virtualDom() {\n return this.__virtualDom;\n }\n\n get isDestroyed() {\n return this.__config[NODE_IS_DESTROYED];\n }\n\n get isReplaced() {\n return false;\n }\n}\n\nexport default Node;\n","export default {\n CANVAS: 0,\n SVG: 1,\n WEBGL: 2,\n};\n","let o = {\n AUTO: 0,\n PX: 1,\n PERCENT: 2,\n NUMBER: 3,\n INHERIT: 4,\n DEG: 5,\n STRING: 6,\n RGBA: 7,\n REM: 8,\n EM: 9,\n VW: 10,\n VH: 11,\n VMAX: 12,\n VMIN: 13,\n /**\n * 通用的格式化计算数值单位的方法,百分比/像素/REM/VW/auto和纯数字\n * @param v value\n * @returns 格式化好的[number, unit]\n */\n calUnit(v) {\n let n = parseFloat(v) || 0;\n if(/%$/.test(v)) {\n return [n, o.PERCENT];\n }\n else if(/px$/i.test(v)) {\n return [n, o.PX];\n }\n else if(/deg$/i.test(v)) {\n return [n, o.DEG];\n }\n else if(/rem$/i.test(v)) {\n return [n, o.REM];\n }\n else if(/vw$/i.test(v)) {\n return [n, o.VW];\n }\n else if(/vh$/i.test(v)) {\n return [n, o.VH];\n }\n else if(/em$/i.test(v)) {\n return [n, o.EM];\n }\n else if(/vw$/i.test(v)) {\n return [n, o.VW];\n }\n else if(/vh$/i.test(v)) {\n return [n, o.VH];\n }\n else if(/vmax$/i.test(v)) {\n return [n, o.VMAX];\n }\n else if(/vmin$/i.test(v)) {\n return [n, o.VMIN];\n }\n return [n, o.NUMBER];\n },\n};\n\nexport default o;\n","'use strict';\n\nlet o = {\n info: {\n arial: {\n lhr: 1.14990234375, // 默认line-height ratio,(67+1854+434)/2048\n // car: 1.1171875, // content-area ratio,(1854+434)/2048\n blr: 0.9052734375, // base-line ratio,1854/2048\n // mdr: 0.64599609375, // middle ratio,(1854-1062/2)/2048\n lgr: 0.03271484375, // line-gap ratio,67/2048,默认0\n // 个别字符误差,初次之外误差还有根据经验得的比例系数,https://github.com/karasjs/karas/issues/145\n padding: {\n // 1: 1,\n // f: 0.9,\n },\n },\n helvetica: {\n lhr: 1.14990234375, // (8+1900+447)/2048\n blr: 0.927734375, // 1900/2048\n lgr: 0.00390625, // 8/2048\n },\n verdana: {\n lhr: 1.21533203125, // (0+2059+430)/2048\n blr: 1.00537109375, // 2059/2048\n },\n tahoma: {\n lhr: 1.20703125, // (0+2049+423)/2048\n blr: 1.00048828125, // 2049/2048\n padding: {\n S: 1,\n T: 1,\n Z: 1,\n c: 1,\n f: 0.7,\n i: 1,\n l: 1,\n t: 0.9,\n },\n },\n georgia: {\n lhr: 1.13623046875, // (0+1878+449)/2048\n blr: 0.9169921875, // 1878/2048\n },\n 'courier new': {\n lhr: 1.1328125, // (0+1705+615)/2048\n blr: 0.83251953125, // 1705/2048\n },\n 'pingfang sc': {\n lhr: 1.4, // (0+1060+340)/1000\n blr: 1.06, // 1060/1000\n padding: {\n f: 0.5,\n },\n },\n simsun: {\n lhr: 1.4, // (0+1060+340)/1000\n blr: 1.06,\n padding: {\n f: 0.5,\n },\n },\n },\n support(fontFamily) {\n return this.info.hasOwnProperty(fontFamily) && this.info[fontFamily].checked;\n },\n register(name, info) {\n let { emSquare = 2048, ascent = 1854, descent = 434, lineGap = 0, padding = {} } = info || {};\n this.info[name.toLowerCase()] = {\n lhr: (ascent + descent + lineGap) / emSquare,\n blr: ascent / emSquare,\n padding,\n };\n },\n hasRegister(fontFamily) {\n return this.info.hasOwnProperty(fontFamily);\n },\n hasChecked(fontFamily) {\n return this.hasRegister(fontFamily) && this.info[fontFamily].hasOwnProperty('checked');\n },\n setChecked(fontFamily, res) {\n return this.info[fontFamily].checked = res;\n },\n addPadding(name, padding) {\n Object.assign(this.info[name.toLowerCase()].padding, padding);\n },\n};\n\no.info['宋体'] = o.info.simsun;\no.info['pingfang'] = o.info['pingfang sc'];\n\nexport default o;\n","export default {\n position: /(([-+]?[\\d.]+[pxremvwhina%]*)|(left|top|right|bottom|center)){1,2}/ig,\n // tfo: /((-?[\\d.]+(px|%)?)|(left|top|right|bottom|center)){1,2}/ig,\n gradient: /\\b(\\w+)-?gradient\\((.+)\\)/i,\n img: /(?:\\burl\\((['\"]?)(.*?)\\1\\))|(?:\\b((data:)))/i,\n};\n","// 生成4*4单位矩阵\nfunction identity() {\n return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n}\n\n// 矩阵a*b,固定两个matrix都是长度16\nfunction multiply(a, b) {\n if(isE(a)) {\n return b;\n }\n if(isE(b)) {\n return a;\n }\n let c = [];\n for(let i = 0; i < 4; i++) {\n let a0 = a[i] || 0;\n let a1 = a[i + 4] || 0;\n let a2 = a[i + 8] || 0;\n let a3 = a[i + 12] || 0;\n c[i] = a0 * b[0] + a1 * b[1] + a2 * b[2] + a3 * b[3];\n c[i + 4] = a0 * b[4] + a1 * b[5] + a2 * b[6] + a3 * b[7];\n c[i + 8] = a0 * b[8] + a1 * b[9] + a2 * b[10] + a3 * b[11];\n c[i + 12] = a0 * b[12] + a1 * b[13] + a2 * b[14] + a3 * b[15];\n }\n return c;\n}\n\nfunction calPoint(point, m) {\n let [x, y, z, w] = point;\n if(w === undefined) {\n w = 1;\n }\n if(m && !isE(m)) {\n if(m.length === 16) {\n z = z || 0;\n let [a1, b1, c1, d1, a2, b2, c2, d2, a3, b3, c3, d3, a4, b4, c4, d4] = m;\n w *= x * d1 + y * d2 + z * d3 + d4;\n return [\n (x * a1 + y * a2 + z * a3 + a4),\n (x * b1 + y * b2 + z * b3 + b4),\n (x * c1 + y * c2 + z * c3 + c4),\n w\n ];\n }\n // 6位类型\n let [a, b, c, d, e, f] = m;\n return [a * x + c * y + e, b * x + d * y + f];\n }\n return [x, y, z, w];\n}\n\n/**\n * 初等行变换求3*3特定css的matrix方阵,一维6长度\n * https://blog.csdn.net/iloveas2014/article/details/82930946\n * @param m\n * @returns {number[]|*}\n */\nfunction inverse(m) {\n if(m.length === 16) {\n return inverse4(m);\n }\n let [a, b, c, d, e, f] = m;\n if(a === 1 && b === 0 && c === 0 && d === 1 && e === 0 && f === 0) {\n return m;\n }\n let divisor = a * d - b * c;\n if(divisor === 0) {\n return m;\n }\n return [d / divisor, -b / divisor, -c / divisor, a / divisor,\n (c * f - d * e) / divisor, (b * e - a * f) / divisor];\n}\n\n// 16位或者6位单位矩阵判断,空也认为是\nfunction isE(m) {\n if(!m || !m.length) {\n return true;\n }\n if(m.length === 16) {\n return m[0] === 1 && m[1] === 0 && m[2] === 0 && m[3] === 0\n && m[4] === 0 && m[5] === 1 && m[6] === 0 && m[7] === 0\n && m[8] === 0 && m[9] === 0 && m[10] === 1 && m[11] === 0\n && m[12] === 0 && m[13] === 0 && m[14] === 0 && m[15] === 1;\n }\n return m[0] === 1 && m[1] === 0 && m[2] === 0 && m[3] === 1 && m[4] === 0 && m[5] === 0;\n}\n\n/**\n * 求任意4*4矩阵的逆矩阵,行列式为 0 则返回单位矩阵兜底\n * 格式:matrix3d(a1, b1, c1, d1, a2, b2, c2, d2, a3, b3, c3, d3, a4, b4, c4, d4)\n * 参见: https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/matrix3d()\n * 对应:\n * [\n * a1,a2,a3,a4,\n * b1,b2,b3,b4,\n * c1,c2,c3,c4,\n * d1,d2,d3,d4,\n * ]\n *\n * 根据公式 A* = |A|A^-1 来计算\n * A* 表示矩阵 A 的伴随矩阵,A^-1 表示矩阵 A 的逆矩阵,|A| 表示行列式的值\n *\n * @returns {number[]}\n */\n\nfunction inverse4(s) {\n let inv = [];\n\n inv[0] = s[5] * s[10] * s[15] - s[5] * s[11] * s[14] - s[9] * s[6] * s[15]\n + s[9] * s[7] * s[14] + s[13] * s[6] * s[11] - s[13] * s[7] * s[10];\n inv[4] = -s[4] * s[10] * s[15] + s[4] * s[11] * s[14] + s[8] * s[6] * s[15]\n - s[8] * s[7] * s[14] - s[12] * s[6] * s[11] + s[12] * s[7] * s[10];\n inv[8] = s[4] * s[9] * s[15] - s[4] * s[11] * s[13] - s[8] * s[5] * s[15]\n + s[8] * s[7] * s[13] + s[12] * s[5] * s[11] - s[12] * s[7] * s[9];\n inv[12] = -s[4] * s[9] * s[14] + s[4] * s[10] * s[13] + s[8] * s[5] * s[14]\n - s[8] * s[6] * s[13] - s[12] * s[5] * s[10] + s[12] * s[6] * s[9];\n\n inv[1] = -s[1] * s[10] * s[15] + s[1] * s[11] * s[14] + s[9] * s[2] * s[15]\n - s[9] * s[3] * s[14] - s[13] * s[2] * s[11] + s[13] * s[3] * s[10];\n inv[5] = s[0] * s[10] * s[15] - s[0] * s[11] * s[14] - s[8] * s[2] * s[15]\n + s[8] * s[3] * s[14] + s[12] * s[2] * s[11] - s[12] * s[3] * s[10];\n inv[9] = -s[0] * s[9] * s[15] + s[0] * s[11] * s[13] + s[8] * s[1] * s[15]\n - s[8] * s[3] * s[13] - s[12] * s[1] * s[11] + s[12] * s[3] * s[9];\n inv[13] = s[0] * s[9] * s[14] - s[0] * s[10] * s[13] - s[8] * s[1] * s[14]\n + s[8] * s[2] * s[13] + s[12] * s[1] * s[10] - s[12] * s[2] * s[9];\n\n inv[2] = s[1] * s[6] * s[15] - s[1] * s[7] * s[14] - s[5] * s[2] * s[15]\n + s[5] * s[3] * s[14] + s[13] * s[2] * s[7] - s[13] * s[3] * s[6];\n inv[6] = -s[0] * s[6] * s[15] + s[0] * s[7] * s[14] + s[4] * s[2] * s[15]\n - s[4] * s[3] * s[14] - s[12] * s[2] * s[7] + s[12] * s[3] * s[6];\n inv[10] = s[0] * s[5] * s[15] - s[0] * s[7] * s[13] - s[4] * s[1] * s[15]\n + s[4] * s[3] * s[13] + s[12] * s[1] * s[7] - s[12] * s[3] * s[5];\n inv[14] = -s[0] * s[5] * s[14] + s[0] * s[6] * s[13] + s[4] * s[1] * s[14]\n - s[4] * s[2] * s[13] - s[12] * s[1] * s[6] + s[12] * s[2] * s[5];\n\n inv[3] = -s[1] * s[6] * s[11] + s[1] * s[7] * s[10] + s[5] * s[2] * s[11]\n - s[5] * s[3] * s[10] - s[9] * s[2] * s[7] + s[9] * s[3] * s[6];\n inv[7] = s[0] * s[6] * s[11] - s[0] * s[7] * s[10] - s[4] * s[2] * s[11]\n + s[4] * s[3] * s[10] + s[8] * s[2] * s[7] - s[8] * s[3] * s[6];\n inv[11] = -s[0] * s[5] * s[11] + s[0] * s[7] * s[9] + s[4] * s[1] * s[11]\n - s[4] * s[3] * s[9] - s[8] * s[1] * s[7] + s[8] * s[3] * s[5];\n inv[15] = s[0] * s[5] * s[10] - s[0] * s[6] * s[9] - s[4] * s[1] * s[10]\n + s[4] * s[2] * s[9] + s[8] * s[1] * s[6] - s[8] * s[2] * s[5];\n\n let det = s[0] * inv[0] + s[1] * inv[4] + s[2] * inv[8] + s[3] * inv[12];\n if (det === 0) {\n return identity();\n }\n\n det = 1 / det;\n let d = [];\n for (let i = 0; i < 16; i++) {\n d[i] = inv[i] * det;\n }\n return d;\n}\n\n// 将4*4的16长度矩阵转成css/canvas的6位标准使用,忽略transform3d\nfunction m2m6(m) {\n return [\n m[0],\n m[1],\n m[4],\n m[5],\n m[12],\n m[13],\n ];\n}\n\nfunction point2d(point) {\n let w = point[3];\n if(w && w !== 1) {\n point = point.slice(0, 2);\n point[0] /= w;\n point[1] /= w;\n }\n return point;\n}\n\nexport default {\n identity,\n multiply,\n calPoint,\n point2d,\n inverse,\n isE,\n m2m6,\n};\n","// 向量点乘积\nfunction dotProduct(x1, y1, x2, y2) {\n return x1 * x2 + y1 * y2;\n}\n\n// 向量叉乘积\nfunction crossProduct(x1, y1, x2, y2) {\n return x1 * y2 - x2 * y1;\n}\n\nexport default {\n dotProduct,\n crossProduct,\n};\n","import mx from './matrix';\nimport vector from './vector';\nimport enums from '../util/enums';\n\nconst H = 4 * (Math.sqrt(2) - 1) / 3;\nconst { crossProduct } = vector;\nconst { calPoint, isE } = mx;\nconst { STYLE_KEY: {\n WIDTH,\n HEIGHT,\n TRANSFORM_ORIGIN,\n} } = enums;\n\n/**\n * 圆弧拟合公式,根据角度求得3阶贝塞尔控制点比例长度,一般<=90,超过拆分\n * @param deg\n * @returns {number}\n */\nfunction h(deg) {\n deg *= 0.5;\n return 4 * ((1 - Math.cos(deg)) / Math.sin(deg)) / 3;\n}\n\n/**\n * 判断点是否在多边形内\n * @param x 点坐标\n * @param y\n * @param vertexes 多边形顶点坐标\n * @returns {boolean}\n */\nfunction pointInPolygon(x, y, vertexes) {\n // 先取最大最小值得一个外围矩形,在外边可快速判断false\n let [xmax, ymax] = vertexes[0];\n let [xmin, ymin] = vertexes[0];\n let len = vertexes.length;\n for(let i = 1; i < len; i++) {\n let [x, y] = vertexes[i];\n xmax = Math.max(xmax, x);\n ymax = Math.max(ymax, y);\n xmin = Math.min(xmin, x);\n ymin = Math.min(ymin, y);\n }\n if(x < xmin || y < ymin || x > xmax || y > ymax) {\n return false;\n }\n // 所有向量积均为非负数说明在多边形内或边上\n for(let i = 0, len = vertexes.length; i < len; i++) {\n let [x1, y1] = vertexes[i];\n let [x2, y2] = vertexes[(i + 1) % len];\n if(crossProduct(x2 - x1, y2 - y1, x - x1, y - y1) < 0) {\n return false;\n }\n }\n return true;\n}\n\n// 判断点是否在一个4边形内,比如事件发生是否在节点上\nfunction pointInQuadrilateral(x, y, x1, y1, x2, y2, x4, y4, x3, y3, matrix) {\n if(matrix && !isE(matrix)) {\n let w1, w2, w3, w4;\n [x1, y1,, w1] = calPoint([x1, y1], matrix);\n [x2, y2,, w2] = calPoint([x2, y2], matrix);\n [x3, y3,, w3] = calPoint([x3, y3], matrix);\n [x4, y4,, w4] = calPoint([x4, y4], matrix);\n if(w1 && w1 !== 1) {\n x1 /= w1;\n y1 /= w1;\n }\n if(w2 && w2 !== 1) {\n x2 /= w2;\n y2 /= w2;\n }\n if(w3 && w3 !== 1) {\n x3 /= w3;\n y3 /= w3;\n }\n if(w4 && w4 !== 1) {\n x4 /= w4;\n y4 /= w4;\n }\n return pointInPolygon(x, y, [\n [x1, y1],\n [x2, y2],\n [x4, y4],\n [x3, y3]\n ]);\n }\n else {\n return x >= x1 && y >= y1 && x <= x4 && y <= y4;\n }\n}\n\n/**\n * 余弦定理3边长求夹角\n * @param a\n * @param b\n * @param c\n */\nfunction angleBySide(a, b, c) {\n let theta = (Math.pow(b, 2) + Math.pow(c, 2) - Math.pow(a, 2)) / (2 * b * c);\n return Math.acos(theta);\n}\n\n/**\n * 余弦定理2边长和夹角求3边\n * @param alpha 弧度\n * @param a\n * @param b\n */\nfunction sideByAngle(alpha, a, b) {\n let cos = Math.cos(alpha);\n return Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2) - 2 * a * b * cos);\n}\n\n/**\n * 两点距离\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n */\nfunction pointsDistance(x1, y1, x2, y2) {\n return Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));\n}\n\n/**\n * 三角形内心\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n * @param x3\n * @param y3\n */\nfunction triangleIncentre(x1, y1, x2, y2, x3, y3) {\n let a = pointsDistance(x2, y2, x3, y3);\n let b = pointsDistance(x1, y1, x3, y3);\n let c = pointsDistance(x1, y1, x2, y2);\n return [\n (a * x1 + b * x2 + c * x3) / (a + b + c),\n (a * y1 + b * y2 + c * y3) / (a + b + c),\n ];\n}\n\n/**\n * 椭圆圆心和长短轴生成4个端点和控制点\n */\nfunction ellipsePoints(x, y, a, b = a) {\n let ox = a * H;\n let oy = b === a ? ox : b * H;\n return [\n [x - a, y],\n [x - a, y - oy, x - ox, y - b, x, y - b],\n [x + ox, y - b, x + a, y - oy, x + a, y],\n [x + a, y + oy, x + ox, y + b, x, y + b],\n [x - ox, y + b, x - a, y + oy, x - a, y],\n ];\n}\n\n/**\n * 扇形圆心和半径起始角度生成4个端点和控制点\n * 分为4个象限进行拟合,0、1、2、3\n */\nfunction sectorPoints(x, y, r, begin, end) {\n if(begin > end) {\n [begin, end] = [end, begin];\n }\n if(begin === end) {\n return [];\n }\n let list = [];\n let b = Math.floor(begin / 90);\n let e = Math.floor(end / 90);\n // 同象限直接算\n if(b === e || (e - b) === 1 && end % 90 === 0) {\n let h2 = h(d2r(Math.abs(begin - end)));\n let d = h2 * r;\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let alpha = Math.atan(d / r);\n if(b < 90) {\n // 第1个交点\n let rx = Math.sin(d2r(begin)) * r;\n let ry = Math.cos(d2r(begin)) * r;\n let p1 = [x + rx, y - ry];\n // 第1个控制点\n let deg = alpha + d2r(begin);\n rx = Math.sin(deg) * c;\n ry = Math.cos(deg) * c;\n let p2 = [x + rx, y - ry];\n // 第2个交点\n rx = Math.sin(d2r(end)) * r;\n ry = Math.cos(d2r(end)) * r;\n let p4 = [x + rx, y - ry];\n // 第2个控制点\n deg = d2r(end) - alpha;\n rx = Math.sin(deg) * c;\n ry = Math.cos(deg) * c;\n let p3 = [x + rx, y - ry];\n list.push(p1);\n list.push(p2.concat(p3).concat(p4));\n }\n else if(b < 180) {\n // 第1个交点\n let rx = Math.cos(d2r(begin - 90)) * r;\n let ry = Math.sin(d2r(begin - 90)) * r;\n let p1 = [x + rx, y + ry];\n // 第1个控制点\n let deg = alpha + d2r(begin - 90);\n rx = Math.cos(deg) * c;\n ry = Math.sin(deg) * c;\n let p2 = [x + rx, y + ry];\n // 第2个交点\n rx = Math.cos(d2r(end - 90)) * r;\n ry = Math.sin(d2r(end - 90)) * r;\n let p4 = [x + rx, y + ry];\n // 第2个控制点\n deg = d2r(end - 90) - alpha;\n rx = Math.cos(deg) * c;\n ry = Math.sin(deg) * c;\n let p3 = [x + rx, y + ry];\n list.push(p1);\n list.push(p2.concat(p3).concat(p4));\n }\n else if(b < 270) {\n // 第1个交点\n let rx = Math.sin(d2r(begin - 180)) * r;\n let ry = Math.cos(d2r(begin - 180)) * r;\n let p1 = [x - rx, y + ry];\n // 第1个控制点\n let deg = alpha + d2r(begin - 180);\n rx = Math.sin(deg) * c;\n ry = Math.cos(deg) * c;\n let p2 = [x - rx, y + ry];\n // 第2个交点\n rx = Math.sin(d2r(end - 180)) * r;\n ry = Math.cos(d2r(end - 180)) * r;\n let p4 = [x - rx, y + ry];\n // 第2个控制点\n deg = d2r(end - 180) - alpha;\n rx = Math.sin(deg) * c;\n ry = Math.cos(deg) * c;\n let p3 = [x - rx, y + ry];\n list.push(p1);\n list.push(p2.concat(p3).concat(p4));\n }\n else {\n // 第1个交点\n let rx = Math.cos(d2r(begin - 270)) * r;\n let ry = Math.sin(d2r(begin - 270)) * r;\n let p1 = [x - rx, y + ry];\n // 第1个控制点\n let deg = alpha + d2r(begin - 270);\n rx = Math.cos(deg) * c;\n ry = Math.sin(deg) * c;\n let p2 = [x - rx, y + ry];\n // 第2个交点\n rx = Math.cos(d2r(end - 270)) * r;\n ry = Math.sin(d2r(end - 270)) * r;\n let p4 = [x - rx, y + ry];\n // 第2个控制点\n deg = d2r(end - 270) - alpha;\n rx = Math.cos(deg) * c;\n ry = Math.sin(deg) * c;\n let p3 = [x - rx, y + ry];\n list.push(p1);\n list.push(p2.concat(p3).concat(p4));\n }\n }\n // 跨象限循环算\n else {\n let i = b;\n let temp = [];\n for(; i <= e; i++) {\n if(i === 0) {\n let res = sectorPoints(x, y, r, begin, 90);\n temp.push(res);\n }\n else if(i === 1) {\n // 防止90~90这种情况,但如果begin和end都是90时又要显示\n if(b === i || end > 90) {\n let res = sectorPoints(x, y, r, begin < 90 ? 90 : begin, end > 180 ? 180 : end);\n temp.push(res);\n }\n }\n else if(i === 2) {\n // 防止180~180这种情况,但如果begin和end都是90时又要显示\n if(b === i || end > 180) {\n let res = sectorPoints(x, y, r, begin < 180 ? 180 : begin, end > 270 ? 270 : end);\n temp.push(res);\n }\n }\n else if(i === 3) {\n // 防止180~180这种情况,但如果begin和end都是90时又要显示\n if(b === i || end > 270) {\n let res = sectorPoints(x, y, r, begin < 270 ? 270 : begin, end);\n temp.push(res);\n }\n }\n }\n // 去掉重复的首尾扇弧点\n list = temp[0];\n for(let i = 1, len = temp.length; i < len; i++) {\n list.push(temp[i][1]);\n }\n }\n return list;\n}\n\n/**\n * 获取2个矩形重叠区域,如不重叠返回null\n * @param a\n * @param b\n */\nfunction getRectsIntersection(a, b) {\n if(!isRectsOverlap(a, b)) {\n return null;\n }\n let [ax1, ay1, ax4, ay4] = a;\n let [bx1, by1, bx4, by4] = b;\n return [\n Math.max(ax1, bx1),\n Math.max(ay1, by1),\n Math.min(ax4, bx4),\n Math.min(ay4, by4),\n ];\n}\n\n/**\n * 2个矩形是否重叠\n * @param a\n * @param b\n */\nfunction isRectsOverlap(a, b) {\n let [ax1, ay1, ax4, ay4] = a;\n let [bx1, by1, bx4, by4] = b;\n if(ax1 >= bx4 || ay1 >= by4 || bx1 >= ax4 || by1 >= ay4) {\n return false;\n }\n return true;\n}\n\n/**\n * 2个矩形是否包含,a包含b\n * @param a\n * @param b\n */\nfunction isRectsInside(a, b) {\n let [ax1, ay1, ax4, ay4] = a;\n let [bx1, by1, bx4, by4] = b;\n if(ax1 <= bx1 && ay1 <= by1 && ax4 >= bx4 && ay4 >= by4) {\n return true;\n }\n return false;\n}\n\nfunction calCoordsInNode(px, py, node) {\n let { matrix = [1, 0, 0, 1, 0, 0], computedStyle = {} } = node;\n let { [WIDTH]: width, [HEIGHT]: height, [TRANSFORM_ORIGIN]: [ox, oy] = [width * 0.5, height * 0.5] } = computedStyle;\n [px, py] = calPoint([px * width - ox, py * height - oy], matrix);\n return [px + ox, py + oy];\n}\n\nfunction calPercentInNode(x, y, node) {\n let { computedStyle: { [WIDTH]: width, [HEIGHT]: height, [TRANSFORM_ORIGIN]: [ox, oy] } } = node;\n // 先求无旋转时右下角相对于原点的角度ds\n let ds = Math.atan((height - oy) / (width - ox));\n let [x1, y1] = calCoordsInNode(1, 1, node);\n let d1;\n let deg;\n // 根据旋转后的坐标,分4个象限,求旋转后的右下角相对于原点的角度d1,得出偏移角度deg,分顺逆时针[-180, 180]\n if(x1 >= ox && y1 >= oy) {\n if(ox === x1) {\n d1 = -Math.atan(Infinity);\n }\n else {\n d1 = Math.atan((y1 - oy) / (x1 - ox));\n }\n deg = d1 - ds;\n }\n else if(x1 >= ox && y1 < oy) {\n if(ox === x1) {\n d1 = -Math.atan(Infinity);\n }\n else {\n d1 = Math.atan((oy - y1) / (x1 - ox));\n }\n deg = d1 + ds;\n }\n else if(x1 < ox && y1 >= oy) {\n d1 = Math.atan((y1 - oy) / (ox - x1));\n deg = d1 - ds;\n }\n else if(x1 < ox && y1 < oy) {\n d1 = Math.atan((y1 - oy) / (x1 - ox));\n if(ds >= d1) {\n deg = d1 + Math.PI - ds;\n }\n else {\n deg = Math.PI - d1 + ds;\n deg = -deg;\n }\n }\n else {\n deg = 0;\n }\n // 目标点到原点的边长不会变\n let dt = Math.sqrt(Math.pow(x - ox, 2) + Math.pow(y - oy, 2));\n // 分4个象限,先求目标点到原点的角度d2,再偏移deg后求得原始坐标\n let d2;\n if(x >= ox && y >= oy) {\n if(ox === x) {\n d2 = -Math.atan(Infinity);\n }\n else {\n d2 = Math.atan((y - oy) / (x - ox));\n }\n }\n else if(x >= ox && y < oy) {\n if(ox === x) {\n d2 = -Math.atan(Infinity);\n }\n else {\n d2 = -Math.atan((y - oy) / (ox - x));\n }\n }\n else if(x < ox && y >= oy) {\n d2 = Math.PI - Math.atan((y - oy) / (ox - x));\n }\n else {\n d2 = Math.atan((y - oy) / (x - ox)) - Math.PI;\n }\n d2 -= deg;\n if(d2 > Math.PI) {\n d2 -= Math.PI;\n return [\n (ox - dt * Math.cos(d2)) / width,\n (oy - dt * Math.sin(d2)) / height,\n ];\n }\n if(d2 > Math.PI * 0.5) {\n d2 = Math.PI - d2;\n return [\n (ox - dt * Math.cos(d2)) / width,\n (oy + dt * Math.sin(d2)) / height,\n ];\n }\n if(d2 >= 0) {\n return [\n (ox + dt * Math.cos(d2)) / width,\n (oy + dt * Math.sin(d2)) / height,\n ];\n }\n if(d2 >= -Math.PI * 0.5) {\n d2 = -d2;\n return [\n (ox + dt * Math.cos(d2)) / width,\n (oy - dt * Math.sin(d2)) / height,\n ];\n }\n if(d2 >= -Math.PI) {\n d2 = Math.PI + d2;\n return [\n (ox - dt * Math.cos(d2)) / width,\n (oy - dt * Math.sin(d2)) / height,\n ];\n }\n d2 = -Math.PI - d2;\n return [\n (ox - dt * Math.cos(d2)) / width,\n (oy + dt * Math.sin(d2)) / height,\n ];\n}\n\nfunction d2r(n) {\n return n * Math.PI / 180;\n}\n\nfunction r2d(n) {\n return n * 180 / Math.PI;\n}\n\n/**\n * 二阶贝塞尔曲线范围框\n * @param x0\n * @param y0\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n * @returns {number[]}\n * https://www.iquilezles.org/www/articles/bezierbbox/bezierbbox.htm\n */\nfunction bboxBezier2(x0, y0, x1, y1, x2, y2) {\n let minX = Math.min(x0, x2);\n let minY = Math.min(y0, y2);\n let maxX = Math.max(x0, x2);\n let maxY = Math.max(y0, y2);\n // 控制点位于边界内部时,边界就是范围框,否则计算导数获取极值\n if(x1 < minX || y1 < minY || x1 > maxX || y1 > maxY) {\n let tx = (x0 - x1) / (x0 - 2 * x1 + x2);\n let ty = (y0 - y1) / (y0 - 2 * y1 + y2);\n let sx = 1 - tx;\n let sy = 1 - ty;\n let qx = sx * sx * x0 + 2 * sx * tx * x1 + tx * tx * x2;\n let qy = sy * sy * y0 + 2 * sy * ty * y1 + ty * ty * y2;\n minX = Math.min(minX, qx);\n minY = Math.min(minY, qy);\n maxX = Math.min(maxX, qx);\n maxY = Math.min(maxY, qy);\n }\n return [minX, minY, maxX, maxY];\n}\n\n/**\n * 同上三阶的\n */\nfunction bboxBezier3(x0, y0, x1, y1, x2, y2, x3, y3) {\n let minX = Math.min(x0, x3);\n let minY = Math.min(y0, y3);\n let maxX = Math.max(x0, x3);\n let maxY = Math.max(y0, y3);\n if(x1 < minX || y1 < minY || x1 > maxX || y1 > maxY || x2 < minX || y2 < minY || x2 > maxX || y2 > maxY) {\n let cx = -x0 + x1;\n let cy = -y0 + y1;\n let bx = x0 - 2 * x1 + x2;\n let by = y0 - 2 * y1 + y2;\n let ax = -x0 + 3 * x1 - 3 * x2 + x3;\n let ay = -y0 + 3 * y1 - 3 * y2 + y3;\n let hx = bx * bx - ax * cx;\n let hy = by * by - ay * cy;\n if(hx > 0) {\n hx = Math.sqrt(hx);\n let t = (-bx - hx) / ax;\n if(t > 0 && t < 1) {\n let s = 1 - t;\n let q = s * s * s * x0 + 3 * s * s * t * x1 + 3 * s * t * t * x2 + t * t * t * x3;\n minX = Math.min(minX, q);\n maxX = Math.max(maxX, q);\n }\n t = (-bx + hx) / ax;\n if(t > 0 && t < 1) {\n let s = 1 - t;\n let q = s * s * s * x0 + 3 * s * s * t * x1 + 3 * s * t * t * x2 + t * t * t * x3;\n minX = Math.min(minX, q);\n maxX = Math.max(maxX, q);\n }\n }\n if(hy > 0) {\n hy = Math.sqrt(hy);\n let t = (-by - hy) / ay;\n if(t > 0 && t < 1) {\n let s = 1 - t;\n let q = s * s * s * y0 + 3 * s * s * t * y1 + 3 * s * t * t * y2 + t * t * t * y3;\n minY = Math.min(minY, q);\n maxY = Math.max(maxY, q);\n }\n t = (-by + hy) / ay;\n if(t > 0 && t < 1) {\n let s = 1 - t;\n let q = s * s * s * y0 + 3 * s * s * t * y1 + 3 * s * t * t * y2 + t * t * t * y3;\n minY = Math.min(minY, q);\n maxY = Math.max(maxY, q);\n }\n }\n }\n return [minX, minY, maxX, maxY];\n}\n\nfunction bboxBezier(x0, y0, x1, y1, x2, y2, x3, y3) {\n if(arguments.length === 4) {\n return [x0, y0, x1, y1];\n }\n if(arguments.length === 6) {\n return bboxBezier2(x0, y0, x1, y1, x2, y2);\n }\n if(arguments.length === 8) {\n return bboxBezier3(x0, y0, x1, y1, x2, y2, x3, y3);\n }\n}\n\n/**\n * 范数 or 模\n */\nfunction norm(v) {\n let order = v.length;\n let sum = v.reduce((a, b) => Math.pow(a, order) + Math.pow(b, order));\n return Math.pow(sum, 1 / order);\n}\n\nfunction simpson38(derivativeFunc, l, r) {\n let f = derivativeFunc;\n let middleL = (2 * l + r) / 3;\n let middleR = (l + 2 * r) / 3;\n return (f(l) + 3 * f(middleL) + 3 * f(middleR) + f(r)) * (r - l) / 8;\n}\n\n/**\n * bezier 曲线的长度\n * @param derivativeFunc 微分函数\n * @param l 左点\n * @param r 右点\n * @param eps 精度\n * @return {*} number\n */\nfunction adaptiveSimpson38(derivativeFunc, l, r, eps = 0.001) {\n let f = derivativeFunc;\n let mid = (l + r) / 2;\n let st = simpson38(f, l, r);\n let sl = simpson38(f, l, mid);\n let sr = simpson38(f, mid, r);\n let ans = sl + sr - st;\n if(Math.abs(ans) <= 15 * eps) {\n return sl + sr + ans / 15;\n }\n return adaptiveSimpson38(f, l, mid, eps / 2) + adaptiveSimpson38(f, mid, r, eps / 2);\n}\n\n/**\n * bezier 曲线的长度\n * @param points 曲线的起止点 和 控制点\n * @param order 阶次, 2 和 3\n * @param startT 计算长度的起点,满足 0 <= startT <= endT <= 1\n * @param endT 计算长度的终点\n * @return {*} number\n */\nfunction bezierLength(points, order, startT = 0, endT = 1) {\n let derivativeFunc = t => norm(at(t, points, order));\n return adaptiveSimpson38(derivativeFunc, startT, endT);\n}\n\n/**\n * 3 阶 bezier 曲线的 order 阶导数在 t 位置时候的 (x, y) 的值\n */\nfunction at3(t, points, order = 1) {\n let [p0, p1, p2, p3] = points;\n let [x0, y0] = p0;\n let [x1, y1] = p1;\n let [x2, y2] = p2;\n let [x3, y3] = p3;\n let x = 0;\n let y = 0;\n if(order === 0) {\n x = Math.pow((1 - t), 3) * x0 + 3 * t * Math.pow((1 - t), 2) * x1 + 3 * (1 - t) * Math.pow(t, 2) * x2 + Math.pow(t, 3) * x3;\n y = Math.pow((1 - t), 3) * y0 + 3 * t * Math.pow((1 - t), 2) * y1 + 3 * (1 - t) * Math.pow(t, 2) * y2 + Math.pow(t, 3) * y3;\n }\n else if(order === 1) {\n x = 3 * ((1 - t) * (1 - t) * (x1 - x0) + 2 * (1 - t) * t * (x2 - x1) + t * t * (x3 - x2));\n y = 3 * ((1 - t) * (1 - t) * (y1 - y0) + 2 * (1 - t) * t * (y2 - y1) + t * t * (y3 - y2));\n }\n else if(order === 2) {\n x = 6 * (x2 - 2 * x1 + x0) * (1 - t) + 6 * (x3 - 2 * x2 + x1) * t;\n y = 6 * (y2 - 2 * y1 + y0) * (1 - t) + 6 * (y3 - 2 * y2 + y1) * t;\n }\n else if(order === 3) {\n x = 6 * (x3 - 3 * x2 + 3 * x1 - x0);\n y = 6 * (y3 - 3 * y2 + 3 * y1 - y0);\n }\n else {\n // 3阶导数就是常数了,大于3阶的都是0\n x = 0;\n y = 0;\n }\n return [x, y];\n}\n\n/**\n * 2 阶 bezier 曲线的 order 阶导数在 t 位置时候的 (x, y) 的值\n */\nfunction at2(t, points, order = 1) {\n let [p0, p1, p2] = points;\n let [x0, y0] = p0;\n let [x1, y1] = p1;\n let [x2, y2] = p2;\n let x = 0;\n let y = 0;\n if(order === 0) {\n x = Math.pow((1 - t), 2) * x0 + 2 * t * (1 - t) * x1 + Math.pow(t, 2) * x2;\n y = Math.pow((1 - t), 2) * y0 + 2 * t * (1 - t) * y1 + Math.pow(t, 2) * y2;\n }\n else if(order === 1) {\n x = 2 * (1 - t) * (x1 - x0) + 2 * t * (x2 - x1);\n y = 2 * (1 - t) * (y1 - y0) + 2 * t * (y2 - y1);\n }\n else if(order === 2) {\n x = 2 * (x2 - 2 * x1 + x0);\n y = 2 * (y2 - 2 * y1 + y0);\n }\n else {\n x = 0;\n y = 0;\n }\n return [x, y];\n}\n\nfunction at(t, points, bezierOrder, derivativeOrder = 1) {\n if(bezierOrder === 2) {\n return at2(t, points, derivativeOrder);\n }\n else if(bezierOrder === 3) {\n return at3(t, points, derivativeOrder);\n }\n}\n\nfunction pointAtBezier(points, order, percent, maxIteration, eps) {\n let length = bezierLength(points, order, 0, 1);\n return pointAtBezierWithLength(points, order, length, percent, maxIteration, eps);\n}\n\nfunction pointAtBezierWithLength(points, order, length, percent = 1, maxIteration = 20, eps = 0.001) {\n let derivativeFunc = t => norm(at(t, points, order));\n let targetLen = length * percent;\n let approachLen = length;\n let approachT = percent;\n let preApproachT = approachT;\n for(let i = 0; i < maxIteration; i++) {\n approachLen = simpson38(derivativeFunc, 0, approachT);\n let d = approachLen - targetLen;\n if(Math.abs(d) < eps) {\n break;\n }\n // Newton 法\n let derivative1 = norm(at(approachT, points, order, 1)); // 1 阶导数\n let derivative2 = norm(at(approachT, points, order, 2)); // 2 阶导数\n let numerator = d * derivative1;\n let denominator = d * derivative2 + derivative1 * derivative1;\n approachT = approachT - numerator / denominator;\n if(Math.abs(approachT - preApproachT) < eps) {\n break;\n }\n else {\n preApproachT = approachT;\n }\n }\n return at(approachT, points, order, 0);\n}\n\nfunction sliceBezier(points, t) {\n let [[x1, y1], [x2, y2], [x3, y3], p4] = points;\n let x12 = (x2 - x1) * t + x1;\n let y12 = (y2 - y1) * t + y1;\n let x23 = (x3 - x2) * t + x2;\n let y23 = (y3 - y2) * t + y2;\n let x123 = (x23 - x12) * t + x12;\n let y123 = (y23 - y12) * t + y12;\n if(points.length === 4) {\n let [x4, y4] = p4;\n let x34 = (x4 - x3) * t + x3;\n let y34 = (y4 - y3) * t + y3;\n let x234 = (x34 - x23) * t + x23;\n let y234 = (y34 - y23) * t + y23;\n let x1234 = (x234 - x123) * t + x123;\n let y1234 = (y234 - y123) * t + y123;\n return [[x1, y1], [x12, y12], [x123, y123], [x1234, y1234]];\n }\n else if(points.length === 3) {\n return [[x1, y1], [x12, y12], [x123, y123]];\n }\n}\n\nfunction sliceBezier2Both(points, start = 0, end = 1) {\n start = Math.max(start, 0);\n end = Math.min(end, 1);\n if(start === 0 && end === 1) {\n return points;\n }\n if(end < 1) {\n points = sliceBezier(points, end);\n }\n if(start > 0) {\n if(end < 1) {\n start = start / end;\n }\n points = sliceBezier(points.reverse(), (1 - start)).reverse();\n }\n return points;\n}\n\nfunction pointOnCircle(x, y, r, deg) {\n if(deg >= 270) {\n deg -= 270;\n deg = d2r(deg);\n return [\n x - Math.cos(deg) * r,\n y - Math.sin(deg) * r,\n ];\n }\n else if(deg >= 180) {\n deg -= 180;\n deg = d2r(deg);\n return [\n x - Math.sin(deg) * r,\n y + Math.cos(deg) * r,\n ];\n }\n else if(deg >= 90) {\n deg -= 90;\n deg = d2r(deg);\n return [\n x + Math.cos(deg) * r,\n y + Math.sin(deg) * r,\n ];\n }\n else {\n deg = d2r(deg);\n return [\n x + Math.sin(deg) * r,\n y - Math.cos(deg) * r,\n ];\n }\n}\n\nexport default {\n pointInPolygon,\n pointInQuadrilateral,\n d2r,\n r2d,\n // 贝塞尔曲线模拟1/4圆弧比例\n H,\n // <90任意角度贝塞尔曲线拟合圆弧的比例公式\n h,\n angleBySide,\n sideByAngle,\n pointsDistance,\n triangleIncentre,\n ellipsePoints,\n sectorPoints,\n getRectsIntersection,\n isRectsOverlap,\n isRectsInside,\n calCoordsInNode,\n calPercentInNode,\n bboxBezier,\n bezierLength,\n pointAtBezier,\n pointAtBezierWithLength,\n sliceBezier,\n sliceBezier2Both,\n pointOnCircle,\n};\n","/**\n * @typedef {Object} gradientStatement\n * @property {Array} color - 颜色rgba,0~255,如 [0, 255, 0, 255]\n * @property {number} angle - 角度,0~2 * Math.PI,(originX, originY) 为原点,垂直向上为0\n */\n\n/**\n * 获取渐变图像像素数组\n * @param {number} originX - 渐变中心x坐标(相对图片左上角(0,0)的值,可在图片外,下同)\n * @param {number} originY - 渐变中心y坐标\n * @param {number} width - 图片宽度\n * @param {number} height - 图片高度\n * @param {Array} stop - 渐变声明列表\n * @param data - canvas的imgData.data\n * @returns {Array} 图像像素数组,每4个元素(rgba)构成一个像素点\n * @example\n // 矩形宽度为200*200,此时坐标为0~199,渐变中心为中点时,应传入99.5,可消除零点问题\n // 若渐变中心在某一整数轴上,就会引入零点问题,此时零点取y轴正半轴的色值,要消除这个问题,可以对渐变中心增加一个偏移量,使其不为整数\n let w = 200;\n let h = 200;\n let ctx = document.getElementById('example').getContext('2d');\n let imgData = ctx.getImageData(0,0, w, h);\n let data = getConicGradientImage(99.5, 99.5, w, h, [{\n color: [0,0,0,255],\n angle: 0,\n } ,{\n color: [255,0,0,255],\n angle: 2 * Math.PI,\n }]);\n for (let i = 0; i < imgData.data.length; i++) {\n imgData.data[i] = data[i];\n }\n ctx.putImageData(imgData, 0, 0);\n */\nfunction getConicGradientImage(\n originX,\n originY,\n width,\n height,\n stop,\n data\n) {\n if(stop.length < 2) {\n throw new Error(\n 'Conic gradient should recieve at least 2 gradient statements (start line and end line).'\n );\n }\n\n width = Math.floor(width);\n height = Math.floor(height);\n\n /**\n * 根据坐标获取角度\n * @param {number} x - x坐标,左上角为原点\n * @param {number} y - y坐标,左上角为原点\n * @returns {number} angle - 角度,0~2 * Math.PI,(originX, originY) 为原点,垂直向上为0\n */\n let getAngle = (x, y) => {\n // 此函数注释内的x、y轴基于 (originX, originY)\n // 计算相对 (originX, originY) 的坐标(dx, dy)\n let dx = x - originX;\n let dy = originY - y;\n // 在y轴上\n if(dx === 0) {\n return dy < 0\n ? // y轴负半轴,\n 1 * Math.PI\n : // y轴正半轴,因此,(originX, originY) 的angle视作0\n 0;\n }\n // 在x轴上\n if(dy === 0) {\n return dx < 0\n ? // x轴负半轴\n 1.5 * Math.PI\n : // x轴正半轴\n 0.5 * Math.PI;\n }\n let atan = Math.atan(dy / dx);\n /**\n * 2 | 1\n * -----|-----\n * 3 | 4\n */\n // 第一象限,atan > 0\n // 第四象限,atan < 0\n if(dx > 0) {\n return 0.5 * Math.PI - atan;\n }\n // 第二象限,atan < 0\n // 第三象限,atan > 0\n if(dx < 0) {\n return 1.5 * Math.PI - atan;\n }\n };\n\n let increasingList = stop.map(item => ({\n color: item[0],\n angle: item[1] * Math.PI * 2,\n }));\n\n for(let y = 0; y < height; y++) {\n for(let x = 0; x < width; x++) {\n // step 1. 找到当前点坐标相对 (originX, originY) 的角度\n let angle = getAngle(x, y);\n // step 2. 找到当前点坐标对应的渐变区间\n let j;\n for(j = 0; j < increasingList.length && increasingList[j].angle <= angle; j++) {\n }\n let start = increasingList[j - 1];\n let end = increasingList[j];\n if(!(start && end)) {\n // step 2-1. 不在渐变区间里\n continue;\n }\n // step 3. 计算色值并填充\n let factor = (angle - start.angle) / (end.angle - start.angle);\n let color = end.color.map(\n (v, idx) => factor * (v - start.color[idx]) + start.color[idx]\n );\n let i = (x + y * width) * 4;\n data[i] = color[0];\n data[i+1] = color[1];\n data[i+2] = color[2];\n data[i+3] = Math.min(255, color[3] * 255);\n }\n }\n return data;\n}\n\nexport default {\n getConicGradientImage,\n};\n","function canvasPolygon(ctx, list, dx = 0, dy = 0) {\n if(!list || !list.length) {\n return;\n }\n let start = -1;\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(Array.isArray(item) && item.length) {\n start = i;\n break;\n }\n }\n if(start === -1) {\n return;\n }\n ctx.moveTo(list[start][0] + dx, list[start][1] + dy);\n for(let i = start + 1, len = list.length; i < len; i++) {\n let item = list[i];\n if(!Array.isArray(item)) {\n continue;\n }\n if(item.length === 2) {\n ctx.lineTo(item[0] + dx, item[1] + dy);\n }\n else if(item.length === 4) {\n ctx.quadraticCurveTo(item[0] + dx, item[1] + dy, item[2] + dx, item[3] + dy);\n }\n else if(item.length === 6) {\n ctx.bezierCurveTo(item[0] + dx, item[1] + dy, item[2] + dx, item[3] + dy, item[4] + dx, item[5] + dy);\n }\n }\n}\n\nfunction svgPolygon(list) {\n if(!list || !list.length) {\n return '';\n }\n let start = -1;\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(Array.isArray(item) && item.length) {\n start = i;\n break;\n }\n }\n if(start === -1) {\n return '';\n }\n let s = 'M' + list[start][0] + ',' + list[start][1];\n for(let i = start + 1, len = list.length; i < len; i++) {\n let item = list[i];\n if(!Array.isArray(item)) {\n continue;\n }\n if(item.length === 2) {\n s += 'L' + item[0] + ',' + item[1];\n }\n else if(item.length === 4) {\n s += 'Q' + item[0] + ',' + item[1] + ' ' + item[2] + ',' + item[3];\n }\n else if(item.length === 6) {\n s += 'C' + item[0] + ',' + item[1] + ' ' + item[2] + ',' + item[3] + ' ' + item[4] + ',' + item[5];\n }\n }\n return s;\n}\n\nfunction canvasLine(ctx, x1, y1, x2, y2, controlA, controlB, num, dx = 0, dy = 0) {\n ctx.moveTo(x1 + dx, y1 + dy);\n if(num === 3) {\n ctx.bezierCurveTo(controlA[0] + dx, controlA[1] + dy, controlB[0] + dx, controlB[1], x2 + dx, y2 + dy);\n return 2;\n }\n else if(num === 2) {\n ctx.quadraticCurveTo(controlB[0] + dx, controlB[1] + dy, x2 + dx, y2 + dy);\n return 2;\n }\n else if(num === 1) {\n ctx.quadraticCurveTo(controlA[0] + dx, controlA[1] + dy, x2 + dx, y2 + dy);\n return 2;\n }\n else {\n ctx.lineTo(x2 + dx, y2 + dy);\n return 1;\n }\n}\n\nfunction svgLine(x1, y1, x2, y2, controlA, controlB, num) {\n if(num === 3) {\n return 'M' + x1 + ',' + y1\n + 'C' + controlA[0] + ',' + controlA[1] + ' ' + controlB[0] + ',' + controlB[1]\n + ' ' + x2 + ',' + y2;\n }\n else if(num === 2) {\n return 'M' + x1 + ',' + y1\n + 'Q' + controlB[0] + ',' + controlB[1]\n + ' ' + x2 + ',' + y2;\n }\n else if(num === 1) {\n return 'M' + x1 + ',' + y1\n + 'Q' + controlA[0] + ',' + controlA[1]\n + ' ' + x2 + ',' + y2;\n }\n else {\n return 'M' + x1 + ',' + y1 + 'L' + x2 + ',' + y2;\n }\n}\n\nfunction canvasFilter(filter) {\n let s = '';\n filter.forEach(item => {\n let [k, v] = item;\n if(k === 'blur') {\n s += `blur(${v}px)`;\n }\n else if(k === 'hue-rotate') {\n s += `hue-rotate(${v}deg)`;\n }\n else if(k === 'saturate' || k === 'brightness' || k === 'grayscale' || k === 'contrast' || k === 'sepia' || k === 'invert') {\n s += `${k}(${v}%)`;\n }\n });\n return s;\n}\n\nexport default {\n canvasPolygon,\n svgPolygon,\n canvasLine,\n svgLine,\n canvasFilter,\n svgFilter: canvasFilter,\n};\n","import Node from './Node';\nimport mode from '../refresh/mode';\nimport css from '../style/css';\nimport enums from '../util/enums';\n\nconst {\n STYLE_KEY: {\n FONT_SIZE,\n FONT_FAMILY,\n FONT_WEIGHT,\n FONT_STYLE,\n COLOR,\n },\n NODE_KEY: {\n NODE_VIRTUAL_DOM,\n },\n} = enums;\n\nconst { CANVAS, SVG, WEBGL } = mode;\n\nconst CHAR = '…';\n\nclass Ellipsis extends Node{\n constructor(x, y, width, parent) {\n super();\n this.__x = this.__sx1 = x;\n this.__y = this.__sy1 = y;\n this.__width = width;\n this.__parent = this.__domParent = parent;\n parent.__ellipsis = this;\n this.__parentLineBox = null;\n this.__baseline = css.getBaseline(parent.computedStyle);\n }\n\n render(renderMode, lv, ctx, cache, dx = 0, dy = 0) {\n let { x, y, parent } = this;\n let {\n ox,\n oy,\n computedStyle,\n cacheStyle: {\n [COLOR]: color,\n },\n } = parent;\n y += css.getBaseline(computedStyle);\n x += ox + dx;\n y += oy + dy;\n if(renderMode === CANVAS || renderMode === WEBGL) {\n let font = css.setFontStyle(computedStyle);\n if(ctx.font !== font) {\n ctx.font = font;\n }\n if(ctx.fillStyle !== color) {\n ctx.fillStyle = color;\n }\n ctx.fillText(CHAR, x, y);\n }\n else if(renderMode === SVG) {\n let props = [\n ['x', x],\n ['y', y],\n ['fill', color],\n ['font-family', computedStyle[FONT_FAMILY]],\n ['font-weight', computedStyle[FONT_WEIGHT]],\n ['font-style', computedStyle[FONT_STYLE]],\n ['font-size', computedStyle[FONT_SIZE] + 'px'],\n ];\n let vd = this.__config[NODE_VIRTUAL_DOM] = this.__virtualDom = {\n type: 'text',\n children: [\n {\n type: 'item',\n tagName: 'text',\n props,\n content: CHAR,\n },\n ],\n };\n parent.virtualDom.children.push(vd);\n }\n }\n\n get parentLineBox() {\n return this.__parentLineBox;\n }\n}\n\nexport default Ellipsis;\n\n","import geom from '../math/geom';\nimport mode from '../refresh/mode';\nimport painter from '../util/painter';\nimport enums from '../util/enums';\nimport unit from './unit';\nimport Ellipsis from '../node/Ellipsis';\n\nconst { H } = geom;\nconst { PX, PERCENT, REM, VW, VH, VMAX, VMIN } = unit;\nconst { canvasPolygon, svgPolygon } = painter;\nconst {\n STYLE_KEY: {\n BORDER_LEFT_WIDTH,\n BORDER_TOP_WIDTH,\n BORDER_BOTTOM_WIDTH,\n PADDING_LEFT,\n PADDING_BOTTOM,\n PADDING_TOP,\n BORDER_TOP_LEFT_RADIUS,\n BORDER_TOP_RIGHT_RADIUS,\n BORDER_BOTTOM_LEFT_RADIUS,\n BORDER_BOTTOM_RIGHT_RADIUS,\n FONT_SIZE,\n },\n} = enums;\n\n/* 获取合适的虚线实体空白宽度ps/pd和数量n\n * 总长total,start边长bs,end边长be,内容长w,\n * 实体长范围[smin,smax],空白长范围[dmin,dmax]\n */\nfunction calFitDashed(total, bs, be, w, smin, smax, dmin, dmax) {\n let n = 1;\n let ps = 1;\n let pd = 1;\n // 从最大实体空白长开始尝试\n outer:\n for(let i = smax; i >= smin; i--) {\n for(let j = dmax; j >= dmin; j--) {\n // 已知实体空白长度,n实体和n-1空白组成total,计算获取n数量\n let per = i + j;\n let num = Math.floor((total + j) / per);\n let k = j;\n // 可能除不尽,此时扩展空白长\n if(num * per < j + total) {\n let free = total - num * i;\n k = free / (num - 1);\n if(k > dmax) {\n continue;\n }\n }\n per = i + k;\n // bs比实体大才有效,因为小的话必定和第一个实体完整相连\n if(bs > 1 && bs > i) {\n let mo = bs % per;\n if(mo > i) {\n continue;\n }\n if(be > 1) {\n let mo = (bs + w) % per;\n if(mo > i) {\n continue;\n }\n }\n }\n if(be > 1) {\n let mo = (bs + w) % per;\n if(mo > i) {\n continue;\n }\n }\n if(num > 0) {\n n = num;\n ps = i;\n pd = k;\n }\n break outer;\n }\n }\n return {\n n,\n ps,\n pd,\n };\n}\n\n// dashed时n个实线和n-1虚线默认以3:1宽度组成,dotted则是n和n以1:1组成\nfunction calDashed(style, m1, m2, m3, m4, bw) {\n let total = m4 - m1;\n let w = m3 - m2;\n let bs = m2 - m1;\n let be = m4 - m3;\n if(style === 'dotted') {\n return calFitDashed(total, bs, be, w, bw, bw, Math.max(1, bw * 0.25), bw * 2);\n }\n else {\n let { n, ps, pd } = calFitDashed(total, bs, be, w, bw, bw * 3, Math.max(1, bw * 0.25), bw * 2);\n if(n === 1) {\n return calFitDashed(total, bs, be, w, bw, bw, Math.max(1, bw * 0.25), bw * 2);\n }\n // 降级为dotted\n return { n, ps, pd };\n }\n}\n\n// 获取边框分割为几块的坐标,虚线分割为若干四边形、三边型、五边形\n// 三边形重复内外边交点形成四边形,五边形进行切割形成2个四边形\n// direction为上右下左0123\nfunction calPoints(borderWidth, borderStyle, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, direction, beginRadius, endRadius) {\n let points = [];\n if(borderStyle === 'none') {\n return points;\n }\n if(['dashed', 'dotted'].indexOf(borderStyle) > -1) {\n // 寻找一个合适的虚线线段长度和之间空白边距长度\n let { n, ps, pd } = (direction === 0 || direction === 2)\n ? calDashed(borderStyle, x1, x2, x3, x4, borderWidth)\n : calDashed(borderStyle, y1, y2, y3, y4, borderWidth);\n if(n > 1) {\n for(let i = 0; i < n; i++) {\n // 最后一个可能没有到底,延长之\n let isLast = i === n - 1;\n let main1;\n let main2;\n let cross1;\n let cross2;\n if(direction === 0 || direction === 2) {\n main1 = i ? (x1 + ps * i + pd * i) : x1;\n }\n else {\n main1 = i ? (y1 + ps * i + pd * i) : y1;\n }\n main2 = main1 + ps;\n if(direction === 0) {\n // 整个和borderLeft重叠\n if(main2 <= x2) {\n if(isLast) {\n points.push([\n [x1, y1],\n [x4, y1],\n [x3, y2],\n [x2, y2]\n ]);\n }\n else {\n cross1 = y1 + (main1 - x1) * Math.tan(deg1);\n cross2 = y1 + (main2 - x1) * Math.tan(deg1);\n points.push([\n [main1, y1],\n [main2, y1],\n [main2, cross2],\n [main1, cross1]\n ]);\n }\n }\n // 整个和borderRight重叠\n else if(main1 >= x3) {\n cross1 = y1 + (x4 - main1) * Math.tan(deg2);\n cross2 = y1 + (x4 - main2) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [main1, y1],\n [x4, y1],\n [x4, y1],\n [main1, cross1]\n ]);\n }\n else {\n points.push([\n [main1, y1],\n [main2, y1],\n [main2, cross2],\n [main1, cross1]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross1 = y1 + (main1 - x1) * Math.tan(deg1);\n points.push([\n [main1, y1],\n [x2, y1],\n [x2, y2],\n [main1, cross1]\n ]);\n if(isLast) {\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x2, y2]\n ]);\n }\n else {\n // 下部分和borderRight重叠\n if(main2 > x3) {\n cross2 = y1 + (x4 - main2) * Math.tan(deg2);\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n points.push([\n [x3, y1],\n [main2, y1],\n [main2, cross2],\n [x3, y2]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x2, y1],\n [main2, y1],\n [main2, y2],\n [x2, y2]\n ]);\n }\n }\n }\n // 下部分和borderRight重叠\n else if(main2 > x3) {\n cross1 = y1 + (x4 - main2) * Math.tan(deg2);\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross2 = y1 + (main1 - x1) * Math.tan(deg1);\n points.push([\n [main1, y1],\n [x2, y1],\n [x2, y2],\n [main1, cross2]\n ]);\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n if(isLast) {\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x3, y2]\n ]);\n }\n else {\n points.push([\n [x3, y1],\n [main2, y1],\n [main2, cross1],\n [x3, y2]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [main1, y1],\n [x3, y1],\n [x3, y2],\n [main1, y2]\n ]);\n if(isLast) {\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x3, y2]\n ]);\n }\n else {\n points.push([\n [x3, y1],\n [main2, y1],\n [main2, cross1],\n [x3, y2]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [main1, y1],\n [x4, y1],\n [x3, y2],\n [main1, y2]\n ]);\n }\n else {\n points.push([\n [main1, y1],\n [main2, y1],\n [main2, y2],\n [main1, y2]\n ]);\n }\n }\n }\n }\n else if(direction === 1) {\n // 整个和borderTop重叠\n if(main2 <= y2) {\n if(isLast) {\n points.push([\n [x3, y2],\n [x4, y1],\n [x4, y4],\n [x3, y3]\n ]);\n }\n else {\n cross1 = x4 - (main1 - y1) * Math.tan(deg1);\n cross2 = x4 - (main2 - y1) * Math.tan(deg1);\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, main2],\n [cross2, main2],\n ]);\n }\n }\n // 整个和borderBottom重叠\n else if(main1 >= y3) {\n cross1 = x3 + (main1 - y3) * Math.tan(deg2);\n cross2 = x3 + (main2 - y3) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, y4],\n [x4, y4]\n ]);\n }\n else {\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, main2],\n [cross2, main2]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross1 = x3 + (y2 - main1) * Math.tan(deg1);\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, y2],\n [x3, y2]\n ]);\n if(isLast) {\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, y4],\n [x4, y4]\n ]);\n }\n else {\n // 下部分和borderBottom重叠\n if(main2 > y3) {\n cross2 = x3 + (main2 - y3) * Math.tan(deg2);\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, main2],\n [cross2, main2]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, main2],\n [x3, main2]\n ]);\n }\n }\n }\n // 下部分和borderBottom重叠\n else if(main2 > y3) {\n cross1 = x3 + (main2 - y3) * Math.tan(deg2);\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross2 = x3 + (y2 - main1) * Math.tan(deg1);\n points.push([\n [cross2, main1],\n [x4, main1],\n [x4, y2],\n [x3, y2]\n ]);\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, x4],\n [x4, x4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, main2],\n [cross1, main2]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [x3, main1],\n [x4, main1],\n [x4, y3],\n [x3, y3]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, y4],\n [x4, y4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, main2],\n [cross1, main2]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [x3, main1],\n [x4, main1],\n [x4, y4],\n [x3, y3]\n ]);\n }\n else {\n points.push([\n [x3, main1],\n [x4, main1],\n [x4, main2],\n [x3, main2]\n ]);\n }\n }\n }\n }\n else if(direction === 2) {\n // 整个和borderLeft重叠\n if(main2 <= x2) {\n if(isLast) {\n points.push([\n [x1, y4],\n [x2, y3],\n [x3, y3],\n [x4, y4]\n ]);\n }\n else {\n cross1 = y4 - (main1 - x1) * Math.tan(deg1);\n cross2 = y4 - (main2 - x1) * Math.tan(deg1);\n points.push([\n [main1, cross1],\n [main2, cross2],\n [main2, y4],\n [main1, y4]\n ]);\n }\n }\n // 整个和borderRight重叠\n else if(main1 >= x3) {\n cross1 = y4 - (x4 - main1) * Math.tan(deg2);\n cross2 = y4 - (x4 - main2) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [main1, cross1],\n [x4, y4],\n [x4, y4],\n [main1, y4]\n ]);\n }\n else {\n points.push([\n [main1, cross1],\n [main2, cross2],\n [main2, y4],\n [main1, y4]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross1 = y4 - (main1 - x1) * Math.tan(deg1);\n points.push([\n [main1, cross1],\n [x2, y3],\n [x2, y4],\n [main1, y4]\n ]);\n if(isLast) {\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n else {\n // 下部分和borderRight重叠\n if(main2 > x3) {\n cross2 = y4 - (main2 - x3) * Math.tan(deg2);\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n points.push([\n [x3, y3],\n [main2, cross2],\n [main2, y4],\n [x3, y4]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x2, y3],\n [main2, y3],\n [main2, y4],\n [x2, y4]\n ]);\n }\n }\n }\n // 下部分和borderRight重叠\n else if(main2 > x3) {\n cross1 = y4 - (x4 - main2) * Math.tan(deg2);\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross2 = y4 - (main1 - x3) * Math.tan(deg1);\n points.push([\n [main1, cross2],\n [x2, y3],\n [x2, y4],\n [main1, y4]\n ]);\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [main2, cross1],\n [main2, y4],\n [x3, y4]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [main1, y3],\n [x3, y3],\n [x3, y4],\n [main1, y4]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [main2, cross1],\n [main2, y4],\n [x3, y4]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [main1, y3],\n [x3, y3],\n [x4, y4],\n [main1, y4]\n ]);\n }\n else {\n points.push([\n [main1, y3],\n [main2, y3],\n [main2, y4],\n [main1, y4]\n ]);\n }\n }\n }\n }\n else if(direction === 3) {\n // 整个和borderTop重叠\n if(main2 <= y2) {\n if(isLast) {\n points.push([\n [x1, y1],\n [x2, y2],\n [x2, y3],\n [x1, y4]\n ]);\n }\n else {\n cross1 = x1 + (main1 - y1) * Math.tan(deg1);\n cross2 = x1 + (main2 - y1) * Math.tan(deg1);\n points.push([\n [x1, main1],\n [cross1, main1],\n [cross2, main2],\n [x1, main2]\n ]);\n }\n }\n // 整个和borderBottom重叠\n else if(main1 >= y3) {\n cross1 = x1 + (y4 - main1) * Math.tan(deg2);\n cross2 = x1 + (y4 - main2) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [x1, main1],\n [cross1, main1],\n [x1, y4],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, main1],\n [cross1, main1],\n [cross2, main2],\n [x1, main2]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross1 = x1 + (main1 - y1) * Math.tan(deg1);\n points.push([\n [x1, main1],\n [cross1, main1],\n [x2, y2],\n [x1, y2]\n ]);\n if(isLast) {\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4],\n ]);\n }\n else {\n // 下部分和borderBottom重叠\n if(main2 > y3) {\n cross2 = x1 + (y4 - main2) * Math.tan(deg2);\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n points.push([\n [x1, y3],\n [x2, y3],\n [cross2, main2],\n [x1, main2]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, main2],\n [x1, main2]\n ]);\n }\n }\n }\n // 下部分和borderBottom重叠\n else if(main2 > y3) {\n cross1 = x1 + (y4 - main2) * Math.tan(deg2);\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross2 = x1 + (main1 - y1) * Math.tan(deg1);\n points.push([\n [x1, main1],\n [cross2, main1],\n [x2, y2],\n [x1, y1]\n ]);\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n if(isLast) {\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, y3],\n [x2, y3],\n [cross1, main2],\n [x1, main2]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [x1, main1],\n [x2, main1],\n [x2, y3],\n [x1, y3]\n ]);\n if(isLast) {\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, y3],\n [x2, y3],\n [cross1, main2],\n [x1, main2]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [x1, main1],\n [x2, main1],\n [x2, y3],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, main1],\n [x2, main1],\n [x2, main2],\n [x1, main2]\n ]);\n }\n }\n }\n }\n }\n if(direction === 0) {\n return calTopRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 1) {\n return calRightRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 2) {\n return calBottomRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 3) {\n return calLeftRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n }\n }\n // 兜底返回实线\n if(direction === 0) {\n if(x2 > x1) {\n points.push([\n [x1, y1],\n [x2, y1],\n [x2, y2],\n [x1, y1]\n ]);\n }\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n if(x4 > x3) {\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x3, y2]\n ]);\n }\n return calTopRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 1) {\n if(y2 > y1) {\n points.push([\n [x4, y1],\n [x4, y1],\n [x4, y2],\n [x3, y2]\n ]);\n }\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n if(y4 > y3) {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, y4],\n [x4, y4]\n ]);\n }\n return calRightRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 2) {\n if(x2 > x1) {\n points.push([\n [x1, y4],\n [x2, y3],\n [x2, y4],\n [x1, y4]\n ]);\n }\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n if(x4 > x3) {\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n return calBottomRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 3) {\n if(y2 > y1) {\n points.push([\n [x1, y1],\n [x1, y1],\n [x2, y2],\n [x1, y2]\n ]);\n }\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n if(y4 > y3) {\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4]\n ]);\n }\n return calLeftRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n}\n\nfunction calTopRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,左圆角、右圆角、中间矩形,3个区域2个坐标;当左右圆角相接时中间矩形为0即中间2个坐标相等\n let oxl = x2 + brx - (x2 - x1);\n let oxr = x3 - erx + (x4 - x3);\n // 先拆分,当一块四边形跨越左右圆角和中间非圆角时被拆为3份,只跨一边圆角拆2份,不跨不处理\n // 也有可能左右圆角相接,跨越的只分为左右2份\n // 最终左圆角内的存入begin,右圆角内的存入end,中间center\n let beginList = [];\n let centerList = [];\n let endList = [];\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在左圆角\n if(points[1][0] < oxl) {\n beginList.push(points);\n }\n // 全在右圆角\n else if(points[0][0] > oxr) {\n endList.push(points);\n }\n // 跨越左右圆角\n else if(points[1][0] > oxr && points[0][0] < oxl) {\n let ya = oxl < x2 ? (y1 + Math.tan(deg1) * (oxl - x1)) : y2;\n let yb = oxr > x3 ? (y1 + Math.tan(deg2) * (x4 - oxr)) : y2;\n beginList.push([\n points[0],\n [oxl, y1],\n [oxl, ya],\n points[3]\n ]);\n if(oxl < oxr) {\n if(oxl > x2 && oxr < x3) {\n centerList.push([\n [oxl, y1],\n [oxr, y1],\n [oxr, y2],\n [oxl, y2],\n ]);\n }\n else if(oxl > x2) {\n centerList.push([\n [oxl, y1],\n [x3, y1],\n [x3, y2],\n [oxl, y2],\n ]);\n centerList.push([\n [x3, y1],\n [oxr, y1],\n [oxr, yb],\n [x3, y2]\n ]);\n }\n else if(oxr < x3) {\n centerList.push([\n [oxl, y1],\n [x2, y1],\n [x2, y2],\n [oxl, ya]\n ]);\n centerList.push([\n [x2, y1],\n [oxr, y1],\n [oxr, y2],\n [x2, y2],\n ]);\n }\n else {\n centerList.push([\n [oxl, y1],\n [x2, y1],\n [x2, y2],\n [oxl, ya]\n ]);\n centerList.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2],\n ]);\n centerList.push([\n [x3, y1],\n [oxr, y1],\n [oxr, yb],\n [x3, y2]\n ]);\n }\n }\n endList.push([\n [oxr, y1],\n points[1],\n points[2],\n [oxr, yb]\n ]);\n }\n // 跨越右圆角\n else if(points[1][0] > oxr) {\n let y = oxr > x3 ? (y1 + Math.tan(deg2) * (x4 - oxr)) : y2;\n centerList.push([\n points[0],\n [oxr, y1],\n [oxr, y],\n points[3]\n ]);\n endList.push([\n [oxr, y1],\n points[1],\n points[2],\n [oxr, y]\n ]);\n }\n // 跨越左圆角\n else if(points[0][0] < oxl) {\n let y = oxl < x2 ? (y1 + Math.tan(deg1) * (oxl - x1)) : y2;\n beginList.push([\n points[0],\n [oxl, y1],\n [oxl, y],\n points[3]\n ]);\n centerList.push([\n [oxl, y1],\n points[1],\n points[2],\n [oxl, y],\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = brx > (x2 - x1) && borderWidth < bry;\n // 算这个角度是为了头部和上条边相交线的延长线\n let crossDeg = Math.atan((x2 - x1) / (y2 - y1));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oyl = y1 + bry;\n let rx2 = brx - (x2 - x1);\n let ry2 = bry - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierTopLeft(beginList[0][0], beginList[0][1], oxl, oyl, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierTopLeft(beginList[0][3], beginList[0][2], oxl, oyl, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierTopLeft(points[0], points[1], oxl, oyl, sx1, ry1);\n if(needInner) {\n controls2 = calBezierTopLeft(points[3], points[2], oxl, oyl, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 0);\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 0);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n });\n }\n let endLength = endList.length;\n if(endLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = erx > (x4 - x3) && borderWidth < ery;\n // 算这个角度是为了最后和下条边相交线的延长线\n let crossDeg = Math.atan((x4 - x3) / (y2 - y1));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oyr = y1 + ery;\n let rx2 = erx - (x4 - x3);\n let ry2 = ery - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierTopRight(endList[endLength - 1][0], endList[endLength - 1][1], oxr, oyr, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierTopRight(endList[endLength - 1][3], endList[endLength - 1][2], oxr, oyr, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierTopRight(points[0], points[1], oxr, oyr, sx1, ry1);\n if(needInner) {\n controls2 = calBezierTopRight(points[3], points[2], oxr, oyr, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 1);\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 1);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierTopLeft(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = -p1x + ox;\n let dsx1 = dx1 * sx;\n let dx2 = -p2x + ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (oy - p2y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox - Math.sin(deg2) * r / sx;\n let cpy2 = oy - Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n // 最初的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox - Math.cos(alpha) * r / sx;\n cpy1 = oy - Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (oy - p1y));\n cpx1 = ox - Math.sin(deg1) * r / sx;\n cpy1 = oy - Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(p1x, p1y, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(p2x, p2y, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calBezierTopRight(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (oy - p1y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox + Math.sin(deg1) * r / sx;\n let cpy1 = oy - Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n // 最后的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox + Math.cos(alpha) * r / sx;\n cpy2 = oy - Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (oy - p2y));\n cpx2 = ox + Math.sin(deg2) * r / sx;\n cpy2 = oy - Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calRightRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,上圆角、下圆角、中间矩形,3个区域2个坐标;当上下圆角相接时中间矩形为0即中间2个坐标相等\n let oyt = y2 + bry - (y2 - y1);\n let oyb = y3 - ery + (y4 - y3);\n let beginList = [];\n let centerList = [];\n let endList = [];\n // 同borderTop拆分\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在上圆角\n if(points[2][1] < oyt) {\n beginList.push(points);\n }\n // 全在下圆角\n else if(points[1][1] > oyb) {\n endList.push(points);\n }\n // 跨越上下圆角\n else if(points[2][1] > oyb && points[1][1] < oyt) {\n let xa = oyt < y2 ? (x3 + Math.tan(deg2) * (y2 - oyt)) : x3;\n let xb = oyb > y3 ? (x3 + Math.tan(deg1) * (oyb - y3)) : x3;\n beginList.push([\n points[0],\n points[1],\n [x4, oyt],\n [xa, oyt]\n ]);\n if(oyt < oyb) {\n if(oyb < y3 && oyt > y2) {\n centerList.push([\n [x3, oyt],\n [x4, oyt],\n [x4, oyb],\n [x3, oyb]\n ]);\n }\n else if(oyt > y2) {\n centerList.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3],\n ]);\n centerList.push([\n [x3, y3],\n [x4, y3],\n [x4, oyb],\n [xb, oyb],\n ]);\n }\n else if(oyb < y3) {\n centerList.push([\n [xa, oyt],\n [x4, oyt],\n [x4, y2],\n [x3, y2],\n ]);\n centerList.push([\n [x3, y2],\n [x4, y2],\n [x4, oyb],\n [x3, oyb],\n ]);\n }\n else {\n centerList.push([\n [xa, oyt],\n [x4, oyt],\n [x4, y2],\n [x3, y2],\n ]);\n centerList.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3],\n ]);\n centerList.push([\n [x3, y3],\n [x4, y3],\n [x4, oyb],\n [xb, oyb],\n ]);\n }\n }\n endList.push([\n [xb, oyb],\n [x4, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越下圆角\n else if(points[2][1] > oyb) {\n let x = oyb > y3 ? (x3 + Math.tan(deg1) * (oyb - y3)) : x3;\n centerList.push([\n points[0],\n points[1],\n [x4, oyb],\n [x, oyb]\n ]);\n endList.push([\n [x, oyb],\n [x4, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越上圆角\n else if(points[1][1] < oyt) {\n let x = oyt < y2 ? (x3 + Math.tan(deg2) * (y2 - oyt)) : x3;\n beginList.push([\n points[0],\n points[1],\n [x4, oyt],\n [x, oyt]\n ]);\n centerList.push([\n [x, oyt],\n [x4, oyt],\n points[2],\n points[3]\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n let needInner = bry > (y2 - y1) && borderWidth < brx;\n let crossDeg = Math.atan((x4 - x3) / (y2 - y1));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oxt = x4 - brx;\n let rx2 = brx - (x4 - x3);\n let ry2 = bry - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierRightTop(beginList[0][1], beginList[0][2], oxt, oyt, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierRightTop(beginList[0][0], beginList[0][3], oxt, oyt, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierRightTop(points[1], points[2], oxt, oyt, sx1, ry1);\n if(needInner) {\n controls2 = calBezierRightTop(points[0], points[3], oxt, oyt, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 2);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 2);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[2] = points[3];\n points[3] = points[0];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n let endLength = endList.length;\n if(endLength) {\n let needInner = ery > (y4 - y3) && borderWidth < erx;\n let crossDeg = Math.atan((x4 - x3) / (y4 - y3));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oxb = x4 - erx;\n let rx2 = erx - (x4 - x3);\n let ry2 = ery - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierRightBottom(endList[endLength - 1][1], endList[endLength - 1][2], oxb, oyb, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierRightBottom(endList[endLength - 1][0], endList[endLength - 1][3], oxb, oyb, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierRightBottom(points[1], points[2], oxb, oyb, sx1, ry1);\n if(needInner) {\n controls2 = calBezierRightBottom(points[0], points[3], oxb, oyb, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 3);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 3);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[2] = points[3];\n points[3] = points[0];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierRightTop(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (oy - p2y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox + Math.sin(deg2) * r / sx;\n let cpy2 = oy - Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox + Math.cos(alpha) * r / sx;\n cpy1 = oy - Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (oy - p1y));\n cpx1 = ox + Math.sin(deg1) * r / sx;\n cpy1 = oy - Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#000';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\nfunction calBezierRightBottom(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (p1y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox + Math.sin(deg1) * r / sx;\n let cpy1 = oy + Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox + Math.cos(alpha) * r / sx;\n cpy2 = oy + Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (p2y - oy));\n cpx2 = ox + Math.sin(deg2) * r / sx;\n cpy2 = oy + Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\nfunction calBottomRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,左圆角、右圆角、中间矩形,3个区域2个坐标;当左右圆角相接时中间矩形为0即中间2个坐标相等\n let oxl = x2 + brx - (x2 - x1);\n let oxr = x3 - erx + (x4 - x3);\n // 先拆分,当一块四边形跨越左右圆角和中间非圆角时被拆为3份,只跨一边圆角拆2份,不跨不处理\n // 也有可能左右圆角相接,跨越的只分为左右2份\n // 最终左圆角内的存入begin,右圆角内的存入end,中间center\n let beginList = [];\n let centerList = [];\n let endList = [];\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在左圆角\n if(points[2][0] < oxl) {\n beginList.push(points);\n }\n // 全在右圆角\n else if(points[3][0] > oxr) {\n endList.push(points);\n }\n // 跨越左右圆角\n else if(points[2][0] > oxr && points[3][0] < oxl) {\n let ya = oxl < x2 ? (y4 - Math.tan(deg1) * (oxl - x1)) : y2;\n let yb = oxr > x3 ? (y4 - Math.tan(deg2) * (x4 - oxr)) : y3;\n beginList.push([\n points[0],\n [oxl, ya],\n [oxl, y4],\n points[3]\n ]);\n if(oxl < oxr) {\n if(oxl > x2 && oxr < x3) {\n centerList.push([\n [oxl, y3],\n [oxr, y3],\n [oxr, y4],\n [oxl, y4],\n ]);\n }\n else if(oxl > x2) {\n centerList.push([\n [oxl, y3],\n [x3, y3],\n [x3, y4],\n [oxl, y4],\n ]);\n centerList.push([\n [x3, y3],\n [oxr, yb],\n [oxr, y4],\n [x3, y4]\n ]);\n }\n else if(oxr < x3) {\n centerList.push([\n [oxl, ya],\n [x2, y3],\n [x2, y4],\n [oxl, y4]\n ]);\n centerList.push([\n [x2, y3],\n [oxr, y3],\n [oxr, y4],\n [x2, y4],\n ]);\n }\n else {\n centerList.push([\n [oxl, ya],\n [x2, y3],\n [x2, y4],\n [oxl, y4]\n ]);\n centerList.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4],\n ]);\n centerList.push([\n [x3, y3],\n [oxr, yb],\n [oxr, y4],\n [x3, y4]\n ]);\n }\n }\n endList.push([\n [oxr, yb],\n points[1],\n points[2],\n [oxr, y4]\n ]);\n }\n // 跨越右圆角\n else if(points[2][0] > oxr) {\n let y = oxr > x3 ? (y4 - Math.tan(deg2) * (x4 - oxr)) : y3;\n centerList.push([\n points[0],\n [oxr, y],\n [oxr, y4],\n points[3]\n ]);\n endList.push([\n [oxr, y],\n points[1],\n points[2],\n [oxr, y4]\n ]);\n }\n // 跨越左圆角\n else if(points[3][0] < oxl) {\n let y = oxl < x2 ? (y4 - Math.tan(deg1) * (oxl - x1)) : y3;\n beginList.push([\n points[0],\n [oxl, y],\n [oxl, y4],\n points[3]\n ]);\n centerList.push([\n [oxl, y],\n points[1],\n points[2],\n [oxl, y4],\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = brx > (x2 - x1) && borderWidth < bry;\n // 算这个角度是为了头部和上条边相交线的延长线\n let crossDeg = Math.atan((x2 - x1) / (y4 - y3));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oyl = y4 - bry;\n let rx2 = brx - (x2 - x1);\n let ry2 = bry - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierBottomLeft(beginList[0][3], beginList[0][2], oxl, oyl, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierBottomLeft(beginList[0][0], beginList[0][1], oxl, oyl, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierBottomLeft(points[3], points[2], oxl, oyl, sx1, ry1);\n if(needInner) {\n controls2 = calBezierBottomLeft(points[0], points[1], oxl, oyl, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 4);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 4);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n else {\n points[2] = points[1];\n points[3] = points[0];\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n });\n }\n let endLength = endList.length;\n if(endLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = erx > (x4 - x3) && borderWidth < ery;\n // 算这个角度是为了最后和下条边相交线的延长线\n let crossDeg = Math.atan((x4 - x3) / (y4 - y3));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oyr = y4 - ery;\n let rx2 = erx - (x4 - x3);\n let ry2 = ery - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierBottomRight(endList[endLength - 1][3], endList[endLength - 1][2], oxr, oyr, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierBottomRight(endList[endLength - 1][0], endList[endLength - 1][1], oxr, oyr, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierBottomRight(points[3], points[2], oxr, oyr, sx1, ry1);\n if(needInner) {\n controls2 = calBezierBottomRight(points[0], points[1], oxr, oyr, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 5);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 5);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n else {\n points[2] = points[1];\n points[3] = points[0];\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierBottomLeft(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = -p1x + ox;\n let dsx1 = dx1 * sx;\n let dx2 = -p2x + ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (p2y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox - Math.sin(deg2) * r / sx;\n let cpy2 = oy + Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n // 最初的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox - Math.cos(alpha) * r / sx;\n cpy1 = oy + Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (p1y - oy));\n cpx1 = ox - Math.sin(deg1) * r / sx;\n cpy1 = oy + Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calBezierBottomRight(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (p1y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox + Math.sin(deg1) * r / sx;\n let cpy1 = oy + Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n // 最后的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox + Math.cos(alpha) * r / sx;\n cpy2 = oy + Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (p2y - oy));\n cpx2 = ox + Math.sin(deg2) * r / sx;\n cpy2 = oy + Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calLeftRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,上圆角、下圆角、中间矩形,3个区域2个坐标;当上下圆角相接时中间矩形为0即中间2个坐标相等\n let oyt = y2 + bry - (y2 - y1);\n let oyb = y3 - ery + (y4 - y3);\n let beginList = [];\n let centerList = [];\n let endList = [];\n // 同borderTop拆分\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在上圆角\n if(points[3][1] < oyt) {\n beginList.push(points);\n }\n // 全在下圆角\n else if(points[0][1] > oyb) {\n endList.push(points);\n }\n // 跨越上下圆角\n else if(points[3][1] > oyb && points[0][1] < oyt) {\n let xa = oyt < y2 ? (x2 - Math.tan(deg2) * (y2 - oyt)) : x2;\n let xb = oyb > y3 ? (x2 - Math.tan(deg1) * (oyb - y3)) : x2;\n beginList.push([\n points[0],\n points[1],\n [xa, oyt],\n [x1, oyt]\n ]);\n if(oyt < oyb) {\n if(oyb < y3 && oyt > y2) {\n centerList.push([\n [x1, oyt],\n [x2, oyt],\n [x2, oyb],\n [x1, oyb]\n ]);\n }\n else if(oyt > y2) {\n centerList.push([\n [x1, oyt],\n [x2, oyt],\n [x2, y3],\n [x1, y3],\n ]);\n centerList.push([\n [x1, y3],\n [x2, y3],\n [xb, oyb],\n [x1, oyb],\n ]);\n }\n else if(oyb < y3) {\n centerList.push([\n [x1, oyt],\n [xa, oyt],\n [x2, y2],\n [x1, y2],\n ]);\n centerList.push([\n [x1, y2],\n [x2, y2],\n [x2, oyb],\n [x1, oyb],\n ]);\n }\n else {\n centerList.push([\n [x1, oyt],\n [xa, oyt],\n [x2, y2],\n [x1, y2],\n ]);\n centerList.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3],\n ]);\n centerList.push([\n [x1, y3],\n [x2, y3],\n [xb, oyb],\n [x1, oyb],\n ]);\n }\n }\n endList.push([\n [x1, oyb],\n [xb, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越下圆角\n else if(points[3][1] > oyb) {\n let x = oyb > y3 ? (x2 - Math.tan(deg1) * (oyb - y3)) : x2;\n centerList.push([\n points[0],\n points[1],\n [x, oyb],\n [x1, oyb]\n ]);\n endList.push([\n [x1, oyb],\n [x, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越上圆角\n else if(points[1][1] < oyt) {\n let x = oyt < y2 ? (x2 - Math.tan(deg2) * (y2 - oyt)) : x2;\n beginList.push([\n points[0],\n points[1],\n [x, oyt],\n [x1, oyt]\n ]);\n centerList.push([\n [x1, oyt],\n [x, oyt],\n points[2],\n points[3]\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n let needInner = bry > (y2 - y1) && borderWidth < brx;\n let crossDeg = Math.atan((x2 - x1) / (y2 - y1));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oxt = x1 + brx;\n let rx2 = brx - (x2 - x1);\n let ry2 = bry - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierLeftTop(beginList[0][0], beginList[0][3], oxt, oyt, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierLeftTop(beginList[0][1], beginList[0][2], oxt, oyt, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierLeftTop(points[0], points[3], oxt, oyt, sx1, ry1);\n if(needInner) {\n controls2 = calBezierLeftTop(points[1], points[2], oxt, oyt, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 6);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 6);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[3] = points[1];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n let endLength = endList.length;\n if(endLength) {\n let needInner = ery > (y4 - y3) && borderWidth < erx;\n let crossDeg = Math.atan((x2 - x1) / (y4 - y3));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oxb = x1 + erx;\n let rx2 = erx - (x2 - x1);\n let ry2 = ery - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierLeftBottom(endList[endLength - 1][0], endList[endLength - 1][3], oxb, oyb, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierLeftBottom(endList[endLength - 1][1], endList[endLength - 1][2], oxb, oyb, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierLeftBottom(points[0], points[3], oxb, oyb, sx1, ry1);\n if(needInner) {\n controls2 = calBezierLeftBottom(points[1], points[2], oxb, oyb, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 7);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 7);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[3] = points[1];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierLeftTop(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = ox - p1x;\n let dsx1 = dx1 * sx;\n let dx2 = ox - p2x;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (oy - p2y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox - Math.sin(deg2) * r / sx;\n let cpy2 = oy - Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox - Math.cos(alpha) * r / sx;\n cpy1 = oy - Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (oy - p1y));\n cpx1 = ox - Math.sin(deg1) * r / sx;\n cpy1 = oy - Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#000';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\nfunction calBezierLeftBottom(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = ox - p1x;\n let dsx1 = dx1 * sx;\n let dx2 = ox - p2x;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (p1y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox - Math.sin(deg1) * r / sx;\n let cpy1 = oy + Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox - Math.cos(alpha) * r / sx;\n cpy2 = oy + Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (p2y - oy));\n cpx2 = ox - Math.sin(deg2) * r / sx;\n cpy2 = oy + Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\n/**\n * 简单计算椭圆的圆化坐标控制点,视作重合位置,外面判断backgroundClip并调整坐标\n * @param x 起始x\n * @param y 起始y\n * @param w 宽\n * @param h 高\n * @param btlr borderTopLeftRadius\n * @param btrr borderTopRightRadius\n * @param bbrr borderBottomRightRadius\n * @param bblr borderBottomLeftRadius\n * @returns {[]} 多边形的顶点和曲线控制点\n */\nfunction calRadius(x, y, w, h, btlr, btrr, bbrr, bblr) {\n let need;\n let [btlx, btly] = btlr;\n let [btrx, btry] = btrr;\n let [bbrx, bbry] = bbrr;\n let [bblx, bbly] = bblr;\n btlx = Math.max(btlx, 0);\n btly = Math.max(btly, 0);\n btrx = Math.max(btrx, 0);\n btry = Math.max(btry, 0);\n bbrx = Math.max(bbrx, 0);\n bbry = Math.max(bbry, 0);\n bblx = Math.max(bblx, 0);\n bbly = Math.max(bbly, 0);\n // 圆角必须x/y都>0才有效,否则视为不绘制\n if(btlx > 0 && btly > 0 || btrx > 0 && btry > 0 || bbrx > 0 && bbry > 0 || bblx > 0 && bbly > 0) {\n need = true;\n }\n if(need) {\n let list = [];\n if(btlx > 0 && btly > 0) {\n list.push([x, y + btly]);\n list.push([x, y + (btly) * (1 - H), x + btlx * (1 - H), y, x + btlx, y]);\n }\n else {\n list.push([x, y]);\n }\n if(btrx > 0 && btry > 0) {\n list.push([x + w - btrx, y]);\n list.push([x + w - btrx * (1 - H), y, x + w, y + btry * (1 - H), x + w, y + btry]);\n }\n else {\n list.push([x + w, y]);\n }\n if(bbrx > 0 && bbry > 0) {\n list.push([x + w, y + h - bbry]);\n list.push([x + w, y + h - bbry * (1 - H), x + w - bbrx * (1 - H), y + h, x + w - bbrx, y + h]);\n }\n else {\n list.push([x + w, y + h]);\n }\n if(bblx > 0 && bbly > 0) {\n list.push([x + bblx, y + h]);\n list.push([x + bblx * (1 - H), y + h, x, y + h - bbly * (1 - H), x, y + h - bbly]);\n }\n else {\n list.push([x, y + h]);\n }\n return list;\n }\n}\n\nfunction limit(points, x, y, direction) {\n if(direction === 0) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n else if(direction === 1) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n else if(direction === 2) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 3) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n else if(direction === 4) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 5) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 6) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 7) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n}\n\nconst BR_KS = [BORDER_TOP_LEFT_RADIUS, BORDER_TOP_RIGHT_RADIUS, BORDER_BOTTOM_RIGHT_RADIUS, BORDER_BOTTOM_LEFT_RADIUS];\nfunction calBorderRadius(w, h, currentStyle, computedStyle, root) {\n let noRadius = true;\n BR_KS.forEach(k => {\n computedStyle[k] = currentStyle[k].map((item, i) => {\n if(item[0] > 0) {\n noRadius = false;\n }\n else {\n return 0;\n }\n if(item[1] === PX) {\n return Math.max(0, item[0]);\n }\n else if(item[1] === PERCENT) {\n return Math.max(0, item[0] * (i ? h : w) * 0.01);\n }\n else if(item[1] === REM) {\n return Math.max(0, item[0] * root.computedStyle[FONT_SIZE]);\n }\n else if(item[1] === VW) {\n return Math.max(0, item[0] * root.width * 0.01);\n }\n else if(item[1] === VH) {\n return Math.max(0, item[0] * root.height * 0.01);\n }\n else if(item[1] === VMAX) {\n return Math.max(0, item[0] * Math.max(root.width, root.height) * 0.01);\n }\n else if(item[1] === VMIN) {\n return Math.max(0, item[0] * Math.min(root.width, root.height) * 0.01);\n }\n return 0;\n });\n });\n // 优化提前跳出\n if(noRadius) {\n return;\n }\n // radius限制,相交的2个之和不能超过边长,如果2个都超过中点取中点,只有1个超过取交点,这包含了单个不能超过总长的逻辑\n BR_KS.forEach((k, i) => {\n let j = i % 2 === 0 ? 0 : 1;\n let target = j ? h : w;\n let prev = computedStyle[k];\n let next = computedStyle[BR_KS[(i + 1) % 4]];\n // 相加超过边长则是相交\n if(prev[j] + next[j] > target) {\n let half = target * 0.5;\n // 都超过一半中点取中点\n if(prev[j] >= half && next[j] >= half) {\n prev[j] = next[j] = half;\n }\n // 仅1个超过中点,因相交用总长减去另一方即可\n else if(prev[j] > half) {\n prev[j] = target - next[j];\n }\n else if(next[j] > half) {\n next[j] = target - prev[j];\n }\n }\n });\n}\n\nfunction calBorderRadiusInline(contentBoxList, currentStyle, computedStyle) {\n let first, last;\n if(contentBoxList.length) {\n first = contentBoxList[0];\n last = contentBoxList[contentBoxList.length - 1];\n if(last instanceof Ellipsis) {\n last = contentBoxList[contentBoxList.length - 2];\n }\n }\n // 先看first的左侧\n let w = first ? first.outerWidth : 0, h = first ? first.outerHeight : 0;\n w += computedStyle[BORDER_LEFT_WIDTH] + computedStyle[PADDING_LEFT];\n h += computedStyle[BORDER_TOP_WIDTH] + computedStyle[BORDER_BOTTOM_WIDTH]\n + computedStyle[PADDING_TOP] + computedStyle[PADDING_BOTTOM];\n [BORDER_TOP_LEFT_RADIUS, BORDER_BOTTOM_LEFT_RADIUS].forEach(k => {\n computedStyle[k] = currentStyle[k].map((item, i) => {\n let v;\n if(item[1] === PX) {\n v = Math.max(0, item[0]);\n v = Math.min(i ? h : w, v);\n }\n else {\n v = Math.max(0, item[0] * (i ? h : w) * 0.01);\n v = Math.min(i ? h : w, v);\n }\n return v;\n });\n });\n // 再看end的右侧\n w = last ? last.outerWidth : 0;\n h = last ? last.outerHeight : 0;\n [BORDER_TOP_RIGHT_RADIUS, BORDER_BOTTOM_RIGHT_RADIUS].forEach(k => {\n computedStyle[k] = currentStyle[k].map((item, i) => {\n let v;\n if(item[1] === PX) {\n v = Math.max(0, item[0]);\n v = Math.min(i ? h : w, v);\n }\n else {\n v = Math.max(0, item[0] * (i ? h : w) * 0.01);\n v = Math.min(i ? h : w, v);\n }\n return v;\n });\n });\n}\n\nfunction renderBorder(xom, renderMode, ctx, points, color, dx, dy) {\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n ctx.beginPath();\n if(ctx.fillStyle !== color) {\n ctx.fillStyle = color;\n }\n points.forEach(point => {\n canvasPolygon(ctx, point, dx, dy);\n });\n ctx.fill();\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n let s = '';\n points.forEach(point => {\n s += svgPolygon(point);\n });\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', s],\n ['fill', color],\n ],\n });\n }\n}\n\nexport default {\n calPoints,\n calRadius,\n calBorderRadius,\n calBorderRadiusInline,\n renderBorder,\n};\n","// 类型为引用防止json仿造\nconst TYPE_VD = Symbol('Dom');\nconst TYPE_GM = Symbol('Geom');\nconst TYPE_CP = Symbol('Component');\n\nexport default {\n TYPE_VD,\n TYPE_GM,\n TYPE_CP,\n};\n","import $$type from './$$type';\nimport mx from '../math/matrix';\n\nlet toString = {}.toString;\nfunction isType(type) {\n return function(obj) {\n return toString.call(obj) === '[object ' + type + ']';\n }\n}\n\nlet isObject = isType('Object');\nlet isString = isType('String');\nlet isFunction = isType('Function');\nlet isNumber = isType('Number');\nlet isBoolean = isType('Boolean');\nlet isDate = isType('Date');\n\nlet hasOwn = {}.hasOwnProperty;\nlet fnToString = hasOwn.toString;\nlet ObjectFunctionString = fnToString.call(Object);\n\nfunction isNil(v) {\n return v === undefined || v === null;\n}\n\nfunction joinSourceArray(arr) {\n let res = '';\n for(let i = 0, len = arr.length; i < len; i++) {\n let item = arr[i];\n if(Array.isArray(item)) {\n res += joinSourceArray(item);\n }\n else {\n res += stringify(item);\n }\n }\n return res;\n}\n\nfunction stringify(s) {\n if(isNil(s)) {\n return '';\n }\n return s.toString();\n}\n\nfunction encodeHtml(s, prop) {\n if(prop) {\n return s.replace(/\"/g, '"');\n }\n return s.replace(/&/g, '&').replace(/';\n vd.defs.forEach(item => {\n s += joinDef(item);\n });\n s += '';\n vd.bb.forEach(item => {\n s += joinVd(item);\n });\n s += '';\n (vd.children || []).forEach(item => {\n if(item.isMask) {\n return;\n }\n s += joinVd(item);\n });\n s += '';\n return s;\n}\n\n// 普通元素\nfunction joinVd(vd) {\n if(vd.type === 'item' || vd.type === 'img') {\n let s = '';\n (vd.props || []).forEach(item => {\n s += ' ' + item[0] + '=\"' + item[1] + '\"';\n });\n if(vd.tagName === 'text') {\n return '' + vd.content + '';\n }\n return '<' + vd.tagName + s + '/>';\n }\n else if(vd.type === 'text') {\n let s = ``;\n // text有许多lineBox\n (vd.children || []).forEach(item => {\n s += joinVd(item);\n });\n return '' + s + '';\n }\n else if(vd.type === 'dom' || vd.type === 'geom') {\n let s = '';\n vd.bb.forEach(item => {\n s += joinVd(item);\n });\n s += '';\n (vd.children || []).forEach(item => {\n if(item.isMask) {\n return;\n }\n s += joinVd(item);\n });\n s += '';\n let { opacity, transform, visibility, mask, overflow, filter, mixBlendMode } = vd;\n return '' + s + '';\n }\n}\n\nfunction joinDef(def) {\n let s = '<' + def.tagName + ' id=\"' + def.uuid + '\"';\n if(def.tagName === 'mask' || def.tagName === 'clipPath') {\n // s += ' maskUnits=\"userSpaceOnUse\"';\n }\n else if(def.tagName === 'filter') {\n // s += ' filterUnits=\"userSpaceOnUse\"';\n }\n else {\n s += ' gradientUnits=\"userSpaceOnUse\"';\n }\n (def.props || []).forEach(item => {\n s += ' ' + item[0] + '=\"' + item[1] + '\"';\n });\n s += '>';\n (def.children || []).forEach(item => {\n s += joinItem(item);\n });\n s += '' + def.tagName + '>';\n return s;\n}\n\nfunction joinItem(item) {\n let s = '<' + item.tagName;\n (item.props || []).forEach(item => {\n s += ' ' + item[0] + '=\"' + item[1] + '\"';\n });\n s += '>' + item.tagName + '>';\n return s;\n}\n\nfunction rgba2int(color) {\n if(Array.isArray(color)) {\n return color;\n }\n let res = [];\n if(!color || color === 'transparent') {\n res = [0, 0, 0, 0];\n }\n else if(color.charAt(0) === '#') {\n color = color.slice(1);\n if(color.length === 3) {\n res.push(parseInt(color.charAt(0) + color.charAt(0), 16));\n res.push(parseInt(color.charAt(1) + color.charAt(1), 16));\n res.push(parseInt(color.charAt(2) + color.charAt(2), 16));\n res[3] = 1;\n }\n else if(color.length === 6) {\n res.push(parseInt(color.slice(0, 2), 16));\n res.push(parseInt(color.slice(2, 4), 16));\n res.push(parseInt(color.slice(4), 16));\n res[3] = 1;\n }\n else if(color.length === 8) {\n res.push(parseInt(color.slice(0, 2), 16));\n res.push(parseInt(color.slice(2, 4), 16));\n res.push(parseInt(color.slice(4, 6), 16));\n res.push(parseInt(color.slice(6), 16) / 255);\n }\n else {\n res[0] = res[1] = res[2] = 0;\n res[3] = 1;\n }\n }\n else {\n let c = color.match(/rgba?\\s*\\(\\s*([\\d.]+)\\s*,\\s*([\\d.]+)\\s*,\\s*([\\d.]+)(?:\\s*,\\s*([\\d.]+))?\\s*\\)/i);\n if(c) {\n res = [parseInt(c[1]), parseInt(c[2]), parseInt(c[3])];\n if(!isNil(c[4])) {\n res[3] = parseFloat(c[4]);\n }\n else {\n res[3] = 1;\n }\n }\n else {\n res = [0, 0, 0, 0];\n }\n }\n return res;\n}\n\nfunction int2rgba(color) {\n if(Array.isArray(color)) {\n if(color.length === 4) {\n color = color.map((c, i) => i === 3 ? c : Math.floor(Math.max(0, c)));\n return 'rgba(' + joinArr(color, ',') + ')';\n }\n else if(color.length === 3) {\n color = color.map(c => Math.floor(c));\n return 'rgba(' + joinArr(color, ',') + ',1)';\n }\n }\n return color || 'rgba(0,0,0,0)';\n}\n\nfunction int2invert(color) {\n if(Array.isArray(color)) {\n color = color.slice(0);\n color[0] = 255 - color[0];\n color[1] = 255 - color[1];\n color[2] = 255 - color[2];\n if(color.length === 4) {\n return 'rgba(' + joinArr(color, ',') + ')';\n }\n else if(color.length === 3) {\n return 'rgba(' + joinArr(color, ',') + ',1)';\n }\n }\n return 'rgba(0,0,0,0)';\n}\n\nfunction arr2hash(arr) {\n let hash = {};\n for(let i = 0, len = arr.length; i < len; i++) {\n let item = arr[i];\n if(Array.isArray(item)) {\n hash[item[0]] = item[1];\n }\n else {\n for(let list = Object.keys(item), j = list.length - 1; j >= 0; j--) {\n let k = list[j];\n hash[k] = item[k];\n }\n }\n }\n return hash;\n}\n\nfunction hash2arr(hash) {\n if(Array.isArray(hash)) {\n return hash;\n }\n let arr = [];\n for(let list = Object.keys(hash), i = 0, len = list.length; i < len; i++) {\n let k = list[i];\n arr.push([k, hash[k]]);\n }\n return arr;\n}\n\nfunction clone(obj) {\n if(isNil(obj) || typeof obj !== 'object') {\n return obj;\n }\n // parse递归会出现内部先返回解析好的json,外部parse不能clone\n if(obj.$$type === $$type.TYPE_VD\n || obj.$$type === $$type.TYPE_GM\n || obj.$$type === $$type.TYPE_CP) {\n return obj;\n }\n if(util.isDate(obj)) {\n return new Date(obj);\n }\n if(!isPlainObject(obj) && !Array.isArray(obj)) {\n return obj;\n }\n let n = Array.isArray(obj) ? [] : {};\n Object.keys(obj).forEach(i => {\n n[i] = clone(obj[i]);\n });\n return n;\n}\n\n/**\n * 简化的arr对比,arr中只有arr和其它类型,其它类型对比值或引用,arr递归\n * @param a\n * @param b\n * @returns {boolean}\n */\nfunction equalArr(a, b) {\n if(!a || !b) {\n return a === b;\n }\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n let ai = a[i];\n let bi = b[i];\n let isArrayA = Array.isArray(ai);\n let isArrayB = Array.isArray(bi);\n if(isArrayA && isArrayB) {\n if(!equalArr(ai, bi)) {\n return false;\n }\n }\n else if(isArrayA || isArrayB) {\n return false;\n }\n else if(ai !== bi) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * 深度对比对象\n * @param a\n * @param b\n * @returns {boolean}\n */\nfunction equal(a, b) {\n if(a === b) {\n return true;\n }\n if(isObject(a) && isObject(b)) {\n let hash = {};\n for(let i = 0, arr = Object.keys(a), len = arr.length; i < len; i++) {\n let k = arr[i];\n if(!b.hasOwnProperty(k) || !equal(a[k], b[k])) {\n return false;\n }\n hash[k] = true;\n }\n // a没有b有则false\n for(let i = 0, arr = Object.keys(b), len = arr.length; i < len; i++) {\n let k = arr[i];\n if(!hash.hasOwnProperty(k)) {\n return false;\n }\n }\n }\n else if(isDate(a) && isDate(b)) {\n return a.getTime() === b.getTime();\n }\n else if(Array.isArray(a) && Array.isArray(b)) {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n if(!equal(a[i], b[i])) {\n return false;\n }\n }\n }\n else {\n return a === b;\n }\n return true;\n}\n\nfunction extend(target, source, keys) {\n if(source === null || typeof source !== 'object') {\n return target;\n }\n if(!keys) {\n keys = Object.keys(source);\n }\n let i = 0;\n let len = keys.length;\n while(i < len) {\n let k = keys[i];\n target[k] = source[k];\n i++;\n }\n return target;\n}\n\nfunction joinArr(arr, split) {\n let s = arr.length ? arr[0] : '';\n for(let i = 1, len = arr.length; i < len; i++) {\n s += split + arr[i];\n }\n return s;\n}\n\nfunction extendAnimate(ovd, nvd) {\n let list = nvd.__animationList = ovd.animationList.splice(0);\n list.forEach(item => {\n item.__setTarget(nvd);\n // 事件队列的缘故,可能动画本帧刚执行过,然后再继承,就会缺失,需再次赋值一遍;也有可能停留最后\n if(item.assigning || item.finished && item.__stayEnd()) {\n item.assignCurrentStyle();\n }\n });\n // 帧动画继承\n nvd.__frameAnimateList = ovd.__frameAnimateList.splice(0);\n}\n\nfunction transformBbox(bbox, matrix, dx = 0, dy = 0) {\n if(matrix && !mx.isE(matrix)) {\n let [x1, y1, x2, y2] = bbox;\n // 可能因filter的原因扩展范围\n if(dx) {\n x1 -= dx;\n x2 += dx;\n }\n if(dy) {\n y1 -= dy;\n y2 += dy;\n }\n let list = [x2, y1, x1, y2, x2, y2];\n let w;\n [x1, y1, , w] = mx.calPoint([x1, y1], matrix);\n if(w && w !== 1) {\n x1 /= w;\n y1 /= w;\n }\n let xa = x1, ya = y1, xb = x1, yb = y1;\n for(let i = 0; i < 6; i += 2) {\n let x = list[i], y = list[i + 1];\n [x, y, , w] = mx.calPoint([x, y], matrix);\n if(w && w !== 1) {\n x /= w;\n y /= w;\n }\n xa = Math.min(xa, x);\n xb = Math.max(xb, x);\n ya = Math.min(ya, y);\n yb = Math.max(yb, y);\n }\n bbox = [xa, ya, xb, yb];\n }\n else if(dx || dy) {\n bbox = bbox.slice(0);\n bbox[0] -= dx;\n bbox[1] -= dy;\n bbox[2] += dx;\n bbox[3] += dy;\n }\n return bbox;\n}\n\nfunction isPlainObject(obj) {\n if(!obj || toString.call(obj) !== '[object Object]') {\n return false;\n }\n let proto = Object.getPrototypeOf(obj);\n if(!proto) {\n return true;\n }\n let Ctor = hasOwn.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor === 'function' && fnToString.call(Ctor) === ObjectFunctionString;\n}\n\nfunction assignMatrix(t, v) {\n t[0] = v[0];\n t[1] = v[1];\n t[2] = v[2];\n t[3] = v[3];\n t[4] = v[4];\n t[5] = v[5];\n t[6] = v[6];\n t[7] = v[7];\n t[8] = v[8];\n t[9] = v[9];\n t[10] = v[10];\n t[11] = v[11];\n t[12] = v[12];\n t[13] = v[13];\n t[14] = v[14];\n t[15] = v[15];\n return t;\n}\n\nlet util = {\n isObject,\n isString,\n isFunction,\n isNumber,\n isBoolean,\n isDate,\n isNil,\n isPrimitive(v) {\n return util.isNil(v) || util.isBoolean(v) || util.isString(v) || util.isNumber(v);\n },\n // css中常用undefined/null表示auto本身\n isAuto(v) {\n return isNil(v) || v === 'auto';\n },\n isPlainObject,\n stringify,\n joinSourceArray(arr) {\n return joinSourceArray(arr);\n },\n encodeHtml,\n joinVirtualDom,\n joinVd,\n joinDef,\n rgba2int,\n int2rgba,\n int2invert,\n arr2hash,\n hash2arr,\n clone,\n equalArr,\n equal,\n extend,\n joinArr,\n extendAnimate,\n transformBbox,\n assignMatrix,\n};\n\nexport default util;\n","export default {\n flag: false,\n};\n","export default {\n alpha: true,\n antialias: true,\n premultipliedAlpha: true,\n preserveDrawingBuffer: true,\n // depth: true,\n // stencil: true,\n};\n","import mx from '../math/matrix';\n\nconst calPoint = mx.calPoint;\n\n/**\n * 初始化 shader\n * @param gl GL context\n * @param vshader vertex shader (string)\n * @param fshader fragment shader (string)\n * @return program, if the program object was created and successfully made current\n */\nfunction initShaders(gl, vshader, fshader) {\n let program = createProgram(gl, vshader, fshader);\n if(!program) {\n throw new Error('Failed to create program');\n }\n\n // 要开启透明度,用以绘制透明的图形\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);\n return program;\n}\n\n/**\n * Create the linked program object\n * @param gl GL context\n * @param vshader a vertex shader program (string)\n * @param fshader a fragment shader program (string)\n * @return created program object, or null if the creation has failed\n */\nfunction createProgram(gl, vshader, fshader) {\n // Create shader object\n let vertexShader = loadShader(gl, gl.VERTEX_SHADER, vshader);\n let fragmentShader = loadShader(gl, gl.FRAGMENT_SHADER, fshader);\n if(!vertexShader || !fragmentShader) {\n return null;\n }\n\n // Create a program object\n let program = gl.createProgram();\n if(!program) {\n return null;\n }\n program.vertexShader = vertexShader;\n program.fragmentShader = fragmentShader;\n\n // Attach the shader objects\n gl.attachShader(program, vertexShader);\n gl.attachShader(program, fragmentShader);\n\n // Link the program object\n gl.linkProgram(program);\n\n // Check the result of linking\n let linked = gl.getProgramParameter(program, gl.LINK_STATUS);\n if(!linked) {\n let error = gl.getProgramInfoLog(program);\n gl.deleteProgram(program);\n gl.deleteShader(fragmentShader);\n gl.deleteShader(vertexShader);\n throw new Error('Failed to link program: ' + error);\n }\n return program;\n}\n\n/**\n * Create a shader object\n * @param gl GL context\n * @param type the type of the shader object to be created\n * @param source shader program (string)\n * @return created shader object, or null if the creation has failed.\n */\nexport function loadShader(gl, type, source) {\n // Create shader object\n let shader = gl.createShader(type);\n if(shader == null) {\n throw new Error('unable to create shader');\n }\n\n // Set the shader program\n gl.shaderSource(shader, source);\n\n // Compile the shader\n gl.compileShader(shader);\n\n // Check the result of compilation\n let compiled = gl.getShaderParameter(shader, gl.COMPILE_STATUS);\n if(!compiled) {\n let error = gl.getShaderInfoLog(shader);\n gl.deleteShader(shader);\n throw new Error('Failed to compile shader: ' + error);\n }\n\n return shader;\n}\n\nfunction convertCoords2Gl([x, y, z, w], cx, cy, revertY) {\n if(z === undefined) {\n z = 0;\n }\n if(w === undefined) {\n w = 1;\n }\n if(w && w !== 1) {\n x /= w;\n y /= w;\n z /= w;\n }\n if(x === cx) {\n x = 0;\n }\n else {\n x = (x - cx) / cx;\n }\n if(y === cy) {\n y = 0;\n }\n else {\n y = (y - cy) / cy;\n if(revertY) {\n y = -y;\n }\n }\n return [x * w, y * w, z * w, w];\n}\n\nfunction createTexture(gl, tex, n, width, height) {\n let texture = gl.createTexture();\n bindTexture(gl, texture, n);\n // gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, -1);\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n // 传入高宽时是绑定fbo,且tex一定为null\n if(width && height) {\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, tex);\n }\n // 普通将canvas对象作为纹理\n else {\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, tex);\n }\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n return texture;\n}\n\nfunction bindTexture(gl, texture, n) {\n gl.activeTexture(gl['TEXTURE' + n]);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n}\n\n/**\n * texCache集满纹理上传占用最多可用纹理单元后,进行批量顺序绘制\n * 将所有dom的矩形顶点(经过transform变换后的)、贴图坐标、透明度存入3个buffer中,\n * 然后相同纹理单元的形成一批,设置uniform的纹理单元号进行绘制,如此循环\n * @param gl\n * @param list\n * @param hash\n * @param cx\n * @param cy\n * @param revertY\n */\nfunction drawTextureCache(gl, list, hash, cx, cy, revertY) {\n let vtPoint = [], vtTex = [], vtOpacity = [];\n let lastChannel; // 上一个dom的单元号\n let record = [0]; // [num, channel]每一批的数量和单元号记录\n let stack = [record]; // 所有批的数据记录集合\n list.forEach((item, i) => {\n let [cache, opacity, matrix, dx, dy] = item;\n if(i) {\n let channel = hash[cache.page.uuid];\n // 和上一个单元号不同时,生成新的批次记录\n if(lastChannel !== channel) {\n lastChannel = channel;\n record = [0, lastChannel];\n stack.push(record);\n }\n }\n else {\n lastChannel = hash[cache.page.uuid];\n record[1] = lastChannel;\n }\n let { x, y, width, height, page, bbox } = cache;\n // 计算顶点坐标和纹理坐标,转换[0,1]对应关系\n let bx = bbox[0], by = bbox[1];\n let [xa, ya] = [bx + (dx || 0), by + height + (dy || 0)];\n let [xb, yb] = [bx + width + (dx || 0), by + (dy || 0)];\n let [x1, y1, , w1] = calPoint([xa, ya], matrix);\n let [x2, y2, , w2] = calPoint([xb, ya], matrix);\n let [x3, y3, , w3] = calPoint([xb, yb], matrix);\n let [x4, y4, , w4] = calPoint([xa, yb], matrix);\n [x1, y1] = convertCoords2Gl([x1, y1, 0, w1], cx, cy, revertY);\n [x2, y2] = convertCoords2Gl([x2, y2, 0, w2], cx, cy, revertY);\n [x3, y3] = convertCoords2Gl([x3, y3, 0, w3], cx, cy, revertY);\n [x4, y4] = convertCoords2Gl([x4, y4, 0, w4], cx, cy, revertY);\n vtPoint.push(x1, y1, 0, w1, x4, y4, 0, w4, x2, y2, 0, w2, x4, y4, 0, w4, x2, y2, 0, w2, x3, y3, 0, w3);\n let tx1 = x / page.width, ty1 = (y + height) / page.height;\n let tx2 = (x + width) / page.width, ty2 = y / page.height;\n vtTex.push(tx1, ty1, tx1, ty2, tx2, ty1, tx1, ty2, tx2, ty1, tx2, ty2);\n vtOpacity.push(opacity, opacity, opacity, opacity, opacity, opacity);\n record[0]++;\n });\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vtPoint), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(gl.program, 'a_position');\n gl.vertexAttribPointer(a_position, 4, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vtTex), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(gl.program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // opacity buffer\n let opacityBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, opacityBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vtOpacity), gl.STATIC_DRAW);\n let a_opacity = gl.getAttribLocation(gl.program, 'a_opacity');\n gl.vertexAttribPointer(a_opacity, 1, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_opacity);\n // 纹理单元\n let u_texture = gl.getUniformLocation(gl.program, 'u_texture');\n let count = 0;\n // 循环按批次渲染\n stack.forEach(record => {\n let [num, channel] = record;\n gl.uniform1i(u_texture, channel);\n num *= 6;\n gl.drawArrays(gl.TRIANGLES, count, num);\n count += num;\n });\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.deleteBuffer(opacityBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n gl.disableVertexAttribArray(a_opacity);\n}\n\n/**\n * https://www.w3.org/TR/2018/WD-filter-effects-1-20181218/#feGaussianBlurElement\n * 根据cacheTotal生成cacheFilter,按照css规范的优化方法执行3次,避免卷积核扩大3倍性能慢\n * x/y方向分开执行,加速性能,计算次数由d*d变为d+d,d为卷积核大小\n * spread由d和sigma计算得出,d由sigma计算得出,sigma即css的blur()参数\n * 规范的优化方法对d的值分奇偶优化,这里再次简化,d一定是奇数,即卷积核大小\n * i和j为total和filter的纹理单元,3次执行(x/y合起来算1次)需互换单元,来回执行源和结果\n * 由total变为filter时cache会各方向上扩展spread的大小到width/height\n * 因此第一次绘制时坐标非1,后面则固定1\n * @param gl\n * @param program\n * @param frameBuffer\n * @param texCache\n * @param tex1 初次绘制目标纹理\n * @param tex2 初次绘制源纹理\n * @param i 初次绘制目标纹理单元\n * @param j 初次绘制源纹理单元\n * @param width\n * @param height\n * @param cx\n * @param cy\n * @param spread\n * @param d\n * @param sigma\n */\nfunction drawBlur(gl, program, frameBuffer, texCache, tex1, tex2, i, j, width, height, cx, cy, spread, d, sigma) {\n // 第一次将total绘制到blur上,此时尺寸存在spread差值,因此不加模糊防止坐标计算问题,仅作为扩展纹理尺寸\n let [x1, y2] = convertCoords2Gl([spread, height - spread], cx, cy);\n let [x2, y1] = convertCoords2Gl([width - spread, spread], cx, cy);\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n x1, y1,\n x1, y2,\n x2, y1,\n x1, y2,\n x2, y1,\n x2, y2,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(program, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n 0, 0,\n 0, 1,\n 1, 0,\n 0, 1,\n 1, 0,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // direction全0,即无模糊,此时只是进行扩展尺寸操作,还没到模糊所以传0\n let u_direction = gl.getUniformLocation(program, 'u_direction');\n gl.uniform2f(u_direction, 0, 0);\n // 纹理单元\n let u_texture = gl.getUniformLocation(program, 'u_texture');\n gl.uniform1i(u_texture, j);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n // fbo绑定切换纹理对象和单元索引,同时注意不能向源纹理绘制,因为源是cacheTotal,需要重新生成一个,y方向再来一次\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n /**\n * 反复执行共3次,坐标等均不变,只是切换fbo绑定对象和纹理单元\n * 注意max和ratio的设置,当是100尺寸的正方形时,传给direction的始终为1\n * 当正方形<100时,direction相应地要扩大相对于100的倍数,反之则缩小,如此为了取相邻点坐标时是+-1\n * 当非正方形时,长轴一端为基准值不变,短的要二次扩大比例倍数\n */\n let max = 100 / Math.max(width, height);\n let ratio = width / height;\n let recycle = []; // 3次过程中新生成的中间纹理需要回收\n for(let k = 0; k < 3; k++) {\n let tex3 = createTexture(gl, null, j, width, height);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex3, 0);\n if(width >= height) {\n gl.uniform2f(u_direction, max, 0);\n }\n else {\n gl.uniform2f(u_direction, max * ratio, 0);\n }\n gl.uniform1i(u_texture, i);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n recycle.push(tex1);\n let tex4 = createTexture(gl, null, i, width, height);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex4, 0);\n if(width >= height) {\n gl.uniform2f(u_direction, 0, max * ratio);\n }\n else {\n gl.uniform2f(u_direction, 0, max);\n }\n gl.uniform1i(u_texture, j);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n tex1 = tex4;\n recycle.push(tex3);\n }\n // 回收\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n recycle.forEach(item => gl.deleteTexture(item));\n return tex1;\n}\n\nfunction drawCm(gl, program, i, m) {\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(program, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n 0, 0,\n 0, 1,\n 1, 0,\n 0, 1,\n 1, 0,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // 纹理单元\n let u_texture = gl.getUniformLocation(program, 'u_texture');\n gl.uniform1i(u_texture, i);\n // matrix\n let u_m = gl.getUniformLocation(program, 'u_m');\n gl.uniform1fv(u_m, new Float32Array(m));\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n // 回收\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n}\n\n/**\n * 根据total/filter生成overflow\n * @param gl\n * @param i 输入纹理单元\n * @param dx 二者偏移值\n * @param dy\n * @param width 最终大小\n * @param height\n * @param w 输入纹理大小\n * @param h\n */\nfunction drawOverflow(gl, i, dx, dy, width, height, w, h) {\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(gl.programOverflow, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer,原本大小width/height,使用其中的w/h\n let x1 = dx / w, y1 = dy / h, x2 = (width + dx) / w, y2 = (height + dy) /h;\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n x1, y1,\n x1, y2,\n x2, y1,\n x1, y2,\n x2, y1,\n x2, y2,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(gl.programOverflow, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // 纹理单元\n let u_texture = gl.getUniformLocation(gl.programOverflow, 'u_texture');\n gl.uniform1i(u_texture, i);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n gl.deleteBuffer(pointBuffer);\n}\n\nfunction drawMask(gl, i, j, program) {\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(program, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n 0, 0,\n 0, 1,\n 1, 0,\n 0, 1,\n 1, 0,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // 纹理单元\n let u_texture1 = gl.getUniformLocation(program, 'u_texture1');\n gl.uniform1i(u_texture1, j);\n let u_texture2 = gl.getUniformLocation(program, 'u_texture2');\n gl.uniform1i(u_texture2, i);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n}\n\nfunction drawMbm(gl, program, i, j, W, H) {\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(program, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n 0, 0,\n 0, 1,\n 1, 0,\n 0, 1,\n 1, 0,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // 纹理单元\n let u_texture1 = gl.getUniformLocation(program, 'u_texture1');\n gl.uniform1i(u_texture1, i);\n let u_texture2 = gl.getUniformLocation(program, 'u_texture2');\n gl.uniform1i(u_texture2, j);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n}\n\nexport default {\n initShaders,\n createTexture,\n bindTexture,\n drawTextureCache,\n drawBlur,\n drawOverflow,\n drawMask,\n drawMbm,\n drawCm,\n};\n","import util from './util';\nimport debug from './debug';\nimport font from '../style/font';\nimport ca from '../gl/ca';\nimport webgl from '../gl/webgl';\n\nconst SPF = 1000 / 60;\n\nconst CANVAS = {};\nconst WEBGL = {};\nconst CANVAS_LIST = [];\nconst WEBGL_LIST = [];\nconst SUPPORT_OFFSCREEN_CANVAS = typeof OffscreenCanvas === 'function' && util.isFunction(OffscreenCanvas.prototype.getContext);\n\nlet defaultFontFamilyData;\n\nfunction cache(key, width, height, hash, message) {\n let o;\n if(!key) {\n let target = hash === CANVAS ? CANVAS_LIST : WEBGL_LIST;\n if(target.length) {\n o = target.pop();\n }\n else {\n o = !debug.flag && SUPPORT_OFFSCREEN_CANVAS ? new OffscreenCanvas(width, height) : document.createElement('canvas');\n }\n }\n else if(!hash[key]) {\n o = hash[key] = !debug.flag && SUPPORT_OFFSCREEN_CANVAS ? new OffscreenCanvas(width, height) : document.createElement('canvas');\n }\n else {\n o = hash[key];\n }\n o.width = width;\n o.height = height;\n if(debug.flag) {\n o.style.width = width + 'px';\n o.style.height = height + 'px';\n o.setAttribute('type', hash === CANVAS ? 'canvas' : 'webgl');\n if(key) {\n o.setAttribute('key', key);\n }\n if(message) {\n o.setAttribute('message', message);\n }\n document.body.appendChild(o);\n }\n let ctx;\n if(hash === CANVAS) {\n ctx = o.getContext('2d');\n }\n else {\n ctx = o.getContext('webgl', ca) || o.getContext('experimental-webgl', ca);\n }\n return {\n canvas: o,\n ctx,\n draw() {\n // 空函数,仅对小程序提供hook特殊处理,flush缓冲\n },\n enabled: true,\n available: true,\n release() {\n if(!key && this.available) {\n if(hash === CANVAS) {\n CANVAS_LIST.push(this.canvas);\n }\n else {\n WEBGL_LIST.push(this.canvas);\n }\n }\n this.available = false;\n },\n };\n}\n\nfunction cacheCanvas(key, width, height, message) {\n return cache(key, width, height, CANVAS, message);\n}\n\nfunction cacheWebgl(key, width, height, message) {\n return cache(key, width, height, WEBGL, message);\n}\n\nconst IMG = {};\nconst INIT = 0;\nconst LOADING = 1;\nconst LOADED = 2;\nconst FONT = {};\nconst COMPONENT = {};\nlet div;\n\nfunction createDiv() {\n div = document.createElement('div');\n div.style.position = 'absolute';\n div.style.left = '99999px';\n div.style.top = '-99999px';\n div.style.visibility = 'hidden';\n div.style.whiteSpace = 'nowrap';\n document.body.appendChild(div);\n}\n\nlet inject = {\n measureTextSync(str, ff, fs, fw) {\n if(!div) {\n createDiv();\n }\n div.style.fontFamily = ff;\n div.style.fontSize = fs + 'px';\n div.style.fontWeight = fw;\n div.innerHTML = str.replace(/' + str.charAt(i).replace('<', '<').replace(/[ \\n]/, ' ') + '';\n }\n div.innerHTML = s;\n let max = 0;\n let cns = div.childNodes;\n for(let i = 0, len = cns.length; i < len; i++) {\n let node = cns[i];\n // clientWidth只返回ceil整数,精度必须用getComputedStyle\n max = Math.max(max, parseFloat(window.getComputedStyle(node, null).width));\n }\n return max;\n },\n IMG,\n INIT,\n LOADED,\n LOADING,\n measureImg(url, cb) {\n if(Array.isArray(url)) {\n if(!url.length) {\n return cb();\n }\n let count = 0;\n let len = url.length;\n let list = [];\n url.forEach((item, i) => {\n inject.measureImg(item, function(cache) {\n list[i] = cache;\n if(++count === len) {\n cb(list);\n }\n });\n });\n return;\n }\n else if(!url || !util.isString(url)) {\n inject.error('Measure img invalid: ' + url);\n cb && cb({\n state: LOADED,\n success: false,\n url,\n });\n return;\n }\n let cache = IMG[url] = IMG[url] || {\n state: INIT,\n task: [],\n };\n if(cache.state === LOADED) {\n cb && cb(cache);\n }\n else if(cache.state === LOADING) {\n cb && cache.task.push(cb);\n }\n else {\n cache.state = LOADING;\n cb && cache.task.push(cb);\n let img = new Image();\n img.onload = function() {\n cache.state = LOADED;\n cache.success = true;\n cache.width = img.width;\n cache.height = img.height;\n cache.source = img;\n cache.url = url;\n let list = cache.task.splice(0);\n list.forEach(cb => cb(cache));\n };\n img.onerror = function(e) {\n cache.state = LOADED;\n cache.success = false;\n cache.url = url;\n let list = cache.task.splice(0);\n list.forEach(cb => cb(cache));\n };\n if(url.substr(0, 5) !== 'data:') {\n let host = /^(?:\\w+:)?\\/\\/([^/:]+)/.exec(url);\n if(host) {\n if(typeof location === 'undefined' || location.hostname !== host[1]) {\n img.crossOrigin = 'anonymous';\n }\n }\n }\n img.src = url;\n if(debug.flag && typeof document !== 'undefined') {\n document.body.appendChild(img);\n }\n }\n },\n warn(s) {\n console.warn(s);\n },\n error(s) {\n console.error(s);\n },\n requestAnimationFrame(cb) {\n if(!cb) {\n return;\n }\n let res;\n if(typeof requestAnimationFrame !== 'undefined') {\n inject.requestAnimationFrame = requestAnimationFrame.bind(window);\n res = requestAnimationFrame(cb);\n }\n else {\n res = setTimeout(cb, SPF);\n inject.requestAnimationFrame = function(cb) {\n return setTimeout(cb, SPF);\n };\n }\n return res;\n },\n cancelAnimationFrame(id) {\n let res;\n if(typeof cancelAnimationFrame !== 'undefined') {\n inject.cancelAnimationFrame = cancelAnimationFrame.bind(window);\n res = cancelAnimationFrame(id);\n }\n else {\n res = clearTimeout(id);\n inject.cancelAnimationFrame = function(id) {\n return clearTimeout(id);\n };\n }\n return res;\n },\n now() {\n if(typeof performance !== 'undefined') {\n inject.now = function() {\n return Math.floor(performance.now());\n };\n return Math.floor(performance.now());\n }\n inject.now = Date.now.bind(Date);\n return Date.now();\n },\n hasCacheCanvas(key) {\n return key && CANVAS.hasOwnProperty(key);\n },\n getCacheCanvas(width, height, key, message) {\n return cacheCanvas(key, width, height, message);\n },\n releaseCacheCanvas(o) {\n CANVAS_LIST.push(o);\n },\n delCacheCanvas(key) {\n key && delete CANVAS[key];\n },\n hasCacheWebgl(key) {\n return key && WEBGL.hasOwnProperty(key);\n },\n getCacheWebgl(width, height, key, message) {\n return cacheWebgl(key, width, height, message);\n },\n releaseCacheWebgl(o) {\n WEBGL_LIST.push(o);\n },\n delCacheWebgl(key) {\n key && delete WEBGL[key];\n },\n isDom(o) {\n if(o) {\n if(util.isString(o)) {\n return true;\n }\n if(typeof window !== 'undefined' && window.Element && (o instanceof window.Element)) {\n return true;\n }\n if(typeof window !== 'undefined' && window.OffscreenCanvas && (o instanceof window.OffscreenCanvas)) {\n return true;\n }\n // worker\n if(typeof self !== 'undefined' && self.OffscreenCanvas && (o instanceof self.OffscreenCanvas)) {\n return true;\n }\n if(util.isFunction(o.getElementsByTagName)) {\n return true;\n }\n }\n return false;\n },\n isWebGLTexture(o) {\n if(o && typeof WebGLTexture !== 'undefined') {\n return o instanceof WebGLTexture;\n }\n },\n defaultFontFamily: 'arial',\n getFontCanvas() {\n return inject.getCacheCanvas(16, 16, '__$$CHECK_SUPPORT_FONT_FAMILY$$__');\n },\n checkSupportFontFamily(ff) {\n ff = ff.toLowerCase();\n // 强制arial兜底\n if(ff === this.defaultFontFamily || ff === 'serif' || ff === 'sans-serif' || ff === 'sansserif') {\n return true;\n }\n if(!font.info.hasOwnProperty(ff)) {\n return false;\n }\n if(font.info[ff].hasOwnProperty('checked')) {\n return font.info[ff].checked;\n }\n let canvas = inject.getFontCanvas();\n let context = canvas.ctx;\n context.textAlign = 'center';\n context.fillStyle = '#000';\n context.textBaseline = 'middle';\n if(!defaultFontFamilyData) {\n context.clearRect(0, 0, 16, 16);\n context.font = '16px ' + this.defaultFontFamily;\n context.fillText('a', 8, 8);\n canvas.draw();\n defaultFontFamilyData = context.getImageData(0, 0, 16, 16).data;\n }\n context.clearRect(0, 0, 16, 16);\n context.font = '16px ' + ff;\n context.fillText('a', 8, 8);\n canvas.draw();\n let data = context.getImageData(0, 0, 16, 16).data;\n for(let i = 0, len = data.length; i < len; i++) {\n if(defaultFontFamilyData[i] !== data[i]) {\n return font.info[ff].checked = true;\n }\n }\n return font.info[ff].checked = false;\n },\n loadFont(fontFamily, url, cb) {\n if(util.isFunction(url)) {\n cb = url;\n url = fontFamily;\n }\n if(Array.isArray(url)) {\n if(!url.length) {\n return cb();\n }\n let count = 0;\n let len = url.length;\n let list = [];\n url.forEach((item, i) => {\n inject.loadFont(item.fontFamily, item.url, function(cache) {\n list[i] = cache;\n if(++count === len) {\n cb(list);\n }\n });\n });\n return;\n }\n else if(!url || !util.isString(url)) {\n inject.error('Load font invalid: ' + url);\n cb && cb({\n state: LOADED,\n success: false,\n url,\n });\n return;\n }\n if(!fontFamily) {\n fontFamily = url;\n }\n let cache = FONT[url] = FONT[url] || {\n state: INIT,\n task: [],\n };\n if(cache.state === LOADED) {\n cb && cb(cache);\n }\n else if(cache.state === LOADING) {\n cb && cache.task.push(cb);\n }\n else {\n cache.state = LOADING;\n cb && cache.task.push(cb);\n if(!/url\\(/.test(url)) {\n url = `url(${url})`;\n }\n let f = new FontFace(fontFamily, url);\n f.load().then(function() {\n document.fonts.add(f);\n cache.state = LOADED;\n cache.success = true;\n cache.url = url;\n let list = cache.task.splice(0);\n list.forEach(cb => cb(cache));\n }).catch(function() {\n cache.state = LOADED;\n cache.success = false;\n cache.url = url;\n let list = cache.task.splice(0);\n list.forEach(cb => cb(cache));\n });\n }\n },\n loadComponent(url, cb) {\n if(Array.isArray(url)) {\n if(!url.length) {\n return cb();\n }\n let count = 0;\n let len = url.length;\n let list = [];\n url.forEach((item, i) => {\n inject.loadComponent(item, function(cache) {\n list[i] = cache;\n if(++count === len) {\n cb(list);\n }\n });\n });\n return;\n }\n else if(!url || !util.isString(url)) {\n inject.error('Load component invalid: ' + url);\n cb && cb({\n state: LOADED,\n success: false,\n url,\n });\n return;\n }\n let cache = COMPONENT[url] = COMPONENT[url] || {\n state: INIT,\n task: [],\n };\n if(cache.state === LOADED) {\n cb && cb(cache);\n }\n else if(cache.state === LOADING) {\n cb && cache.task.push(cb);\n }\n else {\n cache.state = LOADING;\n cb && cache.task.push(cb);\n let script = document.createElement('script');\n script.src = url;\n script.async = true;\n script.onload = function() {\n cache.state = LOADED;\n cache.success = true;\n cache.url = url;\n let list = cache.task.splice(0);\n list.forEach(cb => cb(cache));\n document.head.removeChild(script);\n };\n script.onerror = function() {\n cache.state = LOADED;\n cache.success = false;\n cache.url = url;\n let list = cache.task.splice(0);\n list.forEach(cb => cb(cache));\n document.head.removeChild(script);\n };\n document.head.appendChild(script);\n }\n },\n};\n\nexport default inject;\n","import unit from './unit';\nimport reg from './reg';\nimport geom from '../math/geom';\nimport vector from '../math/vector';\nimport mx from '../math/matrix';\nimport gradient from '../math/gradient';\nimport border from './border';\nimport mode from '../refresh/mode';\nimport util from '../util/util';\nimport painter from '../util/painter';\nimport enums from '../util/enums';\nimport inject from '../util/inject';\n\nconst { rgba2int, isNil } = util;\nconst { PX, PERCENT, DEG, NUMBER, REM, VW, VH, VMAX, VMIN, calUnit } = unit;\nconst { d2r } = geom;\nconst { canvasPolygon, svgPolygon } = painter;\nconst {\n STYLE_KEY: {\n FONT_SIZE,\n },\n NODE_KEY: {\n NODE_DEFS_CACHE,\n },\n} = enums;\n\nfunction getLinearDeg(v) {\n let deg = 180;\n if(v === 'to top') {\n deg = 0;\n }\n else if(v === 'to top right') {\n deg = 45;\n }\n else if(v === 'to right') {\n deg = 90;\n }\n else if(v === 'to bottom right') {\n deg = 135;\n }\n else if(v === 'to bottom') {\n }\n else if(v === 'to bottom left') {\n deg = 225;\n }\n else if(v === 'to left') {\n deg = 270;\n }\n else if(v === 'to top left') {\n deg = 315;\n }\n // 数字角度,没有的话取默认角度\n else {\n let match = /([-+]?[\\d.]+)deg/.exec(v);\n if(match) {\n deg = parseFloat(match[1]);\n }\n }\n return deg % 360;\n}\n\nfunction getRadialPosition(data) {\n if(/^[-+]?[\\d.]/.test(data)) {\n let v = calUnit(data);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n return v;\n }\n else {\n return [\n {\n top: 0,\n left: 0,\n center: 50,\n right: 100,\n bottom: 100,\n }[data] || 50,\n PERCENT,\n ];\n }\n}\n\n// 获取color-stop区间范围,去除无用值\nfunction getColorStop(v, length, root) {\n let list = [];\n let firstColor = v[0][0];\n // 先把已经声明距离的换算成[0,1]以数组形式存入,未声明的原样存入\n for(let i = 0, len = v.length; i < len; i++) {\n let item = v[i];\n // 考虑是否声明了位置\n if(item.length > 1) {\n let p = item[1];\n if(p[1] === PERCENT) {\n list.push([item[0], p[0] * 0.01]);\n }\n else if(p[1] === REM) {\n list.push([item[0], p[0] * root.computedStyle[FONT_SIZE] / length]);\n }\n else if(p[1] === VW) {\n list.push([item[0], p[0] * root.width / length]);\n }\n else if(p[1] === VH) {\n list.push([item[0], p[0] * root.height / length]);\n }\n else if(p[1] === VMAX) {\n list.push([item[0], p[0] * Math.max(root.width, root.height) / length]);\n }\n else if(p[1] === VMIN) {\n list.push([item[0], p[0] * Math.min(root.width, root.height) / length]);\n }\n else {\n list.push([item[0], p[0] / length]);\n }\n }\n else {\n list.push([item[0]]);\n }\n }\n if(list.length === 1) {\n list.push(util.clone(list[0]));\n }\n // 首尾不声明默认为[0, 1]\n if(list[0].length === 1) {\n list[0].push(0);\n }\n if(list.length > 1) {\n let i = list.length - 1;\n if(list[i].length === 1) {\n list[i].push(1);\n }\n }\n // 找到未声明位置的,需区间计算,找到连续的未声明的,前后的区间平分\n let start = list[0][1];\n for(let i = 1, len = list.length; i < len - 1; i++) {\n let item = list[i];\n if(item.length > 1) {\n start = item[1];\n }\n else {\n let j = i + 1;\n let end = list[list.length - 1][1];\n for(; j < len - 1; j++) {\n let item = list[j];\n if(item.length > 1) {\n end = item[1];\n break;\n }\n }\n let num = j - i + 1;\n let per = (end - start) / num;\n for(let k = i; k < j; k++) {\n let item = list[k];\n item.push(start + per * (k + 1 - i));\n }\n i = j;\n }\n }\n // 每个不能小于前面的,canvas/svg不能兼容这种情况,需处理\n for(let i = 1, len = list.length; i < len; i++) {\n let item = list[i];\n let prev = list[i - 1];\n if(item[1] < prev[1]) {\n item[1] = prev[1];\n }\n }\n // 0之前的和1之后的要过滤掉\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(item[1] > 1) {\n list.splice(i);\n let prev = list[i - 1];\n if(prev && prev[1] < 1) {\n let dr = item[0][0] - prev[0][0];\n let dg = item[0][1] - prev[0][1];\n let db = item[0][2] - prev[0][2];\n let da = item[0][3] - prev[0][3];\n let p = (1 - prev[1]) / (item[1] - prev[1]);\n list.push([\n [\n item[0][0] + dr * p,\n item[0][1] + dg * p,\n item[0][2] + db * p,\n item[0][3] + da * p,\n ],\n 1],\n );\n }\n break;\n }\n }\n for(let i = list.length - 1; i >= 0; i--) {\n let item = list[i];\n if(item[1] < 0) {\n list.splice(0, i + 1);\n let next = list[i];\n if(next && next[1] > 0) {\n let dr = next[0][0] - item[0][0];\n let dg = next[0][1] - item[0][1];\n let db = next[0][2] - item[0][2];\n let da = next[0][3] - item[0][3];\n let p = (-item[1]) / (next[1] - item[1]);\n list.unshift([\n [\n item[0][0] + dr * p,\n item[0][1] + dg * p,\n item[0][2] + db * p,\n item[0][3] + da * p,\n ],\n 0],\n );\n }\n break;\n }\n }\n // 可能存在超限情况,如在使用px单位超过len或 {\n // item[0] = int2rgba(item[0]);\n if(item[1] < 0) {\n item[1] = 0;\n }\n else if(item[1] > 1) {\n item[1] = 1;\n }\n });\n // 都超限时,第一个颜色兜底\n if(!list.length) {\n list.push([firstColor, 0]);\n }\n return list;\n}\n\n// 根据角度和圆心获取渐变的4个点坐标\nfunction calLinearCoords(deg, length, cx, cy) {\n let x0;\n let y0;\n let x1;\n let y1;\n if(deg >= 270) {\n let r = d2r(360 - deg);\n x0 = cx + Math.sin(r) * length;\n y0 = cy + Math.cos(r) * length;\n x1 = cx - Math.sin(r) * length;\n y1 = cy - Math.cos(r) * length;\n }\n else if(deg >= 180) {\n let r = d2r(deg - 180);\n x0 = cx + Math.sin(r) * length;\n y0 = cy - Math.cos(r) * length;\n x1 = cx - Math.sin(r) * length;\n y1 = cy + Math.cos(r) * length;\n }\n else if(deg >= 90) {\n let r = d2r(180 - deg);\n x0 = cx - Math.sin(r) * length;\n y0 = cy - Math.cos(r) * length;\n x1 = cx + Math.sin(r) * length;\n y1 = cy + Math.cos(r) * length;\n }\n else {\n let r = d2r(deg);\n x0 = cx - Math.sin(r) * length;\n y0 = cy + Math.cos(r) * length;\n x1 = cx + Math.sin(r) * length;\n y1 = cy - Math.cos(r) * length;\n }\n return [x0, y0, x1, y1];\n}\n\nfunction calCircleCentre(position, x1, y1, iw, ih, root) {\n let cx, cy;\n let positionX = position[0], positionY = position[1];\n if(positionX[1] === PERCENT) {\n cx = x1 + positionX[0] * iw * 0.01;\n }\n else if(positionX[1] === REM) {\n cx = x1 + positionX[0] * root.computedStyle[FONT_SIZE];\n }\n else if(positionX[1] === VW) {\n cx = x1 + positionX[0] * root.width * 0.01;\n }\n else if(positionX[1] === VH) {\n cx = x1 + positionX[0] * root.height * 0.01;\n }\n else if(positionX[1] === VMAX) {\n cx = x1 + positionX[0] * Math.max(root.width, root.height) * 0.01;\n }\n else if(positionX[1] === VMIN) {\n cx = x1 + positionX[0] * Math.min(root.width, root.height) * 0.01;\n }\n else {\n cx = x1 + positionX[0];\n }\n if(positionY[1] === PERCENT) {\n cy = y1 + positionY[0] * ih * 0.01;\n }\n else if(positionY[1] === REM) {\n cy = y1 + positionY[0] * root.computedStyle[FONT_SIZE];\n }\n else if(positionY[1] === VW) {\n cy = y1 + positionY[0] * root.width * 0.01;\n }\n else if(positionY[1] === VH) {\n cy = y1 + positionY[0] * root.height * 0.01;\n }\n else if(positionY[1] === VH) {\n cy = y1 + positionY[0] * Math.max(root.width, root.height) * 0.01;\n }\n else if(positionY[1] === VH) {\n cy = y1 + positionY[0] * Math.min(root.width, root.height) * 0.01;\n }\n else {\n cy = y1 + positionY[0];\n }\n return [cx, cy];\n}\n\n// 获取径向渐变圆心半径\nfunction calRadialRadius(shape, size, position, iw, ih, x1, y1, x2, y2, root) {\n let cx, cy, xl, yl, r, tx, ty, d = 0;\n // 扩展的from to ratio格式,圆心、长轴坐标、短轴缩放比\n if(Array.isArray(size)) {\n cx = x1 + size[0] * iw;\n cy = y1 + size[1] * ih;\n tx = x1 + size[4] * iw;\n ty = y1 + size[5] * ih;\n if(size[6] <= 0) {\n r = Math.min(Math.abs(cx - x1), Math.min(Math.abs(cy - y1), Math.min(Math.abs(cy - y2), Math.min(Math.abs(cx - y2)))));\n }\n else {\n xl = Math.sqrt(Math.pow((size[2] - size[0]) * iw, 2) + Math.pow((size[3] - size[1]) * ih, 2));\n yl = xl * size[6];\n r = Math.max(xl, yl);\n // 看旋转\n if(xl !== yl) {\n if(size[2] >= size[0]) {\n if(size[3] >= size[1]) {\n d = Math.asin((size[3] - size[1]) * ih / xl);\n }\n else {\n d = -Math.asin((size[1] - size[3]) * ih / xl);\n }\n }\n else {\n if(size[3] >= size[1]) {\n d = d2r(180) - Math.asin((size[3] - size[1]) * ih / xl);\n }\n else {\n d = Math.asin((size[1] - size[3]) * ih / xl) - d2r(180);\n }\n }\n }\n }\n }\n else {\n // 默认椭圆a是水平轴,b是垂直轴\n [cx, cy] = calCircleCentre(position, x1, y1, iw, ih, root);\n tx = cx;\n ty = cy;\n let ratio = 1;\n if(size === 'closest-corner' && shape === 'circle') {\n if(cx <= x1 || cx >= x2 || cy <= y1 || cy >= y2) {\n r = Math.min(Math.abs(cx - x1), Math.min(Math.abs(cy - y1), Math.min(Math.abs(cy - y2), Math.min(Math.abs(cx - y2)))));\n }\n else {\n if(cx < x1 + iw * 0.5) {\n xl = cx - x1;\n }\n else {\n xl = x2 - cx;\n }\n if(cy < y1 + ih * 0.5) {\n yl = cy - y1;\n }\n else {\n yl = y2 - cy;\n }\n r = Math.sqrt(Math.pow(xl, 2) + Math.pow(yl, 2));\n }\n }\n else if(size === 'closest-side' || size === 'closest-corner') {\n // 在边外特殊情况只有end颜色填充\n if(cx <= x1 || cx >= x2 || cy <= y1 || cy >= y2) {\n r = Math.min(Math.abs(cx - x1), Math.min(Math.abs(cy - y1), Math.min(Math.abs(cy - y2), Math.min(Math.abs(cx - y2)))));\n }\n else {\n let ratio = 1;\n if(cx < x1 + iw * 0.5) {\n xl = cx - x1;\n }\n else {\n xl = x2 - cx;\n }\n if(cy < y1 + ih * 0.5) {\n yl = cy - y1;\n }\n else {\n yl = y2 - cy;\n }\n r = Math.min(xl, yl);\n // css的角和边有对应关系,即边扩展倍数,计算为固定值\n if(size === 'closest-corner') {\n ratio = Math.sqrt(2);\n }\n xl *= ratio;\n yl *= ratio;\n r *= ratio;\n }\n }\n else {\n if(cx <= x1) {\n xl = x1 - cx + iw;\n }\n else if(cx >= x2) {\n xl = cx - x2 + iw;\n }\n else if(cx < x1 + iw * 0.5) {\n xl = x2 - cx;\n }\n else {\n xl = cx - x1;\n }\n if(cy <= y1) {\n yl = y1 - cy + ih;\n }\n else if(cy >= y2) {\n yl = cy - y2 + ih;\n }\n else if(cy < y1 + ih * 0.5) {\n yl = y2 - cy;\n }\n else {\n yl = cy - y1;\n }\n r = Math.max(xl, yl);\n if(size !== 'farthest-side') {\n ratio = Math.sqrt(2);\n }\n xl *= ratio;\n yl *= ratio;\n r *= ratio;\n }\n }\n if(shape === 'circle') {\n xl = yl = r;\n }\n return [cx, cy, r, xl, yl, tx, ty, d];\n}\n\nfunction parseGradient(s) {\n let gradient = reg.gradient.exec(s);\n if(gradient) {\n let o = {\n k: gradient[1],\n };\n if(o.k === 'linear') {\n let deg = /([-+]?[\\d.]+deg)|(to\\s+[toprighbml]+)/i.exec(gradient[2]);\n if(deg) {\n o.d = getLinearDeg(deg[0].toLowerCase());\n }\n // 扩展支持从a点到b点相对坐标,而不是css角度,sketch等ui软件中用此格式\n else {\n let points = /([-+]?[\\d.]+)\\s+([-+]?[\\d.]+)\\s+([-+]?[\\d.]+)\\s+([-+]?[\\d.]+)/.exec(gradient[2]);\n if(points) {\n o.d = [parseFloat(points[1]), parseFloat(points[2]), parseFloat(points[3]), parseFloat(points[4])];\n }\n else {\n o.d = 180;\n }\n }\n }\n else if(o.k === 'radial') {\n o.s = gradient[2].indexOf('circle') > -1 ? 'circle' : 'ellipse';\n let size = /(closest|farthest)-(side|corner)/i.exec(gradient[2]);\n if(size) {\n o.z = size[0].toLowerCase();\n }\n // 扩展支持从a点到b点相对坐标,而不是size,sketch等ui软件中用此格式\n else {\n let points = /([-+]?[\\d.]+)\\s+([-+]?[\\d.]+)\\s+([-+]?[\\d.]+)\\s+([-+]?[\\d.]+)(?:\\s+([-+]?[\\d.]+))?(?:\\s+([-+]?[\\d.]+))?(?:\\s+([-+]?[\\d.]+))?/.exec(gradient[2]);\n if(points) {\n o.z = [parseFloat(points[1]), parseFloat(points[2]), parseFloat(points[3]), parseFloat(points[4])];\n let i5 = !isNil(points[5]), i6 = !isNil(points[6]), i7 = !isNil(points[7]);\n // 重载,567是偏移x/y和ratio,都可省略即不偏移和半径1,只有5是ratio,只有56是x/y\n if(i5 && i6 && i7) {\n o.z.push(parseFloat(points[5]));\n o.z.push(parseFloat(points[6]));\n o.z.push(parseFloat(points[7]));\n }\n else if(i5 && i6) {\n o.z.push(parseFloat(points[5]));\n o.z.push(parseFloat(points[6]));\n o.z.push(1);\n }\n else if(i5) {\n o.z.push(o.z[0]);\n o.z.push(o.z[1]);\n o.z.push(parseFloat(points[5]));\n }\n else {\n o.z.push(o.z[0]);\n o.z.push(o.z[1])\n o.z.push(1);\n }\n }\n else {\n o.z = 'farthest-corner';\n }\n }\n let position = /at\\s+((?:[-+]?[\\d.]+[pxremvwhina%]*)|(?:left|top|right|bottom|center))(?:\\s+((?:[-+]?[\\d.]+[pxremvwhina%]*)|(?:left|top|right|bottom|center)))?/i.exec(gradient[2]);\n if(position) {\n let x = getRadialPosition(position[1]);\n let y = position[2] ? getRadialPosition(position[2]) : x;\n o.p = [x, y];\n }\n else {\n o.p = [[50, PERCENT], [50, PERCENT]];\n }\n }\n else if(o.k === 'conic') {\n let deg = /([-+]?[\\d.]+deg)/i.exec(gradient[2]);\n if(deg) {\n o.d = parseFloat(deg[0]) % 360;\n }\n else {\n o.d = 0;\n }\n let position = /at\\s+((?:[-+]?[\\d.]+[pxremvwhina%]*)|(?:left|top|right|bottom|center))(?:\\s+((?:[-+]?[\\d.]+[pxremvwhina%]*)|(?:left|top|right|bottom|center)))?/i.exec(gradient[2]);\n if(position) {\n let x = getRadialPosition(position[1]);\n let y = position[2] ? getRadialPosition(position[2]) : x;\n o.p = [x, y];\n }\n else {\n o.p = [[50, PERCENT], [50, PERCENT]];\n }\n }\n let v = gradient[2].match(/(([-+]?[\\d.]+[pxremvwhina%]+)?\\s*((#[0-9a-f]{3,8})|(rgba?\\s*\\(.+?\\)))\\s*([-+]?[\\d.]+[pxremvwhina%]+)?)|(transparent)/ig) || [];\n o.v = v.map(item => {\n let color = /(?:#[0-9a-f]{3,8})|(?:rgba?\\s*\\(.+?\\))|(?:transparent)/i.exec(item);\n let arr = [rgba2int(color[0])];\n let percent = /[-+]?[\\d.]+[pxremvwhina%]+/.exec(item);\n if(percent) {\n let v = calUnit(percent[0]);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n arr[1] = v;\n }\n return arr;\n });\n return o;\n }\n}\n\nfunction getLinear(v, d, ox, oy, cx, cy, w, h, root, dx = 0, dy = 0) {\n ox += dx;\n oy += dy;\n cx += dx;\n cy += dy;\n // d为数组是2个坐标点,数字是css标准角度\n let x1, y1, x2, y2, stop;\n if(Array.isArray(d)) {\n x1 = ox + d[0] * w;\n y1 = oy + d[1] * h;\n x2 = ox + d[2] * w;\n y2 = oy + d[3] * h;\n let total = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));\n stop = getColorStop(v, total);\n }\n else {\n while(d >= 360) {\n d -= 360;\n }\n while(d < 0) {\n d += 360;\n }\n // 根据角度求直线上2点,设置半径为长宽最大值,这样一定在矩形外,看做一个向量A\n let len = Math.max(w, h);\n let coords = calLinearCoords(d, len, cx, cy, w, h);\n len *= 2;\n // start和4个顶点的向量在A上的投影长度\n let l1 = vector.dotProduct(ox - coords[0], oy - coords[1], coords[2] - coords[0], coords[3] - coords[1]) / len;\n let l2 = vector.dotProduct(ox + w - coords[0], oy - coords[1], coords[2] - coords[0], coords[3] - coords[1]) / len;\n let l3 = vector.dotProduct(ox + w - coords[0], oy + h - coords[1], coords[2] - coords[0], coords[3] - coords[1]) / len;\n let l4 = vector.dotProduct(ox - coords[0], oy + h - coords[1], coords[2] - coords[0], coords[3] - coords[1]) / len;\n // 最小和最大值为0~100%\n let min = l1, max = l1;\n min = Math.min(min, Math.min(l2, Math.min(l3, l4)));\n max = Math.max(max, Math.max(l2, Math.max(l3, l4)));\n // 求得0和100%的长度和坐标\n let total = max - min;\n let r1 = min / len;\n let dx = coords[2] - coords[0];\n let dy = coords[3] - coords[1];\n x1 = coords[0] + dx * r1;\n y1 = coords[1] + dy * r1;\n x2 = coords[2] - dx * r1;\n y2 = coords[3] - dy * r1;\n stop = getColorStop(v, total, root);\n }\n return {\n x1,\n y1,\n x2,\n y2,\n stop,\n };\n}\n\nfunction getRadial(v, shape, size, position, x1, y1, x2, y2, root) {\n let w = x2 - x1;\n let h = y2 - y1;\n let [cx, cy, r, xl, yl, tx, ty, d] = calRadialRadius(shape, size, position, w, h, x1, y1, x2, y2, root);\n // 圆形取最小值,椭圆根据最小圆进行transform,椭圆其中一边轴和r一样,另一边则大小缩放可能\n let matrix, scx = 1, scy = 1;\n if(xl !== yl || d) {\n matrix = [1, 0, 0, 1, 0, 0];\n if(d) {\n let sin = Math.sin(d);\n let cos = Math.cos(d);\n matrix = [cos, sin, 0, 0, -sin, cos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n }\n if(xl !== r) {\n scx = xl / r;\n let m = [scx, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n matrix = mx.multiply(matrix, m);\n }\n if(yl !== r) {\n scy = yl / r;\n let m = [1, 0, 0, 0, 0, scy, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n matrix = mx.multiply(matrix, m);\n }\n }\n let stop = getColorStop(v, r, root);\n return {\n cx,\n cy,\n tx,\n ty,\n r,\n stop,\n scx,\n scy,\n matrix,\n d,\n };\n}\n\nfunction getConic(v, d, p, x1, y1, x2, y2, ratio, root) {\n let [cx, cy, r, deg] = calConicRadius(v, d, p, x1, y1, x2, y2, root);\n let stop = getColorStop(v, 1, root);\n r <<= 1; // 锥形半径*2,这样分割画圆时保证一定会填满原有矩形\n r *= ratio; // 矢量图形比较特殊,有可能超限,传入个倍数扩大半径\n return {\n cx,\n cy,\n w: x2 - x1,\n h: y2 - y1,\n r,\n deg,\n stop,\n };\n}\n\nfunction calConicRadius(v, deg, position, x1, y1, x2, y2, root) {\n let iw = x2 - x1;\n let ih = y2 - y1;\n let [cx, cy] = calCircleCentre(position, x1, y1, iw, ih, root);\n let r, a, b;\n if(cx >= x1 + iw * 0.5) {\n a = cx - x1;\n }\n else {\n a = x2 - cx;\n }\n if(cy >= y1 + ih * 0.5) {\n b = cy - y1;\n }\n else {\n b = y2 - cy;\n }\n r = Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2));\n return [cx, cy, r, deg];\n}\n\nfunction renderConic(xom, renderMode, ctx, res, x, y, w, h, btlr, btrr, bbrr, bblr, isInline) {\n // border-radius使用三次贝塞尔曲线模拟1/4圆角,误差在[0, 0.000273]之间\n let list = border.calRadius(x, y, w, h, btlr, btrr, bbrr, bblr);\n if(!list) {\n list = [\n [x, y],\n [x + w, y],\n [x + w, y + h],\n [x, y + h],\n [x, y],\n ];\n }\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n let offscreen = inject.getCacheCanvas(w, h, '__$$CONIC_GRADIENT$$__');\n let imgData = offscreen.ctx.getImageData(0,0, w, h);\n gradient.getConicGradientImage(res.cx - x, res.cy - y, res.w, res.h, res.stop, imgData.data);\n offscreen.ctx.putImageData(imgData, 0, 0);\n ctx.save();\n ctx.beginPath();\n canvasPolygon(ctx, list);\n ctx.clip();\n ctx.closePath();\n ctx.drawImage(offscreen.canvas, x, y);\n ctx.restore();\n offscreen.ctx.clearRect(0, 0, w, h);\n }\n}\n\nexport default {\n parseGradient,\n getLinear,\n getRadial,\n getConic,\n renderConic,\n};\n","import inject from '../util/inject';\n\nconst DOM = {\n position: 'static',\n display: 'block',\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n left: 'auto',\n marginTop: 0,\n marginRight: 0,\n marginBottom: 0,\n marginLeft: 0,\n paddingTop: 0,\n paddingRight: 0,\n paddingBottom: 0,\n paddingLeft: 0,\n fontSize: 'inherit',\n fontFamily: 'inherit',\n color: 'inherit',\n fontStyle: 'inherit',\n fontWeight: 'inherit',\n lineHeight: 'inherit',\n backgroundImage: null,\n backgroundColor: 'transparent',\n backgroundSize: 'auto',\n backgroundRepeat: 'repeat',\n backgroundPositionX: 0,\n backgroundPositionY: 0,\n backgroundClip: 'borderBox',\n borderTopWidth: 0,\n borderRightWidth: 0,\n borderBottomWidth: 0,\n borderLeftWidth: 0,\n borderTopColor: 'transparent',\n borderRightColor: 'transparent',\n borderBottomColor: 'transparent',\n borderLeftColor: 'transparent',\n borderTopStyle: 'none',\n borderRightStyle: 'none',\n borderBottomStyle: 'none',\n borderLeftStyle: 'none',\n borderTopLeftRadius: 0,\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n borderBottomLeftRadius: 0,\n width: 'auto',\n height: 'auto',\n flexGrow: 0,\n flexShrink: 1,\n flexBasis: 'auto',\n flexDirection: 'row',\n flexWrap: 'nowrap',\n order: 0,\n justifyContent: 'flexStart',\n alignItems: 'stretch',\n alignSelf: 'auto',\n alignContent: 'stretch',\n textAlign: 'inherit',\n letterSpacing: 'inherit',\n transformOrigin: 'center',\n visibility: 'inherit',\n opacity: 1,\n zIndex: 0,\n transform: null,\n translateX: 0,\n translateY: 0,\n translateZ: 0,\n scaleX: 1,\n scaleY: 1,\n scaleZ: 1,\n skewX: 0,\n skewY: 0,\n rotateX: 0,\n rotateY: 0,\n rotateZ: 0,\n rotate3d: '0, 0, 0, 0',\n perspective: 0,\n perspectiveOrigin: 'center',\n filter: null,\n boxShadow: null,\n pointerEvents: 'inherit',\n overflow: 'visible',\n mixBlendMode: 'normal',\n whiteSpace: 'inherit',\n textOverflow: 'clip',\n lineClamp: 0,\n textStrokeWidth: 'inherit',\n textStrokeColor: 'inherit',\n textStrokeOver: 'inherit',\n};\n\nconst GEOM = {\n fill: 'transparent',\n stroke: '#000',\n strokeWidth: 1,\n strokeDasharray: '',\n strokeLinecap: 'butt',\n strokeLinejoin: 'miter',\n strokeMiterlimit: 4,\n fillRule: 'nonzero',\n};\n\nlet DOM_ENTRY_SET = [];\nlet DOM_KEY_SET = [];\nObject.keys(DOM).forEach(k => {\n DOM_KEY_SET.push(k);\n let v = DOM[k];\n DOM_ENTRY_SET.push({\n k,\n v,\n });\n});\n\nlet GEOM_ENTRY_SET = [];\nlet GEOM_KEY_SET = [];\nObject.keys(GEOM).forEach(k => {\n GEOM_KEY_SET.push(k);\n let v = GEOM[k];\n GEOM_ENTRY_SET.push({\n k,\n v,\n });\n});\n\nlet INHERIT = {\n get fontFamily() {\n return inject.defaultFontFamily;\n },\n fontSize: 16,\n fontWeight: 400,\n fontStyle: 'normal',\n color: '#000',\n textAlign: 'left',\n visibility: 'visible',\n pointerEvents: 'auto',\n textStrokeColor: '#000',\n textStrokeWidth: 1,\n textStrokeOver: 'none',\n};\n\nlet INHERIT_KEY_SET = [];\nObject.keys(INHERIT).forEach(k => {\n INHERIT_KEY_SET.push(k);\n});\n\nexport default {\n DOM,\n GEOM,\n isValid(i) {\n return DOM.hasOwnProperty(i) || GEOM.hasOwnProperty(i);\n },\n DOM_KEY_SET,\n GEOM_KEY_SET,\n DOM_ENTRY_SET,\n GEOM_ENTRY_SET,\n INHERIT,\n INHERIT_KEY_SET,\n};\n","import reg from './reg';\nimport util from '../util/util';\n\nlet { isNil } = util;\n\nfunction parseFlex(style, grow, shrink, basis) {\n if(isNil(style.flexGrow)) {\n style.flexGrow = grow || 0;\n }\n if(isNil(style.flexShrink)) {\n style.flexShrink = shrink || 0;\n }\n if(isNil(style.flexBasis)) {\n style.flexBasis = basis || 0;\n }\n}\n\nfunction parseMarginPadding(style, key, list) {\n let temp = style[key];\n if(!isNil(temp)) {\n let match = temp.toString().match(/([-+]?[\\d.]+[pxremvwhina%]*)|(auto)/ig);\n if(match) {\n if(match.length === 1) {\n match[3] = match[2] = match[1] = match[0];\n }\n else if(match.length === 2) {\n match[2] = match[0];\n match[3] = match[1];\n }\n else if(match.length === 3) {\n match[3] = match[1];\n }\n list.forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = match[i];\n }\n });\n }\n }\n}\n\nfunction parseOneBorder(style, k) {\n let v = style[k];\n if(isNil(v)) {\n return;\n }\n // 后面会统一格式化处理\n if(isNil(style[k + 'Width'])) {\n let w = /\\b[\\d.]+[pxremvwhina%]*\\b/i.exec(v);\n style[k + 'Width'] = w ? w[0] : 0;\n }\n if(isNil(style[k + 'Style'])) {\n let s = /\\b(solid|dashed|dotted)\\b/i.exec(v);\n style[k + 'Style'] = s ? s[1] : 'solid';\n }\n if(isNil(style[k + 'Color'])) {\n let c = /#[0-9a-f]{3,8}/i.exec(v);\n if(c && [4, 7, 9].indexOf(c[0].length) > -1) {\n style[k + 'Color'] = c[0];\n }\n else if(/\\btransparent\\b/i.test(v)) {\n style[k + 'Color'] = 'transparent';\n }\n else {\n c = /rgba?\\s*\\(.+\\)/i.exec(v);\n style[k + 'Color'] = c ? c[0] : 'transparent';\n }\n }\n}\n\nexport default {\n margin: ['marginTop', 'marginRight', 'marginBottom', 'marginLeft'],\n padding: ['paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft'],\n border: ['borderTop', 'borderRight', 'borderBottom', 'borderLeft'],\n borderTop: ['borderTopWidth', 'borderTopStyle', 'borderTopColor'],\n borderRight: ['borderRightWidth', 'borderRightStyle', 'borderRightColor'],\n borderBottom: ['borderBottomWidth', 'borderBottomStyle', 'borderBottomColor'],\n borderLeft: ['borderLeftWidth', 'borderLeftStyle', 'borderLeftColor'],\n borderWidth: ['borderTopWidth', 'borderRightWidth', 'borderBottomWidth', 'borderLeftWidth'],\n borderColor: ['borderTopColor', 'borderRightColor', 'borderBottomColor', 'borderLeftColor'],\n borderStyle: ['borderTopStyle', 'borderRightStyle', 'borderBottomStyle', 'borderLeftStyle'],\n borderRadius: ['borderTopLeftRadius', 'borderTopRightRadius', 'borderBottomRightRadius', 'borderBottomLeftRadius'],\n background: ['backgroundColor', 'backgroundImage', 'backgroundRepeat', 'backgroundPosition'],\n backgroundPosition: ['backgroundPositionX', 'backgroundPositionY'],\n flex: ['flexGrow', 'flexShrink', 'flexBasis'],\n translate: ['translateX', 'translateY'],\n translate3d: ['translateX', 'translateY', 'translateY'],\n scale: ['scaleX', 'scaleY'],\n scale3d: ['scaleX', 'scaleY', 'scaleZ'],\n rotate: ['rotateZ'],\n skew: ['skewX', 'skewY'],\n textStroke: ['textStrokeWidth', 'textStrokeColor', 'textStrokeOver'],\n\n toFull(style, k) {\n let v = style[k];\n if(k === 'background') {\n // bg缩写多个时有color则必须是最后一个\n if(Array.isArray(v)) {\n let length = v.length;\n if(isNil(style.backgroundColor)) {\n let bgc = /^\\s*((transparent)|(#[0-9a-f]{3,8})|(rgba?\\s*\\(.+?\\)))/i.exec(v[length - 1]);\n if(bgc) {\n style.backgroundColor = bgc[0];\n v = v.slice(0, length - 1);\n }\n }\n let bgi = [];\n let bgr = [];\n let bgp = [];\n v.forEach(item => {\n if(isNil(style.backgroundImage)) {\n let gd = reg.gradient.exec(item);\n if(gd) {\n bgi.push(gd[0]);\n item = item.replace(gd[0], '');\n }\n else {\n let img = reg.img.exec(v);\n if(img) {\n bgi.push(img[0]);\n item = item.replace(img[0], '');\n }\n }\n }\n if(isNil(style.backgroundRepeat)) {\n let repeat = /(no-?)?repeat(-?[xy])?/i.exec(item);\n if(repeat) {\n bgr.push(repeat[0].toLowerCase());\n }\n }\n if(isNil(style.backgroundPosition)) {\n let position = item.match(reg.position);\n if(position) {\n bgp.push(position.join(' '));\n }\n }\n });\n if(bgi.length) {\n style.backgroundImage = bgi;\n }\n if(bgr.length) {\n style.backgroundRepeat = bgr;\n }\n if(bgp.length) {\n style.backgroundPosition = bgp;\n this.toFull(style, 'backgroundPosition');\n }\n }\n else {\n if(isNil(style.backgroundImage)) {\n let gd = reg.gradient.exec(v);\n if(gd) {\n style.backgroundImage = gd[0];\n v = v.replace(gd[0], '');\n }\n else {\n let img = reg.img.exec(v);\n if(img) {\n style.backgroundImage = img[0];\n v = v.replace(img[0], '');\n }\n }\n }\n if(isNil(style.backgroundRepeat)) {\n let repeat = /(no-?)?repeat(-?[xy])?/i.exec(v);\n if(repeat) {\n style.backgroundRepeat = repeat[0].toLowerCase();\n }\n }\n if(isNil(style.backgroundColor)) {\n let bgc = /^(transparent)|(#[0-9a-f]{3,8})|(rgba?\\s*\\(.+?\\))/i.exec(v);\n if(bgc) {\n style.backgroundColor = bgc[0];\n v = v.replace(bgc[0], '');\n }\n }\n if(isNil(style.backgroundPosition)) {\n let position = v.match(reg.position);\n if(position) {\n style.backgroundPosition = position.join(' ');\n this.toFull(style, 'backgroundPosition');\n }\n }\n }\n }\n else if(k === 'flex') {\n if(v === 'none') {\n parseFlex(style, 0, 0, 'auto');\n }\n else if(v === 'auto') {\n parseFlex(style, 1, 1, 'auto');\n }\n else if(/^[\\d.]+\\s+[\\d.]+\\s+(auto|none|content)/.test(v) || /^[\\d.]+\\s+[\\d.]+\\s+[\\d.]+[pxremvwhina%]*/.test(v)) {\n let arr = v.split(/\\s+/);\n parseFlex(style, parseFloat(arr[0]), parseFloat(arr[1]), arr[2]);\n }\n else if(/^[\\d.]+\\s+[\\d.]+$/.test(v)) {\n let arr = v.split(/\\s+/);\n parseFlex(style, parseFloat(arr[0]), parseFloat(arr[1]), 0);\n }\n else if(/^[\\d.]+\\s+[\\d.]+[pxremvwhina%]+/.test(v)) {\n let arr = v.split(/\\s+/);\n parseFlex(style, parseFloat(arr[0]), 1, arr[1]);\n }\n else if(/^[\\d.]+$/.test(v)) {\n parseFlex(style, parseFloat(v), 1, 0);\n }\n else if(/^[\\d.]+[pxremvwhina%]+/i.test(v)) {\n parseFlex(style, 1, 1, v);\n }\n else {\n parseFlex(style, 0, 1, 'auto');\n }\n }\n else if(k === 'flexFlow') {\n v = v.toString().split(/\\s+/);\n if(v.length) {\n if(isNil(style.flexDirection)) {\n }\n style.flexDirection = v[0];\n if(v.length > 1) {\n style.flexWrap = v[1];\n }\n }\n }\n else if(k === 'borderRadius') {\n // borderRadius缩写很特殊,/分隔x/y,然后上右下左4个\n v = v.toString().split('/');\n if(v.length === 1) {\n v[1] = v[0];\n }\n for(let i = 0; i < 2; i++) {\n let item = v[i].toString().split(/\\s+/);\n if(item.length === 0) {\n v[i] = [0, 0, 0, 0];\n }\n else if(item.length === 1) {\n v[i] = [item[0], item[0], item[0], item[0]];\n }\n else if(item.length === 2) {\n v[i] = [item[0], item[1], item[0], item[1]];\n }\n else if(item.length === 3) {\n v[i] = [item[0], item[1], item[2], item[1]];\n }\n else {\n v[i] = item.slice(0, 4);\n }\n }\n this[k].forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = v[0][i] + ' ' + v[1][i];\n }\n });\n }\n else if(k === 'backgroundPosition') {\n if(!Array.isArray(v)) {\n v = [v];\n }\n let isEmpty = this[k].map(k2 => isNil(style[k2]));\n v.forEach(v2 => {\n v2 = v2.toString().split(/\\s+/);\n if(v2.length === 1) {\n v2[1] = '50%';\n }\n this[k].forEach((k2, i) => {\n if(isEmpty[i]) {\n style[k2] = style[k2] || [];\n style[k2].push(v2[i]);\n }\n });\n });\n }\n else if(['translate', 'scale', 'skew'].indexOf(k) > -1) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[1] = arr[0];\n }\n this[k].forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = arr[i];\n }\n });\n }\n else if(['translate3d', 'scale3d'].indexOf(k) > -1) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[2] = arr[1] = arr[0];\n }\n else if(arr.length === 2) {\n arr[2] = k === 'scale3d' ? 1 : 0;\n }\n this[k].forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = arr[i];\n }\n });\n }\n else if(k === 'margin' || k === 'padding') {\n parseMarginPadding(style, k, this[k]);\n }\n else if(/^border((Top)|(Right)|(Bottom)|(Left))$/.test(k)) {\n parseOneBorder(style, k);\n }\n else if(k === 'textStroke') {\n let w = /(?:^|\\s)([-+]?[\\d.]+[pxremvwhina%]*)/.exec(v);\n if(w) {\n style.textStrokeWidth = w[1];\n }\n let c = /(transparent)|(#[0-9a-f]{3,8})|(rgba?\\s*\\(.+?\\))/i.exec(v);\n if(c) {\n style.textStrokeColor = c[0];\n }\n if(/\\bfill\\b/i.test(v)) {\n style.textStrokeOver = 'fill';\n }\n else {\n style.textStrokeOver = 'none';\n }\n }\n else if(this[k]) {\n this[k].forEach(k => {\n if(isNil(style[k])) {\n style[k] = v;\n }\n });\n }\n return style;\n }\n};\n","import enums from '../util/enums';\n\nconst { STYLE_KEY } = enums;\n\nconst KEY_COLOR = [\n [STYLE_KEY.BACKGROUND_COLOR],\n [STYLE_KEY.BORDER_BOTTOM_COLOR],\n [STYLE_KEY.BORDER_LEFT_COLOR],\n [STYLE_KEY.BORDER_RIGHT_COLOR],\n [STYLE_KEY.BORDER_TOP_COLOR],\n [STYLE_KEY.COLOR],\n [STYLE_KEY.TEXT_STROKE_COLOR],\n];\n\nconst KEY_LENGTH = [\n [STYLE_KEY.FONT_SIZE],\n [STYLE_KEY.BORDER_BOTTOM_WIDTH],\n [STYLE_KEY.BORDER_LEFT_WIDTH],\n [STYLE_KEY.BORDER_RIGHT_WIDTH],\n [STYLE_KEY.BORDER_TOP_WIDTH],\n [STYLE_KEY.LEFT],\n [STYLE_KEY.TOP],\n [STYLE_KEY.RIGHT],\n [STYLE_KEY.BOTTOM],\n [STYLE_KEY.FLEX_BASIS],\n [STYLE_KEY.WIDTH],\n [STYLE_KEY.HEIGHT],\n [STYLE_KEY.LINE_HEIGHT],\n [STYLE_KEY.MARGIN_BOTTOM],\n [STYLE_KEY.MARGIN_LEFT],\n [STYLE_KEY.MARGIN_TOP],\n [STYLE_KEY.MARGIN_RIGHT],\n [STYLE_KEY.PADDING_TOP],\n [STYLE_KEY.PADDING_RIGHT],\n [STYLE_KEY.PADDING_BOTTOM],\n [STYLE_KEY.PADDING_LEFT],\n [STYLE_KEY.STROKE_WIDTH],\n [STYLE_KEY.STROKE_MITERLIMIT],\n [STYLE_KEY.LETTER_SPACING],\n [STYLE_KEY.PERSPECTIVE],\n [STYLE_KEY.TEXT_STROKE_WIDTH],\n];\n\nconst KEY_GRADIENT = [\n [STYLE_KEY.BACKGROUND_IMAGE],\n [STYLE_KEY.FILL],\n [STYLE_KEY.STROKE],\n];\n\nconst KEY_RADIUS = [\n [STYLE_KEY.BORDER_TOP_LEFT_RADIUS],\n [STYLE_KEY.BORDER_TOP_RIGHT_RADIUS],\n [STYLE_KEY.BORDER_BOTTOM_RIGHT_RADIUS],\n [STYLE_KEY.BORDER_BOTTOM_LEFT_RADIUS],\n];\n\nconst COLOR_HASH = {};\nKEY_COLOR.forEach(k => {\n COLOR_HASH[k] = true;\n});\n\nconst LENGTH_HASH = {};\nKEY_LENGTH.forEach(k => {\n LENGTH_HASH[k] = true;\n});\n\nconst RADIUS_HASH = {};\nKEY_RADIUS.forEach(k => {\n RADIUS_HASH[k] = true;\n});\n\nconst GRADIENT_HASH = {};\nKEY_GRADIENT.forEach(k => {\n GRADIENT_HASH[k] = true;\n});\n\nconst GRADIENT_TYPE = {\n linear: true,\n radial: true,\n conic: true,\n};\n\nconst KEY_EXPAND = [\n [STYLE_KEY.TRANSLATE_X],\n [STYLE_KEY.TRANSLATE_Y],\n [STYLE_KEY.TRANSLATE_Z],\n [STYLE_KEY.SKEW_X],\n [STYLE_KEY.SKEW_Y],\n [STYLE_KEY.SCALE_X],\n [STYLE_KEY.SCALE_Y],\n [STYLE_KEY.SCALE_Z],\n [STYLE_KEY.ROTATE_X],\n [STYLE_KEY.ROTATE_Y],\n [STYLE_KEY.ROTATE_Z],\n];\n\nconst EXPAND_HASH = {};\nKEY_EXPAND.forEach(k => {\n EXPAND_HASH[k] = true;\n});\n\nexport default {\n KEY_COLOR,\n KEY_EXPAND,\n KEY_GRADIENT,\n KEY_LENGTH,\n KEY_RADIUS,\n COLOR_HASH,\n EXPAND_HASH,\n GRADIENT_HASH,\n LENGTH_HASH,\n RADIUS_HASH,\n GRADIENT_TYPE,\n};\n","import reset from '../style/reset';\nimport enums from '../util/enums';\n\nconst { DOM: RESET_DOM, GEOM: RESET_GEOM } = reset;\nconst { STYLE_KEY } = enums;\n\nconst GEOM = {};\nconst GEOM_KEY_SET = [];\nconst IGNORE = {\n [STYLE_KEY.POINTER_EVENTS]: true,\n};\nconst REPAINT = {\n [STYLE_KEY.TRANSFORM]: true,\n [STYLE_KEY.TRANSLATE_X]: true,\n [STYLE_KEY.TRANSLATE_Y]: true,\n [STYLE_KEY.SKEW_X]: true,\n [STYLE_KEY.SKEW_Y]: true,\n [STYLE_KEY.SCALE_X]: true,\n [STYLE_KEY.SCALE_Y]: true,\n [STYLE_KEY.ROTATE_Z]: true,\n [STYLE_KEY.COLOR]: true,\n [STYLE_KEY.FONT_STYLE]: true,\n [STYLE_KEY.STROKE_WIDTH]: true,\n [STYLE_KEY.FILL]: true,\n [STYLE_KEY.STROKE_DASHARRAY]: true,\n [STYLE_KEY.STROKE_LINECAP]: true,\n [STYLE_KEY.STROKE_LINEJOIN]: true,\n [STYLE_KEY.STROKE_MITERLIMIT]: true,\n [STYLE_KEY.BACKGROUND_COLOR]: true,\n [STYLE_KEY.BACKGROUND_IMAGE]: true,\n [STYLE_KEY.BACKGROUND_POSITION_X]: true,\n [STYLE_KEY.BACKGROUND_POSITION_Y]: true,\n [STYLE_KEY.BACKGROUND_REPEAT]: true,\n [STYLE_KEY.BACKGROUND_SIZE]: true,\n [STYLE_KEY.STROKE]: true,\n [STYLE_KEY.BORDER_BOTTOM_COLOR]: true,\n [STYLE_KEY.BORDER_LEFT_COLOR]: true,\n [STYLE_KEY.BORDER_RIGHT_COLOR]: true,\n [STYLE_KEY.BORDER_TOP_COLOR]: true,\n [STYLE_KEY.BORDER_TOP_LEFT_RADIUS]: true,\n [STYLE_KEY.BORDER_TOP_RIGHT_RADIUS]: true,\n [STYLE_KEY.BORDER_BOTTOM_RIGHT_RADIUS]: true,\n [STYLE_KEY.BORDER_BOTTOM_LEFT_RADIUS]: true,\n [STYLE_KEY.VISIBILITY]: true,\n [STYLE_KEY.OPACITY]: true,\n [STYLE_KEY.Z_INDEX]: true,\n [STYLE_KEY.FILTER]: true,\n [STYLE_KEY.BOX_SHADOW]: true,\n [STYLE_KEY.OVERFLOW]: true,\n [STYLE_KEY.BACKGROUND_CLIP]: true,\n [STYLE_KEY.TEXT_STROKE_WIDTH]: true,\n [STYLE_KEY.TEXT_STROKE_COLOR]: true,\n [STYLE_KEY.TEXT_STROKE_OVER]: true,\n};\n\nlet o = {\n GEOM,\n GEOM_KEY_SET,\n IGNORE,\n REPAINT,\n addGeom(tagName, ks, cb) {\n if(Array.isArray(ks)) {\n ks.forEach(k => {\n o.addGeom(tagName, k, cb);\n });\n }\n else if(ks) {\n if(!GEOM.hasOwnProperty(ks)) {\n GEOM_KEY_SET.push(ks);\n }\n let hash = GEOM[ks] = GEOM[ks] || {};\n hash[tagName] = cb || true;\n }\n },\n isIgnore(k) {\n return IGNORE.hasOwnProperty(k);\n },\n isGeom(tagName, k) {\n return tagName && k && GEOM.hasOwnProperty(k) && GEOM[k].hasOwnProperty(tagName);\n },\n isRepaint(k, tagName) {\n return REPAINT.hasOwnProperty(k) || o.isGeom(tagName, k);\n },\n isValid(tagName, k) {\n if(!k) {\n return false;\n }\n if(RESET_DOM.hasOwnProperty(k)) {\n return true;\n }\n // geom的fill等矢量才有的样式\n if(tagName.charAt(0) === '$' && RESET_GEOM.hasOwnProperty(k)) {\n return true;\n }\n if(GEOM.hasOwnProperty(k)) {\n return GEOM[k].hasOwnProperty(tagName);\n }\n if(k === 'translatePath') {\n return true;\n }\n return false;\n },\n};\n\no.addGeom('$line', ['x1', 'y1', 'x2', 'y2', 'controlA', 'controlB', 'start', 'end']);\no.addGeom('$circle', ['r']);\no.addGeom('$ellipse', ['rx', 'ry']);\no.addGeom('$rect', ['rx', 'ry']);\no.addGeom('$sector', ['begin', 'end', 'edge', 'closure']);\no.addGeom('$polyline', ['points', 'controls', 'start', 'end']);\no.addGeom('$polygon', ['points', 'controls', 'start', 'end', 'booleanOperations']);\n\nexport default o;\n","import unit from './unit';\nimport font from './font';\nimport gradient from './gradient';\nimport reg from './reg';\nimport reset from './reset';\nimport abbr from './abbr';\nimport enums from '../util/enums';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport key from '../animate/key';\nimport change from '../refresh/change';\n\nconst { STYLE_KEY, STYLE_RV_KEY, style2Upper, STYLE_KEY: {\n POSITION,\n WIDTH,\n HEIGHT,\n TRANSLATE_X,\n TRANSLATE_Y,\n TRANSLATE_Z,\n SCALE_X,\n SCALE_Y,\n SCALE_Z,\n SKEW_X,\n SKEW_Y,\n ROTATE_X,\n ROTATE_Y,\n ROTATE_Z,\n ROTATE_3D,\n PERSPECTIVE,\n PERSPECTIVE_ORIGIN,\n TRANSFORM,\n TRANSFORM_ORIGIN,\n BACKGROUND_IMAGE,\n BACKGROUND_COLOR,\n BACKGROUND_POSITION_X,\n BACKGROUND_POSITION_Y,\n BACKGROUND_SIZE,\n OPACITY,\n Z_INDEX,\n COLOR,\n FONT_SIZE,\n FONT_FAMILY,\n FONT_WEIGHT,\n FONT_STYLE,\n LINE_HEIGHT,\n TEXT_ALIGN,\n FILTER,\n VISIBILITY,\n BOX_SHADOW,\n POINTER_EVENTS,\n FILL,\n STROKE,\n STROKE_WIDTH,\n STROKE_DASHARRAY,\n BORDER_TOP_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_LEFT_WIDTH,\n DISPLAY,\n FLEX_DIRECTION,\n FLEX_GROW,\n FLEX_SHRINK,\n FLEX_BASIS,\n JUSTIFY_CONTENT,\n ALIGN_SELF,\n ALIGN_ITEMS,\n MATRIX,\n LETTER_SPACING,\n BACKGROUND_CLIP,\n WHITE_SPACE,\n TEXT_OVERFLOW,\n LINE_CLAMP,\n ORDER,\n FLEX_WRAP,\n ALIGN_CONTENT,\n TRANSLATE_PATH,\n TEXT_STROKE_COLOR,\n TEXT_STROKE_WIDTH,\n TEXT_STROKE_OVER,\n OVERFLOW,\n} } = enums;\nconst { AUTO, PX, PERCENT, NUMBER, INHERIT, DEG, RGBA, STRING, REM, VW, VH, VMAX, VMIN, calUnit } = unit;\nconst { isNil, rgba2int, equalArr } = util;\nconst { MEASURE_KEY_SET, isGeom, GEOM, GEOM_KEY_SET } = change;\n\nconst {\n COLOR_HASH,\n LENGTH_HASH,\n RADIUS_HASH,\n GRADIENT_HASH,\n EXPAND_HASH,\n GRADIENT_TYPE,\n} = key;\n\nconst TRANSFORM_HASH = {\n translateX: TRANSLATE_X,\n translateY: TRANSLATE_Y,\n translateZ: TRANSLATE_Z,\n scaleX: SCALE_X,\n scaleY: SCALE_Y,\n scaleZ: SCALE_Z,\n skewX: SKEW_X,\n skewY: SKEW_Y,\n rotateX: ROTATE_X,\n rotateY: ROTATE_Y,\n rotateZ: ROTATE_Z,\n rotate: ROTATE_Z,\n};\n\nfunction compatibleTransform(k, arr) {\n if(k === SCALE_X || k === SCALE_Y || k === SCALE_Z) {\n arr[1] = NUMBER;\n }\n else if(k === TRANSLATE_X || k === TRANSLATE_Y || k === TRANSLATE_Z) {\n if(arr[1] === NUMBER) {\n arr[1] = PX;\n }\n }\n else if(k === PERSPECTIVE) {\n if([NUMBER, PERCENT, DEG].indexOf(arr[1]) > -1) {\n arr[1] = PX;\n }\n }\n else {\n if(arr[1] === NUMBER) {\n arr[1] = DEG;\n }\n }\n}\n\n/**\n * 将传入的手写style标准化,并且用reset默认值覆盖其中为空的\n * @param style 手写的style样式\n * @param reset 默认样式,可选\n * @returns Object 标准化的枚举数组结构样式\n */\nfunction normalize(style, reset = []) {\n if(!util.isObject(style)) {\n return {};\n }\n let res = {};\n // style只有单层无需深度clone\n style = util.extend({}, style);\n // 缩写提前处理,因为reset里没有缩写\n let temp = style.border;\n if(temp) {\n abbr.toFull(style, 'border');\n }\n ['borderTop', 'borderRight', 'borderBottom', 'borderLeft'].forEach(k => {\n abbr.toFull(style, k);\n });\n temp = style.borderWidth;\n if(temp) {\n abbr.toFull(style, 'borderWidth');\n }\n temp = style.borderColor;\n if(temp) {\n abbr.toFull(style, 'borderColor');\n }\n temp = style.borderStyle;\n if(temp) {\n abbr.toFull(style, 'borderStyle');\n }\n temp = style.borderRadius;\n if(temp) {\n abbr.toFull(style, 'borderRadius');\n }\n temp = style.background;\n // 处理渐变背景缩写\n if(temp) {\n abbr.toFull(style, 'background');\n }\n // 背景位置\n temp = style.backgroundPosition;\n if(!isNil(temp)) {\n abbr.toFull(style, 'backgroundPosition');\n }\n // flex\n temp = style.flex;\n if(temp) {\n abbr.toFull(style, 'flex');\n }\n // flex-flow\n temp = style.flexFlow;\n if(temp) {\n abbr.toFull(style, 'flexFlow');\n }\n temp = style.margin;\n if(!isNil(temp)) {\n abbr.toFull(style, 'margin');\n }\n temp = style.padding;\n if(!isNil(temp)) {\n abbr.toFull(style, 'padding');\n }\n temp = style.textStroke;\n if(temp) {\n abbr.toFull(style, 'textStroke');\n }\n temp = style.rotate3d;\n if(temp) {\n abbr.toFull(style, 'rotate3d');\n }\n // 扩展css,将transform几个值拆分为独立的css为动画准备,同时不能使用transform\n ['translate', 'scale', 'skew', 'translate3d', 'scale3d', 'rotate'].forEach(k => {\n temp = style[k];\n if(!isNil(temp)) {\n abbr.toFull(style, k);\n }\n });\n // 扩展的不能和transform混用,给出警告\n [\n 'translateX',\n 'translateY',\n 'translateZ',\n 'scaleX',\n 'scaleY',\n 'scaleZ',\n 'skewX',\n 'skewY',\n 'rotateX',\n 'rotateY',\n 'rotateZ',\n 'rotate3d',\n ].forEach(k => {\n let v = style[k];\n if(v !== undefined && style.transform) {\n inject.warn(`Can not use expand style \"${k}\" with transform`);\n }\n });\n // 默认reset,根据传入不同,当style为空时覆盖\n reset.forEach(item => {\n let { k, v } = item;\n if(isNil(style[k])) {\n style[k] = v;\n }\n });\n // 背景图\n temp = style.backgroundImage;\n if(temp !== undefined) {\n if(!temp) {\n res[BACKGROUND_IMAGE] = [null];\n }\n else if(Array.isArray(temp)) {\n res[BACKGROUND_IMAGE] = temp.map(item => {\n if(!item) {\n return null;\n }\n if(reg.gradient.test(item)) {\n return gradient.parseGradient(item);\n }\n if(reg.img.test(item)) {\n return reg.img.exec(item)[2];\n }\n return null;\n });\n }\n // 区分是渐变色还是图\n else if(reg.gradient.test(temp)) {\n res[BACKGROUND_IMAGE] = [gradient.parseGradient(temp)];\n }\n else if(reg.img.test(temp)) {\n res[BACKGROUND_IMAGE] = [reg.img.exec(temp)[2]];\n }\n else {\n res[BACKGROUND_IMAGE] = [null];\n }\n }\n temp = style.backgroundColor;\n if(temp !== undefined) {\n temp = temp || 'transparent';\n // 先赋值默认透明,后续操作有合法值覆盖\n let bgc = /^#[0-9a-f]{3,8}/i.exec(temp);\n if(bgc && [4, 7, 9].indexOf(bgc[0].length) > -1) {\n res[BACKGROUND_COLOR] = [rgba2int(bgc[0]), RGBA];\n }\n else {\n bgc = /rgba?\\s*\\(.+\\)/i.exec(temp);\n res[BACKGROUND_COLOR] = [rgba2int(bgc ? bgc[0] : [0, 0, 0, 0]), RGBA];\n }\n }\n ['backgroundPositionX', 'backgroundPositionY'].forEach((k, i) => {\n temp = style[k];\n if(temp !== undefined) {\n temp = temp || 0;\n k = i ? BACKGROUND_POSITION_Y : BACKGROUND_POSITION_X;\n if(!Array.isArray(temp)) {\n temp = [temp];\n }\n res[k] = temp.map(item => {\n if(/^[-+]?[\\d.]/.test(item)) {\n let v = calUnit(item);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n return v;\n }\n else {\n return [\n {\n top: 0,\n left: 0,\n center: 50,\n right: 100,\n bottom: 100,\n }[item] || 0,\n PERCENT,\n ];\n }\n });\n }\n });\n // 背景尺寸\n temp = style.backgroundSize;\n if(temp !== undefined) {\n if(!Array.isArray(temp)) {\n temp = [temp];\n }\n res[BACKGROUND_SIZE] = temp.map(item => {\n if(!item) {\n return [\n [0, AUTO],\n [0, AUTO],\n ];\n }\n let match = item.toString().match(/\\b(?:([-+]?[\\d.]+[pxremvwhina%]*)|(contain|cover|auto))/ig);\n if(match) {\n if(match.length === 1) {\n if(match[0] === 'contain' || match[0] === 'cover') {\n match[1] = match[0];\n }\n else {\n match[1] = 'auto';\n }\n }\n let v = [];\n for(let i = 0; i < 2; i++) {\n let item = match[i];\n if(/^[-+]?[\\d.]/.test(item)) {\n let n = calUnit(item);\n if([NUMBER, DEG].indexOf(n[1]) > -1) {\n n[1] = PX;\n }\n v.push(n);\n }\n else if(item === 'contain' || item === 'cover') {\n v.push([item, STRING]);\n }\n else {\n v.push([0, AUTO]);\n }\n }\n return v;\n }\n else {\n return [\n [0, AUTO],\n [0, AUTO],\n ];\n }\n });\n }\n // border-color\n ['Top', 'Right', 'Bottom', 'Left'].forEach(k => {\n k = 'border' + k + 'Color';\n let v = style[k];\n if(v !== undefined) {\n res[STYLE_KEY[style2Upper(k)]] = [rgba2int(v || 'transparent'), RGBA];\n }\n });\n // border-radius\n ['TopLeft', 'TopRight', 'BottomRight', 'BottomLeft'].forEach(k => {\n k = 'border' + k + 'Radius';\n let v = style[k];\n if(v !== undefined) {\n v = v || 0;\n let arr = v.toString().split(/\\s+/);\n if(arr.length === 1) {\n arr[1] = arr[0];\n }\n for(let i = 0; i < 2; i++) {\n let item = arr[i];\n if(/^[-+]?[\\d.]/.test(item)) {\n let n = calUnit(item);\n if([NUMBER, DEG].indexOf(n[1]) > -1) {\n n[1] = PX;\n }\n if(n[0] < 0) {\n n[0] = 0;\n }\n arr[i] = n;\n }\n else {\n arr[i] = [0, PX];\n }\n }\n res[STYLE_KEY[style2Upper(k)]] = arr;\n }\n });\n temp = style.transform;\n if(temp === null) {\n res[TRANSFORM] = null;\n }\n else if(temp !== undefined) {\n let transform = res[TRANSFORM] = [];\n let match = (temp || '').toString().match(/\\w+\\(.+?\\)/g);\n if(match) {\n match.forEach(item => {\n let i = item.indexOf('(');\n let k = item.slice(0, i);\n let v = item.slice(i + 1, item.length - 1);\n if(k === 'matrix') {\n let arr = v.toString().split(/\\s*,\\s*/);\n arr = arr.map(item => parseFloat(item));\n if(arr.length > 6) {\n arr = arr.slice(0, 6);\n }\n if(arr.length === 6) {\n transform.push([MATRIX, [\n arr[0], arr[1], 0, 0, arr[2], arr[3], 0, 0, 0, 0, 1, 0, arr[4], arr[5], 0, 1,\n ]]);\n }\n }\n else if(k === 'matrix3d') {\n let arr = v.toString().split(/\\s*,\\s*/);\n arr = arr.map(item => parseFloat(item));\n if(arr.length > 16) {\n arr = arr.slice(0, 16);\n }\n if(arr.length === 16) {\n transform.push([MATRIX, arr]);\n }\n }\n else if(k === 'perspective') {\n let arr = calUnit(v);\n if(arr[0] < 0) {\n arr[0] = 0;\n }\n compatibleTransform(PERSPECTIVE, arr);\n transform.push([PERSPECTIVE, arr]);\n }\n else if(k === 'rotate3d') {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 4) {\n let deg = calUnit(arr[3]);\n compatibleTransform(ROTATE_3D, deg);\n arr[0] = parseFloat(arr[0].replace('(', ''));\n arr[1] = parseFloat(arr[1]);\n arr[2] = parseFloat(arr[2]);\n arr[3] = deg;\n transform.push([ROTATE_3D, arr]);\n }\n }\n else if(TRANSFORM_HASH.hasOwnProperty(k)) {\n let k2 = TRANSFORM_HASH[k];\n let arr = calUnit(v);\n compatibleTransform(k2, arr);\n transform.push([k2, arr]);\n }\n else if({ translate: true, scale: true, skew: true }.hasOwnProperty(k)) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[1] = k === 'scale' ? arr[0] : [0];\n }\n if(arr.length === 2) {\n let k1 = STYLE_KEY[style2Upper(k + 'X')];\n let k2 = STYLE_KEY[style2Upper(k + 'Y')];\n let arr1 = calUnit(arr[0]);\n let arr2 = calUnit(arr[1]);\n compatibleTransform(k1, arr1);\n compatibleTransform(k2, arr2);\n transform.push([k1, arr1]);\n transform.push([k2, arr2]);\n }\n }\n else if({ translate3d: true, scale3d: true }.hasOwnProperty(k)) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[1] = k === 'scale3d' ? [1] : [0];\n arr[2] = k === 'scale3d' ? [1] : [0];\n }\n else if(arr.length === 2) {\n arr[2] = k === 'scale3d' ? [1] : [0];\n }\n if(arr.length === 3) {\n let k1 = STYLE_KEY[style2Upper(k + 'X')];\n let k2 = STYLE_KEY[style2Upper(k + 'Y')];\n let k3 = STYLE_KEY[style2Upper(k + 'Z')];\n let arr1 = calUnit(arr[0]);\n let arr2 = calUnit(arr[1]);\n let arr3 = calUnit(arr[2]);\n compatibleTransform(k1, arr1);\n compatibleTransform(k2, arr2);\n compatibleTransform(k3, arr3);\n transform.push([k1, arr1]);\n transform.push([k2, arr2]);\n transform.push([k3, arr3]);\n }\n }\n });\n }\n }\n temp = style.perspective;\n if(temp !== undefined) {\n let arr = calUnit(temp || 0);\n if(arr[0] < 0) {\n arr[0] = 0;\n }\n compatibleTransform(PERSPECTIVE, arr);\n res[PERSPECTIVE] = arr;\n }\n ['perspectiveOrigin', 'transformOrigin'].forEach(k => {\n temp = style[k];\n if(temp !== undefined) {\n if(temp === null) {\n temp = '';\n }\n let arr = res[STYLE_KEY[style2Upper(k)]] = [];\n let match = temp.toString().match(reg.position);\n if(match) {\n if(match.length === 1) {\n match[1] = match[0];\n }\n for(let i = 0; i < 2; i++) {\n let item = match[i];\n if(/^[-+]?[\\d.]/.test(item)) {\n let n = calUnit(item);\n if([NUMBER, DEG].indexOf(n[1]) > -1) {\n n[1] = PX;\n }\n arr.push(n);\n }\n else {\n arr.push([\n {\n top: 0,\n left: 0,\n center: 50,\n right: 100,\n bottom: 100,\n }[item],\n PERCENT,\n ]);\n // 不规范的写法变默认值50%\n if(isNil(arr[i][0])) {\n arr[i][0] = 50;\n }\n }\n }\n }\n else {\n arr.push([50, PERCENT]);\n arr.push([50, PERCENT]);\n }\n }\n });\n [\n 'translateX',\n 'translateY',\n 'translateZ',\n 'scaleX',\n 'scaleY',\n 'scaleZ',\n 'skewX',\n 'skewY',\n 'rotateX',\n 'rotateY',\n 'rotateZ',\n 'rotate',\n ].forEach(k => {\n let v = style[k];\n if(v === undefined) {\n return;\n }\n if(v === null) {\n if(k.indexOf('scale') === 0) {\n v = 1;\n }\n else {\n v = 0;\n }\n }\n let k2 = TRANSFORM_HASH[k];\n let n = calUnit(v);\n // 没有单位或默认值处理单位\n compatibleTransform(k2, n);\n res[k2] = n;\n });\n temp = style.rotate3d;\n if(temp !== undefined) {\n let arr = (temp || '').toString().split(/\\s*,\\s*/);\n if(arr.length === 4) {\n let deg = calUnit(arr[3]);\n compatibleTransform(ROTATE_3D, deg);\n arr[0] = parseFloat(arr[0].replace('(', ''));\n arr[1] = parseFloat(arr[1]);\n arr[2] = parseFloat(arr[2]);\n arr[3] = deg;\n }\n res[ROTATE_3D] = arr;\n }\n temp = style.opacity;\n if(temp !== undefined) {\n if(temp === null) {\n temp = 1;\n }\n temp = parseFloat(temp);\n if(!isNaN(temp)) {\n temp = Math.max(temp, 0);\n temp = Math.min(temp, 1);\n res[OPACITY] = temp;\n }\n else {\n res[OPACITY] = 1;\n }\n }\n temp = style.zIndex;\n if(temp !== undefined) {\n res[Z_INDEX] = parseInt(temp) || 0;\n }\n // 转化不同单位值为对象标准化,不写单位的变成number单位转化为px\n [\n 'marginTop',\n 'marginRight',\n 'marginBottom',\n 'marginLeft',\n 'paddingTop',\n 'paddingRight',\n 'paddingBottom',\n 'paddingLeft',\n 'borderTopWidth',\n 'borderRightWidth',\n 'borderBottomWidth',\n 'borderLeftWidth',\n 'top',\n 'right',\n 'bottom',\n 'left',\n 'width',\n 'height',\n ].forEach(k => {\n let v = style[k];\n if(v === undefined) {\n return;\n }\n if(v === 'auto') {\n v = [0, AUTO];\n }\n else {\n v = calUnit(v || 0);\n // 无单位视为px\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n }\n let k2 = STYLE_KEY[style2Upper(k)];\n res[k2] = v;\n // 限制padding/border为正数\n if({\n paddingTop: true,\n paddingRight: true,\n paddingBottom: true,\n paddingLeft: true,\n borderTopWidth: true,\n borderRightWidth: true,\n borderBottomWidth: true,\n borderLeftWidth: true,\n width: true,\n height: true,\n }.hasOwnProperty(k) && v[0] < 0) {\n v[0] = 0;\n }\n });\n temp = style.flexBasis;\n if(temp !== undefined) {\n if(temp === 'content') {\n res[FLEX_BASIS] = [temp, STRING];\n }\n else if(/^[\\d.]/.test(temp)) {\n let v = res[FLEX_BASIS] = calUnit(temp);\n v[0] = Math.max(v[0], 0);\n // 无单位视为px\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n }\n else {\n res[FLEX_BASIS] = [0, AUTO];\n }\n }\n temp = style.order;\n if(temp !== undefined) {\n res[ORDER] = parseInt(temp) || 0;\n }\n temp = style.color;\n if(temp !== undefined) {\n if(temp === 'inherit') {\n res[COLOR] = [[], INHERIT];\n }\n else {\n res[COLOR] = [rgba2int(temp), RGBA];\n }\n }\n temp = style.textStrokeColor;\n if(temp !== undefined) {\n if(temp === 'inherit') {\n res[TEXT_STROKE_COLOR] = [[], INHERIT];\n }\n else {\n res[TEXT_STROKE_COLOR] = [rgba2int(temp), RGBA];\n }\n }\n temp = style.fontSize;\n if(temp !== undefined) {\n if(temp === 'inherit') {\n res[FONT_SIZE] = [0, INHERIT];\n }\n else {\n let v = calUnit(temp);\n // fontSize不能为负数,否则为继承\n if(v < 0) {\n res[FONT_SIZE] = [0, INHERIT];\n }\n else {\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n res[FONT_SIZE] = v;\n }\n }\n }\n temp = style.textStrokeWidth;\n if(temp !== undefined) {\n if(temp === 'inherit') {\n res[TEXT_STROKE_WIDTH] = [0, INHERIT];\n }\n else {\n let v = calUnit(temp);\n // textStrokeWidth不能为负数,否则为继承\n if(v < 0) {\n res[TEXT_STROKE_WIDTH] = [0, INHERIT];\n }\n else {\n if([NUMBER, DEG, PERCENT].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n res[TEXT_STROKE_WIDTH] = v;\n }\n }\n }\n temp = style.textStrokeOver;\n if(temp !== undefined) {\n if(temp === null || temp === 'inherit') {\n res[TEXT_STROKE_OVER] = [0, INHERIT];\n }\n else {\n let v = temp.toString();\n if(v !== 'none' && v !== 'fill') {\n v = 'none';\n }\n res[TEXT_STROKE_OVER] = [v, STRING];\n }\n }\n temp = style.fontWeight;\n if(temp !== undefined) {\n if(temp === 'bold') {\n res[FONT_WEIGHT] = [700, NUMBER];\n }\n else if(temp === 'normal') {\n res[FONT_WEIGHT] = [400, NUMBER];\n }\n else if(temp === 'lighter') {\n res[FONT_WEIGHT] = [200, NUMBER];\n }\n else if(temp === 'inherit') {\n res[FONT_WEIGHT] = [0, INHERIT];\n }\n else {\n res[FONT_WEIGHT] = [Math.max(0, parseInt(temp)) || 400, NUMBER];\n }\n }\n temp = style.fontStyle;\n if(temp !== undefined) {\n if(temp === null || temp === 'inherit') {\n res[FONT_STYLE] = [0, INHERIT];\n }\n else {\n res[FONT_STYLE] = [temp, STRING];\n }\n }\n temp = style.fontFamily;\n if(temp !== undefined) {\n if(temp === null || temp === 'inherit') {\n res[FONT_FAMILY] = [0, INHERIT];\n }\n else {\n // 统一文字声明格式\n res[FONT_FAMILY] = [temp.toString().toLowerCase().replace(/['\"]/, '').replace(/\\s*,\\s*/g, ','), STRING];\n }\n }\n temp = style.textAlign;\n if(temp !== undefined) {\n if(temp === null || temp === 'inherit') {\n res[TEXT_ALIGN] = [0, INHERIT];\n }\n else {\n res[TEXT_ALIGN] = [temp, STRING];\n }\n }\n temp = style.lineHeight;\n if(temp !== undefined) {\n if(temp === 'inherit') {\n res[LINE_HEIGHT] = [0, INHERIT];\n }\n else if(temp === 'normal') {\n res[LINE_HEIGHT] = [0, AUTO];\n }\n // lineHeight默认数字,想要px必须强制带单位\n else if(/^[\\d.]+/i.test(temp)) {\n let v = calUnit(temp);\n if([DEG].indexOf(v[1]) > -1) {\n v[1] = NUMBER;\n }\n res[LINE_HEIGHT] = v;\n }\n else {\n let n = Math.max(0, parseFloat(temp)) || 'normal';\n // 非法数字\n if(n === 'normal') {\n res[LINE_HEIGHT] = [null, AUTO];\n }\n else {\n res[LINE_HEIGHT] = [n, NUMBER];\n }\n }\n }\n temp = style.letterSpacing;\n if(temp !== undefined) {\n if(temp === null || temp === 'inherit') {\n res[LETTER_SPACING] = [0, INHERIT];\n }\n else if(temp === 'normal') {\n res[LETTER_SPACING] = [0, PX];\n }\n else if(/^[-+]?[\\d.]/.test(temp)) {\n let v = calUnit(temp);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n res[LETTER_SPACING] = v;\n }\n else {\n res[LETTER_SPACING] = [parseFloat(temp) || 0, PX];\n }\n }\n temp = style.whiteSpace;\n if(temp !== undefined) {\n if(temp === null || temp === 'inherit') {\n res[WHITE_SPACE] = [0, INHERIT];\n }\n else {\n res[WHITE_SPACE] = [temp, STRING];\n }\n }\n temp = style.lineClamp;\n if(temp !== undefined) {\n temp = parseInt(temp) || 0;\n res[LINE_CLAMP] = Math.max(0, temp);\n }\n // fill和stroke为渐变时特殊处理,fillRule无需处理字符串\n temp = style.fill;\n if(temp !== undefined) {\n if(!temp) {\n res[FILL] = ['none'];\n }\n else if(Array.isArray(temp)) {\n if(temp.length) {\n res[FILL] = temp.map(item => {\n if(!item) {\n return 'none';\n }\n else if(reg.gradient.test(item)) {\n return gradient.parseGradient(item);\n }\n else {\n return rgba2int(item);\n }\n });\n }\n else {\n res[FILL] = ['none'];\n }\n }\n else if(reg.gradient.test(temp)) {\n res[FILL] = [gradient.parseGradient(temp)];\n }\n else {\n res[FILL] = [rgba2int(temp)];\n }\n }\n temp = style.stroke;\n if(temp !== undefined) {\n if(!temp) {\n res[STROKE] = ['none'];\n }\n else if(Array.isArray(temp)) {\n if(temp.length) {\n res[STROKE] = temp.map(item => {\n if(!item) {\n return 'none';\n }\n else if(reg.gradient.test(item)) {\n return gradient.parseGradient(item);\n }\n else {\n return rgba2int(item);\n }\n });\n }\n else {\n res[STROKE] = ['none'];\n }\n }\n else if(reg.gradient.test(temp)) {\n res[STROKE] = [gradient.parseGradient(temp)];\n }\n else {\n res[STROKE] = [rgba2int(temp)];\n }\n }\n temp = style.strokeWidth;\n if(temp !== undefined) {\n if(!Array.isArray(temp)) {\n temp = [temp];\n }\n res[STROKE_WIDTH] = temp.map(item => {\n let v = calUnit(item);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n v[0] = Math.max(v[0], 0);\n return v;\n });\n }\n temp = style.strokeDasharray;\n if(temp !== undefined) {\n if(Array.isArray(temp)) {\n res[STROKE_DASHARRAY] = temp.map(item => {\n let match = (item || '').toString().match(/[\\d.]+/g);\n if(match) {\n match = match.map(item => parseFloat(item));\n if(match.length % 2 === 1) {\n match.push(match[match.length - 1]);\n }\n return match;\n }\n return [];\n });\n }\n else {\n let match = (temp || '').toString().match(/[\\d.]+/g);\n if(match) {\n match = match.map(item => parseFloat(item));\n if(match.length % 2 === 1) {\n match.push(match[match.length - 1]);\n }\n res[STROKE_DASHARRAY] = [match];\n }\n else {\n res[STROKE_DASHARRAY] = [[]];\n }\n }\n }\n temp = style.filter;\n if(temp !== undefined) {\n let match = (temp || '').toString().match(/\\b[\\w-]+\\s*\\(\\s*[-+]?[\\d.]+\\s*[pxremvwhdg%]*\\s*\\)\\s*/ig);\n let f = null;\n if(match) {\n f = [];\n match.forEach(item => {\n let m2 = /([\\w-]+)\\s*\\(\\s*([-+]?[\\d.]+\\s*[pxremvwhdg%]*)\\s*\\)\\s*/i.exec(item);\n if(m2) {\n let k = m2[1].toLowerCase(), v = calUnit(m2[2]);\n if(k === 'blur') {\n if(v[0] <= 0 || [DEG, PERCENT].indexOf(v[1]) > -1) {\n return;\n }\n if(v[1] === NUMBER) {\n v[1] = PX;\n }\n f.push([k, v]);\n }\n else if(k === 'hue-rotate') {\n if([NUMBER, DEG].indexOf(v[1]) === -1) {\n return;\n }\n v[1] = DEG;\n f.push([k, v]);\n }\n else if(k === 'saturate' || k === 'brightness' || k === 'grayscale' || k === 'contrast' || k === 'sepia' || k === 'invert') {\n if([NUMBER, PERCENT].indexOf(v[1]) === -1) {\n return;\n }\n v[0] = Math.max(v[0], 0);\n v[1] = PERCENT;\n f.push([k, v]);\n }\n }\n });\n }\n res[FILTER] = f;\n }\n temp = style.visibility;\n if(temp !== undefined) {\n if(temp === null || temp === 'inherit') {\n res[VISIBILITY] = [0, INHERIT];\n }\n else {\n res[VISIBILITY] = [temp, STRING];\n }\n }\n temp = style.pointerEvents;\n if(temp !== undefined) {\n if(temp === null || temp === 'inherit') {\n res[POINTER_EVENTS] = [0, INHERIT];\n }\n else {\n res[POINTER_EVENTS] = [temp, STRING];\n }\n }\n temp = style.boxShadow;\n if(temp !== undefined) {\n let bs = null;\n let match = (temp || '').match(/([-+]?[\\d.]+[pxremvwhina%]*)\\s*([-+]?[\\d.]+[pxremvwhina%]*)\\s*([-+]?[\\d.]+[pxremvwhina%]*\\s*)?([-+]?[\\d.]+[pxremvwhina%]*\\s*)?(((transparent)|(#[0-9a-f]{3,8})|(rgba?\\(.+?\\)))\\s*)?(inset|outset)?\\s*,?/ig);\n if(match) {\n match.forEach(item => {\n let boxShadow = /([-+]?[\\d.]+[pxremvwhina%]*)\\s*([-+]?[\\d.]+[pxremvwhina%]*)\\s*([-+]?[\\d.]+[pxremvwhina%]*\\s*)?([-+]?[\\d.]+[pxremvwhina%]*\\s*)?(?:((?:transparent)|(?:#[0-9a-f]{3,8})|(?:rgba?\\(.+\\)))\\s*)?(inset|outset)?/i.exec(item);\n if(boxShadow) {\n bs = bs || [];\n let res = [];\n // v,h,blur,spread,color,inset\n for(let i = 0; i < 4; i++) {\n let v = calUnit(boxShadow[i + 1]);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n // x/y可以负,blur和spread不行\n if(i > 1 && v[0] < 0) {\n v = 0;\n }\n res.push(v);\n }\n res.push(rgba2int(boxShadow[5]));\n res.push(boxShadow[6] || 'outset');\n bs.push(res);\n }\n });\n }\n res[BOX_SHADOW] = bs;\n }\n // 直接赋值的string类型\n [\n 'position',\n 'display',\n 'flexDirection',\n 'flexWrap',\n 'justifyContent',\n 'alignItems',\n 'alignSelf',\n 'alignContent',\n 'overflow',\n 'mixBlendMode',\n 'borderTopStyle',\n 'borderRightStyle',\n 'borderBottomStyle',\n 'borderLeftStyle',\n 'backgroundClip',\n 'textOverflow',\n ].forEach(k => {\n if(style.hasOwnProperty(k)) {\n res[STYLE_KEY[style2Upper(k)]] = style[k];\n }\n });\n // 直接赋值的number类型\n [\n 'flexGrow',\n 'flexShrink',\n ].forEach(k => {\n if(style.hasOwnProperty(k)) {\n res[STYLE_KEY[style2Upper(k)]] = Math.max(parseFloat(style[k]) || 0, 0);\n }\n });\n temp = style.zIndex;\n if(temp !== undefined) {\n res[Z_INDEX] = parseFloat(temp) || 0;\n }\n // 这些支持多个的用数组表示\n [\n 'backgroundRepeat',\n 'strokeLinecap',\n 'strokeLinejoin',\n 'strokeMiterlimit',\n 'fillRule',\n ].forEach(k => {\n if(style.hasOwnProperty(k)) {\n let v = style[k];\n res[STYLE_KEY[style2Upper(k)]] = Array.isArray(v) ? v : [v];\n }\n });\n GEOM_KEY_SET.forEach(k => {\n if(style.hasOwnProperty(k)) {\n res[k] = style[k];\n }\n });\n return res;\n}\n\n/**\n * 每次布局前需要计算的reflow相关的computedStyle,每次布局只计算一次,布局完后清除缓存标\n * @param node 对象节点\n */\nfunction computeReflow(node) {\n if(node.__hasComputeReflow) {\n return;\n }\n node.__hasComputeReflow = true;\n let { currentStyle, computedStyle, domParent: parent, root } = node;\n let rem = root.computedStyle[FONT_SIZE];\n let isRoot = !parent;\n let parentComputedStyle = parent && parent.computedStyle;\n [FONT_SIZE, FONT_FAMILY, FONT_WEIGHT].forEach(k => {\n let v = currentStyle[k];\n // ff特殊处理\n if(k === FONT_FAMILY) {\n if(v[1] === INHERIT) {\n computedStyle[k] = getFontFamily(isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : parentComputedStyle[k]);\n }\n else {\n computedStyle[k] = getFontFamily(v[0]);\n }\n }\n else if(v[1] === INHERIT) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : parentComputedStyle[k];\n }\n // 只有fontSize会有%\n else if(v[1] === PERCENT) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (parentComputedStyle[k] * v[0] * 0.01);\n }\n else if(v[1] === REM) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (node.root.computedStyle[FONT_SIZE] * v[0]);\n }\n else if(v[1] === VW) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (node.root.width * 0.01 * v[0]);\n }\n else if(v[1] === VH) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (node.root.height * 0.01 * v[0]);\n }\n else if(v[1] === VMAX) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (Math.max(node.root.width, node.root.height) * 0.01 * v[0]);\n }\n else if(v[1] === VMIN) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (Math.min(node.root.width, node.root.height) * 0.01 * v[0]);\n }\n else {\n computedStyle[k] = v[0];\n }\n });\n [\n BORDER_TOP_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_LEFT_WIDTH,\n ].forEach(k => {\n // border-width不支持百分比\n let item = currentStyle[k];\n if(item[1] === PX) {\n computedStyle[k] = item[0];\n }\n else if(item[1] === REM) {\n computedStyle[k] = item[0] * rem;\n }\n else if(item[1] === VW) {\n computedStyle[k] = item[0] * root.width * 0.01;\n }\n else if(item[1] === VH) {\n computedStyle[k] = item[0] * root.height * 0.01;\n }\n else if(item[1] === VMAX) {\n computedStyle[k] = item[0] * Math.max(root.width, root.height) * 0.01;\n }\n else if(item[1] === VMIN) {\n computedStyle[k] = item[0] * Math.min(root.width, root.height) * 0.01;\n }\n else {\n computedStyle[k] = 0;\n }\n });\n [\n POSITION,\n DISPLAY,\n FLEX_DIRECTION,\n JUSTIFY_CONTENT,\n ALIGN_ITEMS,\n ALIGN_SELF,\n FLEX_GROW,\n FLEX_SHRINK,\n LINE_CLAMP,\n ORDER,\n FLEX_WRAP,\n ALIGN_CONTENT,\n OVERFLOW,\n TEXT_OVERFLOW,\n ].forEach(k => {\n computedStyle[k] = currentStyle[k];\n });\n // 匿名块对象\n if(computedStyle[POSITION] === 'absolute' || parentComputedStyle && parentComputedStyle[DISPLAY] === 'flex') {\n if(['block', 'flex'].indexOf(computedStyle[DISPLAY]) === -1) {\n computedStyle[DISPLAY] = 'block';\n }\n }\n let textAlign = currentStyle[TEXT_ALIGN];\n if(textAlign[1] === INHERIT) {\n computedStyle[TEXT_ALIGN] = isRoot ? 'left' : parentComputedStyle[TEXT_ALIGN];\n }\n else {\n computedStyle[TEXT_ALIGN] = textAlign[0];\n }\n let fontSize = computedStyle[FONT_SIZE];\n let lineHeight = currentStyle[LINE_HEIGHT];\n // lineHeight继承很特殊,数字和normal不同于普通单位\n if(lineHeight[1] === INHERIT) {\n if(isRoot) {\n computedStyle[LINE_HEIGHT] = calNormalLineHeight(computedStyle);\n }\n else {\n let p = parent;\n let ph;\n while(p) {\n ph = p.currentStyle[LINE_HEIGHT];\n if(ph[1] !== INHERIT) {\n break;\n }\n p = p.domParent;\n }\n // 到root还是inherit或normal,或者中途遇到了normal,使用normal\n if([AUTO, INHERIT].indexOf(ph[1]) > -1) {\n computedStyle[LINE_HEIGHT] = calNormalLineHeight(computedStyle);\n }\n // 数字继承\n else if(ph[1] === NUMBER) {\n computedStyle[LINE_HEIGHT] = Math.max(ph[0], 0) * fontSize;\n }\n // 单位继承\n else {\n computedStyle[LINE_HEIGHT] = parentComputedStyle[LINE_HEIGHT];\n }\n }\n }\n // 防止为0\n else if(lineHeight[1] === PX) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0], 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === PERCENT) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * fontSize * 0.01, 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === REM) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * rem, 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === VW) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * root.width * 0.01, 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === VH) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * root.height * 0.01, 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === VMAX) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * Math.max(root.width, root.height) * 0.01, 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === VMIN) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * Math.min(root.width, root.height) * 0.01, 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === NUMBER) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0], 0) * fontSize || calNormalLineHeight(computedStyle);\n }\n // normal或auto\n else {\n computedStyle[LINE_HEIGHT] = calNormalLineHeight(computedStyle);\n }\n let letterSpacing = currentStyle[LETTER_SPACING];\n if(letterSpacing[1] === INHERIT) {\n computedStyle[LETTER_SPACING] = isRoot ? 0 : parentComputedStyle[LETTER_SPACING];\n }\n else if(letterSpacing[1] === PERCENT) {\n computedStyle[LETTER_SPACING] = fontSize * 0.01 * letterSpacing[0];\n }\n else if(letterSpacing[1] === REM) {\n computedStyle[LETTER_SPACING] = rem * letterSpacing[0];\n }\n else if(letterSpacing[1] === VW) {\n computedStyle[LETTER_SPACING] = root.width * 0.01 * letterSpacing[0];\n }\n else if(letterSpacing[1] === VH) {\n computedStyle[LETTER_SPACING] = root.height * 0.01 * letterSpacing[0];\n }\n else if(letterSpacing[1] === VMAX) {\n computedStyle[LETTER_SPACING] = Math.max(root.width, root.height) * 0.01 * letterSpacing[0];\n }\n else if(letterSpacing[1] === VMIN) {\n computedStyle[LETTER_SPACING] = Math.min(root.width, root.height) * 0.01 * letterSpacing[0];\n }\n else {\n computedStyle[LETTER_SPACING] = letterSpacing[0];\n }\n //whiteSpace\n let whiteSpace = currentStyle[WHITE_SPACE];\n if(whiteSpace[1] === INHERIT) {\n computedStyle[WHITE_SPACE] = isRoot ? 'normal' : parentComputedStyle[WHITE_SPACE];\n }\n else {\n computedStyle[WHITE_SPACE] = whiteSpace[0];\n }\n}\n\nfunction setFontStyle(style) {\n let fontSize = style[FONT_SIZE] || 0;\n let fontFamily = style[FONT_FAMILY] || inject.defaultFontFamily || 'arial';\n if(/\\s/.test(fontFamily)) {\n fontFamily = '\"' + fontFamily.replace(/\"/g, '\\\\\"') + '\"';\n }\n return (style[FONT_STYLE] || 'normal') + ' ' + (style[FONT_WEIGHT] || '400') + ' '\n + fontSize + 'px/' + fontSize + 'px ' + fontFamily;\n}\n\nfunction getFontFamily(str) {\n let ff = str.split(/\\s*,\\s*/);\n let f = inject.defaultFontFamily;\n for(let i = 0, len = ff.length; i < len; i++) {\n let fontFamily = ff[i].replace(/^['\"]/, '').replace(/['\"]$/, '');\n if(!font.hasRegister(fontFamily)) {\n continue;\n }\n if(!font.hasChecked(fontFamily)) {\n let res = inject.checkSupportFontFamily(fontFamily);\n if(font.setChecked(fontFamily, res)) {\n f = fontFamily;\n break;\n }\n }\n if(font.support(fontFamily)) {\n f = fontFamily;\n break;\n }\n }\n return f;\n}\n\nfunction getBaseline(style) {\n let fontSize = style[FONT_SIZE];\n let ff = getFontFamily(style[FONT_FAMILY]);\n let normal = fontSize * (font.info[ff] || font.info[inject.defaultFontFamily] || font.info.arial).lhr;\n return (style[LINE_HEIGHT] - normal) * 0.5 + fontSize * (font.info[ff] || font.info[inject.defaultFontFamily] || font.info.arial).blr;\n}\n\nfunction calNormalLineHeight(style) {\n let ff = getFontFamily(style[FONT_FAMILY]);\n return style[FONT_SIZE] * (font.info[ff] || font.info[inject.defaultFontFamily] || font.info.arial).lhr;\n}\n\nfunction calRelativePercent(n, parent, k) {\n n *= 0.01;\n while(parent) {\n let style = parent.currentStyle[k];\n if(style[1] === AUTO) {\n if(k === WIDTH) {\n parent = parent.domParent;\n }\n else {\n break;\n }\n }\n else if(style[1] === PX) {\n return n * style[0];\n }\n else if(style[1] === PERCENT) {\n n *= style[0] * 0.01;\n parent = parent.domParent;\n }\n else if(style[1] === REM) {\n return n * style[0] * parent.root.computedStyle[FONT_SIZE];\n }\n else if(style[1] === VW) {\n return n * style[0] * parent.root.width * 0.01;\n }\n else if(style[1] === VH) {\n return n * style[0] * parent.root.height * 0.01;\n }\n else if(style[1] === VMAX) {\n return n * style[0] * Math.max(parent.root.width, parent.root.height) * 0.01;\n }\n else if(style[1] === VMIN) {\n return n * style[0] * Math.min(parent.root.width, parent.root.height) * 0.01;\n }\n }\n return n;\n}\n\nfunction calRelative(currentStyle, k, v, parent, isWidth) {\n if(v[1] === AUTO) {\n v = 0;\n }\n else if([PX, NUMBER].indexOf(v[1]) > -1) {\n v = v[0];\n }\n else if(v[1] === PERCENT) {\n if(isWidth) {\n v = calRelativePercent(v[0], parent, WIDTH);\n }\n else {\n v = calRelativePercent(v[0], parent, HEIGHT);\n }\n }\n else if(v[1] === REM) {\n v = v[0] * parent.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * parent.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * parent.root.height * 0.01;\n }\n else if(v[1] === VMAX) {\n v = v[0] * Math.max(parent.root.width, parent.root.height) * 0.01;\n }\n else if(v[1] === VMIN) {\n v = v[0] * Math.min(parent.root.width, parent.root.height) * 0.01;\n }\n return v;\n}\n\nfunction calAbsolute(currentStyle, k, v, size, root) {\n if(v[1] === AUTO) {\n v = 0;\n }\n else if([PX, NUMBER, DEG, RGBA, STRING].indexOf(v[1]) > -1) {\n v = v[0];\n }\n else if(v[1] === PERCENT) {\n v = v[0] * size * 0.01;\n }\n else if(v[1] === REM) {\n v = v[0] * root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * root.height * 0.01;\n }\n else if(v[1] === VMAX) {\n v = v[0] * Math.max(root.width, root.height) * 0.01;\n }\n else if(v[1] === VMIN) {\n v = v[0] * Math.min(root.width, root.height) * 0.01;\n }\n return v;\n}\n\nfunction equalStyle(k, a, b, target) {\n if(!a || !b) {\n return a === b;\n }\n if(k === TRANSFORM) {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n let oa = a[i];\n let ob = b[i];\n if(oa[0] !== ob[0]) {\n return false;\n }\n // translate/matrix等都是数组\n if(!equalArr(oa[1], ob[1])) {\n return false;\n }\n }\n return true;\n }\n if(k === FILTER) {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n if(!equalArr(a[i], b[i])) {\n return false;\n }\n }\n }\n if(k === BACKGROUND_SIZE) {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n let aa = a[i], bb = b[i];\n if(aa[0][0] !== bb[0][0] || aa[0][1] !== bb[0][1] || aa[1][0] !== bb[1][0] || aa[1][1] !== bb[1][1]) {\n return false;\n }\n }\n return true;\n }\n if(k === TRANSFORM_ORIGIN || RADIUS_HASH.hasOwnProperty(k)) {\n return a[0][0] === b[0][0] && a[0][1] === b[0][1]\n && a[1][0] === b[1][0] && a[1][1] === b[1][1];\n }\n if(k === BACKGROUND_POSITION_X || k === BACKGROUND_POSITION_Y\n || LENGTH_HASH.hasOwnProperty(k) || EXPAND_HASH.hasOwnProperty(k)) {\n return a[0] === b[0] && a[1] === b[1];\n }\n if(k === BOX_SHADOW) {\n return equalArr(a, b);\n }\n if(COLOR_HASH.hasOwnProperty(k)) {\n return a[1] === b[1] && equalArr(a[0], b[0]);\n }\n if(GRADIENT_HASH.hasOwnProperty(k) && a.k === b.k && GRADIENT_TYPE.hasOwnProperty(a.k)) {\n let av = a.v;\n let bv = b.v;\n if(a.d !== b.d || av.length !== bv.length) {\n return false;\n }\n for(let i = 0, len = av.length; i < len; i++) {\n let ai = av[i];\n let bi = bv[i];\n if(ai.length !== bi.length) {\n return false;\n }\n for(let j = 0; j < 4; j++) {\n if(ai[0][j] !== bi[0][j]) {\n return false;\n }\n }\n if(ai.length > 1) {\n if(ai[1][0] !== bi[1][0] || ai[1][1] !== bi[1][1]) {\n return false;\n }\n }\n }\n return true;\n }\n // multi都是纯值数组,equalArr本身即递归,非multi根据类型判断\n if(isGeom(target.tagName, k) && (target.isMulti || Array.isArray(a) && Array.isArray(b))) {\n return equalArr(a, b);\n }\n return a === b;\n}\n\nfunction isRelativeOrAbsolute(node) {\n let position = node.currentStyle[POSITION];\n return position === 'relative' || position === 'absolute';\n}\n\nconst VALUE = {\n [POSITION]: true,\n [DISPLAY]: true,\n [STYLE_KEY.BACKGROUND_REPEAT]: true,\n [FLEX_DIRECTION]: true,\n [FLEX_GROW]: true,\n [FLEX_SHRINK]: true,\n [FLEX_WRAP]: true,\n [JUSTIFY_CONTENT]: true,\n [ALIGN_ITEMS]: true,\n [ALIGN_SELF]: true,\n [STYLE_KEY.OVERFLOW]: true,\n [STYLE_KEY.MIX_BLEND_MODE]: true,\n [STYLE_KEY.STROKE_LINECAP]: true,\n [STYLE_KEY.STROKE_LINEJOIN]: true,\n [STYLE_KEY.STROKE_MITERLIMIT]: true,\n [STYLE_KEY.FILL_RULE]: true,\n [OPACITY]: true,\n [Z_INDEX]: true,\n [BACKGROUND_CLIP]: true,\n [TEXT_OVERFLOW]: true,\n [LINE_CLAMP]: true,\n};\n// 仅1维数组\nconst ARRAY_0 = {\n [COLOR]: true,\n [TEXT_STROKE_COLOR]: true,\n [BACKGROUND_COLOR]: true,\n [STYLE_KEY.BORDER_TOP_COLOR]: true,\n [STYLE_KEY.BORDER_RIGHT_COLOR]: true,\n [STYLE_KEY.BORDER_BOTTOM_COLOR]: true,\n [STYLE_KEY.BORDER_LEFT_COLOR]: true,\n};\n// 仅2维数组且只有2个值\nconst ARRAY_0_1 = {\n [STYLE_KEY.BORDER_TOP_LEFT_RADIUS]: true,\n [STYLE_KEY.BORDER_TOP_RIGHT_RADIUS]: true,\n [STYLE_KEY.BORDER_BOTTOM_RIGHT_RADIUS]: true,\n [STYLE_KEY.BORDER_BOTTOM_LEFT_RADIUS]: true,\n [TRANSFORM_ORIGIN]: true,\n [PERSPECTIVE_ORIGIN]: true,\n};\nfunction cloneStyle(style, keys) {\n if(!keys) {\n keys = Object.keys(style).map(i => {\n if(!GEOM.hasOwnProperty(i)) {\n i = parseInt(i);\n }\n return i;\n });\n }\n let res = {};\n for(let i = 0, len = keys.length; i < len; i++) {\n let k = keys[i];\n let v = style[k];\n // 渐变特殊处理\n if(k === BACKGROUND_IMAGE) {\n res[k] = v.map(item => {\n // 可能为null\n if(item && item.k) {\n return util.clone(item);\n }\n else {\n return item;\n }\n });\n }\n else if(k === FILL || k === STROKE) {\n res[k] = v.map(item => {\n // 渐变\n // 可能非法为空\n if(item && item.k) {\n return util.clone(item);\n }\n // 颜色\n else {\n return item.slice(0);\n }\n });\n }\n else if(k === TRANSFORM || k === FILTER) {\n if(v) {\n let n = v.slice(0);\n for(let i = 0, len = n.length; i < len; i++) {\n n[i] = n[i].slice(0);\n n[i][1] = n[i][1].slice(0);\n }\n res[k] = n;\n }\n }\n else if(k === BOX_SHADOW) {\n if(v) {\n v = v.map(item => {\n let n = item.slice(0);\n n[4] = n[4].slice(0);\n return n;\n });\n res[k] = v;\n }\n }\n else if(k === TRANSLATE_PATH) {\n if(v) {\n res[k] = v.map(item => item.slice(0));\n }\n }\n // position等直接值类型赋值\n else if(VALUE.hasOwnProperty(k)) {\n res[k] = v;\n }\n // geom自定义属性\n else if(GEOM.hasOwnProperty(k)) {\n res[k] = util.clone(v);\n }\n // 其余皆是数组或空,默认是一维数组只需slice即可\n else if(v) {\n let n = res[k] = v.slice(0);\n // 特殊引用里数组某项再次clone\n if(k === BACKGROUND_POSITION_X || k === BACKGROUND_POSITION_Y) {\n for(let i = 0, len = n.length; i < len; i++) {\n n[i] = n[i].slice(0);\n }\n }\n else if(k === BACKGROUND_SIZE) {\n for(let i = 0, len = n.length; i < len; i++) {\n n[i] = n[i].slice(0);\n n[i][0] = n[i][0].slice(0);\n n[i][1] = n[i][1].slice(0);\n }\n }\n else if(ARRAY_0.hasOwnProperty(k)) {\n n[0] = n[0].slice(0);\n }\n else if(ARRAY_0_1.hasOwnProperty(k)) {\n n[0] = n[0].slice(0);\n n[1] = n[1].slice(0);\n }\n else if(k === TRANSFORM) {\n for(let i = 0, len = n.length; i < len; i++) {\n n[i] = n[i].slice(0);\n }\n }\n else if(k === ROTATE_3D) {\n n[3] = n[3].slice(0);\n }\n }\n }\n return res;\n}\n\nfunction calAbsFixedSize(value, size, root) {\n if(value[1] === PX) {\n return value[0];\n }\n else if(value[1] === PERCENT) {\n return value[0] * 0.01 * size;\n }\n else if(value[1] === REM) {\n return value[0] * root.computedStyle[FONT_SIZE];\n }\n else if(value[1] === VW) {\n return value[0] * root.width * 0.01;\n }\n else if(value[1] === VH) {\n return value[0] * root.height * 0.01;\n }\n else if(value[1] === VMAX) {\n return value[0] * Math.max(root.width, root.height) * 0.01;\n }\n else if(value[1] === VMIN) {\n return value[0] * Math.min(root.width, root.height) * 0.01;\n }\n return 0;\n}\n\nexport default {\n normalize,\n computeReflow,\n setFontStyle,\n getFontFamily,\n getBaseline,\n calRelative,\n calAbsolute,\n calAbsFixedSize,\n equalStyle,\n isRelativeOrAbsolute,\n cloneStyle,\n};\n","import mode from '../refresh/mode';\nimport css from '../style/css';\nimport enums from '../util/enums';\nimport util from '../util/util';\n\nconst { STYLE_KEY: {\n COLOR,\n FONT_WEIGHT,\n FONT_FAMILY,\n FONT_SIZE,\n FONT_STYLE,\n LETTER_SPACING,\n TEXT_STROKE_COLOR,\n TEXT_STROKE_WIDTH,\n TEXT_STROKE_OVER,\n} } = enums;\n\n/**\n * 表示一行文本的类,保存它的位置、内容、从属信息,在布局阶段生成,并在渲染阶段被Text调用render()\n * 关系上直属于Text类,一个Text类可能因为换行原因导致有多个TextBox,一行内容中也可能有不同Text从而不同TextBox\n * 另外本类还会被LineBoxManager添加到LineBox里,LineBox为一行中的inline/文本组合,之间需要进行垂直对齐\n * 在textOverflow为ellipsis时,可能会收到后面节点的向前回退(后面不足放下…),使得省略号发生在本节点\n */\nclass TextBox {\n constructor(parent, index, x, y, w, h, content) {\n this.__parent = parent;\n this.__index = index;\n this.__x = x;\n this.__y = y;\n this.__width = w;\n this.__height = h;\n this.__content = content;\n this.__virtualDom = {};\n this.__parentLineBox = null;\n }\n\n setEllipsis(fontFamily, fontSize, fontWeight) {\n this.__fontFamily = fontFamily;\n this.__fontSize = fontSize;\n this.__fontWeight = fontWeight;\n }\n\n setDom(dom) {\n this.__dom = dom;\n }\n\n /**\n * 渲染阶段被Text类调用,多行Text会有多个TextBox,内容被分拆开\n * @param renderMode\n * @param ctx\n * @param computedStyle\n * @param cacheStyle Text父节点Dom的缓存样式,相比computedStyle可以直接用,比如color被缓存为style字符串\n * @param dx\n * @param dy\n */\n render(renderMode, ctx, computedStyle, cacheStyle, dx, dy) {\n let { content, x, y, parent, width, dom } = this;\n let { ox, oy } = parent;\n y += css.getBaseline(computedStyle);\n x += ox + dx;\n y += oy + dy;\n this.__endX = x + width;\n this.__endY = y;\n // ELLIPSIS使用block的样式\n if(dom) {\n cacheStyle = dom.cacheStyle;\n computedStyle = dom.computedStyle;\n }\n let {\n [LETTER_SPACING]: letterSpacing,\n [TEXT_STROKE_WIDTH]: textStrokeWidth,\n [TEXT_STROKE_COLOR]: textStrokeColor,\n } = computedStyle;\n let i = 0, length = content.length;\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n if(dom) {\n computedStyle = dom.computedStyle;\n let font = css.setFontStyle(computedStyle);\n if(ctx.font !== font) {\n ctx.font = font;\n }\n let color = cacheStyle[COLOR];\n if(ctx.fillStyle !== color) {\n ctx.fillStyle = color;\n }\n }\n let overFill = computedStyle[TEXT_STROKE_OVER] === 'fill';\n if(letterSpacing) {\n for(; i < length; i++) {\n let c = content.charAt(i);\n if(overFill) {\n ctx.fillText(c, x, y);\n }\n if(textStrokeWidth && (textStrokeColor[3] > 0 || textStrokeColor.length === 3)) {\n ctx.strokeText(c, x, y);\n }\n if(!overFill) {\n ctx.fillText(c, x, y);\n }\n x += ctx.measureText(c).width + letterSpacing;\n }\n }\n else {\n if(overFill) {\n ctx.fillText(content, x, y);\n }\n if(textStrokeWidth && (textStrokeColor[3] > 0 || textStrokeColor.length === 3)) {\n ctx.strokeText(content, x, y);\n }\n if(!overFill) {\n ctx.fillText(content, x, y);\n }\n }\n }\n else if(renderMode === mode.SVG) {\n let props = [\n ['x', x],\n ['y', y],\n ['fill', cacheStyle[COLOR]],\n ['font-family', computedStyle[FONT_FAMILY]],\n ['font-weight', computedStyle[FONT_WEIGHT]],\n ['font-style', computedStyle[FONT_STYLE]],\n ['font-size', computedStyle[FONT_SIZE] + 'px'],\n ];\n // svg无法定义stroke的over\n if(textStrokeWidth && (textStrokeColor[3] > 0 || textStrokeColor.length === 3)) {\n props.push(['stroke', cacheStyle[TEXT_STROKE_COLOR]]);\n props.push(['stroke-width', computedStyle[TEXT_STROKE_WIDTH]]);\n }\n if(letterSpacing) {\n props.push(['letter-spacing', letterSpacing]);\n }\n this.__virtualDom = {\n type: 'item',\n tagName: 'text',\n props,\n content: util.encodeHtml(content),\n };\n }\n }\n\n __offsetX(diff) {\n this.__x += diff;\n }\n\n __offsetY(diff) {\n this.__y += diff;\n }\n\n get x() {\n return this.__x;\n }\n\n get y() {\n return this.__y;\n }\n\n get endX() {\n return this.__endX;\n }\n\n get endY() {\n return this.__endY;\n }\n\n get width() {\n return this.__width;\n }\n\n get outerWidth() {\n return this.__width;\n }\n\n get height() {\n return this.__height;\n }\n\n get outerHeight() {\n return this.__height;\n }\n\n get content() {\n return this.__content;\n }\n\n get baseline() {\n return this.parent.baseline;\n }\n\n get virtualDom() {\n return this.__virtualDom;\n }\n\n get parent() {\n return this.__parent;\n }\n\n get parentLineBox() {\n return this.__parentLineBox;\n }\n\n get isReplaced() {\n return false;\n }\n\n get dom() {\n return this.__dom;\n }\n}\n\nexport default TextBox;\n","import inject from '../util/inject';\n\nlet SIZE = [8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192];\nlet NUMBER = [128, 64, 32, 16, 8, 4, 2, 1, 1, 1, 1];\nlet MAX = SIZE[SIZE.length - 1];\nconst HASH_CANVAS = {};\n\nlet uuid = 0;\n\nclass Page {\n constructor(size, number) {\n this.__size = size;\n this.__number = number;\n this.__free = this.__total = number * number;\n size *= number;\n this.__width = size;\n this.__height = size;\n let offscreen = this.__canvas = inject.getCacheCanvas(size, size, null, number);\n if(offscreen) {\n this.__offscreen = offscreen;\n }\n // 1/0标识n*n个单元格是否空闲可用,一维数组表示\n this.__grid = [];\n for(let i = 0; i < this.__total; i++) {\n this.__grid.push(1);\n }\n this.__uuid = uuid++;\n // webgl贴图缓存使用,一旦更新则标识记录,绑定某号纹理单元查看变化才更新贴图\n this.__update = false;\n this.time = 0;\n }\n\n add() {\n let { number, grid } = this;\n for(let i = 0; i < number; i++) {\n for(let j = 0; j < number; j++) {\n let index = i * number + j;\n if(grid[index]) {\n grid[index] = 0;\n this.__free--;\n return index;\n }\n }\n }\n // 理论不可能进入,除非bug\n throw new Error('Can not find free page');\n }\n\n del(pos) {\n if(!this.grid[pos]) {\n this.grid[pos] = 1;\n this.__free++;\n }\n }\n\n getCoords(pos) {\n let { size, number } = this;\n let x = pos % number;\n let y = Math.floor(pos / number);\n return [x * size, y * size];\n }\n\n get uuid() {\n return this.__uuid;\n }\n\n get size() {\n return this.__size;\n }\n\n get width() {\n return this.__width;\n }\n\n get height() {\n return this.__height;\n }\n\n get number() {\n return this.__number;\n }\n\n get total() {\n return this.__total;\n }\n\n get free() {\n return this.__free;\n }\n\n get grid() {\n return this.__grid;\n }\n\n get offscreen() {\n return this.__offscreen;\n }\n\n get canvas() {\n return this.offscreen.canvas;\n }\n\n get ctx() {\n return this.offscreen.ctx;\n }\n\n get update() {\n return this.__update;\n }\n\n set update(v) {\n this.__update = v;\n }\n\n static getInstance(size) {\n if(size > MAX) {\n return;\n }\n let s = SIZE[0];\n let n = NUMBER[0];\n // 使用刚好满足的尺寸\n for(let i = 0, len = SIZE.length; i < len; i++) {\n s = SIZE[i];\n n = NUMBER[i];\n if(SIZE[i] >= size) {\n break;\n }\n }\n let list = HASH_CANVAS[s] = HASH_CANVAS[s] || [];\n // 从hash列表中尝试取可用的一页,找不到就生成新的页\n let page;\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(item.free) {\n page = item;\n break;\n }\n }\n if(!page) {\n page = new Page(s, n);\n if(!page.offscreen) {\n inject.error('Can not create off-screen for page');\n return;\n }\n list.push(page);\n }\n let pos = page.add();\n return { page, pos };\n }\n\n static set CONFIG(v) {\n if(!v || !Array.isArray(v.SIZE) || !Array.isArray(v.NUMBER)) {\n return;\n }\n SIZE = v.SIZE;\n NUMBER = v.NUMBER;\n MAX = SIZE[SIZE.length - 1];\n }\n\n static get CONFIG() {\n return {\n SIZE,\n NUMBER,\n };\n }\n\n static get MAX() {\n return MAX;\n }\n\n static genUuid() {\n return uuid++;\n }\n}\n\nexport default Page;\n","import matrix from './matrix';\nimport geom from './geom';\n\n// 一条边相对于自己开始点的x向量角度,即从x到此边旋转,0~180和-180~0,需要判断象限\nfunction calDeg(x1, y1, x2, y2) {\n let dx = x2 - x1;\n let dy = y2 - y1;\n let atan = Math.atan(Math.abs(dy) / Math.abs(dx));\n // 2象限\n if(dx < 0 && dy >= 0) {\n return Math.PI - atan;\n }\n // 3象限\n if(dx < 0 && dy < 0) {\n return atan - Math.PI;\n }\n // 1象限\n if(dx >= 0 && dy >= 0) {\n return atan;\n }\n // 4象限,顺时针正好\n return -atan;\n}\n\nfunction rotate(theta) {\n let sin = Math.sin(theta);\n let cos = Math.cos(theta);\n let t = matrix.identity();\n t[0] = t[5] = cos;\n t[1] = sin;\n t[4] = -sin;\n return t;\n}\n\n/**\n * 确保3个点中,a点在三角形左上方,b/c在右方,同时ab到ac要顺时针旋转\n * @param points\n */\nfunction pointIndex(points) {\n let [x1, y1, x2, y2, x3, y3] = points;\n let index = [0, 1, 2];\n // 将a点放入最左\n if(x2 < x1 && x2 < x3) {\n [x1, y1, x2, y2] = [x2, y2, x1, y1];\n index[0] = 1;\n index[1] = 0;\n }\n else if(x3 < x2 && x3 < x1) {\n [x1, y1, x3, y3] = [x3, y3, x1, y1];\n index[0] = 2;\n index[2] = 0;\n }\n // 有可能出现2个并列的情况,判断取上面那个\n if(x1 === x2) {\n if(y1 > y2) {\n [x1, y1, x2, y2] = [x2, y2, x1, y1];\n let t = index[0];\n index[0] = index[1];\n index[1] = t;\n }\n }\n else if(x1 === x3) {\n if(y1 > y3) {\n [x1, y1, x3, y3] = [x3, y3, x1, y1];\n let t = index[0];\n index[0] = index[2];\n index[2] = t;\n }\n }\n // ab到ac要顺时针旋转,即2个向量夹角为正,用向量叉乘判断正负\n let cross = (x2 - x1) * (y3 - y1) - (x3 - x1) * (y2 - y1);\n if(cross < 0) {\n [x2, y2, x3, y3] = [x3, y3, x2, y2];\n let t = index[1];\n index[1] = index[2];\n index[2] = t;\n }\n return [x1, y1, x2, y2, x3, y3, index];\n}\n\n/**\n * 第2个点根据第一个点的交换顺序交换\n * @param points\n * @param index\n * @returns {[]}\n */\nfunction pointByIndex(points, index) {\n let res = [];\n for(let i = 0, len = index.length; i < len; i++) {\n let j = index[i];\n res.push(points[j * 2]);\n res.push(points[j * 2 + 1]);\n }\n return res;\n}\n\n/**\n * 确保3个点中,a点在三角形左上方,b/c在右方,同时ab到ac要顺时针旋转\n * @param source 源3个点\n * @param target 目标3个点\n * @returns 交换顺序后的点坐标\n */\nfunction exchangeOrder(source, target) {\n let [sx1, sy1, sx2, sy2, sx3, sy3, index] = pointIndex(source);\n let [tx1, ty1, tx2, ty2, tx3, ty3] = pointByIndex(target, index);\n return [\n [sx1, sy1, sx2, sy2, sx3, sy3],\n [tx1, ty1, tx2, ty2, tx3, ty3]\n ];\n}\n\n/**\n * 存在一种情况,变换结果使得三角形镜像相反了,即顶点a越过bc线,判断是否溢出\n * @param source\n * @param target\n * @returns {boolean}是否溢出\n */\nfunction isOverflow(source, target) {\n let [sx1, sy1, sx2, sy2, sx3, sy3] = source;\n let [tx1, ty1, tx2, ty2, tx3, ty3] = target;\n let cross1 = (sx2 - sx1) * (sy3 - sy1) - (sx3 - sx1) * (sy2 - sy1);\n let cross2 = (tx2 - tx1) * (ty3 - ty1) - (tx3 - tx1) * (ty2 - ty1);\n return cross1 > 0 && cross2 < 0 || cross1 < 0 && cross2 > 0;\n}\n\nfunction transform(source, target) {\n let [sx1, sy1, sx2, sy2, sx3, sy3] = source;\n let [tx1, ty1, tx2, ty2, tx3, ty3] = target;\n // 记录翻转\n let overflow = isOverflow(source, target);\n // 第0步,将源三角第1个a点移到原点\n let m = matrix.identity();\n m[12] = -sx1;\n m[13] = -sy1;\n let t;\n // 第1步,以第1条边ab为基准,将其贴合x轴上,为后续倾斜不干扰做准备\n let theta = calDeg(sx1, sy1, sx2, sy2);\n if(theta !== 0) {\n t = rotate(-theta);\n m = matrix.multiply(t, m);\n }\n // 第2步,以第1条边AB为基准,缩放x轴ab至目标相同长度,可与4步合并\n let ls = geom.pointsDistance(sx1, sy1, sx2, sy2);\n let lt = geom.pointsDistance(tx1, ty1, tx2, ty2);\n // if(ls !== lt) {\n // let scale = lt / ls;\n // t = matrix.identity();\n // t[0] = scale;\n // m = matrix.multiply(t, m);\n // }\n // 第3步,缩放y,先将目标三角形旋转到x轴平行,再变换坐标计算\n let n = matrix.identity();\n n[12] = -tx1;\n n[13] = -ty1;\n theta = calDeg(tx1, ty1, tx2, ty2);\n // 记录下这个旋转角度,后面源三角形要反向旋转\n let alpha = theta;\n if(theta !== 0) {\n t = rotate(-theta);\n n = matrix.multiply(t, n);\n }\n // 目标三角反向旋转至x轴后的坐标\n // 源三角目前的第3点坐标y值即为长度,因为a点在原点0无需减去\n let ls2 = Math.abs(matrix.calPoint([sx3, sy3], m)[1]);\n let lt2 = Math.abs(matrix.calPoint([tx3, ty3], n)[1]);\n // 缩放y\n // if(ls2 !== lt2) {\n // let scale = lt / ls;\n // t = matrix.identity();\n // t[3] = scale;\n // m = matrix.multiply(t, m);\n // }\n if(ls !== lt || ls2 !== lt2) {\n t = matrix.identity();\n if(ls !== lt) {\n t[0] = lt / ls;\n }\n if(ls2 !== lt2) {\n t[5] = lt2 / ls2;\n }\n m = matrix.multiply(t, m);\n }\n // 第4步,x轴倾斜,用余弦定理求目前a和A的夹角\n n = m;\n let [ax1, ay1] = matrix.calPoint([sx1, sy1], n);\n let [ax2, ay2] = matrix.calPoint([sx2, sy2], n);\n let [ax3, ay3] = matrix.calPoint([sx3, sy3], n);\n let ab = geom.pointsDistance(ax1, ay1, ax2, ay2);\n let ac = geom.pointsDistance(ax1, ay1, ax3, ay3);\n let bc = geom.pointsDistance(ax3, ay3, ax2, ay2);\n let AB = geom.pointsDistance(tx1, ty1, tx2, ty2);\n let AC = geom.pointsDistance(tx1, ty1, tx3, ty3);\n let BC = geom.pointsDistance(tx3, ty3, tx2, ty2);\n let a = geom.angleBySide(bc, ab, ac);\n let A = geom.angleBySide(BC, AB, AC);\n // 先至90°,再旋转至目标角,可以合并成tan相加,不知道为什么不能直接tan倾斜差值角度\n if(a !== A) {\n t = matrix.identity();\n t[4] = Math.tan(a - Math.PI * 0.5) + Math.tan(Math.PI * 0.5 - A);\n m = matrix.multiply(t, m);\n }\n // 发生翻转时特殊处理按x轴垂直翻转\n if(overflow) {\n m[1] = -m[1];\n m[5] = -m[5];\n m[13] = -m[13];\n }\n // 第5步,再次旋转,角度为目标旋转到x轴的负值,可与下步合并\n if(alpha !== 0) {\n t = rotate(alpha);\n // m = matrix.multiply(t, m);\n }\n else {\n t = matrix.identity();\n }\n // 第6步,移动第一个点的差值\n // t = matrix.identity();\n t[12] = tx1;\n t[13] = ty1;\n return matrix.multiply(t, m);\n}\n\nexport default {\n exchangeOrder,\n isOverflow,\n transform,\n};\n","/**\n * martinez v0.7.1\n * Martinez polygon clipping algorithm, does boolean operation on polygons (multipolygons, polygons with holes etc): intersection, union, difference, xor\n *\n * @author Alex Milevski \n * @license MIT\n * @preserve\n */\n\nfunction DEFAULT_COMPARE (a, b) { return a > b ? 1 : a < b ? -1 : 0; }\n\nvar SplayTree = function SplayTree(compare, noDuplicates) {\n if ( compare === void 0 ) compare = DEFAULT_COMPARE;\n if ( noDuplicates === void 0 ) noDuplicates = false;\n\n this._compare = compare;\n this._root = null;\n this._size = 0;\n this._noDuplicates = !!noDuplicates;\n};\n\nvar prototypeAccessors = { size: { configurable: true } };\n\n\nSplayTree.prototype.rotateLeft = function rotateLeft (x) {\n var y = x.right;\n if (y) {\n x.right = y.left;\n if (y.left) { y.left.parent = x; }\n y.parent = x.parent;\n }\n\n if (!x.parent) { this._root = y; }\n else if (x === x.parent.left) { x.parent.left = y; }\n else { x.parent.right = y; }\n if (y) { y.left = x; }\n x.parent = y;\n};\n\n\nSplayTree.prototype.rotateRight = function rotateRight (x) {\n var y = x.left;\n if (y) {\n x.left = y.right;\n if (y.right) { y.right.parent = x; }\n y.parent = x.parent;\n }\n\n if (!x.parent) { this._root = y; }\n else if(x === x.parent.left) { x.parent.left = y; }\n else { x.parent.right = y; }\n if (y) { y.right = x; }\n x.parent = y;\n};\n\n\nSplayTree.prototype._splay = function _splay (x) {\n while (x.parent) {\n var p = x.parent;\n if (!p.parent) {\n if (p.left === x) { this.rotateRight(p); }\n else { this.rotateLeft(p); }\n } else if (p.left === x && p.parent.left === p) {\n this.rotateRight(p.parent);\n this.rotateRight(p);\n } else if (p.right === x && p.parent.right === p) {\n this.rotateLeft(p.parent);\n this.rotateLeft(p);\n } else if (p.left === x && p.parent.right === p) {\n this.rotateRight(p);\n this.rotateLeft(p);\n } else {\n this.rotateLeft(p);\n this.rotateRight(p);\n }\n }\n};\n\n\nSplayTree.prototype.splay = function splay (x) {\n var p, gp, ggp, l, r;\n\n while (x.parent) {\n p = x.parent;\n gp = p.parent;\n\n if (gp && gp.parent) {\n ggp = gp.parent;\n if (ggp.left === gp) { ggp.left= x; }\n else { ggp.right = x; }\n x.parent = ggp;\n } else {\n x.parent = null;\n this._root = x;\n }\n\n l = x.left; r = x.right;\n\n if (x === p.left) { // left\n if (gp) {\n if (gp.left === p) {\n /* zig-zig */\n if (p.right) {\n gp.left = p.right;\n gp.left.parent = gp;\n } else { gp.left = null; }\n\n p.right = gp;\n gp.parent = p;\n } else {\n /* zig-zag */\n if (l) {\n gp.right = l;\n l.parent = gp;\n } else { gp.right = null; }\n\n x.left = gp;\n gp.parent = x;\n }\n }\n if (r) {\n p.left = r;\n r.parent = p;\n } else { p.left = null; }\n\n x.right= p;\n p.parent = x;\n } else { // right\n if (gp) {\n if (gp.right === p) {\n /* zig-zig */\n if (p.left) {\n gp.right = p.left;\n gp.right.parent = gp;\n } else { gp.right = null; }\n\n p.left = gp;\n gp.parent = p;\n } else {\n /* zig-zag */\n if (r) {\n gp.left = r;\n r.parent = gp;\n } else { gp.left = null; }\n\n x.right = gp;\n gp.parent = x;\n }\n }\n if (l) {\n p.right = l;\n l.parent = p;\n } else { p.right = null; }\n\n x.left = p;\n p.parent = x;\n }\n }\n};\n\n\nSplayTree.prototype.replace = function replace (u, v) {\n if (!u.parent) { this._root = v; }\n else if (u === u.parent.left) { u.parent.left = v; }\n else { u.parent.right = v; }\n if (v) { v.parent = u.parent; }\n};\n\n\nSplayTree.prototype.minNode = function minNode (u) {\n if ( u === void 0 ) u = this._root;\n\n if (u) { while (u.left) { u = u.left; } }\n return u;\n};\n\n\nSplayTree.prototype.maxNode = function maxNode (u) {\n if ( u === void 0 ) u = this._root;\n\n if (u) { while (u.right) { u = u.right; } }\n return u;\n};\n\n\nSplayTree.prototype.insert = function insert (key, data) {\n var z = this._root;\n var p = null;\n var comp = this._compare;\n var cmp;\n\n if (this._noDuplicates) {\n while (z) {\n p = z;\n cmp = comp(z.key, key);\n if (cmp === 0) { return; }\n else if (comp(z.key, key) < 0) { z = z.right; }\n else { z = z.left; }\n }\n } else {\n while (z) {\n p = z;\n if (comp(z.key, key) < 0) { z = z.right; }\n else { z = z.left; }\n }\n }\n\n z = { key: key, data: data, left: null, right: null, parent: p };\n\n if (!p) { this._root = z; }\n else if (comp(p.key, z.key) < 0) { p.right = z; }\n else { p.left= z; }\n\n this.splay(z);\n this._size++;\n return z;\n};\n\n\nSplayTree.prototype.find = function find (key) {\n var z = this._root;\n var comp = this._compare;\n while (z) {\n var cmp = comp(z.key, key);\n if (cmp < 0) { z = z.right; }\n else if (cmp > 0) { z = z.left; }\n else { return z; }\n }\n return null;\n};\n\n/**\n * Whether the tree contains a node with the given key\n * @param{Key} key\n * @return {boolean} true/false\n */\nSplayTree.prototype.contains = function contains (key) {\n var node = this._root;\n var comparator = this._compare;\n while (node){\n var cmp = comparator(key, node.key);\n if (cmp === 0) { return true; }\n else if (cmp < 0) { node = node.left; }\n else { node = node.right; }\n }\n\n return false;\n};\n\n\nSplayTree.prototype.remove = function remove (key) {\n var z = this.find(key);\n\n if (!z) { return false; }\n\n this.splay(z);\n\n if (!z.left) { this.replace(z, z.right); }\n else if (!z.right) { this.replace(z, z.left); }\n else {\n var y = this.minNode(z.right);\n if (y.parent !== z) {\n this.replace(y, y.right);\n y.right = z.right;\n y.right.parent = y;\n }\n this.replace(z, y);\n y.left = z.left;\n y.left.parent = y;\n }\n\n this._size--;\n return true;\n};\n\n\nSplayTree.prototype.removeNode = function removeNode (z) {\n if (!z) { return false; }\n\n this.splay(z);\n\n if (!z.left) { this.replace(z, z.right); }\n else if (!z.right) { this.replace(z, z.left); }\n else {\n var y = this.minNode(z.right);\n if (y.parent !== z) {\n this.replace(y, y.right);\n y.right = z.right;\n y.right.parent = y;\n }\n this.replace(z, y);\n y.left = z.left;\n y.left.parent = y;\n }\n\n this._size--;\n return true;\n};\n\n\nSplayTree.prototype.erase = function erase (key) {\n var z = this.find(key);\n if (!z) { return; }\n\n this.splay(z);\n\n var s = z.left;\n var t = z.right;\n\n var sMax = null;\n if (s) {\n s.parent = null;\n sMax = this.maxNode(s);\n this.splay(sMax);\n this._root = sMax;\n }\n if (t) {\n if (s) { sMax.right = t; }\n else { this._root = t; }\n t.parent = sMax;\n }\n\n this._size--;\n};\n\n/**\n * Removes and returns the node with smallest key\n * @return {?Node}\n */\nSplayTree.prototype.pop = function pop () {\n var node = this._root, returnValue = null;\n if (node) {\n while (node.left) { node = node.left; }\n returnValue = { key: node.key, data: node.data };\n this.remove(node.key);\n }\n return returnValue;\n};\n\n\n/* eslint-disable class-methods-use-this */\n\n/**\n * Successor node\n * @param{Node} node\n * @return {?Node}\n */\nSplayTree.prototype.next = function next (node) {\n var successor = node;\n if (successor) {\n if (successor.right) {\n successor = successor.right;\n while (successor && successor.left) { successor = successor.left; }\n } else {\n successor = node.parent;\n while (successor && successor.right === node) {\n node = successor; successor = successor.parent;\n }\n }\n }\n return successor;\n};\n\n\n/**\n * Predecessor node\n * @param{Node} node\n * @return {?Node}\n */\nSplayTree.prototype.prev = function prev (node) {\n var predecessor = node;\n if (predecessor) {\n if (predecessor.left) {\n predecessor = predecessor.left;\n while (predecessor && predecessor.right) { predecessor = predecessor.right; }\n } else {\n predecessor = node.parent;\n while (predecessor && predecessor.left === node) {\n node = predecessor;\n predecessor = predecessor.parent;\n }\n }\n }\n return predecessor;\n};\n/* eslint-enable class-methods-use-this */\n\n\n/**\n * @param{forEachCallback} callback\n * @return {SplayTree}\n */\nSplayTree.prototype.forEach = function forEach (callback) {\n var current = this._root;\n var s = [], done = false, i = 0;\n\n while (!done) {\n // Reach the left most Node of the current Node\n if (current) {\n // Place pointer to a tree node on the stack\n // before traversing the node's left subtree\n s.push(current);\n current = current.left;\n } else {\n // BackTrack from the empty subtree and visit the Node\n // at the top of the stack; however, if the stack is\n // empty you are done\n if (s.length > 0) {\n current = s.pop();\n callback(current, i++);\n\n // We have visited the node and its left\n // subtree. Now, it's right subtree's turn\n current = current.right;\n } else { done = true; }\n }\n }\n return this;\n};\n\n\n/**\n * Walk key range from `low` to `high`. Stops if `fn` returns a value.\n * @param{Key} low\n * @param{Key} high\n * @param{Function} fn\n * @param{*?} ctx\n * @return {SplayTree}\n */\nSplayTree.prototype.range = function range (low, high, fn, ctx) {\n var Q = [];\n var compare = this._compare;\n var node = this._root, cmp;\n\n while (Q.length !== 0 || node) {\n if (node) {\n Q.push(node);\n node = node.left;\n } else {\n node = Q.pop();\n cmp = compare(node.key, high);\n if (cmp > 0) {\n break;\n } else if (compare(node.key, low) >= 0) {\n if (fn.call(ctx, node)) { return this; } // stop if smth is returned\n }\n node = node.right;\n }\n }\n return this;\n};\n\n/**\n * Returns all keys in order\n * @return {Array}\n */\nSplayTree.prototype.keys = function keys () {\n var current = this._root;\n var s = [], r = [], done = false;\n\n while (!done) {\n if (current) {\n s.push(current);\n current = current.left;\n } else {\n if (s.length > 0) {\n current = s.pop();\n r.push(current.key);\n current = current.right;\n } else { done = true; }\n }\n }\n return r;\n};\n\n\n/**\n * Returns `data` fields of all nodes in order.\n * @return {Array}\n */\nSplayTree.prototype.values = function values () {\n var current = this._root;\n var s = [], r = [], done = false;\n\n while (!done) {\n if (current) {\n s.push(current);\n current = current.left;\n } else {\n if (s.length > 0) {\n current = s.pop();\n r.push(current.data);\n current = current.right;\n } else { done = true; }\n }\n }\n return r;\n};\n\n\n/**\n * Returns node at given index\n * @param{number} index\n * @return {?Node}\n */\nSplayTree.prototype.at = function at (index) {\n // removed after a consideration, more misleading than useful\n // index = index % this.size;\n // if (index < 0) index = this.size - index;\n\n var current = this._root;\n var s = [], done = false, i = 0;\n\n while (!done) {\n if (current) {\n s.push(current);\n current = current.left;\n } else {\n if (s.length > 0) {\n current = s.pop();\n if (i === index) { return current; }\n i++;\n current = current.right;\n } else { done = true; }\n }\n }\n return null;\n};\n\n/**\n * Bulk-load items. Both array have to be same size\n * @param{Array} keys\n * @param{Array}[values]\n * @param{Boolean} [presort=false] Pre-sort keys and values, using\n * tree's comparator. Sorting is done\n * in-place\n * @return {AVLTree}\n */\nSplayTree.prototype.load = function load (keys, values, presort) {\n if ( keys === void 0 ) keys = [];\n if ( values === void 0 ) values = [];\n if ( presort === void 0 ) presort = false;\n\n if (this._size !== 0) { throw new Error('bulk-load: tree is not empty'); }\n var size = keys.length;\n if (presort) { sort(keys, values, 0, size - 1, this._compare); }\n this._root = loadRecursive(null, keys, values, 0, size);\n this._size = size;\n return this;\n};\n\n\nSplayTree.prototype.min = function min () {\n var node = this.minNode(this._root);\n if (node) { return node.key; }\n else { return null; }\n};\n\n\nSplayTree.prototype.max = function max () {\n var node = this.maxNode(this._root);\n if (node) { return node.key; }\n else { return null; }\n};\n\nSplayTree.prototype.isEmpty = function isEmpty () { return this._root === null; };\nprototypeAccessors.size.get = function () { return this._size; };\n\n\n/**\n * Create a tree and load it with items\n * @param{Array} keys\n * @param{Array?} [values]\n\n * @param{Function?} [comparator]\n * @param{Boolean?} [presort=false] Pre-sort keys and values, using\n * tree's comparator. Sorting is done\n * in-place\n * @param{Boolean?} [noDuplicates=false] Allow duplicates\n * @return {SplayTree}\n */\nSplayTree.createTree = function createTree (keys, values, comparator, presort, noDuplicates) {\n return new SplayTree(comparator, noDuplicates).load(keys, values, presort);\n};\n\nObject.defineProperties( SplayTree.prototype, prototypeAccessors );\n\n\nfunction loadRecursive (parent, keys, values, start, end) {\n var size = end - start;\n if (size > 0) {\n var middle = start + Math.floor(size / 2);\n var key = keys[middle];\n var data = values[middle];\n var node = { key: key, data: data, parent: parent };\n node.left = loadRecursive(node, keys, values, start, middle);\n node.right = loadRecursive(node, keys, values, middle + 1, end);\n return node;\n }\n return null;\n}\n\n\nfunction sort(keys, values, left, right, compare) {\n if (left >= right) { return; }\n\n var pivot = keys[(left + right) >> 1];\n var i = left - 1;\n var j = right + 1;\n\n while (true) {\n do { i++; } while (compare(keys[i], pivot) < 0);\n do { j--; } while (compare(keys[j], pivot) > 0);\n if (i >= j) { break; }\n\n var tmp = keys[i];\n keys[i] = keys[j];\n keys[j] = tmp;\n\n tmp = values[i];\n values[i] = values[j];\n values[j] = tmp;\n }\n\n sort(keys, values, left, j, compare);\n sort(keys, values, j + 1, right, compare);\n}\n\nvar NORMAL = 0;\nvar NON_CONTRIBUTING = 1;\nvar SAME_TRANSITION = 2;\nvar DIFFERENT_TRANSITION = 3;\n\nvar INTERSECTION = 0;\nvar UNION = 1;\nvar DIFFERENCE = 2;\nvar XOR = 3;\n\n/**\n * @param {SweepEvent} event\n * @param {SweepEvent} prev\n * @param {Operation} operation\n */\nfunction computeFields (event, prev, operation) {\n // compute inOut and otherInOut fields\n if (prev === null) {\n event.inOut = false;\n event.otherInOut = true;\n\n // previous line segment in sweepline belongs to the same polygon\n } else {\n if (event.isSubject === prev.isSubject) {\n event.inOut = !prev.inOut;\n event.otherInOut = prev.otherInOut;\n\n // previous line segment in sweepline belongs to the clipping polygon\n } else {\n event.inOut = !prev.otherInOut;\n event.otherInOut = prev.isVertical() ? !prev.inOut : prev.inOut;\n }\n\n // compute prevInResult field\n if (prev) {\n event.prevInResult = (!inResult(prev, operation) || prev.isVertical())\n ? prev.prevInResult : prev;\n }\n }\n\n // check if the line segment belongs to the Boolean operation\n var isInResult = inResult(event, operation);\n if (isInResult) {\n event.resultTransition = determineResultTransition(event, operation);\n } else {\n event.resultTransition = 0;\n }\n}\n\n\n/* eslint-disable indent */\nfunction inResult(event, operation) {\n switch (event.type) {\n case NORMAL:\n switch (operation) {\n case INTERSECTION:\n return !event.otherInOut;\n case UNION:\n return event.otherInOut;\n case DIFFERENCE:\n // return (event.isSubject && !event.otherInOut) ||\n // (!event.isSubject && event.otherInOut);\n return (event.isSubject && event.otherInOut) ||\n (!event.isSubject && !event.otherInOut);\n case XOR:\n return true;\n }\n break;\n case SAME_TRANSITION:\n return operation === INTERSECTION || operation === UNION;\n case DIFFERENT_TRANSITION:\n return operation === DIFFERENCE;\n case NON_CONTRIBUTING:\n return false;\n }\n return false;\n}\n/* eslint-enable indent */\n\n\nfunction determineResultTransition(event, operation) {\n var thisIn = !event.inOut;\n var thatIn = !event.otherInOut;\n\n var isIn;\n switch (operation) {\n case INTERSECTION:\n isIn = thisIn && thatIn; break;\n case UNION:\n isIn = thisIn || thatIn; break;\n case XOR:\n isIn = thisIn ^ thatIn; break;\n case DIFFERENCE:\n if (event.isSubject) {\n isIn = thisIn && !thatIn;\n } else {\n isIn = thatIn && !thisIn;\n }\n break;\n }\n return isIn ? +1 : -1;\n}\n\nvar SweepEvent = function SweepEvent (point, left, otherEvent, isSubject, edgeType) {\n\n /**\n * Is left endpoint?\n * @type {Boolean}\n */\n this.left = left;\n\n /**\n * @type {Array.}\n */\n this.point = point;\n\n /**\n * Other edge reference\n * @type {SweepEvent}\n */\n this.otherEvent = otherEvent;\n\n /**\n * Belongs to source or clipping polygon\n * @type {Boolean}\n */\n this.isSubject = isSubject;\n\n /**\n * Edge contribution type\n * @type {Number}\n */\n this.type = edgeType || NORMAL;\n\n\n /**\n * In-out transition for the sweepline crossing polygon\n * @type {Boolean}\n */\n this.inOut = false;\n\n\n /**\n * @type {Boolean}\n */\n this.otherInOut = false;\n\n /**\n * Previous event in result?\n * @type {SweepEvent}\n */\n this.prevInResult = null;\n\n /**\n * Type of result transition (0 = not in result, +1 = out-in, -1, in-out)\n * @type {Number}\n */\n this.resultTransition = 0;\n\n // connection step\n\n /**\n * @type {Number}\n */\n this.otherPos = -1;\n\n /**\n * @type {Number}\n */\n this.outputContourId = -1;\n\n this.isExteriorRing = true; // TODO: Looks unused, remove?\n};\n\nvar prototypeAccessors$1 = { inResult: { configurable: true } };\n\n\n/**\n * @param{Array.}p\n * @return {Boolean}\n */\nSweepEvent.prototype.isBelow = function isBelow (p) {\n var p0 = this.point, p1 = this.otherEvent.point;\n return this.left\n ? (p0[0] - p[0]) * (p1[1] - p[1]) - (p1[0] - p[0]) * (p0[1] - p[1]) > 0\n // signedArea(this.point, this.otherEvent.point, p) > 0 :\n : (p1[0] - p[0]) * (p0[1] - p[1]) - (p0[0] - p[0]) * (p1[1] - p[1]) > 0;\n //signedArea(this.otherEvent.point, this.point, p) > 0;\n};\n\n\n/**\n * @param{Array.}p\n * @return {Boolean}\n */\nSweepEvent.prototype.isAbove = function isAbove (p) {\n return !this.isBelow(p);\n};\n\n\n/**\n * @return {Boolean}\n */\nSweepEvent.prototype.isVertical = function isVertical () {\n return this.point[0] === this.otherEvent.point[0];\n};\n\n\n/**\n * Does event belong to result?\n * @return {Boolean}\n */\nprototypeAccessors$1.inResult.get = function () {\n return this.resultTransition !== 0;\n};\n\n\nSweepEvent.prototype.clone = function clone () {\n var copy = new SweepEvent(\n this.point, this.left, this.otherEvent, this.isSubject, this.type);\n\n copy.contourId = this.contourId;\n copy.resultTransition = this.resultTransition;\n copy.prevInResult = this.prevInResult;\n copy.isExteriorRing = this.isExteriorRing;\n copy.inOut = this.inOut;\n copy.otherInOut = this.otherInOut;\n\n return copy;\n};\n\nObject.defineProperties( SweepEvent.prototype, prototypeAccessors$1 );\n\nfunction equals(p1, p2) {\n if (p1[0] === p2[0]) {\n if (p1[1] === p2[1]) {\n return true;\n } else {\n return false;\n }\n }\n return false;\n}\n\n// const EPSILON = 1e-9;\n// const abs = Math.abs;\n// TODO https://github.com/w8r/martinez/issues/6#issuecomment-262847164\n// Precision problem.\n//\n// module.exports = function equals(p1, p2) {\n// return abs(p1[0] - p2[0]) <= EPSILON && abs(p1[1] - p2[1]) <= EPSILON;\n// };\n\nvar epsilon = 1.1102230246251565e-16;\nvar splitter = 134217729;\nvar resulterrbound = (3 + 8 * epsilon) * epsilon;\n\n// fast_expansion_sum_zeroelim routine from oritinal code\nfunction sum(elen, e, flen, f, h) {\n var Q, Qnew, hh, bvirt;\n var enow = e[0];\n var fnow = f[0];\n var eindex = 0;\n var findex = 0;\n if ((fnow > enow) === (fnow > -enow)) {\n Q = enow;\n enow = e[++eindex];\n } else {\n Q = fnow;\n fnow = f[++findex];\n }\n var hindex = 0;\n if (eindex < elen && findex < flen) {\n if ((fnow > enow) === (fnow > -enow)) {\n Qnew = enow + Q;\n hh = Q - (Qnew - enow);\n enow = e[++eindex];\n } else {\n Qnew = fnow + Q;\n hh = Q - (Qnew - fnow);\n fnow = f[++findex];\n }\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n while (eindex < elen && findex < flen) {\n if ((fnow > enow) === (fnow > -enow)) {\n Qnew = Q + enow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (enow - bvirt);\n enow = e[++eindex];\n } else {\n Qnew = Q + fnow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (fnow - bvirt);\n fnow = f[++findex];\n }\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n }\n while (eindex < elen) {\n Qnew = Q + enow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (enow - bvirt);\n enow = e[++eindex];\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n while (findex < flen) {\n Qnew = Q + fnow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (fnow - bvirt);\n fnow = f[++findex];\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n if (Q !== 0 || hindex === 0) {\n h[hindex++] = Q;\n }\n return hindex;\n}\n\nfunction estimate(elen, e) {\n var Q = e[0];\n for (var i = 1; i < elen; i++) { Q += e[i]; }\n return Q;\n}\n\nfunction vec(n) {\n return new Float64Array(n);\n}\n\nvar ccwerrboundA = (3 + 16 * epsilon) * epsilon;\nvar ccwerrboundB = (2 + 12 * epsilon) * epsilon;\nvar ccwerrboundC = (9 + 64 * epsilon) * epsilon * epsilon;\n\nvar B = vec(4);\nvar C1 = vec(8);\nvar C2 = vec(12);\nvar D = vec(16);\nvar u = vec(4);\n\nfunction orient2dadapt(ax, ay, bx, by, cx, cy, detsum) {\n var acxtail, acytail, bcxtail, bcytail;\n var bvirt, c, ahi, alo, bhi, blo, _i, _j, _0, s1, s0, t1, t0, u3;\n\n var acx = ax - cx;\n var bcx = bx - cx;\n var acy = ay - cy;\n var bcy = by - cy;\n\n s1 = acx * bcy;\n c = splitter * acx;\n ahi = c - (c - acx);\n alo = acx - ahi;\n c = splitter * bcy;\n bhi = c - (c - bcy);\n blo = bcy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acy * bcx;\n c = splitter * acy;\n ahi = c - (c - acy);\n alo = acy - ahi;\n c = splitter * bcx;\n bhi = c - (c - bcx);\n blo = bcx - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n B[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n B[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n B[2] = _j - (u3 - bvirt) + (_i - bvirt);\n B[3] = u3;\n\n var det = estimate(4, B);\n var errbound = ccwerrboundB * detsum;\n if (det >= errbound || -det >= errbound) {\n return det;\n }\n\n bvirt = ax - acx;\n acxtail = ax - (acx + bvirt) + (bvirt - cx);\n bvirt = bx - bcx;\n bcxtail = bx - (bcx + bvirt) + (bvirt - cx);\n bvirt = ay - acy;\n acytail = ay - (acy + bvirt) + (bvirt - cy);\n bvirt = by - bcy;\n bcytail = by - (bcy + bvirt) + (bvirt - cy);\n\n if (acxtail === 0 && acytail === 0 && bcxtail === 0 && bcytail === 0) {\n return det;\n }\n\n errbound = ccwerrboundC * detsum + resulterrbound * Math.abs(det);\n det += (acx * bcytail + bcy * acxtail) - (acy * bcxtail + bcx * acytail);\n if (det >= errbound || -det >= errbound) { return det; }\n\n s1 = acxtail * bcy;\n c = splitter * acxtail;\n ahi = c - (c - acxtail);\n alo = acxtail - ahi;\n c = splitter * bcy;\n bhi = c - (c - bcy);\n blo = bcy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acytail * bcx;\n c = splitter * acytail;\n ahi = c - (c - acytail);\n alo = acytail - ahi;\n c = splitter * bcx;\n bhi = c - (c - bcx);\n blo = bcx - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n u[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n u[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n var C1len = sum(4, B, 4, u, C1);\n\n s1 = acx * bcytail;\n c = splitter * acx;\n ahi = c - (c - acx);\n alo = acx - ahi;\n c = splitter * bcytail;\n bhi = c - (c - bcytail);\n blo = bcytail - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acy * bcxtail;\n c = splitter * acy;\n ahi = c - (c - acy);\n alo = acy - ahi;\n c = splitter * bcxtail;\n bhi = c - (c - bcxtail);\n blo = bcxtail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n u[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n u[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n var C2len = sum(C1len, C1, 4, u, C2);\n\n s1 = acxtail * bcytail;\n c = splitter * acxtail;\n ahi = c - (c - acxtail);\n alo = acxtail - ahi;\n c = splitter * bcytail;\n bhi = c - (c - bcytail);\n blo = bcytail - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acytail * bcxtail;\n c = splitter * acytail;\n ahi = c - (c - acytail);\n alo = acytail - ahi;\n c = splitter * bcxtail;\n bhi = c - (c - bcxtail);\n blo = bcxtail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n u[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n u[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n var Dlen = sum(C2len, C2, 4, u, D);\n\n return D[Dlen - 1];\n}\n\nfunction orient2d(ax, ay, bx, by, cx, cy) {\n var detleft = (ay - cy) * (bx - cx);\n var detright = (ax - cx) * (by - cy);\n var det = detleft - detright;\n\n if (detleft === 0 || detright === 0 || (detleft > 0) !== (detright > 0)) { return det; }\n\n var detsum = Math.abs(detleft + detright);\n if (Math.abs(det) >= ccwerrboundA * detsum) { return det; }\n\n return -orient2dadapt(ax, ay, bx, by, cx, cy, detsum);\n}\n\n/**\n * Signed area of the triangle (p0, p1, p2)\n * @param {Array.} p0\n * @param {Array.} p1\n * @param {Array.} p2\n * @return {Number}\n */\nfunction signedArea(p0, p1, p2) {\n var res = orient2d(p0[0], p0[1], p1[0], p1[1], p2[0], p2[1]);\n if (res > 0) { return -1; }\n if (res < 0) { return 1; }\n return 0;\n}\n\n/**\n * @param {SweepEvent} e1\n * @param {SweepEvent} e2\n * @return {Number}\n */\nfunction compareEvents(e1, e2) {\n var p1 = e1.point;\n var p2 = e2.point;\n\n // Different x-coordinate\n if (p1[0] > p2[0]) { return 1; }\n if (p1[0] < p2[0]) { return -1; }\n\n // Different points, but same x-coordinate\n // Event with lower y-coordinate is processed first\n if (p1[1] !== p2[1]) { return p1[1] > p2[1] ? 1 : -1; }\n\n return specialCases(e1, e2, p1);\n}\n\n\n/* eslint-disable no-unused-vars */\nfunction specialCases(e1, e2, p1, p2) {\n // Same coordinates, but one is a left endpoint and the other is\n // a right endpoint. The right endpoint is processed first\n if (e1.left !== e2.left)\n { return e1.left ? 1 : -1; }\n\n // const p2 = e1.otherEvent.point, p3 = e2.otherEvent.point;\n // const sa = (p1[0] - p3[0]) * (p2[1] - p3[1]) - (p2[0] - p3[0]) * (p1[1] - p3[1])\n // Same coordinates, both events\n // are left endpoints or right endpoints.\n // not collinear\n if (signedArea(p1, e1.otherEvent.point, e2.otherEvent.point) !== 0) {\n // the event associate to the bottom segment is processed first\n return (!e1.isBelow(e2.otherEvent.point)) ? 1 : -1;\n }\n\n return (!e1.isSubject && e2.isSubject) ? 1 : -1;\n}\n/* eslint-enable no-unused-vars */\n\n/**\n * @param {SweepEvent} se\n * @param {Array.} p\n * @param {Queue} queue\n * @return {Queue}\n */\nfunction divideSegment(se, p, queue) {\n var r = new SweepEvent(p, false, se, se.isSubject);\n var l = new SweepEvent(p, true, se.otherEvent, se.isSubject);\n\n /* eslint-disable no-console */\n if (equals(se.point, se.otherEvent.point)) {\n console.warn('what is that, a collapsed segment?', se);\n }\n /* eslint-enable no-console */\n\n r.contourId = l.contourId = se.contourId;\n\n // avoid a rounding error. The left event would be processed after the right event\n if (compareEvents(l, se.otherEvent) > 0) {\n se.otherEvent.left = true;\n l.left = false;\n }\n\n // avoid a rounding error. The left event would be processed after the right event\n // if (compareEvents(se, r) > 0) {}\n\n se.otherEvent.otherEvent = l;\n se.otherEvent = r;\n\n queue.push(l);\n queue.push(r);\n\n return queue;\n}\n\n//const EPS = 1e-9;\n\n/**\n * Finds the magnitude of the cross product of two vectors (if we pretend\n * they're in three dimensions)\n *\n * @param {Object} a First vector\n * @param {Object} b Second vector\n * @private\n * @returns {Number} The magnitude of the cross product\n */\nfunction crossProduct(a, b) {\n return (a[0] * b[1]) - (a[1] * b[0]);\n}\n\n/**\n * Finds the dot product of two vectors.\n *\n * @param {Object} a First vector\n * @param {Object} b Second vector\n * @private\n * @returns {Number} The dot product\n */\nfunction dotProduct(a, b) {\n return (a[0] * b[0]) + (a[1] * b[1]);\n}\n\n/**\n * Finds the intersection (if any) between two line segments a and b, given the\n * line segments' end points a1, a2 and b1, b2.\n *\n * This algorithm is based on Schneider and Eberly.\n * http://www.cimec.org.ar/~ncalvo/Schneider_Eberly.pdf\n * Page 244.\n *\n * @param {Array.} a1 point of first line\n * @param {Array.} a2 point of first line\n * @param {Array.} b1 point of second line\n * @param {Array.} b2 point of second line\n * @param {Boolean=} noEndpointTouch whether to skip single touchpoints\n * (meaning connected segments) as\n * intersections\n * @returns {Array.>|Null} If the lines intersect, the point of\n * intersection. If they overlap, the two end points of the overlapping segment.\n * Otherwise, null.\n */\nfunction intersection (a1, a2, b1, b2, noEndpointTouch) {\n // The algorithm expects our lines in the form P + sd, where P is a point,\n // s is on the interval [0, 1], and d is a vector.\n // We are passed two points. P can be the first point of each pair. The\n // vector, then, could be thought of as the distance (in x and y components)\n // from the first point to the second point.\n // So first, let's make our vectors:\n var va = [a2[0] - a1[0], a2[1] - a1[1]];\n var vb = [b2[0] - b1[0], b2[1] - b1[1]];\n // We also define a function to convert back to regular point form:\n\n /* eslint-disable arrow-body-style */\n\n function toPoint(p, s, d) {\n return [\n p[0] + s * d[0],\n p[1] + s * d[1]\n ];\n }\n\n /* eslint-enable arrow-body-style */\n\n // The rest is pretty much a straight port of the algorithm.\n var e = [b1[0] - a1[0], b1[1] - a1[1]];\n var kross = crossProduct(va, vb);\n var sqrKross = kross * kross;\n var sqrLenA = dotProduct(va, va);\n //const sqrLenB = dotProduct(vb, vb);\n\n // Check for line intersection. This works because of the properties of the\n // cross product -- specifically, two vectors are parallel if and only if the\n // cross product is the 0 vector. The full calculation involves relative error\n // to account for possible very small line segments. See Schneider & Eberly\n // for details.\n if (sqrKross > 0/* EPS * sqrLenB * sqLenA */) {\n // If they're not parallel, then (because these are line segments) they\n // still might not actually intersect. This code checks that the\n // intersection point of the lines is actually on both line segments.\n var s = crossProduct(e, vb) / kross;\n if (s < 0 || s > 1) {\n // not on line segment a\n return null;\n }\n var t = crossProduct(e, va) / kross;\n if (t < 0 || t > 1) {\n // not on line segment b\n return null;\n }\n if (s === 0 || s === 1) {\n // on an endpoint of line segment a\n return noEndpointTouch ? null : [toPoint(a1, s, va)];\n }\n if (t === 0 || t === 1) {\n // on an endpoint of line segment b\n return noEndpointTouch ? null : [toPoint(b1, t, vb)];\n }\n return [toPoint(a1, s, va)];\n }\n\n // If we've reached this point, then the lines are either parallel or the\n // same, but the segments could overlap partially or fully, or not at all.\n // So we need to find the overlap, if any. To do that, we can use e, which is\n // the (vector) difference between the two initial points. If this is parallel\n // with the line itself, then the two lines are the same line, and there will\n // be overlap.\n //const sqrLenE = dotProduct(e, e);\n kross = crossProduct(e, va);\n sqrKross = kross * kross;\n\n if (sqrKross > 0 /* EPS * sqLenB * sqLenE */) {\n // Lines are just parallel, not the same. No overlap.\n return null;\n }\n\n var sa = dotProduct(va, e) / sqrLenA;\n var sb = sa + dotProduct(va, vb) / sqrLenA;\n var smin = Math.min(sa, sb);\n var smax = Math.max(sa, sb);\n\n // this is, essentially, the FindIntersection acting on floats from\n // Schneider & Eberly, just inlined into this function.\n if (smin <= 1 && smax >= 0) {\n\n // overlap on an end point\n if (smin === 1) {\n return noEndpointTouch ? null : [toPoint(a1, smin > 0 ? smin : 0, va)];\n }\n\n if (smax === 0) {\n return noEndpointTouch ? null : [toPoint(a1, smax < 1 ? smax : 1, va)];\n }\n\n if (noEndpointTouch && smin === 0 && smax === 1) { return null; }\n\n // There's overlap on a segment -- two points of intersection. Return both.\n return [\n toPoint(a1, smin > 0 ? smin : 0, va),\n toPoint(a1, smax < 1 ? smax : 1, va)\n ];\n }\n\n return null;\n}\n\n/**\n * @param {SweepEvent} se1\n * @param {SweepEvent} se2\n * @param {Queue} queue\n * @return {Number}\n */\nfunction possibleIntersection (se1, se2, queue) {\n // that disallows self-intersecting polygons,\n // did cost us half a day, so I'll leave it\n // out of respect\n // if (se1.isSubject === se2.isSubject) return;\n var inter = intersection(\n se1.point, se1.otherEvent.point,\n se2.point, se2.otherEvent.point\n );\n\n var nintersections = inter ? inter.length : 0;\n if (nintersections === 0) { return 0; } // no intersection\n\n // the line segments intersect at an endpoint of both line segments\n if ((nintersections === 1) &&\n (equals(se1.point, se2.point) ||\n equals(se1.otherEvent.point, se2.otherEvent.point))) {\n return 0;\n }\n\n if (nintersections === 2 && se1.isSubject === se2.isSubject) {\n // if(se1.contourId === se2.contourId){\n // console.warn('Edges of the same polygon overlap',\n // se1.point, se1.otherEvent.point, se2.point, se2.otherEvent.point);\n // }\n //throw new Error('Edges of the same polygon overlap');\n return 0;\n }\n\n // The line segments associated to se1 and se2 intersect\n if (nintersections === 1) {\n\n // if the intersection point is not an endpoint of se1\n if (!equals(se1.point, inter[0]) && !equals(se1.otherEvent.point, inter[0])) {\n divideSegment(se1, inter[0], queue);\n }\n\n // if the intersection point is not an endpoint of se2\n if (!equals(se2.point, inter[0]) && !equals(se2.otherEvent.point, inter[0])) {\n divideSegment(se2, inter[0], queue);\n }\n return 1;\n }\n\n // The line segments associated to se1 and se2 overlap\n var events = [];\n var leftCoincide = false;\n var rightCoincide = false;\n\n if (equals(se1.point, se2.point)) {\n leftCoincide = true; // linked\n } else if (compareEvents(se1, se2) === 1) {\n events.push(se2, se1);\n } else {\n events.push(se1, se2);\n }\n\n if (equals(se1.otherEvent.point, se2.otherEvent.point)) {\n rightCoincide = true;\n } else if (compareEvents(se1.otherEvent, se2.otherEvent) === 1) {\n events.push(se2.otherEvent, se1.otherEvent);\n } else {\n events.push(se1.otherEvent, se2.otherEvent);\n }\n\n if ((leftCoincide && rightCoincide) || leftCoincide) {\n // both line segments are equal or share the left endpoint\n se2.type = NON_CONTRIBUTING;\n se1.type = (se2.inOut === se1.inOut)\n ? SAME_TRANSITION : DIFFERENT_TRANSITION;\n\n if (leftCoincide && !rightCoincide) {\n // honestly no idea, but changing events selection from [2, 1]\n // to [0, 1] fixes the overlapping self-intersecting polygons issue\n divideSegment(events[1].otherEvent, events[0].point, queue);\n }\n return 2;\n }\n\n // the line segments share the right endpoint\n if (rightCoincide) {\n divideSegment(events[0], events[1].point, queue);\n return 3;\n }\n\n // no line segment includes totally the other one\n if (events[0] !== events[3].otherEvent) {\n divideSegment(events[0], events[1].point, queue);\n divideSegment(events[1], events[2].point, queue);\n return 3;\n }\n\n // one line segment includes the other one\n divideSegment(events[0], events[1].point, queue);\n divideSegment(events[3].otherEvent, events[2].point, queue);\n\n return 3;\n}\n\n/**\n * @param {SweepEvent} le1\n * @param {SweepEvent} le2\n * @return {Number}\n */\nfunction compareSegments(le1, le2) {\n if (le1 === le2) { return 0; }\n\n // Segments are not collinear\n if (signedArea(le1.point, le1.otherEvent.point, le2.point) !== 0 ||\n signedArea(le1.point, le1.otherEvent.point, le2.otherEvent.point) !== 0) {\n\n // If they share their left endpoint use the right endpoint to sort\n if (equals(le1.point, le2.point)) { return le1.isBelow(le2.otherEvent.point) ? -1 : 1; }\n\n // Different left endpoint: use the left endpoint to sort\n if (le1.point[0] === le2.point[0]) { return le1.point[1] < le2.point[1] ? -1 : 1; }\n\n // has the line segment associated to e1 been inserted\n // into S after the line segment associated to e2 ?\n if (compareEvents(le1, le2) === 1) { return le2.isAbove(le1.point) ? -1 : 1; }\n\n // The line segment associated to e2 has been inserted\n // into S after the line segment associated to e1\n return le1.isBelow(le2.point) ? -1 : 1;\n }\n\n if (le1.isSubject === le2.isSubject) { // same polygon\n var p1 = le1.point, p2 = le2.point;\n if (p1[0] === p2[0] && p1[1] === p2[1]/*equals(le1.point, le2.point)*/) {\n p1 = le1.otherEvent.point; p2 = le2.otherEvent.point;\n if (p1[0] === p2[0] && p1[1] === p2[1]) { return 0; }\n else { return le1.contourId > le2.contourId ? 1 : -1; }\n }\n } else { // Segments are collinear, but belong to separate polygons\n return le1.isSubject ? -1 : 1;\n }\n\n return compareEvents(le1, le2) === 1 ? 1 : -1;\n}\n\nfunction subdivide(eventQueue, subject, clipping, sbbox, cbbox, operation) {\n var sweepLine = new SplayTree(compareSegments);\n var sortedEvents = [];\n\n var rightbound = Math.min(sbbox[2], cbbox[2]);\n\n var prev, next, begin;\n\n while (eventQueue.length !== 0) {\n var event = eventQueue.pop();\n sortedEvents.push(event);\n\n // optimization by bboxes for intersection and difference goes here\n if ((operation === INTERSECTION && event.point[0] > rightbound) ||\n (operation === DIFFERENCE && event.point[0] > sbbox[2])) {\n break;\n }\n\n if (event.left) {\n next = prev = sweepLine.insert(event);\n begin = sweepLine.minNode();\n\n if (prev !== begin) { prev = sweepLine.prev(prev); }\n else { prev = null; }\n\n next = sweepLine.next(next);\n\n var prevEvent = prev ? prev.key : null;\n var prevprevEvent = (void 0);\n computeFields(event, prevEvent, operation);\n if (next) {\n if (possibleIntersection(event, next.key, eventQueue) === 2) {\n computeFields(event, prevEvent, operation);\n computeFields(event, next.key, operation);\n }\n }\n\n if (prev) {\n if (possibleIntersection(prev.key, event, eventQueue) === 2) {\n var prevprev = prev;\n if (prevprev !== begin) { prevprev = sweepLine.prev(prevprev); }\n else { prevprev = null; }\n\n prevprevEvent = prevprev ? prevprev.key : null;\n computeFields(prevEvent, prevprevEvent, operation);\n computeFields(event, prevEvent, operation);\n }\n }\n } else {\n event = event.otherEvent;\n next = prev = sweepLine.find(event);\n\n if (prev && next) {\n\n if (prev !== begin) { prev = sweepLine.prev(prev); }\n else { prev = null; }\n\n next = sweepLine.next(next);\n sweepLine.remove(event);\n\n if (next && prev) {\n possibleIntersection(prev.key, next.key, eventQueue);\n }\n }\n }\n }\n return sortedEvents;\n}\n\nvar Contour = function Contour() {\n this.points = [];\n this.holeIds = [];\n this.holeOf = null;\n this.depth = null;\n};\n\nContour.prototype.isExterior = function isExterior () {\n return this.holeOf == null;\n};\n\n/**\n * @param {Array.} sortedEvents\n * @return {Array.}\n */\nfunction orderEvents(sortedEvents) {\n var event, i, len, tmp;\n var resultEvents = [];\n for (i = 0, len = sortedEvents.length; i < len; i++) {\n event = sortedEvents[i];\n if ((event.left && event.inResult) ||\n (!event.left && event.otherEvent.inResult)) {\n resultEvents.push(event);\n }\n }\n // Due to overlapping edges the resultEvents array can be not wholly sorted\n var sorted = false;\n while (!sorted) {\n sorted = true;\n for (i = 0, len = resultEvents.length; i < len; i++) {\n if ((i + 1) < len &&\n compareEvents(resultEvents[i], resultEvents[i + 1]) === 1) {\n tmp = resultEvents[i];\n resultEvents[i] = resultEvents[i + 1];\n resultEvents[i + 1] = tmp;\n sorted = false;\n }\n }\n }\n\n\n for (i = 0, len = resultEvents.length; i < len; i++) {\n event = resultEvents[i];\n event.otherPos = i;\n }\n\n // imagine, the right event is found in the beginning of the queue,\n // when his left counterpart is not marked yet\n for (i = 0, len = resultEvents.length; i < len; i++) {\n event = resultEvents[i];\n if (!event.left) {\n tmp = event.otherPos;\n event.otherPos = event.otherEvent.otherPos;\n event.otherEvent.otherPos = tmp;\n }\n }\n\n return resultEvents;\n}\n\n\n/**\n * @param {Number} pos\n * @param {Array.} resultEvents\n * @param {Object>} processed\n * @return {Number}\n */\nfunction nextPos(pos, resultEvents, processed, origPos) {\n var newPos = pos + 1,\n p = resultEvents[pos].point,\n p1;\n var length = resultEvents.length;\n\n if (newPos < length)\n { p1 = resultEvents[newPos].point; }\n\n while (newPos < length && p1[0] === p[0] && p1[1] === p[1]) {\n if (!processed[newPos]) {\n return newPos;\n } else {\n newPos++;\n }\n p1 = resultEvents[newPos].point;\n }\n\n newPos = pos - 1;\n\n while (processed[newPos] && newPos > origPos) {\n newPos--;\n }\n\n return newPos;\n}\n\n\nfunction initializeContourFromContext(event, contours, contourId) {\n var contour = new Contour();\n if (event.prevInResult != null) {\n var prevInResult = event.prevInResult;\n // Note that it is valid to query the \"previous in result\" for its output contour id,\n // because we must have already processed it (i.e., assigned an output contour id)\n // in an earlier iteration, otherwise it wouldn't be possible that it is \"previous in\n // result\".\n var lowerContourId = prevInResult.outputContourId;\n var lowerResultTransition = prevInResult.resultTransition;\n if (lowerResultTransition > 0) {\n // We are inside. Now we have to check if the thing below us is another hole or\n // an exterior contour.\n var lowerContour = contours[lowerContourId];\n if (lowerContour.holeOf != null) {\n // The lower contour is a hole => Connect the new contour as a hole to its parent,\n // and use same depth.\n var parentContourId = lowerContour.holeOf;\n contours[parentContourId].holeIds.push(contourId);\n contour.holeOf = parentContourId;\n contour.depth = contours[lowerContourId].depth;\n } else {\n // The lower contour is an exterior contour => Connect the new contour as a hole,\n // and increment depth.\n contours[lowerContourId].holeIds.push(contourId);\n contour.holeOf = lowerContourId;\n contour.depth = contours[lowerContourId].depth + 1;\n }\n } else {\n // We are outside => this contour is an exterior contour of same depth.\n contour.holeOf = null;\n contour.depth = contours[lowerContourId].depth;\n }\n } else {\n // There is no lower/previous contour => this contour is an exterior contour of depth 0.\n contour.holeOf = null;\n contour.depth = 0;\n }\n return contour;\n}\n\n/**\n * @param {Array.} sortedEvents\n * @return {Array.<*>} polygons\n */\nfunction connectEdges(sortedEvents) {\n var i, len;\n var resultEvents = orderEvents(sortedEvents);\n\n // \"false\"-filled array\n var processed = {};\n var contours = [];\n\n var loop = function ( ) {\n\n if (processed[i]) {\n return;\n }\n\n var contourId = contours.length;\n var contour = initializeContourFromContext(resultEvents[i], contours, contourId);\n\n // Helper function that combines marking an event as processed with assigning its output contour ID\n var markAsProcessed = function (pos) {\n processed[pos] = true;\n resultEvents[pos].outputContourId = contourId;\n };\n\n var pos = i;\n var origPos = i;\n\n var initial = resultEvents[i].point;\n contour.points.push(initial);\n\n /* eslint no-constant-condition: \"off\" */\n while (true) {\n markAsProcessed(pos);\n\n pos = resultEvents[pos].otherPos;\n\n markAsProcessed(pos);\n contour.points.push(resultEvents[pos].point);\n\n pos = nextPos(pos, resultEvents, processed, origPos);\n\n if (pos == origPos) {\n break;\n }\n }\n\n contours.push(contour);\n };\n\n for (i = 0, len = resultEvents.length; i < len; i++) loop( );\n\n return contours;\n}\n\nvar _tinyqueue_1_2_3_tinyqueue = TinyQueue;\nvar default_1 = TinyQueue;\n\nfunction TinyQueue(data, compare) {\n if (!(this instanceof TinyQueue)) { return new TinyQueue(data, compare); }\n\n this.data = data || [];\n this.length = this.data.length;\n this.compare = compare || defaultCompare;\n\n if (this.length > 0) {\n for (var i = (this.length >> 1) - 1; i >= 0; i--) { this._down(i); }\n }\n}\n\nfunction defaultCompare(a, b) {\n return a < b ? -1 : a > b ? 1 : 0;\n}\n\nTinyQueue.prototype = {\n\n push: function (item) {\n this.data.push(item);\n this.length++;\n this._up(this.length - 1);\n },\n\n pop: function () {\n if (this.length === 0) { return undefined; }\n\n var top = this.data[0];\n this.length--;\n\n if (this.length > 0) {\n this.data[0] = this.data[this.length];\n this._down(0);\n }\n this.data.pop();\n\n return top;\n },\n\n peek: function () {\n return this.data[0];\n },\n\n _up: function (pos) {\n var data = this.data;\n var compare = this.compare;\n var item = data[pos];\n\n while (pos > 0) {\n var parent = (pos - 1) >> 1;\n var current = data[parent];\n if (compare(item, current) >= 0) { break; }\n data[pos] = current;\n pos = parent;\n }\n\n data[pos] = item;\n },\n\n _down: function (pos) {\n var data = this.data;\n var compare = this.compare;\n var halfLength = this.length >> 1;\n var item = data[pos];\n\n while (pos < halfLength) {\n var left = (pos << 1) + 1;\n var right = left + 1;\n var best = data[left];\n\n if (right < this.length && compare(data[right], best) < 0) {\n left = right;\n best = data[right];\n }\n if (compare(best, item) >= 0) { break; }\n\n data[pos] = best;\n pos = left;\n }\n\n data[pos] = item;\n }\n};\n_tinyqueue_1_2_3_tinyqueue.default = default_1;\n\nvar max = Math.max;\nvar min = Math.min;\n\nvar contourId = 0;\n\n\nfunction processPolygon(contourOrHole, isSubject, depth, Q, bbox, isExteriorRing) {\n var i, len, s1, s2, e1, e2;\n for (i = 0, len = contourOrHole.length - 1; i < len; i++) {\n s1 = contourOrHole[i];\n s2 = contourOrHole[i + 1];\n e1 = new SweepEvent(s1, false, undefined, isSubject);\n e2 = new SweepEvent(s2, false, e1, isSubject);\n e1.otherEvent = e2;\n\n if (s1[0] === s2[0] && s1[1] === s2[1]) {\n continue; // skip collapsed edges, or it breaks\n }\n\n e1.contourId = e2.contourId = depth;\n if (!isExteriorRing) {\n e1.isExteriorRing = false;\n e2.isExteriorRing = false;\n }\n if (compareEvents(e1, e2) > 0) {\n e2.left = true;\n } else {\n e1.left = true;\n }\n\n var x = s1[0], y = s1[1];\n bbox[0] = min(bbox[0], x);\n bbox[1] = min(bbox[1], y);\n bbox[2] = max(bbox[2], x);\n bbox[3] = max(bbox[3], y);\n\n // Pushing it so the queue is sorted from left to right,\n // with object on the left having the highest priority.\n Q.push(e1);\n Q.push(e2);\n }\n}\n\n\nfunction fillQueue(subject, clipping, sbbox, cbbox, operation) {\n var eventQueue = new _tinyqueue_1_2_3_tinyqueue(null, compareEvents);\n var polygonSet, isExteriorRing, i, ii, j, jj; //, k, kk;\n\n for (i = 0, ii = subject.length; i < ii; i++) {\n polygonSet = subject[i];\n for (j = 0, jj = polygonSet.length; j < jj; j++) {\n isExteriorRing = j === 0;\n if (isExteriorRing) { contourId++; }\n processPolygon(polygonSet[j], true, contourId, eventQueue, sbbox, isExteriorRing);\n }\n }\n\n for (i = 0, ii = clipping.length; i < ii; i++) {\n polygonSet = clipping[i];\n for (j = 0, jj = polygonSet.length; j < jj; j++) {\n isExteriorRing = j === 0;\n if (operation === DIFFERENCE) { isExteriorRing = false; }\n if (isExteriorRing) { contourId++; }\n processPolygon(polygonSet[j], false, contourId, eventQueue, cbbox, isExteriorRing);\n }\n }\n\n return eventQueue;\n}\n\nvar EMPTY = [];\n\n\nfunction trivialOperation(subject, clipping, operation) {\n var result = null;\n if (subject.length * clipping.length === 0) {\n if (operation === INTERSECTION) {\n result = EMPTY;\n } else if (operation === DIFFERENCE) {\n result = subject;\n } else if (operation === UNION ||\n operation === XOR) {\n result = (subject.length === 0) ? clipping : subject;\n }\n }\n return result;\n}\n\n\nfunction compareBBoxes(subject, clipping, sbbox, cbbox, operation) {\n var result = null;\n if (sbbox[0] > cbbox[2] ||\n cbbox[0] > sbbox[2] ||\n sbbox[1] > cbbox[3] ||\n cbbox[1] > sbbox[3]) {\n if (operation === INTERSECTION) {\n result = EMPTY;\n } else if (operation === DIFFERENCE) {\n result = subject;\n } else if (operation === UNION ||\n operation === XOR) {\n result = subject.concat(clipping);\n }\n }\n return result;\n}\n\n\nfunction boolean(subject, clipping, operation) {\n if (typeof subject[0][0][0] === 'number') {\n subject = [subject];\n }\n if (typeof clipping[0][0][0] === 'number') {\n clipping = [clipping];\n }\n var trivial = trivialOperation(subject, clipping, operation);\n if (trivial) {\n return trivial === EMPTY ? null : trivial;\n }\n var sbbox = [Infinity, Infinity, -Infinity, -Infinity];\n var cbbox = [Infinity, Infinity, -Infinity, -Infinity];\n\n // console.time('fill queue');\n var eventQueue = fillQueue(subject, clipping, sbbox, cbbox, operation);\n //console.timeEnd('fill queue');\n\n trivial = compareBBoxes(subject, clipping, sbbox, cbbox, operation);\n if (trivial) {\n return trivial === EMPTY ? null : trivial;\n }\n // console.time('subdivide edges');\n var sortedEvents = subdivide(eventQueue, subject, clipping, sbbox, cbbox, operation);\n //console.timeEnd('subdivide edges');\n\n // console.time('connect vertices');\n var contours = connectEdges(sortedEvents);\n //console.timeEnd('connect vertices');\n\n // Convert contours to polygons\n var polygons = [];\n for (var i = 0; i < contours.length; i++) {\n var contour = contours[i];\n if (contour.isExterior()) {\n // The exterior ring goes first\n var rings = [contour.points];\n // Followed by holes if any\n for (var j = 0; j < contour.holeIds.length; j++) {\n var holeId = contour.holeIds[j];\n rings.push(contours[holeId].points);\n }\n polygons.push(rings);\n }\n }\n\n return polygons;\n}\n\nfunction union (subject, clipping) {\n return boolean(subject, clipping, UNION);\n}\n\nfunction diff (subject, clipping) {\n return boolean(subject, clipping, DIFFERENCE);\n}\n\nfunction xor (subject, clipping) {\n return boolean(subject, clipping, XOR);\n}\n\nfunction intersection$1 (subject, clipping) {\n return boolean(subject, clipping, INTERSECTION);\n}\n\n/**\n * @enum {Number}\n */\nvar operations = { UNION: UNION, DIFFERENCE: DIFFERENCE, INTERSECTION: INTERSECTION, XOR: XOR };\n\nexport { diff, intersection$1 as intersection, operations, union, xor };\n//# sourceMappingURL=martinez.es.js.map\n","import matrix from './matrix';\nimport tar from './tar';\nimport vector from './vector';\nimport geom from './geom';\nimport { union, diff, intersection, xor } from './martinez';\n\nexport default {\n matrix,\n tar,\n vector,\n geom,\n booleanOperations: {\n union,\n diff,\n intersection,\n xor,\n },\n};\n","import unit from '../style/unit';\nimport enums from '../util/enums';\nimport util from '../util/util';\nimport math from '../math/index';\n\nconst { STYLE_KEY: {\n TRANSLATE_X,\n TRANSLATE_Y,\n TRANSLATE_Z,\n SCALE_X,\n SCALE_Y,\n SCALE_Z,\n SKEW_X,\n SKEW_Y,\n ROTATE_X,\n ROTATE_Y,\n ROTATE_Z,\n ROTATE_3D,\n PERSPECTIVE,\n MATRIX,\n FONT_SIZE,\n}} = enums;\nconst { PX, PERCENT, REM, VW, VH, VMAX, VMIN } = unit;\nconst { matrix, geom } = math;\nconst { identity, multiply, isE } = matrix;\nconst { d2r } = geom;\n\nfunction calSingle(t, k, v) {\n if(k === TRANSLATE_X) {\n t[12] = v;\n }\n else if(k === TRANSLATE_Y) {\n t[13] = v;\n }\n else if(k === TRANSLATE_Z) {\n t[14] = v;\n }\n else if(k === SCALE_X) {\n t[0] = v;\n }\n else if(k === SCALE_Y) {\n t[5] = v;\n }\n else if(k === SCALE_Z) {\n t[10] = v;\n }\n else if(k === SKEW_X) {\n v = d2r(v);\n t[4] = Math.tan(v);\n }\n else if(k === SKEW_Y) {\n v = d2r(v);\n t[1] = Math.tan(v);\n }\n else if(k === ROTATE_X) {\n v = d2r(v);\n let sin = Math.sin(v);\n let cos = Math.cos(v);\n t[5] = t[10] = cos;\n t[6] = sin;\n t[9] = -sin;\n }\n else if(k === ROTATE_Y) {\n v = d2r(v);\n let sin = Math.sin(v);\n let cos = Math.cos(v);\n t[0] = t[10] = cos;\n t[8] = sin;\n t[2] = -sin;\n }\n else if(k === ROTATE_Z) {\n v = d2r(v);\n let sin = Math.sin(v);\n let cos = Math.cos(v);\n t[0] = t[5] = cos;\n t[1] = sin;\n t[4] = -sin;\n }\n else if(k === ROTATE_3D) {\n let [x, y, z, r] = v;\n r = d2r(r[0]);\n let s = Math.sin(r);\n let c = Math.cos(r);\n if(x && !y && !z) {\n if(x < 0) {\n s = -s;\n }\n t[5] = c;\n t[9] = -s;\n t[6] = s;\n t[10] = c;\n }\n else if(y && !x && !z) {\n if(y < 0) {\n s = -s;\n }\n t[0] = c;\n t[8] = s;\n t[2] = -s;\n t[10] = c;\n }\n else if(z && !x && !y) {\n if(z < 0) {\n s = -s;\n }\n t[0] = c;\n t[4] = -s;\n t[1] = s;\n t[5] = c;\n }\n else {\n let len = Math.sqrt(x * x + y * y + z * z);\n if(len !== 1) {\n let rlen = 1 / len;\n x *= rlen;\n y *= rlen;\n z *= rlen;\n }\n let nc = 1 - c;\n let xy = x * y;\n let yz = y * z;\n let zx = z * x;\n let xs = x * s;\n let ys = y * s;\n let zs = z * s;\n\n t[0] = x * x * nc + c;\n t[1] = xy * nc + zs;\n t[2] = zx * nc - ys;\n t[3] = 0;\n\n t[4] = xy * nc - zs;\n t[5] = y * y * nc + c;\n t[6] = yz * nc + xs;\n t[7] = 0;\n\n t[8] = zx * nc + ys;\n t[9] = yz * nc - xs;\n t[10] = z * z * nc + c;\n t[11] = 0;\n\n t[12] = 0;\n t[13] = 0;\n t[14] = 0;\n t[15] = 1;\n }\n }\n else if(k === PERSPECTIVE && v > 0) {\n v = Math.max(v, 1);\n t[11] = -1 / v;\n }\n else if(k === MATRIX) {\n util.assignMatrix(t, v);\n }\n}\n\nfunction calMatrix(transform, ow, oh, root) {\n let list = normalize(transform, ow, oh, root);\n let m = identity();\n list.forEach(item => {\n let [k, v] = item;\n let t = identity();\n calSingle(t, k, v);\n m = multiply(m, t);\n });\n return m;\n}\n\n// 已有计算好的变换矩阵,根据tfo原点计算最终的matrix\nfunction calMatrixByOrigin(m, transformOrigin) {\n let [ox, oy] = transformOrigin;\n let res = m.slice(0);\n if(ox === 0 && oy === 0 || isE(m)) {\n return res;\n }\n res = multiply([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, ox, oy, 0, 1], res);\n res = multiply(res, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -ox, -oy, 0, 1]);\n return res;\n}\n\n// img缩放svg下专用,无rem\nfunction calMatrixWithOrigin(transform, transformOrigin, ow, oh) {\n let m = calMatrix(transform, ow, oh);\n return calMatrixByOrigin(m, transformOrigin);\n}\n\nfunction normalizeSingle(k, v, ow, oh, root) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n if(v[1] === PERCENT) {\n return v[0] * ow * 0.01;\n }\n else if(v[1] === REM) {\n return v[0] * root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n return v[0] * root.width * 0.01;\n }\n else if(v[1] === VH) {\n return v[0] * root.height * 0.01;\n }\n else if(v[1] === VMAX) {\n return v[0] * Math.max(root.width, root.height) * 0.01;\n }\n else if(v[1] === VMIN) {\n return v[0] * Math.min(root.width, root.height) * 0.01;\n }\n }\n else if(k === TRANSLATE_Y) {\n if(v[1] === PERCENT) {\n return v[0] * oh * 0.01;\n }\n else if(v[1] === REM) {\n return v[0] * root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n return v[0] * root.width * 0.01;\n }\n else if(v[1] === VH) {\n return v[0] * root.height * 0.01;\n }\n else if(v[1] === VMAX) {\n return v[0] * Math.max(root.width, root.height) * 0.01;\n }\n else if(v[1] === VMIN) {\n return v[0] * Math.min(root.width, root.height) * 0.01;\n }\n }\n else if(k === MATRIX) {\n return v;\n }\n else if(k === ROTATE_3D) {\n return v;\n }\n return v[0];\n}\n\nfunction normalize(transform, ow, oh, root) {\n let res = [];\n transform.forEach(item => {\n let [k, v] = item;\n res.push([k, normalizeSingle(k, v, ow, oh, root)]);\n });\n return res;\n}\n\nfunction calOrigin(transformOrigin, w, h, root) {\n let tfo = [];\n transformOrigin.forEach((item, i) => {\n if(item[1] === PX) {\n tfo.push(item[0]);\n }\n else if(item[1] === PERCENT) {\n tfo.push(item[0] * (i ? h : w) * 0.01);\n }\n else if(item[1] === REM) {\n tfo.push(item[0] * root.computedStyle[FONT_SIZE]);\n }\n else if(item[1] === VW) {\n tfo.push(item[0] * root.width * 0.01);\n }\n else if(item[1] === VH) {\n tfo.push(item[0] * root.height * 0.01);\n }\n else if(item[1] === VMAX) {\n tfo.push(item[0] * Math.max(root.width, root.height) * 0.01);\n }\n else if(item[1] === VMIN) {\n tfo.push(item[0] * Math.min(root.width, root.height) * 0.01);\n }\n });\n return tfo;\n}\n\nfunction calMatrixByPerspective(m, pm) {\n if(!isE(pm)) {\n m = multiply(pm, m);\n }\n return m;\n}\n\nfunction calPerspectiveMatrix(ppt, po) {\n if(ppt && ppt > 0) {\n let res = identity();\n ppt = Math.max(ppt, 1);\n res[11] = -1 / ppt;\n let [ox, oy] = po;\n if(ox || oy) {\n res = multiply([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, ox, oy, 0, 1], res);\n res = multiply(res, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -ox, -oy, 0, 1]);\n }\n return res;\n }\n}\n\n// 是否有透视矩阵应用\nfunction isPerspectiveMatrix(m) {\n if(!m) {\n return;\n }\n return !!(m[3] || m[7] || m[11]);\n}\n\nexport default {\n calMatrix,\n calOrigin,\n calMatrixByPerspective,\n calPerspectiveMatrix,\n calMatrixByOrigin,\n calMatrixWithOrigin,\n isPerspectiveMatrix,\n};\n","/**\n * https://www.w3.org/TR/2018/WD-filter-effects-1-20181218/#feGaussianBlurElement\n * 根据模糊参数sigma求卷积核尺寸\n * @param sigma\n * @returns {number}\n */\nfunction kernelSize(sigma) {\n if(sigma <= 0) {\n return 0;\n }\n let d = Math.floor(sigma * 3 * Math.sqrt(2 * Math.PI) / 4 + 0.5);\n if(d < 2) {\n d = 2;\n }\n if(d % 2 === 0) {\n d++;\n }\n return d;\n}\n\n/**\n * 根据sigma求模糊扩展尺寸,卷积核求得后为d,再求半径/2,然后因为算法要执行3次,所以*3\n * 比如本来d为5,半径2.5算上自身像素点则各方向扩展2,*3则扩展6\n * @param sigma\n * @returns {number}\n */\nfunction outerSize(sigma) {\n let d = kernelSize(sigma);\n return outerSizeByD(d);\n}\n\nfunction outerSizeByD(d) {\n return Math.floor(d * 0.5) * 3;\n}\n\n/**\n * 一维高斯正态分布,根据标准差和卷积核尺寸返回一维权重数组\n * @param sigma\n * @param d\n */\nfunction gaussianWeight(sigma, d) {\n let list = [];\n let len = Math.floor(d * 0.5);\n let total = 0;\n for(let i = len; i >= 0; i--) {\n let n = Math.pow(Math.E, -Math.pow(i, 2) / (2 * Math.pow(sigma, 2)))\n / (sigma * Math.sqrt(2 * Math.PI));\n list.push(n);\n total += n;\n }\n for(let i = 1; i <= len; i++) {\n let n = Math.pow(Math.E, -Math.pow(i, 2) / (2 * Math.pow(sigma, 2)))\n / (sigma * Math.sqrt(2 * Math.PI));\n list.push(n);\n total += n;\n }\n if(total !== 1) {\n for(let i = 0; i < d; i++) {\n list[i] /= total;\n }\n }\n return list;\n}\n\nexport default {\n kernelSize,\n outerSize,\n outerSizeByD,\n gaussianWeight,\n};\n","import Page from './Page';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport enums from '../util/enums';\nimport painter from '../util/painter';\nimport debug from '../util/debug';\nimport tf from '../style/transform';\nimport mx from '../math/matrix';\nimport blur from '../math/blur';\n\nconst {\n STYLE_KEY: {\n TRANSFORM_ORIGIN,\n TRANSFORM,\n },\n} = enums;\n\n// 根据一个共享cache的信息,生成一个独立的离屏canvas,一般是filter,mask用\nfunction genSingle(cache, message) {\n let { size, sx1, sy1, width, height, bbox } = cache;\n let offscreen = inject.getCacheCanvas(width, height, null, message);\n offscreen.x = 0;\n offscreen.y = 0;\n offscreen.bbox = bbox;\n offscreen.size = size;\n offscreen.sx1 = sx1;\n offscreen.sy1 = sy1;\n offscreen.dx = cache.dx;\n offscreen.dy = cache.dy;\n offscreen.dbx = cache.dbx;\n offscreen.dby = cache.dby;\n offscreen.width = width;\n offscreen.height = height;\n return offscreen;\n}\n\nclass Cache {\n constructor(w, h, bbox, page, pos, x1, y1) {\n this.__init(w, h, bbox, page, pos, x1, y1);\n }\n\n __init(w, h, bbox, page, pos, x1, y1) {\n this.__width = w;\n this.__height = h;\n this.__bbox = bbox;\n this.__page = page;\n this.__pos = pos;\n let [x, y] = page.getCoords(pos);\n this.__x = x;\n this.__y = y;\n this.__appendData(x1, y1);\n this.__isNew = true;\n if(page.canvas) {\n this.__enabled = true;\n let ctx = page.ctx;\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.globalAlpha = 1;\n if(debug.flag) {\n page.canvas.setAttribute && page.canvas.setAttribute('size', page.size);\n }\n }\n }\n\n __appendData(sx1, sy1) {\n this.sx1 = sx1; // 去除margin的左上角原点坐标\n this.sy1 = sy1;\n let bbox = this.bbox;\n this.dx = this.x - bbox[0]; // cache坐标和box原点的差值\n this.dy = this.y - bbox[1];\n this.dbx = sx1 - bbox[0]; // 原始x1/y1和box原点的差值\n this.dby = sy1 - bbox[1];\n this.update();\n }\n\n update() {\n this.page.update = true;\n }\n\n clear() {\n if(this.available) {\n let ctx = this.ctx;\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n let size = this.page.size;\n ctx.clearRect(this.x, this.y, size, size);\n this.__available = false;\n this.__isNew = true;\n }\n }\n\n release() {\n if(this.enabled) {\n this.clear();\n this.page.del(this.pos);\n this.__page = null;\n this.__enabled = false;\n }\n }\n\n reset(bbox, x1, y1) {\n // 尺寸没变复用之前的并清空\n if(util.equalArr(this.bbox, bbox) && this.enabled) {\n this.clear();\n return;\n }\n this.release();\n let w = Math.ceil(bbox[2] - bbox[0]);\n let h = Math.ceil(bbox[3] - bbox[1]);\n let res = Page.getInstance(Math.max(w, h));\n if(!res) {\n this.__enabled = false;\n return;\n }\n let { page, pos } = res;\n this.__init(w, h, bbox, page, pos, x1, y1);\n }\n\n // 是否功能可用,生成离屏canvas及尺寸超限\n get enabled() {\n return this.__enabled;\n }\n\n // 是否有可用缓存内容\n get available() {\n return this.enabled && this.__available;\n }\n\n get bbox() {\n return this.__bbox;\n }\n\n get page() {\n return this.__page;\n }\n\n get canvas() {\n return this.page.canvas;\n }\n\n get ctx() {\n return this.page.ctx;\n }\n\n get size() {\n return this.page.size;\n }\n\n get x() {\n return this.__x;\n }\n\n get y() {\n return this.__y;\n }\n\n get width() {\n return this.__width;\n }\n\n get height() {\n return this.__height;\n }\n\n get pos() {\n return this.__pos;\n }\n\n get isNew() {\n return this.__isNew;\n }\n\n static get MAX() {\n return Page.MAX;\n }\n\n static getInstance(bbox, x1, y1) {\n let w = Math.ceil(bbox[2] - bbox[0]);\n let h = Math.ceil(bbox[3] - bbox[1]);\n let res = Page.getInstance(Math.max(w, h));\n if(!res) {\n return;\n }\n let { page, pos } = res;\n return new Cache(w, h, bbox, page, pos, x1, y1);\n }\n\n /**\n * 复制cache的一块出来单独作为cacheFilter,尺寸边距保持一致,用浏览器原生ctx.filter滤镜\n * @param cache\n * @param filter\n * @returns {{canvas: *, ctx: *, release(): void, available: boolean, draw()}}\n */\n static genFilter(cache, filter) {\n let d = 0;\n filter.forEach(item => {\n let [k, v] = item;\n if(k === 'blur') {\n d = blur.outerSize(v);\n }\n });\n let { x, y, size, canvas, sx1, sy1, width, height, bbox } = cache;\n bbox = bbox.slice(0);\n bbox[0] -= d;\n bbox[1] -= d;\n bbox[2] += d;\n bbox[3] += d;\n let offscreen = inject.getCacheCanvas(width + d * 2, height + d * 2, null, 'filter');\n offscreen.ctx.filter = painter.canvasFilter(filter);\n offscreen.ctx.drawImage(canvas, x, y, width, height, d, d, width, height);\n offscreen.ctx.filter = 'none';\n offscreen.draw();\n offscreen.bbox = bbox;\n offscreen.x = 0;\n offscreen.y = 0;\n offscreen.size = size;\n offscreen.sx1 = sx1 - d;\n offscreen.sy1 = sy1 - d;\n offscreen.dx = cache.dx;\n offscreen.dy = cache.dy;\n offscreen.dbx = cache.dbx;\n offscreen.dby = cache.dby;\n offscreen.width = width + d * 2;\n offscreen.height = height + d * 2;\n return offscreen;\n }\n\n static genMask(target, node, cb) {\n let cacheMask = genSingle(target, 'mask1');\n let list = [];\n let { [TRANSFORM]: transform, [TRANSFORM_ORIGIN]: tfo } = node.computedStyle;\n let next = node.next;\n let isClip = next.isClip;\n while(next && next.isMask) {\n list.push(next);\n next = next.next;\n }\n let { x, y, ctx, dbx, dby } = cacheMask;\n tfo[0] += x + dbx + node.__sx1 - target.sx1;\n tfo[1] += y + dby + node.__sy1 - target.sy1;\n let inverse = tf.calMatrixByOrigin(transform, tfo);\n // 先将mask本身绘制到cache上,再设置模式绘制dom本身,因为都是img所以1个就够了\n list.forEach(item => {\n cb(item, cacheMask, inverse);\n });\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.globalAlpha = 1;\n ctx.globalCompositeOperation = isClip ? 'source-out' : 'source-in';\n Cache.drawCache(target, cacheMask);\n ctx.globalCompositeOperation = 'source-over';\n cacheMask.draw(ctx);\n return cacheMask;\n }\n\n /**\n * 如果不超过bbox,直接用已有的total/filter/mask,否则生成一个新的\n */\n static genOverflow(target, node) {\n let { bbox } = target;\n let { sx, sy, outerWidth, outerHeight } = node;\n let xe = sx + outerWidth;\n let ye = sy + outerHeight;\n if(bbox[0] < sx || bbox[1] < sy || bbox[2] > xe || bbox[3] > ye) {\n let cacheOverflow = genSingle(target, 'overflow');\n let ctx = cacheOverflow.ctx;\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.globalAlpha = 1;\n Cache.drawCache(target, cacheOverflow);\n cacheOverflow.draw(ctx);\n ctx.globalCompositeOperation = 'destination-in';\n ctx.fillStyle = '#FFF';\n ctx.beginPath();\n ctx.rect(sx - bbox[0], sy - bbox[1], outerWidth, outerHeight);\n ctx.fill();\n ctx.closePath();\n ctx.globalCompositeOperation = 'source-over';\n return cacheOverflow;\n }\n }\n\n /**\n * bbox变化时直接用老的cache内容重设bbox\n * @param cache\n * @param bbox\n */\n static updateCache(cache, bbox) {\n let old = cache.bbox;\n if(!util.equalArr(bbox, old)) {\n let dx = old[0] - bbox[0];\n let dy = old[1] - bbox[1];\n let newCache = Cache.getInstance(bbox);\n if(newCache && newCache.enabled) {\n let { x: ox, y: oy, canvas, width, height } = cache;\n let { x: nx, y: ny } = newCache;\n newCache.sx1 = cache.sx1;\n newCache.sy1 = cache.sy1;\n newCache.dx = cache.dx + dx;\n newCache.dy = cache.dy + dy;\n newCache.dbx = cache.dbx + dx;\n newCache.dby = cache.dby + dy;\n newCache.ctx.drawImage(canvas, ox, oy, width, height, dx + nx, dy + ny, width, height);\n newCache.__available = true;\n cache.release();\n return newCache;\n }\n }\n else {\n return cache;\n }\n }\n\n static drawCache(source, target, transform, matrix, tfo, parentMatrix, inverse) {\n let { x: tx, y: ty, sx1, sy1, ctx, dbx, dby } = target;\n let { x, y, canvas, sx1: sx2, sy1: sy2, dbx: dbx2, dby: dby2, width, height } = source;\n let ox = tx + sx2 - sx1 + dbx - dbx2;\n let oy = ty + sy2 - sy1 + dby - dby2;\n if(transform && matrix && tfo) {\n tfo[0] += ox;\n tfo[1] += oy;\n let m = tf.calMatrixByOrigin(transform, tfo);\n matrix = mx.multiply(matrix, m);\n if(!mx.isE(parentMatrix)) {\n matrix = mx.multiply(parentMatrix, matrix);\n }\n if(inverse) {\n // 很多情况mask和target相同matrix,可简化计算\n if(util.equalArr(matrix, inverse)) {\n matrix = mx.identity();\n }\n else {\n inverse = mx.inverse(inverse);\n matrix = mx.multiply(inverse, matrix);\n }\n }\n ctx.setTransform(matrix[0], matrix[1], matrix[4], matrix[5], matrix[12], matrix[13]);\n }\n ctx.drawImage(canvas, x, y, width, height, ox, oy, width, height);\n }\n\n static draw(ctx, opacity, matrix, cache) {\n ctx.globalAlpha = opacity;\n ctx.setTransform(matrix[0], matrix[1], matrix[4], matrix[5], matrix[12], matrix[13]);\n let { x, y, canvas, sx1, sy1, dbx, dby, width, height } = cache;\n ctx.drawImage(canvas, x, y, width, height, sx1 - dbx, sy1 - dby, width, height);\n }\n\n static getCache(list) {\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(item && item.available) {\n return item;\n }\n }\n }\n\n static NA = 0; // 无缓存模式\n static LOCAL = 1; // 局部根节点\n static CHILD = 2; // 其子节点\n static SELF = 3; // webgl专用\n}\n\nexport default Cache;\n","import change from './change';\nimport enums from '../util/enums';\n\nconst { STYLE_KEY, STYLE_KEY: {\n TRANSLATE_X,\n TRANSLATE_Y,\n TRANSLATE_Z,\n OPACITY,\n FILTER,\n PERSPECTIVE,\n PERSPECTIVE_ORIGIN,\n} } = enums;\n\nconst ENUM = {\n // 低位表示 0;\n },\n /**\n * 得出等级\n * @param k\n * @returns {number|*}\n */\n getLevel(k) {\n if(change.isIgnore(k)) {\n return ENUM.NONE;\n }\n if(k === TRANSLATE_X) {\n return ENUM.TRANSLATE_X;\n }\n else if(k === TRANSLATE_Y) {\n return ENUM.TRANSLATE_Y;\n }\n else if(k === TRANSLATE_Z) {\n return ENUM.TRANSLATE_Z;\n }\n else if(TRANSFORMS.hasOwnProperty(k)) {\n return ENUM.TRANSFORM;\n }\n else if(k === OPACITY) {\n return ENUM.OPACITY;\n }\n else if(k === FILTER) {\n return ENUM.FILTER;\n }\n else if(k === PERSPECTIVE || k === PERSPECTIVE_ORIGIN) {\n return ENUM.PERSPECTIVE;\n }\n else if(change.isRepaint(k)) {\n return ENUM.REPAINT;\n }\n return ENUM.REFLOW;\n },\n isReflow(lv) {\n return !this.isRepaint(lv);\n },\n isRepaint(lv) {\n return lv < ENUM.REFLOW;\n },\n isRebuild(lv) {\n return lv >= ENUM.REBUILD;\n },\n}, ENUM);\no.TRANSFORMS = TRANSFORMS;\n\nexport default o;\n","import Node from './Node';\nimport TextBox from './TextBox';\nimport Ellipsis from './Ellipsis';\nimport mode from '../refresh/mode';\nimport css from '../style/css';\nimport unit from '../style/unit';\nimport enums from '../util/enums';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport Cache from '../refresh/Cache';\nimport level from '../refresh/level';\n\nconst {\n STYLE_KEY: {\n DISPLAY,\n POSITION,\n LINE_HEIGHT,\n FONT_SIZE,\n FONT_FAMILY,\n FONT_WEIGHT,\n COLOR,\n VISIBILITY,\n LETTER_SPACING,\n OVERFLOW,\n WHITE_SPACE,\n TEXT_OVERFLOW,\n WIDTH,\n TEXT_STROKE_COLOR,\n TEXT_STROKE_WIDTH,\n MARGIN_LEFT,\n MARGIN_RIGHT,\n PADDING_LEFT,\n PADDING_RIGHT,\n BORDER_LEFT_WIDTH,\n BORDER_RIGHT_WIDTH,\n },\n NODE_KEY: {\n NODE_CACHE,\n NODE_LIMIT_CACHE,\n NODE_DOM_PARENT,\n NODE_MATRIX_EVENT,\n NODE_OPACITY,\n NODE_VIRTUAL_DOM,\n },\n UPDATE_KEY: {\n UPDATE_NODE,\n UPDATE_FOCUS,\n UPDATE_CONFIG,\n },\n ELLIPSIS,\n} = enums;\n\nconst { AUTO, REM, VW, VH, VMAX, VMIN } = unit;\nconst { CANVAS, SVG, WEBGL } = mode;\n\n/**\n * 在给定宽度w的情况下,测量文字content多少个满足塞下,只支持水平书写,从start的索引开始,content长length\n * 尽可能地少的次数调用canvas的measureText或svg的html节点的width,因为比较消耗性能\n * 这就需要一种算法,不能逐字遍历看总长度是否超过,也不能单字宽度相加因为有文本整形某些字体多个字宽度不等于每个之和\n * 简单的2分法实现简单,但是次数稍多,对于性能不是最佳,因为内容的slice裁剪和传递给canvas测量都随尺寸增加而加大\n * 由于知道w和fontSize,因此能推测出平均值为fontSize/w,即字的个数,\n * 进行测量后得出w2,和真实w对比,产生误差d,再看d和fontSize推测差距个数,如此反复\n * 返回内容和end索引和长度,最少也要1个字符\n * @param ctx\n * @param renderMode\n * @param start\n * @param length\n * @param content\n * @param w\n * @param perW\n * @param fontFamily\n * @param fontSize\n * @param fontWeight\n * @param letterSpacing\n */\nfunction measureLineWidth(ctx, renderMode, start, length, content, w, perW, fontFamily, fontSize, fontWeight, letterSpacing) {\n if(start >= length) {\n // 特殊情况不应该走进这里\n return [0, 0, false];\n }\n let i = start, j = length, rw = 0, newLine = false;\n // 特殊降级,有letterSpacing时,canvas无法完全兼容,只能采取单字测量的方式完成\n if(letterSpacing && [CANVAS, WEBGL].indexOf(renderMode) > -1) {\n let count = 0;\n for(; i < length; i++) {\n let mw = ctx.measureText(content.charAt(i)).width + letterSpacing;\n if(i > start && count + mw > w + (1e-10)) {\n newLine = true;\n break;\n }\n count += mw;\n }\n return [i - start, count, newLine || count > w + (1e-10)];\n }\n // 没有letterSpacing或者是svg模式可以完美获取TextMetrics\n let hypotheticalNum = Math.round(w / perW);\n // 不能增长0个字符,至少也要1个\n if(hypotheticalNum <= 0) {\n hypotheticalNum = 1;\n }\n // 超过内容长度范围也不行\n else if(hypotheticalNum > length - start) {\n hypotheticalNum = length - start;\n }\n // 类似2分的一个循环\n while(i < j) {\n let mw, str = content.slice(start, start + hypotheticalNum);\n if(renderMode === CANVAS || renderMode === WEBGL) {\n mw = ctx.measureText(str).width;\n }\n else if(renderMode === SVG) {\n mw = inject.measureTextSync(str, fontFamily, fontSize, fontWeight);\n }\n if(letterSpacing) {\n mw += hypotheticalNum * letterSpacing;\n }\n if(mw === w) {\n rw = w;\n newLine = true;\n break;\n }\n // 超出,设置右边界,并根据余量推测减少个数,精度问题,固定宽度或者累加的剩余空间,不用相等判断,而是为原本w宽度加一点点冗余1e-10\n if(mw > w + (1e-10)) {\n newLine = true;\n // 限制至少1个\n if(i === start) {\n rw = mw;\n break;\n }\n // 注意特殊判断i和j就差1个可直接得出结果,因为现在超了而-1不超肯定是-1的结果\n if(i === j - 1 || i - start === hypotheticalNum - 1) {\n hypotheticalNum = i - start;\n break;\n }\n j = hypotheticalNum - 1;\n let reduce = Math.round((mw - w) / perW);\n if(reduce <= 0) {\n reduce = 1;\n }\n hypotheticalNum -= reduce;\n if(hypotheticalNum < i - start) {\n hypotheticalNum = i - start;\n }\n }\n // 还有空余,设置左边界,并根据余量推测增加的个数\n else {\n rw = mw;\n if(hypotheticalNum === length - start) {\n break;\n }\n i = hypotheticalNum + start;\n let add = Math.round((w - mw) / perW);\n if(add <= 0) {\n add = 1;\n }\n hypotheticalNum += add;\n if(hypotheticalNum > j - start) {\n hypotheticalNum = j - start;\n }\n }\n }\n return [hypotheticalNum, rw, newLine];\n}\n\nfunction getFontKey(ff, fs, fw, ls) {\n return ff + '_' + fs + '_' + fw + '_' + ls;\n}\n\nclass Text extends Node {\n constructor(content) {\n super();\n this.__content = util.isNil(content) ? '' : content.toString();\n this.__textBoxes = [];\n this.__charWidth = 0; // 最小字符宽度(单个)\n this.__textWidth = 0; // 整体宽度\n this.__bp = null; // block父节点\n this.__widthHash = {}; // 存储当前字体样式key下的charWidth/textWidth\n }\n\n /**\n * text在virtual时和普通一样,无需特殊处理\n * endSpace由外界inline布局控制,末尾最后一行的空白mpb,包含递归情况,递归为多个嵌套末尾节点的空白mpb之和\n * 即便宽度不足,每行还是强制渲染一个字符,换行依据lx开始,因为x可能是从中间开始的,非inline则两个相等\n * 最后一个字符排版时要考虑末尾mpb,排不下的话回退删掉这个字符,如果最后一个字符另起开头,排不下也强制排,每行至少1个字符\n * 在textOverflow时很特殊,多个inline同行,回退可能到前一个inline节点,这个通过x和lx判断是否行首,决定至少1个字符规则\n * @param data\n * @private\n */\n __layout(data) {\n let __cache = this.__config[NODE_CACHE];\n if(__cache) {\n __cache.release();\n }\n let { x, y, w, lx = x, lineBoxManager, endSpace = 0, lineClamp = 0, lineClampCount = 0 } = data;\n this.__x = this.__sx = this.__sx1 = x;\n this.__y = this.__sy = this.__sy1 = y;\n let { isDestroyed, content, computedStyle, textBoxes, root } = this;\n textBoxes.splice(0);\n let __config = this.__config;\n __config[NODE_LIMIT_CACHE] = false;\n // 空内容w/h都为0可以提前跳出\n if(isDestroyed || computedStyle[DISPLAY] === 'none' || !content) {\n return lineClampCount;\n }\n this.__ox = this.__oy = 0;\n // 顺序尝试分割字符串为TextBox,形成多行,begin为每行起始索引,i是当前字符索引\n let i = 0;\n let beginSpace = x - lx; // x>=lx,当第一行非起始处时前面被prev节点占据,这个差值可认为是count宽度\n let length = content.length;\n let maxW = 0;\n let {\n [LINE_HEIGHT]: lineHeight,\n [LETTER_SPACING]: letterSpacing,\n [WHITE_SPACE]: whiteSpace,\n [FONT_SIZE]: fontSize,\n [FONT_WEIGHT]: fontWeight,\n [FONT_FAMILY]: fontFamily,\n } = computedStyle;\n let bp = this.domParent;\n while(bp.computedStyle[DISPLAY] === 'inline') {\n bp = bp.domParent;\n }\n this.__bp = bp;\n let textOverflow = bp.computedStyle[TEXT_OVERFLOW];\n css.getFontFamily(fontFamily); // 有检测过程必须执行\n // 布局测量前置,根据renderMode不同提供不同的测量方法\n let renderMode = root.renderMode;\n let ctx;\n if(renderMode === CANVAS || renderMode === WEBGL) {\n ctx = renderMode === WEBGL\n ? inject.getFontCanvas().ctx\n : root.ctx;\n ctx.font = css.setFontStyle(computedStyle);\n }\n // fontSize在中文是正好1个字宽度,英文不一定,等宽为2个,不等宽可能1~2个,特殊字符甚至>2个,取预估均值然后倒数得每个均宽0.8\n let perW = (fontSize * 0.8) + letterSpacing;\n let lineCount = 0;\n // 不换行特殊对待,同时考虑overflow和textOverflow\n if(whiteSpace === 'nowrap') {\n let isTextOverflow, textWidth = this.textWidth;\n let {\n [POSITION]: position,\n [OVERFLOW]: overflow,\n } = bp.computedStyle;\n let widthC = bp.currentStyle[WIDTH];\n // 只要是overflow隐藏,不管textOverflow如何(默认是clip等同于overflow:hidden的功能)都截取\n if(overflow === 'hidden') {\n // abs自适应宽度时不裁剪\n if(position === 'absolute' && widthC[1] === AUTO) {\n isTextOverflow = false;\n }\n else {\n isTextOverflow = textWidth > w + (1e-10) - beginSpace - endSpace;\n }\n }\n // ellipsis生效情况,本节点开始向前回退查找,尝试放下一部分字符\n if(isTextOverflow && textOverflow === 'ellipsis') {\n [y] = this.__lineBack(ctx, renderMode, i, length, content, w - endSpace - beginSpace, perW, x, y, maxW,\n endSpace, lineHeight, textBoxes, lineBoxManager, fontFamily, fontSize, fontWeight, letterSpacing);\n lineCount++;\n }\n // 默认是否clip跟随overflow:hidden,无需感知,裁剪由dom做,这里不裁剪\n else {\n let textBox = new TextBox(this, textBoxes.length, x, y, textWidth, lineHeight,\n content);\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox, false);\n y += lineHeight;\n if(isTextOverflow) {\n lineCount++;\n }\n }\n // 和html一样,maxW此时在html是满格\n maxW = textWidth;\n }\n // 普通换行,注意x和lx的区别,可能相同(block起始处)可能不同(非起始处),第1行从x开始,第2行及以后都从lx开始\n // 然后第一次换行还有特殊之处,可能同一行前半部行高很大,此时y增加并非自身的lineHeight,而是整体LineBox的\n else {\n while(i < length) {\n let wl = i ? w : (w - beginSpace);\n if(lineClamp && lineCount + lineClampCount >= lineClamp - 1) {\n wl -= endSpace;\n }\n let [num, rw, newLine] = measureLineWidth(ctx, renderMode, i, length, content, wl, perW, fontFamily, fontSize, fontWeight, letterSpacing);\n // 多行文本截断,这里肯定需要回退,注意防止恰好是最后一个字符,此时无需截取\n if(lineClamp && newLine && lineCount + lineClampCount >= lineClamp - 1) {\n [y, maxW] = this.__lineBack(ctx, renderMode, i, i + num, content, wl - endSpace, perW, lineCount ? lx : x, y, maxW,\n endSpace, lineHeight, textBoxes, lineBoxManager, fontFamily, fontSize, fontWeight, letterSpacing);\n lineCount++;\n break;\n }\n // 最后一行考虑endSpace,可能不够需要回退,但不能是1个字符\n if(i + num === length && endSpace && rw + endSpace > wl + (1e-10) && num > 1) {\n [num, rw, newLine] = measureLineWidth(ctx, renderMode, i, length, content, wl - endSpace, perW, fontFamily, fontSize, fontWeight, letterSpacing);\n // 可能加上endSpace后超过了,还得再判断一次\n if(lineClamp && newLine && lineCount + lineClampCount >= lineClamp - 1) {\n [y, maxW] = this.__lineBack(ctx, renderMode, i, i + num, content, wl - endSpace, perW, lineCount ? lx : x, y, maxW,\n endSpace, lineHeight, textBoxes, lineBoxManager, fontFamily, fontSize, fontWeight, letterSpacing);\n lineCount++;\n break;\n }\n }\n maxW = Math.max(maxW, rw);\n // 根据是否第一行分开处理行首空白\n let textBox = new TextBox(this, textBoxes.length, lineCount ? lx : x, y, rw, lineHeight, content.slice(i, i + num));\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox, newLine);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n // 至少也要1个字符形成1行,哪怕是首行,因为是否放得下逻辑在dom中做过了\n i += num;\n if(newLine) {\n lineCount++;\n }\n }\n // 换行后Text的x重设为lx\n if(lineCount) {\n this.__x = this.__sx1 = lx;\n }\n }\n this.__width = maxW;\n this.__height = y - data.y;\n this.__baseline = css.getBaseline(computedStyle);\n return lineClampCount + lineCount;\n }\n\n __layoutNone() {\n this.__width = this.__height = this.__baseline = 0;\n this.__textBoxes.splice(0);\n }\n\n // 末尾行因ellipsis的缘故向前回退字符生成textBox,可能会因不满足宽度导致无法生成,此时向前继续回退TextBox\n __lineBack(ctx, renderMode, i, length, content, wl, perW, x, y, maxW, endSpace, lineHeight, textBoxes, lineBoxManager,\n fontFamily, fontSize, fontWeight, letterSpacing) {\n let ew, bp = this.__bp, computedStyle = bp.computedStyle;\n // 临时测量ELLIPSIS的尺寸\n if(renderMode === CANVAS || renderMode === WEBGL) {\n let font = css.setFontStyle(computedStyle);\n if(ctx.font !== font) {\n ctx.font = font;\n }\n ew = ctx.measureText(ELLIPSIS).width;\n }\n else {\n ew = inject.measureTextSync(ELLIPSIS, computedStyle[FONT_FAMILY], computedStyle[FONT_SIZE], computedStyle[FONT_WEIGHT]);\n }\n if(renderMode === CANVAS || renderMode === WEBGL) {\n let font = css.setFontStyle(this.computedStyle);\n if (ctx.font !== font) {\n ctx.font = font;\n }\n }\n let [num, rw] = measureLineWidth(ctx, renderMode, i, length, content, wl - ew - endSpace, perW, fontFamily, fontSize, fontWeight, letterSpacing);\n // 还是不够,需要回溯查找前一个inline节点继续回退,同时防止空行首,要至少一个textBox且一个字符\n if(rw + ew > wl + (1e-10) - endSpace) {\n // 向前回溯已有的tb,需注意可能是新行开头这时还没生成新的lineBox,而旧行则至少1个内容\n // 新行的话进不来,会添加上面num的内容,旧行不添加只修改之前的tb内容也有可能删除一些\n let lineBox = lineBoxManager.lineBox;\n if(!lineBoxManager.isNewLine && lineBox && lineBox.size) {\n let list = lineBox.list;\n for(let j = list.length - 1; j >= 0; j--) {\n let tb = list[j];\n // 可能是个inlineBlock,整个省略掉,除非是第一个不作ellipsis处理\n if(!(tb instanceof TextBox)) {\n if(!j) {\n break;\n }\n let item = list.pop();\n x -= item.outerWidth;\n wl += item.outerWidth;\n item.__layoutNone();\n continue;\n }\n // 先判断整个tb都删除是否可以容纳下,同时注意第1个tb不能删除因此必进\n let { content, width, parent } = tb;\n if(!j || wl >= width + ew + (1e-10) + endSpace) {\n let length = content.length;\n let {\n [LINE_HEIGHT]: lineHeight,\n [LETTER_SPACING]: letterSpacing,\n [FONT_SIZE]: fontSize,\n [FONT_WEIGHT]: fontWeight,\n [FONT_FAMILY]: fontFamily,\n } = parent.computedStyle;\n if(renderMode === CANVAS || renderMode === WEBGL) {\n ctx.font = css.setFontStyle(parent.computedStyle);\n }\n // 再进行查找,这里也会有至少一个字符不用担心\n let [num, rw] = measureLineWidth(ctx, renderMode, 0, length, content, wl - ew + width - endSpace, perW, fontFamily, fontSize, fontWeight, letterSpacing);\n // 可能发生x回退,当tb的内容产生减少时\n if(num !== content.length) {\n tb.__content = content.slice(0, num);\n x -= width - rw;\n tb.__width = rw;\n }\n // 重新设置lineHeight和baseline,因为可能删除了东西\n lineBox.__resetLb(computedStyle[LINE_HEIGHT], css.getBaseline(computedStyle));\n let ep = new Ellipsis(x + endSpace, y, ew, bp);\n lineBoxManager.addItem(ep, true);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n maxW = Math.max(maxW, rw + ew);\n return [y, maxW];\n }\n // 舍弃这个tb,x也要向前回退,w增加,这会发生在ELLIPSIS字体很大,里面内容字体很小时\n let item = list.pop();\n wl += width;\n x -= width;\n let tbs = item.parent.textBoxes;\n let k = tbs.indexOf(item);\n if(k > -1) {\n tbs.splice(k, 1);\n }\n // 还得去掉dom,防止inline嵌套一直向上,同时得判断不能误删前面一个的dom\n let dom = item.parent.parent;\n let prev = list[list.length - 1];\n if(prev instanceof TextBox) {\n prev = prev.parent.parent;\n }\n while(dom !== bp && dom !== prev) {\n let contentBoxList = dom.contentBoxList || [];\n let i = contentBoxList.indexOf(item);\n if(i > -1) {\n contentBoxList.splice(i, 1);\n }\n let computedStyle = dom.computedStyle;\n let mbp = computedStyle[MARGIN_LEFT] + computedStyle[MARGIN_RIGHT]\n + computedStyle[PADDING_LEFT] + computedStyle[PADDING_RIGHT]\n + computedStyle[BORDER_LEFT_WIDTH] + computedStyle[BORDER_RIGHT_WIDTH];\n x -= mbp;\n wl += mbp;\n dom.__layoutNone();\n dom = dom.domParent;\n }\n let contentBoxList = prev.contentBoxList || [];\n let i = contentBoxList.indexOf(item);\n if(i > -1) {\n contentBoxList.splice(i, 1);\n }\n }\n }\n }\n // 本次回退不用向前追溯删除textBox会进这里,最少一个字符兜底\n let textBox = new TextBox(this, textBoxes.length, x, y, rw, lineHeight, content.slice(i, i + num));\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox, false);\n // ELLIPSIS也作为内容加入,但特殊的是指向最近block使用其样式渲染\n let ep = new Ellipsis(x + rw + endSpace, y, ew, bp);\n lineBoxManager.addItem(ep, true);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n maxW = Math.max(maxW, rw + ew);\n return [y, maxW];\n }\n\n // 外部dom换行发现超行,且一定是ellipsis时,会进这里让上一行text回退,lineBox一定有值且最后一个一定是本text的最后的textBox\n __backtrack(bp, lineBoxManager, lineBox, textBox, wl, endSpace, ew, computedStyle, ctx, renderMode) {\n let list = lineBox.list;\n for(let j = list.length - 1; j >= 0; j--) {\n let tb = list[j];\n // 可能是个inlineBlock,整个省略掉,除非是第一个不作ellipsis处理\n if(!(tb instanceof TextBox)) {\n if(!j) {\n break;\n }\n let item = list.pop();\n wl += item.outerWidth;\n item.__layoutNone();\n continue;\n }\n // 先判断整个tb都删除是否可以容纳下,同时注意第1个tb不能删除因此必进\n let { content, width, parent } = tb;\n if(!j || wl >= width + ew + (1e-10) + endSpace) {\n let length = content.length;\n let {\n [LETTER_SPACING]: letterSpacing,\n [FONT_SIZE]: fontSize,\n [FONT_WEIGHT]: fontWeight,\n [FONT_FAMILY]: fontFamily,\n } = parent.computedStyle;\n if(renderMode === CANVAS || renderMode === WEBGL) {\n ctx.font = css.setFontStyle(parent.computedStyle);\n }\n let perW = (fontSize * 0.8) + letterSpacing;\n // 再进行查找,这里也会有至少一个字符不用担心\n let [num, rw] = measureLineWidth(ctx, renderMode, 0, length, content, wl - ew - endSpace + width, perW, fontFamily, fontSize, fontWeight, letterSpacing);\n // 可能发生x回退,当tb的内容产生减少时\n if(num !== content.length) {\n tb.__content = content.slice(0, num);\n tb.__width = rw;\n }\n // 重新设置lineHeight和baseline,因为可能删除了东西\n lineBox.__resetLb(computedStyle[LINE_HEIGHT], css.getBaseline(computedStyle));\n let ep = new Ellipsis(tb.x + rw + endSpace, tb.y, ew, bp);\n lineBoxManager.addItem(ep, true);\n return;\n }\n // 舍弃这个tb,x也要向前回退,w增加,这会发生在ELLIPSIS字体很大,里面内容字体很小时\n let item = list.pop();\n wl += width;\n let tbs = item.parent.textBoxes;\n let k = tbs.indexOf(item);\n if(k > -1) {\n tbs.splice(k, 1);\n }\n // 还得去掉dom,防止inline嵌套一直向上,同时得判断不能误删前面一个的dom\n let dom = item.parent.parent;\n let prev = list[list.length - 1];\n if(prev instanceof TextBox) {\n prev = prev.parent.parent;\n }\n while(dom !== bp && dom !== prev) {\n let contentBoxList = dom.contentBoxList || [];\n let i = contentBoxList.indexOf(item);\n if(i > -1) {\n contentBoxList.splice(i, 1);\n }\n let computedStyle = dom.computedStyle;\n let mbp = computedStyle[MARGIN_LEFT] + computedStyle[MARGIN_RIGHT]\n + computedStyle[PADDING_LEFT] + computedStyle[PADDING_RIGHT]\n + computedStyle[BORDER_LEFT_WIDTH] + computedStyle[BORDER_RIGHT_WIDTH];\n wl += mbp;\n dom.__layoutNone();\n dom = dom.domParent;\n }\n let contentBoxList = prev.contentBoxList || [];\n let i = contentBoxList.indexOf(item);\n if(i > -1) {\n contentBoxList.splice(i, 1);\n }\n }\n }\n\n __offsetX(diff, isLayout) {\n super.__offsetX(diff, isLayout);\n if(isLayout) {\n this.textBoxes.forEach(item => {\n item.__offsetX(diff);\n });\n }\n this.__sx1 += diff;\n }\n\n __offsetY(diff, isLayout) {\n super.__offsetY(diff, isLayout);\n if(isLayout) {\n this.textBoxes.forEach(item => {\n item.__offsetY(diff);\n });\n }\n this.__sy1 += diff;\n }\n\n __tryLayInline(w) {\n return w - this.firstCharWidth;\n }\n\n __inlineSize() {\n let minX, maxX;\n this.textBoxes.forEach((item, i) => {\n if(i) {\n minX = Math.min(minX, item.x);\n maxX = Math.max(maxX, item.x + item.width);\n }\n else {\n minX = item.x;\n maxX = item.x + item.width;\n }\n });\n this.__x = minX;\n this.__sx = this.__sx1 = minX + this.ox;\n this.__sy = this.__sy1;\n this.__width = maxX - minX;\n }\n\n render(renderMode, lv, ctx, cache, dx = 0, dy = 0) {\n let { isDestroyed, computedStyle, textBoxes, cacheStyle, __config } = this;\n if(renderMode === SVG) {\n __config[NODE_VIRTUAL_DOM] = this.__virtualDom = {\n type: 'text',\n children: [],\n };\n }\n if(isDestroyed || computedStyle[DISPLAY] === 'none' || computedStyle[VISIBILITY] === 'hidden'\n || !textBoxes.length) {\n return;\n }\n if(renderMode === CANVAS || renderMode === WEBGL) {\n // webgl借用离屏canvas绘制文本,cache标识为true是普通绘制,否则是超限降级情况\n if(renderMode === WEBGL) {\n if(cache) {\n let { sx, sy, bbox } = this;\n let __cache = __config[NODE_CACHE];\n if(__cache) {\n __cache.reset(bbox, sx, sy);\n }\n else {\n __cache = Cache.getInstance(bbox, sx, sy);\n }\n if(__cache && __cache.enabled) {\n __config[NODE_CACHE] = __cache;\n __cache.__available = true;\n ctx = __cache.ctx;\n dx += __cache.dx;\n dy += __cache.dy;\n __config[NODE_LIMIT_CACHE] = false;\n }\n else {\n __config[NODE_LIMIT_CACHE] = true;\n return;\n }\n }\n else {\n let root = this.root;\n let c = inject.getCacheCanvas(root.width, root.height, '__$$OVERSIZE$$__');\n ctx = c.ctx;\n let {\n [NODE_DOM_PARENT]: {\n __config: {\n [NODE_MATRIX_EVENT]: m,\n [NODE_OPACITY]: opacity,\n },\n },\n } = __config;\n ctx.setTransform(m[0], m[1], m[4], m[5], m[12], m[13]);\n ctx.globalAlpha = opacity;\n }\n }\n let font = css.setFontStyle(computedStyle);\n if(ctx.font !== font) {\n ctx.font = font;\n }\n let color = cacheStyle[COLOR];\n if(ctx.fillStyle !== color) {\n ctx.fillStyle = color;\n }\n let strokeWidth = computedStyle[TEXT_STROKE_WIDTH];\n if(ctx.lineWidth !== strokeWidth) {\n ctx.lineWidth = strokeWidth;\n }\n let strokeColor = cacheStyle[TEXT_STROKE_COLOR];\n if(ctx.strokeStyle !== strokeColor) {\n ctx.strokeStyle = strokeColor;\n }\n }\n // 可能为空,整个是个ellipsis\n textBoxes.forEach(item => {\n item.render(renderMode, ctx, computedStyle, cacheStyle, dx, dy);\n });\n if(renderMode === SVG) {\n this.virtualDom.children = textBoxes.map(textBox => textBox.virtualDom);\n }\n }\n\n __deepScan(cb) {\n cb(this);\n }\n\n __destroy() {\n if(this.isDestroyed) {\n return;\n }\n super.__destroy();\n let __cache = this.__config[NODE_CACHE];\n if(__cache) {\n __cache.release();\n }\n }\n\n getComputedStyle(key) {\n return this.domParent.getComputedStyle(key);\n }\n\n updateContent(s, cb) {\n let self = this;\n if(s === self.__content) {\n if(util.isFunction(cb)) {\n cb(-1);\n }\n return;\n }\n root.delRefreshTask(self.__task);\n root.addRefreshTask(self.__task = {\n __before() {\n self.__content = s;\n let res = {};\n let vd = self.domParent;\n res[UPDATE_NODE] = vd;\n res[UPDATE_FOCUS] = level.REFLOW;\n res[UPDATE_CONFIG] = vd.__config;\n let root = vd.root;\n root.__addUpdate(vd, vd.__config, root, root.__config, res);\n },\n __after(diff) {\n if(util.isFunction(cb)) {\n cb(diff);\n }\n },\n });\n }\n\n get content() {\n return this.__content;\n }\n\n set content(v) {\n this.__content = v;\n }\n\n get textBoxes() {\n return this.__textBoxes;\n }\n\n get charWidth() {\n let { __widthHash, content, computedStyle, root: { ctx, renderMode } } = this;\n let {\n [FONT_FAMILY]: fontFamily,\n [FONT_SIZE]: fontSize,\n [FONT_WEIGHT]: fontWeight,\n [LETTER_SPACING]: letterSpacing,\n } = computedStyle;\n let fontKey = getFontKey(fontFamily, fontSize, fontWeight, letterSpacing);\n if(!__widthHash.hasOwnProperty(fontKey)) {\n __widthHash[fontKey] = {};\n }\n let o = __widthHash[fontKey];\n if(!o.hasOwnProperty('charWidth')) {\n let max = 0;\n if(renderMode === CANVAS || renderMode === WEBGL) {\n if(renderMode === WEBGL) {\n ctx = inject.getFontCanvas().ctx;\n }\n ctx.font = css.setFontStyle(computedStyle);\n for(let i = 0, len = content.length; i < len; i++) {\n max = Math.max(max, ctx.measureText(content.charAt([i])).width);\n }\n }\n else if(renderMode === SVG) {\n max = inject.measureTextListMax(content, fontFamily, fontSize, fontWeight);\n }\n o.charWidth = max + letterSpacing;\n }\n return o.charWidth;\n }\n\n get firstCharWidth() {\n let { __widthHash, content, computedStyle, root: { ctx, renderMode } } = this;\n let {\n [FONT_FAMILY]: fontFamily,\n [FONT_SIZE]: fontSize,\n [FONT_WEIGHT]: fontWeight,\n [LETTER_SPACING]: letterSpacing,\n } = computedStyle;\n let fontKey = getFontKey(fontFamily, fontSize, fontWeight, letterSpacing);\n if(!__widthHash.hasOwnProperty(fontKey)) {\n __widthHash[fontKey] = {};\n }\n let o = __widthHash[fontKey];\n if(!o.hasOwnProperty('firstCharWidth')) {\n if(renderMode === CANVAS || renderMode === WEBGL) {\n if(renderMode === WEBGL) {\n ctx = inject.getFontCanvas().ctx;\n }\n ctx.font = css.setFontStyle(computedStyle);\n o.firstCharWidth = ctx.measureText(content.charAt(0)).width + letterSpacing;\n }\n else if(renderMode === SVG) {\n o.firstCharWidth = inject.measureTextSync(content.charAt(0), fontFamily, fontSize, fontWeight) + letterSpacing;\n }\n }\n return o.firstCharWidth;\n }\n\n get textWidth() {\n let { __widthHash, content, computedStyle, root: { ctx, renderMode } } = this;\n let {\n [FONT_FAMILY]: fontFamily,\n [FONT_SIZE]: fontSize,\n [FONT_WEIGHT]: fontWeight,\n [LETTER_SPACING]: letterSpacing,\n } = computedStyle;\n let fontKey = getFontKey(fontFamily, fontSize, fontWeight, letterSpacing);\n if(!__widthHash.hasOwnProperty(fontKey)) {\n __widthHash[fontKey] = {};\n }\n let o = __widthHash[fontKey];\n if(!o.hasOwnProperty('textWidth')) {\n if(renderMode === CANVAS || renderMode === WEBGL) {\n if(renderMode === WEBGL) {\n ctx = inject.getFontCanvas().ctx;\n }\n ctx.font = css.setFontStyle(computedStyle);\n o.textWidth = ctx.measureText(content).width + letterSpacing * content.length;\n }\n else if(renderMode === SVG) {\n o.textWidth = inject.measureTextSync(content, fontFamily, fontSize, fontWeight) + letterSpacing * content.length;\n }\n }\n return o.textWidth;\n }\n\n get baseline() {\n return this.__baseline;\n }\n\n get root() {\n return this.domParent.root;\n }\n\n get currentStyle() {\n return this.domParent.currentStyle;\n }\n\n get style() {\n return this.__style;\n }\n\n get computedStyle() {\n return this.domParent.computedStyle;\n }\n\n get cacheStyle() {\n return this.domParent.__cacheStyle;\n }\n\n get bbox() {\n let { __sx1: sx, __sy1: sy, width, height, root, currentStyle: { [TEXT_STROKE_WIDTH]: textStrokeWidth } } = this;\n let half = 0;\n if(textStrokeWidth[1] === REM) {\n half = Math.max(textStrokeWidth[0] * root.computedStyle[FONT_SIZE], half);\n }\n else if(textStrokeWidth[1] === VW) {\n half = Math.max(textStrokeWidth[0] * root.width, half);\n }\n else if(textStrokeWidth[1] === VH) {\n half = Math.max(textStrokeWidth[0] * root.height, half);\n }\n else if(textStrokeWidth[1] === VMAX) {\n half = Math.max(textStrokeWidth[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else if(textStrokeWidth[1] === VMIN) {\n half = Math.max(textStrokeWidth[0] * Math.min(root.width, root.height) * 0.01, half);\n }\n else {\n half = Math.max(textStrokeWidth[0], half);\n }\n return [sx - half, sy - half, sx + width + half, sy + height + half];\n }\n\n get isShadowRoot() {\n return !this.parent && this.host && this.host !== this.root;\n }\n\n get matrix() {\n return this.domParent.matrix;\n }\n\n get matrixEvent() {\n return this.domParent.matrixEvent;\n }\n}\n\nText.prototype.__renderByMask = Text.prototype.render;\n\nexport default Text;\n","import util from './util';\nimport $$type from './$$type';\n\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\n/**\n * 2. 打平children中的数组,变成一维\n * 3. 合并相连的Text节点,即string内容\n */\nfunction flattenJson(parent) {\n if(Array.isArray(parent)) {\n return parent.map(item => flattenJson(item));\n }\n else if(!parent || [TYPE_VD, TYPE_GM, TYPE_CP].indexOf(parent.$$type) === -1 || !Array.isArray(parent.children)) {\n return parent;\n }\n let list = [];\n traverseJson(list, parent.children, {\n lastText: null,\n });\n parent.children = list;\n return parent;\n}\n\nfunction traverseJson(list, children, options) {\n if(Array.isArray(children)) {\n children.forEach(item => {\n traverseJson(list, item, options);\n });\n }\n else if(children && (children.$$type === TYPE_VD || children.$$type === TYPE_GM)) {\n if(['canvas', 'svg', 'webgl'].indexOf(children.tagName) > -1) {\n throw new Error('Can not nest canvas/svg/webgl');\n }\n if(children.$$type === TYPE_VD) {\n flattenJson(children);\n }\n list.push(children);\n options.lastText = null;\n }\n else if(children && children.$$type === TYPE_CP) {\n list.push(children);\n // 强制component即便返回text也形成一个独立的节点,合并在layout布局中做\n options.lastText = null;\n }\n // 排除掉空的文本,连续的text合并\n else if(!util.isNil(children) && children !== '') {\n if(options.lastText !== null) {\n list[list.length - 1] = options.lastText += children;\n }\n else {\n list.push(children);\n }\n }\n}\n\nexport default flattenJson;\n","import Text from '../node/Text';\nimport util from './util';\nimport $$type from './$$type';\nimport enums from './enums';\nimport flatten from './flatten';\n\nconst { NODE_KEY: {\n NODE_DOM_PARENT,\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n} } = enums;\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet Xom, Dom, Img, Geom, Component;\n\nfunction initRoot(cd, root) {\n let c = flatten({\n tagName: root.tagName,\n props: {},\n children: cd,\n $$type: TYPE_VD,\n });\n root.__json = c;\n root.__host = root;\n let children = build(c.children, root, root);\n return relation(root, children);\n}\n\nfunction initDom(json, root, host, parent) {\n let vd = build(json, root, host);\n return relation(parent, vd);\n}\n\nfunction initCp(json, root, host) {\n if(util.isObject(json)) {\n // cp的flatten在__init中自己做\n return build(json, root, host);\n }\n // text的relation会由上层如Root设置\n else {\n return new Text(json);\n }\n}\n\nfunction initCp2(json, root, host, parent) {\n let vd = new json.klass(json.props);\n vd.__tagName = json.tagName || vd.__tagName;\n vd.__root = root;\n vd.__host = host;\n vd.__json = json;\n vd.__init();\n return relation(parent, vd);\n}\n\n/**\n * 将初始json文件生成virtualDom\n * @param json\n * @param root\n * @param host\n * @param hasP 出现过p标签\n * @returns vd\n */\nfunction build(json, root, host, hasP) {\n if(Array.isArray(json)) {\n return json.map(item => build(item, root, host, hasP));\n }\n let vd;\n if(util.isObject(json) && json.$$type) {\n let { tagName, props, children, klass, $$type, __inheritAnimate, __animateRecords } = json;\n // 更新过程中无变化的cp直接使用原来生成的\n if($$type === TYPE_CP && json.__placeholder) {\n return json.__placeholder;\n }\n if($$type === TYPE_VD) {\n if(tagName === 'img') {\n vd = new Img(tagName, props);\n if(Array.isArray(children) && children.length) {\n throw new Error('Img can not contain children');\n }\n }\n else {\n vd = new Dom(tagName, props);\n }\n // 检查p不能包含div\n if(tagName === 'p') {\n hasP = true;\n }\n else if(tagName === 'div' && hasP) {\n throw new Error('Markup p can not contain div');\n }\n if(Array.isArray(children)) {\n children = relation(vd, build(children, root, host, hasP));\n }\n else {\n children = [];\n }\n vd.__children = children;\n }\n else if($$type === TYPE_GM) {\n if(util.isString(tagName)) {\n let klass = Geom.getRegister(tagName);\n vd = new klass(tagName, props);\n }\n else if(tagName) {\n vd = new tagName('$', props);\n }\n }\n else if($$type === TYPE_CP) {\n vd = new klass(props);\n vd.__tagName = tagName || vd.__tagName;\n }\n else {\n return new Text(json);\n }\n // 根parse需要用到真正的vd引用,然后vd也要引用json,用以做domApi\n json.vd = vd;\n vd.__json = json;\n // 递归parse中的动画记录需特殊处理,将target改为真正的vd引用\n if(__animateRecords) {\n vd.__animateRecords = __animateRecords;\n __animateRecords.list.forEach(item => {\n item.target = item.target.vd;\n });\n delete json.__animateRecords;\n }\n // 更新过程中key相同或者普通相同的vd继承动画\n if(__inheritAnimate) {\n util.extendAnimate(__inheritAnimate, vd);\n delete json.__inheritAnimate;\n }\n vd.__root = root;\n vd.__host = host;\n if($$type === TYPE_CP) {\n vd.__init();\n }\n let ref = props.ref;\n if(util.isString(ref) && ref || util.isNumber(ref)) {\n host.ref[ref] = vd;\n }\n else if(util.isFunction(ref)) {\n ref(vd);\n }\n return vd;\n }\n return new Text(json);\n}\n\n/**\n * 设置关系,父子和兄弟\n * @param parent\n * @param children\n * @param options\n * @returns {Xom|Text|Component}\n */\nfunction relation(parent, children, options = {}) {\n if(Array.isArray(children)) {\n children.forEach(item => {\n relation(parent, item, options);\n });\n }\n else if(children instanceof Xom || children instanceof Component || children instanceof Text) {\n children.__parent = parent;\n children.__domParent = parent;\n // 极为恶心,为了v8的性能优化,text复用parent的__config部分,但domParent重设\n if(children instanceof Text) {\n [\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n ].forEach(k => {\n children.__config[k] = parent.__config[k];\n });\n }\n if(children.__config) {\n children.__config[NODE_DOM_PARENT] = parent;\n }\n if(options.prev) {\n options.prev.__next = children;\n children.__prev = options.prev;\n }\n options.prev = children;\n // 文字视作为父节点的直接文字子节点\n if(children instanceof Component) {\n let sr = children.shadowRoot;\n if(sr instanceof Text) {\n sr.__parent = parent;\n [\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n ].forEach(k => {\n children.__config[k] = parent.__config[k];\n });\n }\n sr.__domParent = parent;\n if(sr.__config) {\n sr.__config[NODE_DOM_PARENT] = parent;\n }\n }\n }\n return children;\n}\n\nexport default {\n ref(o) {\n Xom = o.Xom;\n Dom = o.Dom;\n Img = o.Img;\n Geom = o.Geom;\n Component = o.Component;\n },\n initRoot,\n initDom,\n initCp,\n initCp2,\n relation,\n};\n","import util from './util';\n\nconst { isFunction } = util;\n\nclass Event {\n constructor() {\n this.__eHash = {};\n }\n\n on(id, handle) {\n if(!isFunction(handle)) {\n return;\n }\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.on(id[i], handle);\n }\n }\n else {\n if(!self.__eHash.hasOwnProperty(id)) {\n self.__eHash[id] = [];\n }\n // 遍历防止此handle被侦听过了\n for(let i = 0, item = self.__eHash[id], len = item.length; i < len; i++) {\n if(item[i] === handle) {\n return self;\n }\n }\n self.__eHash[id].push(handle);\n }\n return self;\n }\n\n once(id, handle) {\n if(!isFunction(handle)) {\n return;\n }\n let self = this;\n\n // 包裹一层会导致添加后删除对比引用删不掉,需保存原有引用进行对比\n function cb(...data) {\n handle.apply(self, data);\n self.off(id, cb);\n }\n\n cb.__karasEventCb = handle;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.once(id[i], handle);\n }\n }\n else if(handle) {\n self.on(id, cb);\n }\n return this;\n }\n\n off(id, handle) {\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.off(id[i], handle);\n }\n }\n else if(self.__eHash.hasOwnProperty(id)) {\n if(handle) {\n for(let i = 0, item = self.__eHash[id], len = item.length; i < len; i++) {\n // 需考虑once包裹的引用对比\n if(item[i] === handle || item[i].__karasEventCb === handle) {\n item.splice(i, 1);\n break;\n }\n }\n }\n // 未定义为全部清除\n else {\n delete self.__eHash[id];\n }\n }\n return this;\n }\n\n emit(id, ...data) {\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.emit(id[i], data);\n }\n }\n else {\n if(self.__eHash.hasOwnProperty(id)) {\n let list = self.__eHash[id];\n if(list.length) {\n list = list.slice();\n for(let i = 0, len = list.length; i < len; i++) {\n let cb = list[i];\n if(isFunction(cb)) {\n cb.apply(self, data);\n }\n }\n }\n }\n }\n return this;\n }\n\n static mix(...obj) {\n for(let i = obj.length - 1; i >= 0; i--) {\n let o = obj[i];\n let event = new Event();\n o.__eHash = {};\n let fns = ['on', 'once', 'off', 'emit'];\n for(let j = fns.length - 1; j >= 0; j--) {\n let fn = fns[j];\n o[fn] = event[fn];\n }\n }\n }\n\n static REFRESH = 'refresh';\n static PAUSE = 'pause';\n static PLAY = 'play';\n static FRAME = 'frame';\n static FINISH = 'finish';\n static CANCEL = 'cancel';\n static BEGIN = 'begin';\n static END = 'end';\n}\n\nexport default Event;\n","import Node from './Node';\nimport Text from './Text';\nimport builder from '../util/builder';\nimport Event from '../util/Event';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport flatten from '../util/flatten';\nimport css from '../style/css';\nimport change from '../refresh/change';\n\nconst { isNil, isFunction, clone, extend } = util;\n\nconst REGISTER = {};\n\n/**\n * 向上设置cp类型叶子节点,表明从root到本节点这条链路有更新,使得无链路更新的节约递归\n * 在check时树递归会用到,判断是否需要查找cp更新\n * @param cp\n */\nfunction setUpdateFlag(cp) {\n // 去重\n if(cp.__hasCpUpdate) {\n return;\n }\n cp.__hasCpUpdate = true;\n let host = cp.host;\n if(host) {\n setUpdateFlag(host);\n }\n}\n\nclass Component extends Event {\n constructor(props = {}) {\n super();\n this.__tagName = /(?:function|class)\\s+([\\w$]+)/.exec(this.constructor.toString())[1];\n // 构建工具中都是arr,手写可能出现hash情况\n if(Array.isArray(props)) {\n this.props = util.arr2hash(props);\n }\n else {\n this.props = props;\n }\n this.__parent = null;\n this.__host = null;\n this.__ref = {};\n this.state = {};\n this.__isMounted = false;\n this.__taskList = [];\n }\n\n setState(n, cb) {\n let self = this;\n if(isNil(n)) {\n n = {};\n }\n else if(isFunction(n)) {\n return;\n }\n else {\n if(Object.keys(n).length === 0) {\n if(isFunction(cb)) {\n cb.call(self);\n }\n return;\n }\n let state = clone(self.state);\n n = extend(state, n);\n }\n let root = self.root;\n if(root && self.__isMounted) {\n // 一帧之内多次调用,需合并\n if(self.__nextState) {\n Object.assign(self.__nextState, n);\n self.__taskList.push(cb);\n }\n else {\n self.__nextState = n;\n self.__taskList = [cb];\n // 回调更新列表,before执行时splice出来供after执行,防止中途产生的后续setState干扰\n let list = [];\n let t = self.__task = {\n __before: () => {\n list = self.__taskList.splice(0);\n // 标识更新\n setUpdateFlag(this);\n },\n __after: () => {\n // self.__nextState = null; 由updater.js每次refresh前同步执行清空,这里不能异步清除,否则frame动画会乱序\n list.forEach(cb => {\n if(isFunction(cb)) {\n cb.call(self);\n }\n });\n },\n };\n root.addRefreshCp(t);\n }\n }\n // 构造函数中调用还未render,\n else if(isFunction(cb)) {\n self.state = n;\n cb.call(self);\n }\n }\n\n /**\n * build中调用初始化,json有值时是update过程才有,且处理过flatten\n * @param json\n * @private\n */\n __init(json) {\n this.__ref = {};\n let root = this.root;\n let cd = json || flatten(this.render());\n let sr = builder.initCp(cd, root, this);\n this.__cd = cd;\n if(sr instanceof Text) {\n // 文字视作为父节点的直接文字子节点,在builder里做\n }\n else if(sr instanceof Node) {\n let style = css.normalize(this.props.style);\n let keys = Object.keys(style);\n extend(sr.style, style, keys);\n extend(sr.currentStyle, style, keys);\n // 事件添加到sr\n Object.keys(this.props).forEach(k => {\n let v = this.props[k];\n if(/^on[a-zA-Z]/.test(k)) {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n });\n }\n else if(!(sr instanceof Component)) {\n // 本身build是递归的,子cp已经初始化了\n throw new Error('Component render() must return a dom/text: ' + this);\n }\n // 自定义事件无视返回强制添加\n Object.keys(this.props).forEach(k => {\n let v = this.props[k];\n if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n k = k.slice(3);\n this.on(k, v);\n }\n });\n // shadow指向直接renderRoot,shadowRoot考虑到返回Component的递归即hoc高阶组件\n // host是直接所属,hostRoot同考虑到高阶组件\n this.__shadow = sr;\n sr.__host = this;\n // 递归下去,多层级时执行顺序由里到外,最终会被最上层执行替换\n while(sr instanceof Component) {\n sr.__hostRoot = this;\n sr.shadow.__host = sr;\n sr = sr.shadow;\n }\n this.__shadowRoot = sr;\n sr.__hostRoot = this;\n if(!this.__isMounted) {\n this.__isMounted = true;\n if(isFunction(this.componentDidMount)) {\n root.once(Event.REFRESH, () => {\n this.componentDidMount();\n });\n }\n }\n }\n\n render() {\n inject.warn('Component must implement render()');\n }\n\n __destroy() {\n if(this.isDestroyed) {\n return;\n }\n this.__isDestroyed = true;\n this.__isMounted = false;\n if(isFunction(this.componentWillUnmount)) {\n this.componentWillUnmount();\n }\n this.root.delRefreshTask(this.__task);\n if(this.shadowRoot) {\n this.shadowRoot.__destroy();\n }\n this.__parent = null;\n }\n\n __emitEvent(e, force) {\n let sr = this.shadowRoot;\n if(sr instanceof Text) {\n return;\n }\n let res = sr.__emitEvent(e, force);\n if(res) {\n e.target = this;\n return true;\n }\n }\n\n get tagName() {\n return this.__tagName;\n }\n\n get shadow() {\n return this.__shadow;\n }\n\n get shadowRoot() {\n return this.__shadowRoot;\n }\n\n get root() {\n return this.__root;\n }\n\n get host() {\n return this.__host;\n }\n\n get hostRoot() {\n return this.__hostRoot;\n }\n\n get parent() {\n return this.__parent;\n }\n\n get prev() {\n return this.__prev;\n }\n\n get next() {\n return this.__next;\n }\n\n get ref() {\n return this.__ref;\n }\n\n get domParent() {\n return this.__domParent;\n }\n\n get state() {\n return this.__state;\n }\n\n set state(v) {\n this.__state = v;\n }\n\n get isDestroyed() {\n return this.__isDestroyed;\n }\n\n static get REGISTER() {\n return REGISTER;\n }\n\n static getRegister(name) {\n if(!name || !util.isString(name) || !/^[A-Z]/.test(name)) {\n throw new Error('Invalid param');\n }\n if(!REGISTER.hasOwnProperty(name)) {\n throw new Error(`Component has not register: ${name}`);\n }\n return REGISTER[name];\n }\n\n static register(name, obj) {\n if(!name || !util.isString(name) || !/^[A-Z]/.test(name)\n || !obj.prototype || !(obj.prototype instanceof Component)) {\n throw new Error('Invalid param: Component register');\n }\n if(Component.hasRegister(name)) {\n throw new Error(`Component has already register: ${name}`);\n }\n REGISTER[name] = obj;\n }\n\n static hasRegister(name) {\n return name && REGISTER.hasOwnProperty(name);\n }\n\n static delRegister(name) {\n if(Component.hasRegister(name)) {\n delete REGISTER[name];\n }\n }\n}\n\nObject.keys(change.GEOM).concat([\n 'x',\n 'y',\n 'ox',\n 'oy',\n 'sx',\n 'sy',\n // '__sx1',\n // '__sx2',\n // '__sx3',\n // '__sx4',\n // '__sx5',\n // '__sx6',\n // '__sy1',\n // '__sy2',\n // '__sy3',\n // '__sy4',\n // '__sy5',\n // '__sy6',\n 'width',\n 'height',\n 'outerWidth',\n 'outerHeight',\n 'clientWidth',\n 'clientHeight',\n 'offsetWidth',\n 'offsetHeight',\n 'style',\n 'animationList',\n 'animateStyle',\n 'currentStyle',\n 'computedStyle',\n 'currentProps',\n 'baseline',\n 'virtualDom',\n 'mask',\n 'maskId',\n 'textWidth',\n 'content',\n 'lineBoxes',\n 'charWidthList',\n 'charWidth',\n '__layoutData',\n 'availableAnimating',\n 'effectiveAnimating',\n 'displayAnimating',\n 'visibilityAnimating',\n 'bbox',\n '__config',\n 'contentBoxList',\n 'listener',\n 'matrix',\n 'matrixEvent',\n]).forEach(fn => {\n Object.defineProperty(Component.prototype, fn, {\n get() {\n let sr = this.shadowRoot;\n if(sr) {\n return sr[fn];\n }\n },\n });\n});\n\n[\n '__layout',\n '__layoutAbs',\n '__layoutNone',\n '__tryLayInline',\n '__offsetX',\n '__offsetY',\n '__calAutoBasis',\n '__calMp',\n '__calAbs',\n '__renderAsMask',\n '__renderByMask',\n '__mp',\n 'animate',\n 'removeAnimate',\n 'clearAnimate',\n 'updateStyle',\n 'getBoundingClientRect',\n 'getComputedStyle',\n '__deepScan',\n 'clearCache',\n '__structure',\n '__modifyStruct',\n '__updateStruct',\n 'flowChildren',\n 'absChildren',\n '__isRealInline',\n '__calBasis',\n '__calMinMax',\n '__computeMeasure',\n 'appendChild',\n 'prependChild',\n 'insertBefore',\n 'insertAfter',\n 'removeChild',\n 'remove',\n].forEach(fn => {\n Component.prototype[fn] = function() {\n let sr = this.shadowRoot;\n if(sr && isFunction(sr[fn])) {\n return sr[fn].apply(sr, arguments);\n }\n };\n});\n\nexport default Component;\n","import Ellipsis from './Ellipsis';\nimport TextBox from './TextBox';\nimport enums from '../util/enums';\n\nconst {\n STYLE_KEY: {\n MARGIN_LEFT,\n MARGIN_RIGHT,\n PADDING_LEFT,\n PADDING_RIGHT,\n BORDER_LEFT_WIDTH,\n BORDER_RIGHT_WIDTH,\n },\n} = enums;\n\n/**\n * 获取inline的每一行内容的矩形坐标4个点,同时附带上border的矩形,比前面4个点尺寸大或相等(有无border/padding)\n * @param xom\n * @param contentBoxList\n * @param start\n * @param end\n * @param lineBox\n * @param baseline\n * @param lineHeight\n * @param diffL\n * @param isStart\n * @param isEnd\n * @param backgroundClip\n * @param paddingTop\n * @param paddingRight\n * @param paddingBottom\n * @param paddingLeft\n * @param borderTopWidth\n * @param borderRightWidth\n * @param borderBottomWidth\n * @param borderLeftWidth\n * @returns {(*|number)[]}\n */\nfunction getInlineBox(xom, contentBoxList, start, end, lineBox, baseline, lineHeight, diffL, isStart, isEnd,\n backgroundClip, paddingTop, paddingRight, paddingBottom, paddingLeft,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth) {\n // 根据bgClip确定y伸展范围,inline渲染bg扩展到pb的位置不影响布局\n let eyt = 0, eyb = 0;\n if(backgroundClip === 'paddingBox' || backgroundClip === 'padding-box') {\n eyt = paddingTop;\n eyb = paddingBottom;\n }\n else if(backgroundClip !== 'contentBox' && backgroundClip !== 'content-box') {\n eyt = paddingTop + borderTopWidth;\n eyb = paddingBottom + borderBottomWidth;\n }\n // 同y的border伸展范围,其影响border渲染\n let pbt = paddingTop + borderTopWidth;\n let pbb = paddingBottom + borderBottomWidth;\n // inline的baseline和lineBox的差值\n let diff = lineBox.baseline - baseline;\n // x坐标取首尾contentBox的左右2侧,clip布局时已算好;y是根据lineHeight和lineBox的高度以及baseline对齐后计算的\n let x1 = start.x;\n let dom = start instanceof TextBox ? start.parent.domParent : start.domParent;\n while(dom !== xom) {\n let list = dom.contentBoxList;\n if(start === list[0]) {\n let {\n [MARGIN_LEFT]: marginLeft,\n [PADDING_LEFT]: paddingLeft,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = dom.computedStyle;\n x1 -= marginLeft + paddingLeft + borderLeftWidth;\n }\n dom = dom.domParent;\n }\n let bx1 = x1;\n if(isStart) {\n if(backgroundClip === 'paddingBox' || backgroundClip === 'padding-box') {\n x1 -= paddingLeft;\n }\n else if(backgroundClip !== 'contentBox' && backgroundClip !== 'content-box') {\n x1 -= paddingLeft + borderLeftWidth;\n }\n bx1 -= paddingLeft + borderLeftWidth;\n }\n let y1 = lineBox.y + diff - eyt;\n let by1 = lineBox.y + diff - pbt;\n let x2 = end.x + end.outerWidth;\n // TextBox的parent是Text,再是Dom,这里一定是inline,无嵌套就是xom本身,有则包含若干层最上层还是xom\n dom = end instanceof TextBox ? end.parent.domParent : end.domParent;\n // 从end开始,向上获取dom节点的尾部mpb进行累加,直到xom跳出\n while(dom !== xom) {\n let list = dom.contentBoxList;\n if(end === list[list.length - 1]) {\n let {\n [MARGIN_RIGHT]: marginRight,\n [PADDING_RIGHT]: paddingRight,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n } = dom.computedStyle;\n x2 += marginRight + paddingRight + borderRightWidth;\n }\n dom = dom.domParent;\n }\n let bx2 = x2;\n if(isEnd) {\n if(backgroundClip === 'paddingBox' || backgroundClip === 'padding-box') {\n x2 += paddingRight;\n }\n else if(backgroundClip !== 'contentBox' && backgroundClip !== 'content-box') {\n x2 += paddingRight + borderRightWidth;\n }\n bx2 += paddingRight + borderRightWidth;\n }\n let y2 = lineBox.y + diff + lineHeight - diffL + eyb;\n let by2 = lineBox.y + diff + lineHeight - diffL + pbb;\n // x要考虑xom的ox值\n x1 += xom.ox;\n x2 += xom.ox;\n bx1 += xom.ox;\n bx2 += xom.ox;\n y1 += xom.oy;\n y2 += xom.oy;\n by1 += xom.oy;\n by2 += xom.oy;\n return [x1, y1, x2, y2, bx1, by1, bx2, by2];\n}\n\n/**\n * 统计inline的所有contentBox排成一行时的总宽度,考虑嵌套的mpb\n * @param xom\n * @param contentBoxList\n * @returns {number}\n */\nfunction getInlineWidth(xom, contentBoxList) {\n let sum = 0;\n let length = contentBoxList.length;\n if(contentBoxList[length - 1] instanceof Ellipsis) {\n length--;\n }\n for(let i = 0; i < length; i++) {\n let contentBox = contentBoxList[i];\n sum += contentBox.width;\n // 嵌套时,首尾box考虑mpb\n let dom = contentBox instanceof TextBox ? contentBox.parent.domParent : contentBox.domParent;\n while(dom !== xom) {\n let list = dom.contentBoxList;\n if(contentBox === list[0]) {\n let {\n [MARGIN_LEFT]: marginLeft,\n [PADDING_LEFT]: paddingLeft,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = dom.computedStyle;\n sum += marginLeft + paddingLeft + borderLeftWidth;\n }\n if(contentBox === list[list.length - 1]) {\n let {\n [MARGIN_RIGHT]: marginRight,\n [PADDING_RIGHT]: paddingRight,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n } = dom.computedStyle;\n sum += marginRight + paddingRight + borderRightWidth;\n }\n dom = dom.domParent;\n }\n }\n return sum;\n}\n\nexport default {\n getInlineBox,\n getInlineWidth,\n};\n","import unit from './unit';\nimport transform from './transform';\nimport enums from '../util/enums';\n\nconst { STYLE_KEY: { SCALE_X, SCALE_Y } } = enums;\nconst { PERCENT, NUMBER } = unit;\n\nfunction matrixResize(imgWidth, imgHeight, targetWidth, targetHeight, x, y, w, h) {\n if(imgWidth === targetWidth && imgHeight === targetHeight) {\n return;\n }\n let list = [\n [SCALE_X, [targetWidth / imgWidth, NUMBER]],\n [SCALE_Y, [targetHeight / imgHeight, NUMBER]],\n ];\n let tfo = transform.calOrigin([[0, PERCENT], [0, PERCENT]], w, h);\n tfo[0] += x;\n tfo[1] += y;\n return transform.calMatrixWithOrigin(list, tfo, w, h);\n}\n\nexport default {\n matrixResize,\n};\n","import border from './border';\nimport transform from './transform';\nimport mx from '../math/matrix';\nimport mode from '../refresh/mode';\nimport painter from '../util/painter';\nimport util from '../util/util';\nimport unit from './unit';\nimport enums from '../util/enums';\nimport image from './image';\n\nconst {\n STYLE_KEY: {\n BACKGROUND_POSITION_X,\n BACKGROUND_POSITION_Y,\n FONT_SIZE,\n },\n NODE_KEY: {\n NODE_DEFS_CACHE,\n },\n} = enums;\nconst { clone, joinArr } = util;\nconst { canvasPolygon, svgPolygon } = painter;\nconst { AUTO, PX, PERCENT, STRING, REM, VW, VH, VMAX, VMIN } = unit;\n\nfunction renderBgc(xom, renderMode, ctx, color, list, x, y, w, h, btlr, btrr, bbrr, bblr,\n method = 'fill', isInline = false, dx = 0, dy = 0) {\n // radial渐变ellipse形状会有matrix,用以从圆缩放到椭圆\n let matrix, cx, cy;\n if(Array.isArray(color)) {\n matrix = color[1];\n cx = color[2];\n cy = color[3];\n color = color[0];\n }\n // border-radius使用三次贝塞尔曲线模拟1/4圆角,误差在[0, 0.000273]之间\n list = list || border.calRadius(x, y, w, h, btlr, btrr, bbrr, bblr);\n if(!list) {\n list = [\n [x, y],\n [x + w, y],\n [x + w, y + h],\n [x, y + h],\n [x, y],\n ];\n }\n // 椭圆有matrix,用逆矩阵变化点来完成\n if(matrix) {\n let tfo = [cx, cy];\n matrix = transform.calMatrixByOrigin(matrix, tfo);\n let t = mx.inverse(matrix);\n list = list.map(item => {\n if(!item || !item.length) {\n return null;\n }\n let arr = [];\n for(let i = 0, len = item.length; i < len; i += 2) {\n let p = mx.calPoint([item[i], item[i + 1]], t);\n arr.push(p[0]);\n arr.push(p[1]);\n }\n return arr;\n });\n }\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n if(matrix) {\n ctx.save();\n let me = xom.matrixEvent;\n matrix = mx.multiply(me, matrix);\n ctx.setTransform(matrix[0], matrix[1], matrix[4], matrix[5], matrix[12], matrix[13]);\n }\n ctx.beginPath();\n if(ctx.fillStyle !== color) {\n ctx.fillStyle = color;\n }\n canvasPolygon(ctx, list, dx, dy);\n ctx[method]();\n ctx.closePath();\n if(matrix) {\n ctx.restore();\n }\n }\n else if(renderMode === mode.SVG) {\n let d = svgPolygon(list);\n if(isInline) {\n let v = {\n tagName: 'symbol',\n props: [],\n children: [\n {\n type: 'item',\n tagName: 'path',\n props: [\n ['d', d],\n ['fill', color],\n ],\n },\n ],\n };\n xom.__config[NODE_DEFS_CACHE].push(v);\n return ctx.add(v);\n }\n else {\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', d],\n ['fill', color],\n ],\n });\n // 椭圆渐变独有\n if(matrix) {\n let bb = xom.virtualDom.bb;\n bb[bb.length - 1].props.push(['transform', `matrix(${joinArr(mx.m2m6(matrix), ',')})`]);\n }\n }\n }\n}\n\nfunction calBackgroundSize(value, w, h, root) {\n let res = [];\n value.forEach((item, i) => {\n if(item[1] === PX) {\n res.push(item[0]);\n }\n else if(item[1] === PERCENT) {\n res.push(item[0] * (i ? h : w) * 0.01);\n }\n else if(item[1] === REM) {\n res.push(item[0] * root.computedStyle[FONT_SIZE]);\n }\n else if(item[1] === VW) {\n res.push(item[0] * root.width * 0.01);\n }\n else if(item[1] === VH) {\n res.push(item[0] * root.height * 0.01);\n }\n else if(item[1] === VMAX) {\n res.push(item[0] * Math.max(root.width, root.height) * 0.01);\n }\n else if(item[1] === VMIN) {\n res.push(item[0] * Math.min(root.width, root.height) * 0.01);\n }\n else if(item[1] === AUTO) {\n res.push(-1);\n }\n else if(item[1] === STRING) {\n res.push(item[0] === 'contain' ? -2 : -3);\n }\n });\n return res;\n}\n\nfunction calBackgroundPosition(position, container, size, root) {\n if(Array.isArray(position)) {\n if(position[1] === PX) {\n return position[0];\n }\n else if(position[1] === PERCENT) {\n return (container - size) * position[0] * 0.01;\n }\n else if(position[1] === REM) {\n return position[0] * root.computedStyle[FONT_SIZE];\n }\n else if(position[1] === VW) {\n return position[0] * root.width * 0.01;\n }\n else if(position[1] === VH) {\n return position[0] * root.height * 0.01;\n }\n else if(position[1] === VMAX) {\n return position[0] * Math.max(root.width, root.height) * 0.01;\n }\n else if(position[1] === VMIN) {\n return position[0] * Math.min(root.width, root.height) * 0.01;\n }\n }\n return 0;\n}\n\nfunction renderImage(xom, renderMode, ctx, loadBgi,\n bx1, by1, bx2, by2, btlr, btrr, bbrr, bblr,\n currentStyle, i, backgroundSize, backgroundRepeat, __config, isInline,\n dx = 0, dy = 0) {\n let source = loadBgi.source;\n // 无source不绘制,可能错误或加载中\n if(source) {\n bx1 += dx;\n by1 += dy;\n bx2 += dx;\n by2 += dy;\n let bgW = bx2 - bx1;\n let bgH = by2 - by1;\n let { width, height } = loadBgi;\n let [w, h] = backgroundSize[i] || [];\n // -1为auto,-2为contain,-3为cover\n if(w === -1 && h === -1) {\n w = width;\n h = height;\n }\n else if(w === -2) {\n if(width > bgW && height > bgH) {\n w = width / bgW;\n h = height / bgH;\n if(w >= h) {\n w = bgW;\n h = w * height / width;\n }\n else {\n h = bgH;\n w = h * width / height;\n }\n }\n else if(width > bgW) {\n w = bgW;\n h = w * height / width;\n }\n else if(height > bgH) {\n h = bgH;\n w = h * width / height;\n }\n else {\n w = width;\n h = height;\n }\n }\n else if(w === -3) {\n if(bgW > width && bgH > height) {\n w = width / bgW;\n h = height / bgH;\n if(w <= h) {\n w = bgW;\n h = w * height / width;\n }\n else {\n h = bgH;\n w = h * width / height;\n }\n }\n else if(bgW > width) {\n w = bgW;\n h = w * height / width;\n }\n else if(bgH > height) {\n h = bgH;\n w = h * width / height;\n }\n else {\n w = width / bgW;\n h = height / bgH;\n if(w <= h) {\n w = bgW;\n h = w * height / width;\n }\n else {\n h = bgH;\n w = h * width / height;\n }\n }\n }\n else if(w === -1) {\n w = h * width / height;\n }\n else if(h === -1) {\n h = w * height / width;\n }\n let bgX = bx1 + calBackgroundPosition(currentStyle[BACKGROUND_POSITION_X][i], bgW, w, xom.root);\n let bgY = by1 + calBackgroundPosition(currentStyle[BACKGROUND_POSITION_Y][i], bgH, h, xom.root);\n // 超出尺寸模拟mask截取\n let needMask = bgX < bx1 || bgY < by1 || (bgX + w) > (bx1 + bgW) || (bgY + h) > (by1 + bgH);\n // 计算因为repeat,需要向4个方向扩展渲染几个数量图片\n let xnl = 0;\n let xnr = 0;\n let ynt = 0;\n let ynb = 0;\n // repeat-x\n if(['repeat-x', 'repeatX', 'repeat'].indexOf(backgroundRepeat[i]) > -1) {\n let diff = bgX - bx1;\n if(diff > 0) {\n xnl = Math.ceil(diff / w);\n }\n diff = bx1 + bgW - bgX - w;\n if(diff > 0) {\n xnr = Math.ceil(diff / w);\n }\n }\n // repeat-y\n if(['repeat-y', 'repeatY', 'repeat'].indexOf(backgroundRepeat[i]) > -1) {\n let diff = bgY - by1;\n if(diff > 0) {\n ynt = Math.ceil(diff / h);\n }\n diff = by1 + bgH - bgY - h;\n if(diff > 0) {\n ynb = Math.ceil(diff / h);\n }\n }\n // 分同行列和4个角分别判断,先看同行同列,再看4个角的象限\n let repeat = [];\n if(xnl > 0) {\n for(let i = 0; i < xnl; i++) {\n let x = bgX - (i + 1) * w;\n repeat.push([x, bgY]);\n // 看最左边超过没有\n if(!needMask && i === 0 && x < bx1) {\n needMask = true;\n }\n }\n }\n if(xnr > 0) {\n for(let i = 0; i < xnr; i++) {\n let x = bgX + (i + 1) * w;\n repeat.push([x, bgY]);\n // 看最右边超过没有\n if(!needMask && i === xnr - 1 && x + w > bx1 + bgW) {\n needMask = true;\n }\n }\n }\n if(ynt > 0) {\n for(let i = 0; i < ynt; i++) {\n let y = bgY - (i + 1) * h;\n repeat.push([bgX, y]);\n // 看最上边超过没有\n if(!needMask && i === 0 && y < by1) {\n needMask = true;\n }\n }\n }\n if(ynb > 0) {\n for(let i = 0; i < ynb; i++) {\n let y = bgY + (i + 1) * h;\n repeat.push([bgX, y]);\n // 看最下边超过没有\n if(!needMask && i === ynb - 1 && y + w > by1 + bgH) {\n needMask = true;\n }\n }\n }\n // 原点和同行列十字画完,看4个角的情况\n if(xnl > 0 && ynt > 0) {\n for(let i = 0; i < xnl; i++) {\n for(let j = 0; j < ynt; j++) {\n repeat.push([bgX - (i + 1) * w, bgY - (j + 1) * h]);\n }\n }\n }\n if(xnr > 0 && ynt > 0) {\n for(let i = 0; i < xnr; i++) {\n for(let j = 0; j < ynt; j++) {\n repeat.push([bgX + (i + 1) * w, bgY - (j + 1) * h]);\n }\n }\n }\n if(xnl > 0 && ynb > 0) {\n for(let i = 0; i < xnl; i++) {\n for(let j = 0; j < ynb; j++) {\n repeat.push([bgX - (i + 1) * w, bgY + (j + 1) * h]);\n }\n }\n }\n if(xnr > 0 && ynb > 0) {\n for(let i = 0; i < xnr; i++) {\n for(let j = 0; j < ynb; j++) {\n repeat.push([bgX + (i + 1) * w, bgY + (j + 1) * h]);\n }\n }\n }\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n if(needMask) {\n ctx.save();\n renderBgc(this, renderMode, ctx, '#FFF', null,\n bx1, by1, bgW, bgH, btlr, btrr, bbrr, bblr, 'clip');\n }\n // 先画不考虑repeat的中心声明的\n ctx.drawImage(source, bgX, bgY, w, h);\n // 再画重复的十字和4角象限\n repeat.forEach(item => {\n ctx.drawImage(source, item[0], item[1], w, h);\n });\n if(needMask) {\n ctx.restore();\n }\n }\n else if(renderMode === mode.SVG) {\n let matrix = image.matrixResize(width, height, w, h, bgX, bgY, bgW, bgH);\n let props = [\n ['xlink:href', loadBgi.url],\n ['x', bgX],\n ['y', bgY],\n ['width', width],\n ['height', height],\n ];\n let needResize;\n if(matrix && !mx.isE(matrix)) {\n needResize = true;\n props.push(['transform', 'matrix(' + joinArr(mx.m2m6(matrix), ',') + ')']);\n }\n if(needMask) {\n let p1 = [bx1, by1];\n let p2 = [bx2, by2];\n if(needResize) {\n let inverse = mx.inverse(matrix);\n p1 = mx.calPoint(p1, inverse);\n p2 = mx.calPoint(p2, inverse);\n }\n let v = {\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', `M${p1[0]},${p1[1]}L${p2[0]},${p1[1]}L${p2[0]},${p2[1]}L${p1[0]},${p2[1]}L${p1[0]},${p1[1]}`],\n ['fill', '#FFF'],\n ],\n }],\n };\n let id = ctx.add(v);\n __config[NODE_DEFS_CACHE].push(v);\n props.push(['clip-path', 'url(#' + id + ')']);\n }\n if(isInline) {\n let v = {\n tagName: 'symbol',\n props: [],\n children: [\n {\n type: 'img',\n tagName: 'image',\n props,\n }\n ],\n };\n xom.__config[NODE_DEFS_CACHE].push(v);\n repeat.forEach(item => {\n let copy = clone(props);\n if(needResize) {\n let matrix = image.matrixResize(width, height, w, h, item[0], item[1], bgW, bgH);\n if(matrix && !mx.isE(matrix)) {\n copy[5][1] = 'matrix(' + joinArr(mx.m2m6(matrix), ',') + ')';\n }\n }\n copy[1][1] = item[0];\n copy[2][1] = item[1];\n v.children.push({\n type: 'img',\n tagName: 'image',\n props: copy,\n });\n });\n return ctx.add(v);\n }\n else {\n // 先画不考虑repeat的中心声明的\n xom.virtualDom.bb.push({\n type: 'img',\n tagName: 'image',\n props,\n });\n // 再画重复的十字和4角象限\n repeat.forEach(item => {\n let copy = clone(props);\n if(needResize) {\n let matrix = image.matrixResize(width, height, w, h, item[0], item[1], bgW, bgH);\n if(matrix && !mx.isE(matrix)) {\n copy[5][1] = 'matrix(' + joinArr(mx.m2m6(matrix), ',') + ')';\n }\n }\n copy[1][1] = item[0];\n copy[2][1] = item[1];\n xom.virtualDom.bb.push({\n type: 'img',\n tagName: 'image',\n props: copy,\n });\n });\n }\n }\n }\n}\n\nexport default {\n renderBgc,\n renderImage,\n calBackgroundSize,\n};\n","import inject from '../util/inject';\nimport util from '../util/util';\n\nconst { isFunction } = util;\n\nfunction traversal(list, length, diff, after) {\n if(after) {\n for(let i = 0; i < length; i++) {\n let item = list[i];\n if(item[1]) {\n item[1](diff);\n }\n else {\n item.__after && item.__after(diff);\n }\n }\n }\n else {\n for(let i = 0; i < length; i++) {\n let item = list[i];\n if(item[0]) {\n item[0](diff);\n }\n else {\n item.__before && item.__before(diff);\n }\n }\n }\n}\n\nlet isPause;\n\nclass Frame {\n constructor() {\n this.__hookTask = []; // 动画刷新后,每个root注册的刷新回调执行\n this.__task = [];\n this.__taskCp = []; // 区别于task,component专用,和animate等其它不同流水线,在最后执行,防止混了 #122\n this.__now = null;\n }\n\n __init() {\n let self = this;\n let { task, taskCp } = self;\n inject.cancelAnimationFrame(self.id);\n let last = self.__now = inject.now();\n function cb() {\n // 必须清除,可能会发生重复,当动画finish回调中gotoAndPlay(0),下方结束判断发现aTask还有值会继续,新的init也会进入再次执行\n inject.cancelAnimationFrame(self.id);\n self.id = inject.requestAnimationFrame(function() {\n if(isPause || (!task.length && !taskCp.length)) {\n return;\n }\n let now = self.__now = inject.now();\n let diff = now - last;\n diff = Math.max(diff, 0);\n // let delta = diff * 0.06; // 比例是除以1/60s,等同于*0.06\n last = now;\n // 优先动画计算\n let clone = task.slice(0);\n let cloneCp = taskCp.splice(0); // task要常驻,taskCp只1次直接splice清空\n let length = clone.length;\n let lengthCp = cloneCp.length;\n traversal(clone, length, diff, false);\n traversal(cloneCp, lengthCp, diff, false);\n // 执行动画造成的每个Root的刷新并清空\n let list = self.__hookTask.splice(0);\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n item && item();\n }\n // 普通的before/after\n traversal(clone, length, diff, true);\n traversal(cloneCp, lengthCp, diff, true);\n // 还有则继续,没有则停止节省性能\n if(task.length || taskCp.length) {\n cb();\n }\n });\n }\n cb();\n }\n\n onFrame(handle) {\n if(!handle) {\n return;\n }\n let { task } = this;\n if(!task.length) {\n this.__init();\n }\n if(isFunction(handle)) {\n handle = {\n __after: handle,\n __karasFramecb: handle,\n };\n }\n task.push(handle);\n }\n\n offFrame(handle) {\n if(!handle) {\n return;\n }\n let { task } = this;\n for(let i = 0, len = task.length; i < len; i++) {\n let item = task[i];\n // 需考虑nextFrame包裹的引用对比\n if(item === handle || item.__karasFramecb === handle) {\n task.splice(i, 1);\n break;\n }\n }\n if(!task.length) {\n inject.cancelAnimationFrame(this.id);\n this.__now = null;\n }\n }\n\n nextFrame(handle) {\n if(!handle) {\n return;\n }\n // 包裹一层会导致添加后删除对比引用删不掉,需保存原有引用进行对比\n let cb = isFunction(handle) ? {\n __after: diff => {\n handle(diff);\n this.offFrame(cb);\n },\n } : {\n __before: handle.__before,\n __after: diff => {\n handle.__after && handle.__after(diff);\n this.offFrame(cb);\n },\n };\n cb.__karasFramecb = handle;\n this.onFrame(cb);\n }\n\n __nextFrameCp(handle) {\n let { task, taskCp } = this;\n if(!task.length && !taskCp.length) {\n this.__init();\n }\n taskCp.push(handle);\n }\n\n pause() {\n isPause = true;\n }\n\n resume() {\n if(isPause) {\n this.__init();\n isPause = false;\n }\n }\n\n get task() {\n return this.__task;\n }\n\n get taskCp() {\n return this.__taskCp;\n }\n}\n\nexport default new Frame();\n","/**\n * https://github.com/gre/bezier-easing\n * BezierEasing - use bezier curve for transition easing function\n * by Gaëtan Renaudeau 2014 - 2015 – MIT License\n */\n\n// These values are established by empiricism with tests (tradeoff: performance VS precision)\nlet NEWTON_ITERATIONS = 4;\nlet NEWTON_MIN_SLOPE = 0.001;\nlet SUBDIVISION_PRECISION = 0.0000001;\nlet SUBDIVISION_MAX_ITERATIONS = 10;\n\nlet kSplineTableSize = 11;\nlet kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);\n\nlet float32ArraySupported = typeof Float32Array === 'function';\n\nfunction A(aA1, aA2) {\n return 1.0 - 3.0 * aA2 + 3.0 * aA1;\n}\n\nfunction B(aA1, aA2) {\n return 3.0 * aA2 - 6.0 * aA1;\n}\n\nfunction C(aA1) {\n return 3.0 * aA1;\n}\n\n// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\nfunction calcBezier(aT, aA1, aA2) {\n return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;\n}\n\n// Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.\nfunction getSlope(aT, aA1, aA2) {\n return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1);\n}\n\nfunction binarySubdivide(aX, aA, aB, mX1, mX2) {\n let currentX, currentT, i = 0;\n do {\n currentT = aA + (aB - aA) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - aX;\n if(currentX > 0.0) {\n aB = currentT;\n } else {\n aA = currentT;\n }\n } while(Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\n return currentT;\n}\n\nfunction newtonRaphsonIterate(aX, aGuessT, mX1, mX2) {\n for(let i = 0; i < NEWTON_ITERATIONS; ++i) {\n let currentSlope = getSlope(aGuessT, mX1, mX2);\n if(currentSlope === 0.0) {\n return aGuessT;\n }\n let currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n aGuessT -= currentX / currentSlope;\n }\n return aGuessT;\n}\n\nfunction LinearEasing(x) {\n return x;\n}\n\nfunction bezier(mX1, mY1, mX2, mY2) {\n if(!(0 <= mX1 && mX1 <= 1 && 0 <= mX2 && mX2 <= 1)) {\n throw new Error('bezier x values must be in [0, 1] range');\n }\n\n if(mX1 === mY1 && mX2 === mY2) {\n return LinearEasing;\n }\n\n // Precompute samples table\n let sampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n for(let i = 0; i < kSplineTableSize; ++i) {\n sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\n }\n\n function getTForX(aX) {\n let intervalStart = 0.0;\n let currentSample = 1;\n let lastSample = kSplineTableSize - 1;\n\n for(; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {\n intervalStart += kSampleStepSize;\n }\n --currentSample;\n\n // Interpolate to provide an initial guess for t\n let dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]);\n let guessForT = intervalStart + dist * kSampleStepSize;\n\n let initialSlope = getSlope(guessForT, mX1, mX2);\n if(initialSlope >= NEWTON_MIN_SLOPE) {\n return newtonRaphsonIterate(aX, guessForT, mX1, mX2);\n } else if(initialSlope === 0.0) {\n return guessForT;\n } else {\n return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);\n }\n }\n\n return function BezierEasing(x) {\n // Because JavaScript number are imprecise, we should guarantee the extremes are right.\n if(x === 0 || x === 1) {\n return x;\n }\n return calcBezier(getTForX(x), mY1, mY2);\n };\n}\n\nlet easing = {\n linear: bezier(1, 1, 0, 0),\n easeIn: bezier(0.42, 0, 1, 1),\n easeOut: bezier(0, 0, 0.58, 1),\n ease: bezier(0.25, 0.1, 0.25, 1),\n easeInOut: bezier(0.42, 0, 0.58, 1),\n cubicBezier: bezier,\n getEasing(v, v1, v2, v3) {\n if(arguments.length === 4) {\n return bezier(v, v1, v2, v3);\n }\n else if(Array.isArray(v) && v.length === 4) {\n return bezier(v[0], v[1], v[2], v[3]);\n }\n else if(v) {\n v = v.toString();\n let timingFunction;\n if(/^\\s*(?:cubic-bezier\\s*)?\\(\\s*[\\d.]+\\s*,\\s*[-\\d.]+\\s*,\\s*[\\d.]+\\s*,\\s*[-\\d.]+\\s*\\)\\s*$/i.test(v)) {\n v = v.match(/[\\d.]+/g);\n timingFunction = bezier(v[0], v[1], v[2], v[3]);\n }\n else if(v !== 'getEasing') {\n timingFunction = this[v];\n }\n return timingFunction;\n }\n },\n};\n\neasing['ease-in'] = easing.easeIn;\neasing['ease-out'] = easing.easeOut;\neasing['ease-in-out'] = easing.easeInOut;\n\nexport default easing;\n","import css from '../style/css';\nimport unit from '../style/unit';\nimport tf from '../style/transform';\nimport abbr from '../style/abbr';\nimport enums from '../util/enums';\nimport util from '../util/util';\nimport Event from '../util/Event';\nimport inject from '../util/inject';\nimport frame from './frame';\nimport easing from './easing';\nimport change from '../refresh/change';\nimport key from './key';\nimport mx from '../math/matrix';\n\nconst {\n STYLE_KEY: {\n FILTER,\n TRANSFORM_ORIGIN,\n PERSPECTIVE_ORIGIN,\n BACKGROUND_CLIP,\n BACKGROUND_POSITION_X,\n BACKGROUND_POSITION_Y,\n BOX_SHADOW,\n TRANSLATE_X,\n TRANSLATE_Y,\n TRANSLATE_Z,\n BACKGROUND_SIZE,\n FONT_SIZE,\n FLEX_BASIS,\n FLEX_DIRECTION,\n WIDTH,\n HEIGHT,\n TOP,\n BOTTOM,\n LINE_HEIGHT,\n OPACITY,\n Z_INDEX,\n TRANSFORM,\n COLOR,\n FONT_WEIGHT,\n FONT_STYLE,\n FONT_FAMILY,\n TEXT_ALIGN,\n MATRIX,\n ROTATE_3D,\n TRANSLATE_PATH,\n TEXT_STROKE_COLOR,\n TEXT_STROKE_OVER,\n },\n UPDATE_KEY: {\n UPDATE_NODE,\n UPDATE_STYLE,\n UPDATE_KEYS,\n UPDATE_CONFIG,\n },\n KEY_FRAME_KEY: {\n FRAME_STYLE,\n FRAME_TIME,\n FRAME_EASING,\n FRAME_TRANSITION,\n },\n ANIMATE_KEY: {\n I_ASSIGNING,\n I_IN_FPS,\n I_IS_DELAY,\n I_BEGIN,\n I_END,\n I_FINISHED,\n I_NEXT_END,\n I_FIRST_PLAY,\n I_PLAY_CB,\n I_TARGET,\n I_ROOT,\n I_FRAMES,\n I_FRAMES_R,\n I_CURRENT_TIME,\n I_NEXT_TIME,\n I_STYLE,\n I_DURATION,\n I_ITERATIONS,\n I_FILL,\n I_PLAYBACK_RATE,\n I_PLAY_COUNT,\n I_PLAY_STATE,\n I_DESTROYED,\n I_START_TIME,\n I_FPS_TIME,\n I_EASING,\n I_ENTER_FRAME,\n I_DELAY,\n I_END_DELAY,\n I_KEYS,\n I_ORIGIN_STYLE,\n I_CURRENT_FRAMES,\n I_CURRENT_FRAME,\n I_SPF_LIMIT,\n I_FPS,\n I_DIRECTION,\n I_FIRST_ENTER,\n I_STAY_BEGIN,\n I_STAY_END,\n I_IS2,\n I_END_TIME,\n I_NODE_CONFIG,\n I_ROOT_CONFIG,\n I_OUT_BEGIN_DELAY,\n I_TIME_STAMP,\n },\n} = enums;\nconst { AUTO, PX, PERCENT, INHERIT, RGBA, STRING, NUMBER, REM, VW, VH, VMAX, VMIN, calUnit } = unit;\nconst { isNil, isFunction, isNumber, isObject, isString, clone, equalArr } = util;\nconst { linear } = easing;\nconst { cloneStyle } = css;\nconst { isGeom, GEOM } = change;\n\nconst {\n COLOR_HASH,\n LENGTH_HASH,\n RADIUS_HASH,\n GRADIENT_HASH,\n EXPAND_HASH,\n GRADIENT_TYPE,\n} = key;\n\nconst NUM_CAL_HASH = {\n};\nObject.assign(NUM_CAL_HASH, LENGTH_HASH);\nObject.assign(NUM_CAL_HASH, EXPAND_HASH);\n\nfunction unify(frames, target) {\n let hash = {};\n let keys = [];\n // 获取所有关键帧的属性\n frames.forEach(item => {\n let style = item[FRAME_STYLE];\n Object.keys(style).forEach(k => {\n let v = style[k];\n // 未定义的过滤掉,null空有意义\n if(v !== undefined && !hash.hasOwnProperty(k)) {\n hash[k] = true;\n // geom为属性字符串,style都为枚举int\n if(!GEOM.hasOwnProperty(k)) {\n k = parseInt(k);\n }\n // path动画要转为translateXY,所以手动添加,使2帧之间存在过渡,有可能之前已存在这个动画,可忽视\n if(k === TRANSLATE_PATH) {\n if(!hash.hasOwnProperty(TRANSLATE_X)) {\n keys.push(TRANSLATE_X);\n }\n if(!hash.hasOwnProperty(TRANSLATE_Y)) {\n keys.push(TRANSLATE_Y);\n }\n hash[TRANSLATE_X] = hash[TRANSLATE_Y] = true;\n }\n keys.push(k);\n }\n });\n });\n // 添补没有声明完全的关键帧属性为节点当前值\n frames.forEach(item => {\n let style = item[FRAME_STYLE];\n keys.forEach(k => {\n if(!style.hasOwnProperty(k) || isNil(style[k])) {\n if(GEOM.hasOwnProperty(k)) {\n style[k] = target.getProps(k);\n }\n else {\n style[k] = target.currentStyle[k];\n }\n }\n });\n });\n return keys;\n}\n\n// 每次初始化时处理继承值,以及转换transform为单matrix矩阵\nfunction inherit(frames, keys, target) {\n let computedStyle = target.computedStyle;\n frames.forEach(item => {\n let style = item[FRAME_STYLE];\n keys.forEach(k => {\n let v = style[k];\n // geom的属性可能在帧中没有\n if(isNil(v)) {\n return;\n }\n if(k === TRANSFORM) {\n let ow = target.outerWidth;\n let oh = target.outerHeight;\n let m = tf.calMatrix(v, ow, oh);\n style[k] = [[MATRIX, m]];\n }\n else if(v[1] === INHERIT) {\n if(k === COLOR || k === TEXT_STROKE_COLOR) {\n style[k] = [util.rgba2int(computedStyle[k]), RGBA];\n }\n else if(LENGTH_HASH.hasOwnProperty(k)) {\n style[k] = [computedStyle[k], PX];\n }\n else if(k === FONT_WEIGHT) {\n style[k] = [computedStyle[k], NUMBER];\n }\n else if(k === FONT_STYLE || k === FONT_FAMILY || k === TEXT_ALIGN || k === TEXT_STROKE_OVER) {\n style[k] = [computedStyle[k], STRING];\n }\n }\n });\n });\n}\n\n/**\n * 通知root更新当前动画,需要根据frame的状态来决定是否是同步插入\n * 在异步时,因为动画本身是异步,需要addRefreshTask\n * 而如果此时frame在执行before过程中,说明帧动画本身是在before计算的,需要同步插入\n * @param style\n * @param keys 样式所有的key\n * @param __config\n * @param root\n * @param node\n */\nfunction genBeforeRefresh(style, keys, __config, root, node) {\n let res = {};\n res[UPDATE_NODE] = node;\n res[UPDATE_STYLE] = style;\n res[UPDATE_KEYS] = keys;\n res[UPDATE_CONFIG] = __config[I_NODE_CONFIG];\n root.__addUpdate(node, __config[I_NODE_CONFIG], root, __config[I_ROOT_CONFIG], res);\n __config[I_STYLE] = style;\n __config[I_ASSIGNING] = true;\n // frame每帧回调时,下方先执行计算好变更的样式,这里特殊插入一个hook,让root增加一个刷新操作\n // 多个动画调用因为相同root也只会插入一个,这样在所有动画执行完毕后frame里检查同步进行刷新,解决单异步问题\n root.__frameHook();\n}\n\n/**\n * 将每帧的样式格式化,提取出offset属性并转化为时间,提取出缓动曲线easing\n * @param style 关键帧样式\n * @param duration 动画时间长度\n * @param es options的easing曲线控制,frame没有自定义则使用全局的\n * @returns {{style: *, time: number, easing: *, transition: []}}\n */\nfunction framing(style, duration, es) {\n let { offset, easing } = style;\n // 这两个特殊值提出来存储不干扰style\n delete style.offset;\n delete style.easing;\n // translatePath特殊对待,ae的曲线运动动画\n let translatePath = style.translatePath;\n style = css.normalize(style);\n if(Array.isArray(translatePath) && [6, 8].indexOf(translatePath.length) > -1) {\n style[TRANSLATE_PATH] = translatePath.map(item => calUnit(item));\n }\n let res = [];\n res[FRAME_STYLE] = style;\n res[FRAME_TIME] = offset * duration;\n res[FRAME_EASING] = easing || es;\n res[FRAME_TRANSITION] = [];\n return res;\n}\n\nfunction calByUnit(p, n, container, root) {\n if(p[1] === PX) {\n if(n[1] === PERCENT) {\n return n[0] * 0.01 * container - p[0];\n }\n else if(n[1] === REM) {\n return n[0] * root.computedStyle[FONT_SIZE] - p[0];\n }\n else if(n[1] === VW) {\n return n[0] * root.width * 0.01 - p[0];\n }\n else if(n[1] === VH) {\n return n[0] * root.height * 0.01 - p[0];\n }\n else if(n[1] === VMAX) {\n return n[0] * Math.max(root.width, root.height) * 0.01 - p[0];\n }\n else if(n[1] === VMIN) {\n return n[0] * Math.min(root.width, root.height) * 0.01 - p[0];\n }\n }\n else if(p[1] === PERCENT) {\n if(n[1] === PX) {\n return n[0] * 100 / container - p[0];\n }\n else if(n[1] === REM) {\n return n[0] * root.computedStyle[FONT_SIZE] * 100 / container - p[0];\n }\n else if(n[1] === VW) {\n return n[0] * root.width / container - p[0];\n }\n else if(n[1] === VH) {\n return n[0] * root.height / container - p[0];\n }\n else if(n[1] === VMAX) {\n return n[0] * Math.max(root.width, root.height) / container - p[0];\n }\n else if(n[1] === VMIN) {\n return n[0] * Math.min(root.width, root.height) / container - p[0];\n }\n }\n else if(p[1] === REM) {\n if(n[1] === PX) {\n return n[0] / root.computedStyle[FONT_SIZE] - p[0];\n }\n else if(n[1] === PERCENT) {\n return n[0] * 0.01 * container / root.computedStyle[FONT_SIZE] - p[0];\n }\n else if(n[1] === VW) {\n return n[0] * root.width * 0.01 / root.computedStyle[FONT_SIZE] - p[0];\n }\n else if(n[1] === VH) {\n return n[0] * root.height * 0.01 / root.computedStyle[FONT_SIZE] - p[0];\n }\n else if(n[1] === VMAX) {\n return n[0] * Math.max(root.width, root.height) * 0.01 / root.computedStyle[FONT_SIZE] - p[0];\n }\n else if(n[1] === VMIN) {\n return n[0] * Math.min(root.width, root.height) * 0.01 / root.computedStyle[FONT_SIZE] - p[0];\n }\n }\n else if(p[1] === VW) {\n if(n[1] === PX) {\n return n[0] * 100 / root.width - p[0];\n }\n else if(n[1] === REM) {\n return n[0] * 100 * root.computedStyle[FONT_SIZE] / root.width - p[0];\n }\n else if(n[1] === PERCENT) {\n return n[0] * container / root.width - p[0];\n }\n else if(n[1] === VH) {\n return n[0] * root.height / root.width - p[0];\n }\n else if(n[1] === VMAX) {\n return n[0] * Math.max(root.width, root.height) / root.width - p[0];\n }\n else if(n[1] === VMIN) {\n return n[0] * Math.min(root.width, root.height) / root.width - p[0];\n }\n }\n else if(p[1] === VH) {\n if(n[1] === PX) {\n return n[0] * 100 / root.height - p[0];\n }\n else if(n[1] === REM) {\n return n[0] * 100 * root.computedStyle[FONT_SIZE] / root.height - p[0];\n }\n else if(n[1] === VW) {\n return n[0] * root.width / root.height - p[0];\n }\n else if(n[1] === PERCENT) {\n return n[0] * container / root.height - p[0];\n }\n else if(n[1] === VMAX) {\n return n[0] * Math.max(root.width, root.height) / root.height - p[0];\n }\n else if(n[1] === VMIN) {\n return n[0] * Math.min(root.width, root.height) / root.height - p[0];\n }\n }\n else if(p[1] === VMAX) {\n if(n[1] === PX) {\n return n[0] * 100 / Math.max(root.width, root.height) - p[0];\n }\n else if(n[1] === REM) {\n return n[0] * 100 * root.computedStyle[FONT_SIZE] / Math.max(root.width, root.height) - p[0];\n }\n else if(n[1] === PERCENT) {\n return n[0] * container / Math.max(root.width, root.height) - p[0];\n }\n else if(n[1] === VW) {\n return n[0] * root.width / Math.max(root.width, root.height) - p[0];\n }\n else if(n[1] === VH) {\n return n[0] * root.height / Math.max(root.width, root.height) - p[0];\n }\n else if(n[1] === VMIN) {\n return n[0] * Math.min(root.width, root.height) / Math.max(root.width, root.height) - p[0];\n }\n }\n else if(p[1] === VMIN) {\n if(n[1] === PX) {\n return n[0] * 100 / Math.min(root.width, root.height) - p[0];\n }\n else if(n[1] === REM) {\n return n[0] * 100 * root.computedStyle[FONT_SIZE] / Math.min(root.width, root.height) - p[0];\n }\n else if(n[1] === PERCENT) {\n return n[0] * container / Math.min(root.width, root.height) - p[0];\n }\n else if(n[1] === VW) {\n return n[0] * root.width / Math.min(root.width, root.height) - p[0];\n }\n else if(n[1] === VH) {\n return n[0] * root.height / Math.min(root.width, root.height) - p[0];\n }\n else if(n[1] === VMAX) {\n return n[0] * Math.max(root.width, root.height) / Math.min(root.width, root.height) - p[0];\n }\n }\n}\n\n/**\n * 计算两帧之间的差,单位不同的以后面为准,返回的v表示差值\n * 没有变化返回空\n * auto等无法比较的不参与计算,不返回来标识无过度效果\n * @param prev 上一帧样式\n * @param next 下一帧样式\n * @param k 比较的样式名\n * @param target dom对象\n * @param tagName dom名\n * @returns {{k: *, v: *}}\n */\nfunction calDiff(prev, next, k, target, tagName) {\n let res = [k];\n let p = prev[k];\n let n = next[k];\n if(k === TRANSFORM) {\n // transform因默认值null很特殊,不存在时需给默认矩阵\n if(!p && !n) {\n return;\n }\n let pm, nm;\n if(p) {\n pm = p[0][1];\n }\n else {\n pm = mx.identity();\n }\n if(n) {\n nm = n[0][1];\n }\n else {\n nm = mx.identity();\n }\n // transform特殊被初始化转成matrix矩阵,直接计算差值\n if(equalArr(pm, nm)) {\n return;\n }\n res[1] = [\n nm[0] - pm[0],\n nm[1] - pm[1],\n nm[2] - pm[2],\n nm[3] - pm[3],\n nm[4] - pm[4],\n nm[5] - pm[5],\n nm[6] - pm[6],\n nm[7] - pm[7],\n nm[8] - pm[8],\n nm[9] - pm[9],\n nm[10] - pm[10],\n nm[11] - pm[11],\n nm[12] - pm[12],\n nm[13] - pm[13],\n nm[14] - pm[14],\n nm[15] - pm[15],\n ];\n return res;\n }\n else if(k === ROTATE_3D) {\n if(equalArr(p, n)) {\n return;\n }\n res[1] = [n[0] - n[0], n[1] - p[1], n[2] - p[2], [n[3][0] - p[3][0], n[3][1]]];\n }\n else if(k === FILTER) {\n // filter很特殊,里面有多个滤镜,忽视顺序按hash计算,为空视为默认值,如blur默认0,brightness默认1\n let pHash = {}, nHash = {}, keyHash = {};\n if(p) {\n p.forEach(item => {\n keyHash[item[0]] = true;\n pHash[item[0]] = item[1];\n });\n }\n if(n) {\n n.forEach(item => {\n keyHash[item[0]] = true;\n nHash[item[0]] = item[1];\n })\n }\n let v = {}, hasChange;\n // 只有blur支持px/rem/vw/vh/vmax/vmin,其余都是特殊固定单位\n Object.keys(keyHash).forEach(k => {\n if(k === 'blur') {\n if(!pHash[k]) {\n v[k] = nHash[k].slice(0);\n hasChange = true;\n }\n else if(!nHash[k]) {\n v[k] = [-pHash[k][0], pHash[k][1]];\n hasChange = true;\n }\n else {\n let v2 = calByUnit(pHash[k], nHash[k], 0, target.root);\n v[k] = [v2, pHash[k][1]];\n hasChange = true;\n }\n }\n else if(k === 'hue-rotate') {\n let nv = isNil(nHash[k]) ? 0 : nHash[k][0];\n let pv = isNil(pHash[k]) ? 0 : pHash[k][0];\n if(pv !== nv) {\n v[k] = [nv - pv, PERCENT];\n hasChange = true;\n }\n }\n else if(k === 'saturate' || k === 'brightness' || k === 'contrast' || k === 'sepia' || k === 'invert') {\n let nv = isNil(nHash[k]) ? 100 : nHash[k][0];\n let pv = isNil(pHash[k]) ? 100 : pHash[k][0];\n if(pv !== nv) {\n v[k] = [nv - pv, PERCENT];\n hasChange = true;\n }\n }\n else if(k === 'grayscale') {\n let nv = isNil(nHash[k]) ? 0 : nHash[k][0];\n let pv = isNil(pHash[k]) ? 0 : pHash[k][0];\n if(pv !== nv) {\n v[k] = [nv - pv, PERCENT];\n hasChange = true;\n }\n }\n });\n if(!hasChange) {\n return;\n }\n res[1] = v;\n }\n else if(k === TRANSFORM_ORIGIN || k === PERSPECTIVE_ORIGIN) {\n res[1] = [];\n for(let i = 0; i < 2; i++) {\n let pi = p[i];\n let ni = n[i];\n if(pi[1] === ni[1]) {\n res[1].push(ni[0] - pi[0]);\n }\n else {\n let v = calByUnit(pi, ni, target[i ? 'outerHeight' : 'outerWidth'], target.root);\n res[1].push(v || 0);\n }\n }\n if(equalArr(res[1], [0, 0])) {\n return;\n }\n }\n else if(k === BACKGROUND_POSITION_X || k === BACKGROUND_POSITION_Y) {\n res[1] = [];\n let length = Math.min(p.length, n.length);\n for(let i = 0; i < length; i++) {\n let pi = p[i], ni = n[i];\n if(!pi || !ni) {\n res[1].push(null);\n continue;\n }\n if(pi[1] === ni[1]) {\n let v = ni[0] - pi[0];\n if(!v) {\n res[1].push(null);\n return;\n }\n res[1].push(v);\n }\n else {\n let k2 = k === BACKGROUND_POSITION_X ? 'offsetWidth' : 'offsetHeight';\n if(['padding-box', 'paddingBox'].indexOf(target.computedStyle[BACKGROUND_CLIP]) > -1) {\n k2 = k === BACKGROUND_POSITION_X ? 'clientWidth' : 'clientHeight';\n }\n else if(['content-box', 'contentBox'].indexOf(target.computedStyle[BACKGROUND_CLIP]) > -1) {\n k2 = k === BACKGROUND_POSITION_X ? 'width' : 'height';\n }\n let v = calByUnit(pi, ni, target[k2], target.root);\n if(!v) {\n res[1].push(null);\n return;\n }\n res[1].push(v);\n }\n }\n }\n else if(k === BOX_SHADOW) {\n res[1] = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let a = p[i];\n let b = n[i];\n let v = [];\n // x/y/blur/spread\n for(let j = 0; j < 4; j++) {\n v.push(b[j] - a[j]);\n }\n // rgba\n let c = [];\n for(let j = 0; j < 4; j++) {\n c.push(b[4][j] - a[4][j]);\n }\n v.push(c);\n res[1].push(v);\n }\n }\n else if(EXPAND_HASH.hasOwnProperty(k)) {\n if(p[1] === n[1]) {\n let v = n[0] - p[0];\n if(v === 0) {\n return;\n }\n res[1] = v;\n }\n else {\n let v = calByUnit(p, n, target[k === TRANSLATE_X || k === TRANSLATE_Z ? 'outerWidth' : 'outerHeight'], target.root);\n if(!v) {\n return;\n }\n res[1] = v;\n }\n }\n else if(k === BACKGROUND_SIZE) {\n res[1] = [];\n let length = Math.min(p.length, n.length);\n let has;\n for(let i = 0; i < length; i++) {\n let pi = p[i], ni = n[i];\n if(!pi || !ni) {\n res[1].push(null);\n continue;\n }\n let temp = [];\n for(let j = 0; j < 2; j++) {\n let pp = pi[j], nn = ni[j];\n if(pp[1] === nn[1]) {\n temp.push(nn[0] - pp[0]);\n }\n else {\n let k2 = i ? 'offsetWidth' : 'offsetHeight';\n if(['padding-box', 'paddingBox'].indexOf(target.computedStyle[BACKGROUND_CLIP]) > -1) {\n k2 = i ? 'clientWidth' : 'clientHeight';\n }\n else if(['content-box', 'contentBox'].indexOf(target.computedStyle[BACKGROUND_CLIP]) > -1) {\n k2 = i ? 'width' : 'height';\n }\n let v = calByUnit(pp, nn, target[k2], target.root);\n temp.push(v || 0);\n }\n }\n if(equalArr(temp, [0, 0])) {\n res[1].push(null);\n }\n else {\n res[1].push(temp);\n has = true;\n }\n }\n if(!has) {\n return;\n }\n }\n else if(GRADIENT_HASH.hasOwnProperty(k)) {\n // backgroundImage发生了渐变色和图片的变化,fill发生渐变色和纯色的变化等\n res[1] = [];\n let length = Math.min(p.length, n.length);\n for(let i = 0; i < length; i++) {\n let pi = p[i], ni = n[i];\n if(!pi || !ni || isString(pi) || isString(ni)) {\n res[1].push(null);\n continue;\n }\n if(pi.k !== ni.k) {\n res[1].push(null);\n continue;\n }\n let temp = [];\n // 渐变\n if(pi.k === 'linear' || pi.k === 'radial' || pi.k === 'conic') {\n let pv = pi.v;\n let nv = ni.v;\n temp[0] = [];\n let { clientWidth } = target;\n let eq = equalArr(pv, nv);\n for(let i = 0, len = Math.min(pv.length, nv.length); i < len; i++) {\n let a = pv[i];\n let b = nv[i];\n let t = [];\n t.push([\n b[0][0] - a[0][0],\n b[0][1] - a[0][1],\n b[0][2] - a[0][2],\n b[0][3] - a[0][3],\n ]);\n if(a[1] && b[1]) {\n if(a[1][1] === b[1][1]) {\n t.push(b[1][0] - a[1][0]);\n }\n else {\n let v = calByUnit(a[1], b[1], clientWidth, target.root);\n t.push(v || 0);\n }\n }\n temp[0].push(t);\n }\n // 线性渐变有角度差值变化\n if(pi.k === 'linear') {\n let isArrP = Array.isArray(pi.d);\n let isArrN = Array.isArray(ni.d);\n if(isArrN !== isArrP) {\n res[1].push(null);\n continue;\n }\n if(isArrP) {\n let v = [ni.d[0] - pi.d[0], ni.d[1] - pi.d[1], ni.d[2] - pi.d[2], ni.d[3] - pi.d[3]];\n if(eq && equalArr(v, [0, 0, 0, 0])) {\n res[1].push(null);\n continue;\n }\n temp[1] = v;\n }\n else {\n let v = ni.d - pi.d;\n if(eq && v === 0) {\n res[1].push(null);\n continue;\n }\n temp[1] = v;\n }\n }\n // 径向渐变的位置\n else if(pi.k === 'radial') {\n let isArrP = Array.isArray(pi.z);\n let isArrN = Array.isArray(ni.z);\n if(isArrN !== isArrP) {\n res[1].push(null);\n continue;\n }\n if(isArrP) {\n temp[2] = [];\n for(let i = 0; i < 5; i++) {\n let pz = pi.z[i];\n // 半径比例省略为1\n if(pz === undefined) {\n pz = 1;\n }\n let nz = ni.z[i];\n if(nz === undefined) {\n nz = 1;\n }\n temp[2].push(nz - pz);\n }\n if(eq && equalArr(res[4], [0, 0, 0, 0, 0])) {\n res[1].push(null);\n }\n }\n else {\n temp[2] = [];\n for(let i = 0; i < 2; i++) {\n let pp = pi.p[i];\n let np = ni.p[i];\n if(pp[1] === np[1]) {\n temp[2].push(np[0] - pp[0]);\n }\n else {\n let v = calByUnit(pp, np, target[i ? 'clientWidth' : 'clientHeight'], target.root);\n temp[2].push(v || 0);\n }\n }\n if(eq && equalArr(res[3], [0, 0])) {\n res[1].push(null);\n }\n }\n }\n else if(pi.k === 'conic') {\n temp[1].push(n.d - p.d);\n temp[2] = [];\n for(let i = 0; i < 2; i++) {\n let pp = p.p[i];\n let np = n.p[i];\n if(pp[1] === np[1]) {\n temp[2].push(np[0] - pp[0]);\n }\n else {\n let v = calByUnit(pp, np, target[i ? 'clientWidth' : 'clientHeight'], target.root);\n temp[2].push(v || 0);\n }\n }\n if(eq && res[2] !== 0 && equalArr(res[3], [0, 0])) {\n res[1].push(null);\n }\n }\n }\n // 纯色\n else {\n if(equalArr(n, pi)) {\n res[1].push(null);\n }\n temp[0] = [\n ni[0] - pi[0],\n ni[1] - pi[1],\n ni[2] - pi[2],\n ni[3] - pi[3]\n ];\n }\n res[1].push(temp);\n }\n }\n else if(COLOR_HASH.hasOwnProperty(k)) {\n n = n[0];\n p = p[0];\n if(equalArr(n, p) || n[3] === 0 && p[3] === 0) {\n return;\n }\n res[1] = [\n n[0] - p[0],\n n[1] - p[1],\n n[2] - p[2],\n n[3] - p[3]\n ];\n }\n else if(RADIUS_HASH.hasOwnProperty(k)) {\n // x/y都相等无需\n if(n[0][0] === p[0][0] && n[0][1] === p[0][1]\n && n[1][0] === p[1][0] && n[1][1] === p[1][1]) {\n return;\n }\n res[1] = [];\n for(let i = 0; i < 2; i++) {\n if(n[i][1] === p[i][1]) {\n res[1].push(n[i][0] - p[i][0]);\n }\n else {\n let v = calByUnit(p[i], n[i], target[i ? 'outerHeight' : 'outerWidth'], target.root);\n res[1].push(v || 0);\n }\n }\n }\n else if(LENGTH_HASH.hasOwnProperty(k)) {\n // auto不做动画\n if(p[1] === AUTO || n[1] === AUTO) {\n return;\n }\n let computedStyle = target.computedStyle;\n let parentComputedStyle = (target.domParent || target).computedStyle;\n let diff = 0;\n if(p[1] === n[1]) {\n diff = n[0] - p[0];\n }\n // lineHeight奇怪的单位变化,%相对于fontSize\n else if(k === LINE_HEIGHT) {\n diff = calByUnit(p, n, computedStyle[FONT_SIZE], target.root);\n }\n // fontSize的%相对于parent的\n else if(k === FONT_SIZE) {\n diff = calByUnit(p, n, parentComputedStyle[FONT_SIZE], target.root);\n }\n // 相对于父height的特殊属性\n else if(k === FLEX_BASIS\n && ['column', 'column-reverse', 'columnReverse'].indexOf(computedStyle[FLEX_DIRECTION]) > -1\n || [HEIGHT, TOP, BOTTOM].indexOf(k) > -1) {\n if(p[1] !== AUTO && n[1] !== AUTO) {\n diff = calByUnit(p, n, parentComputedStyle[HEIGHT], target.root);\n }\n }\n // 其余都是相对于父width的\n else {\n if(p[1] !== AUTO && n[1] !== AUTO) {\n diff = calByUnit(p, n, parentComputedStyle[WIDTH], target.root);\n }\n }\n // 兜底NaN非法\n if(diff === 0 || isNaN(diff)) {\n return;\n }\n res[1] = diff;\n }\n else if(GEOM.hasOwnProperty(k)) {\n if(isNil(p)) {\n return;\n }\n else if(GEOM[k][tagName] && isFunction(GEOM[k][tagName].calDiff)) {\n let fn = GEOM[k][tagName].calDiff;\n if(target.isMulti) {\n let arr = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n arr.push(fn(p[i], n[i]));\n }\n return arr;\n }\n else {\n res[1] = fn(p, n);\n }\n }\n // 特殊处理multi\n else if(target.isMulti) {\n if(k === 'points' || k === 'controls') {\n if(isNil(n) || !n.length || isNil(p) || !p.length || equalArr(p, n)) {\n return;\n }\n res[1] = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let pv = p[i];\n let nv = n[i];\n if(isNil(pv) || !pv.length || isNil(nv) || !nv.length) {\n res[1].push(null);\n }\n else {\n let v2 = [];\n for(let j = 0, len2 = Math.min(pv.length, nv.length); j < len2; j++) {\n let pv2 = pv[j];\n let nv2 = nv[j];\n if(isNil(pv2) || isNil(nv2)) {\n v2.push(null);\n }\n else {\n let v3 = [];\n for(let k = 0, len3 = Math.max(pv2.length, nv2.length); k < len3; k++) {\n let pv3 = pv2[k];\n let nv3 = nv2[k];\n // control由4点变2点\n if(isNil(pv3) || isNil(nv3)) {\n v3.push(0);\n }\n else {\n v3.push(nv3 - pv3);\n }\n }\n v2.push(v3);\n }\n }\n res[1].push(v2);\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n if(isNil(n) || !n.length || isNil(p) || !p.length || equalArr(p, n)) {\n return;\n }\n res[1] = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let pv = p[i];\n let nv = n[i];\n if(isNil(pv) || !pv.length || isNil(nv) || !nv.length) {\n res[1].push(null);\n }\n else {\n res[1].push([\n nv[0] - pv[0],\n nv[1] - pv[1],\n ]);\n }\n }\n }\n else {\n if(n === p || equalArr(n, p) || k === 'edge' || k === 'closure' || k === 'booleanOperations') {\n return;\n }\n let v = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let pv = p[i];\n let nv = n[i];\n if(isNil(pv) || isNil(nv)) {\n v.push(0);\n }\n v.push(nv - pv);\n }\n res[1] = v;\n }\n }\n // 非multi特殊处理这几类数组类型数据\n else if(k === 'points' || k === 'controls') {\n if(isNil(n) || !n.length || isNil(p) || !p.length || equalArr(p, n)) {\n return;\n }\n res[1] = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let pv = p[i];\n let nv = n[i];\n if(isNil(pv) || !pv.length || isNil(nv) || !nv.length) {\n res[1].push(null);\n }\n else {\n let v2 = [];\n for(let j = 0, len2 = Math.max(pv.length, nv.length); j < len2; j++) {\n let pv2 = pv[j];\n let nv2 = nv[j];\n // control由4点变2点\n if(isNil(pv2) || isNil(nv2)) {\n v2.push(0);\n }\n else {\n v2.push(nv2 - pv2);\n }\n }\n res[1].push(v2);\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n if(isNil(n) || !n.length || isNil(p) || !p.length || equalArr(p, n)) {\n return;\n }\n res[1] = [\n n[0] - p[0],\n n[1] - p[1],\n ];\n }\n // 其它简单数据,除了edge/closure/booleanOperations没有增量\n else {\n if(n === p || k === 'edge' || k === 'closure' || k === 'booleanOperations') {\n return;\n }\n else {\n res[1] = n - p;\n }\n }\n }\n else if(k === OPACITY || k === Z_INDEX) {\n if(n === p) {\n return;\n }\n res[1] = n - p;\n }\n // 特殊的path,不存在style中但在动画某帧中,不会统一化所以可能反向计算frameR时后一帧没有\n else if(k === TRANSLATE_PATH && p) {\n let k1 = 'offsetWidth', k2 = 'offsetHeight';\n if(['padding-box', 'paddingBox'].indexOf(target.computedStyle[BACKGROUND_CLIP]) > -1) {\n k1 = 'clientWidth';\n k2 = 'clientHeight';\n }\n else if(['content-box', 'contentBox'].indexOf(target.computedStyle[BACKGROUND_CLIP]) > -1) {\n k1 = 'width';\n k2 = 'height';\n }\n res[1] = p.map((item, i) => {\n let [v, u] = item;\n if(u === PERCENT) {\n if(i % 2 === 0) {\n return [(parseFloat(v) || 0) * 0.01 * target[k1], PX];\n }\n else {\n return [(parseFloat(v) || 0) * 0.01 * target[k2], PX];\n }\n }\n else if(u === REM) {\n return [(parseFloat(v) || 0) * root.computedStyle[FONT_SIZE] * 100, PX];\n }\n else if(u === VW) {\n return [(parseFloat(v) || 0) * 0.01 * root.width, PX];\n }\n else if(u === VH) {\n return [(parseFloat(v) || 0) * 0.01 * root.height, PX];\n }\n else if(u === VMAX) {\n return [(parseFloat(v) || 0) * 0.01 * Math.max(root.width, root.height), PX];\n }\n else if(u === VMIN) {\n return [(parseFloat(v) || 0) * 0.01 * Math.min(root.width, root.height), PX];\n }\n else {\n return [parseFloat(v) || 0, PX];\n }\n });\n }\n // display等不能有增量过程的\n else {\n return;\n }\n return res;\n}\n\n// 计算两帧之间不相同的变化,存入transition,相同的忽略\nfunction calFrame(prev, next, keys, target, tagName) {\n keys.forEach(k => {\n let ts = calDiff(prev[FRAME_STYLE], next[FRAME_STYLE], k, target, tagName);\n // 可以形成过渡的才会产生结果返回\n if(ts) {\n prev[FRAME_TRANSITION].push(ts);\n }\n });\n return next;\n}\n\nfunction binarySearch(i, j, time, frames) {\n if(i === j) {\n let frame = frames[i];\n if(frame[FRAME_TIME] > time) {\n return i - 1;\n }\n return i;\n }\n else {\n let middle = i + ((j - i) >> 1);\n let frame = frames[middle];\n if(frame[FRAME_TIME] === time) {\n return middle;\n }\n else if(frame[FRAME_TIME] > time) {\n return binarySearch(i, Math.max(middle - 1, i), time, frames);\n }\n else {\n return binarySearch(Math.min(middle + 1, j), j, time, frames);\n }\n }\n}\n\nfunction getEasing(ea) {\n let timingFunction;\n if(ea) {\n if((timingFunction = /^\\s*steps\\s*\\(\\s*(\\d+)(?:\\s*,\\s*(\\w+))?\\s*\\)/i.exec(ea))) {\n let steps = parseInt(timingFunction[1]);\n let stepsD = timingFunction[2];\n timingFunction = function(percent) {\n // steps有效定义正整数\n if(steps && steps > 0) {\n let per = 1 / steps;\n let n = stepsD === 'start' ? Math.ceil(percent / per) : Math.floor(percent / per);\n return n / steps;\n }\n return percent;\n };\n }\n else {\n timingFunction = easing.getEasing(ea);\n }\n }\n return timingFunction;\n}\n\n/**\n * 根据百分比和缓动函数计算中间态样式\n * 当easing定义为steps时,优先计算\n * @param frame 当前帧\n * @param keys 所有样式key\n * @param percent 到下一帧时间的百分比\n * @param target vd\n * @returns {*}\n */\nfunction calIntermediateStyle(frame, keys, percent, target) {\n let style = cloneStyle(frame[FRAME_STYLE], keys);\n let timingFunction = getEasing(frame[FRAME_EASING]);\n if(timingFunction && timingFunction !== linear) {\n percent = timingFunction(percent);\n }\n let transition = frame[FRAME_TRANSITION];\n for(let i = 0, len = transition.length; i < len; i++) {\n let [k, v] = transition[i];\n let st = style[k];\n // transform特殊处理,只有1个matrix,有可能不存在,需给默认矩阵\n if(k === TRANSFORM) {\n if(!st) {\n st = style[k] = [[MATRIX, mx.identity()]];\n }\n for(let i = 0; i < 16; i++) {\n st[0][1][i] += v[i] * percent;\n }\n }\n // 特殊的曲线运动计算,转换为translateXY,出现在最后一定会覆盖原本的translate防重\n else if(k === TRANSLATE_PATH) {\n let t = 1 - percent;\n if(v.length === 8) {\n style[TRANSLATE_X] = [\n v[0][0] * t * t * t\n + 3 * v[2][0] * percent * t * t\n + 3 * v[4][0] * percent * percent * t\n + v[6][0] * percent * percent * percent,\n PX,\n ];\n style[TRANSLATE_Y] = [\n v[1][0] * t * t * t\n + 3 * v[3][0] * percent * t * t\n + 3 * v[5][0] * percent * percent * t\n + v[7][0] * percent * percent * percent,\n PX,\n ];\n }\n else if(v.length === 6) {\n style[TRANSLATE_X] = [\n v[0][0] * t * t\n + 2 * v[2][0] * percent * t\n + v[4][0] * percent * percent,\n PX,\n ];\n style[TRANSLATE_Y] = [\n v[1][0] * t * t\n + 3 * v[3][0] * percent * t\n + v[5][0] * percent * percent,\n PX,\n ];\n }\n }\n else if(k === ROTATE_3D) {\n st[0] += v[0] * percent;\n st[1] += v[1] * percent;\n st[2] += v[2] * percent;\n st[3][0] += v[3][0] * percent;\n }\n else if(NUM_CAL_HASH.hasOwnProperty(k)) {\n if(v) {\n st[0] += v * percent;\n }\n }\n else if(k === FILTER) {\n // 只有1个样式声明了filter另外一个为空,会造成无样式,需初始化数组并在下面计算出样式存入\n if(!st) {\n st = style[k] = [];\n }\n // 将已有的样式按key存入引用来操作\n let hash = {};\n st.forEach(item => {\n hash[item[0]] = item[1];\n });\n Object.keys(v).forEach(k => {\n if(hash.hasOwnProperty(k)) {\n hash[k][0] += v[k][0] * percent;\n }\n else {\n // 2个关键帧中有1个未声明,需新建样式存入\n if(k === 'blur' || k === 'hue-rotate' || k === 'grayscale') {\n let n = v[k].slice(0);\n n[0] *= percent;\n st.push([k, n]);\n }\n // 默认值是1而非0\n else if(k === 'saturate' || k === 'brightness' || k === 'contrast' || k === 'sepia' || k === 'invert') {\n let n = v[k].slice(0);\n n[0] = 100 + n[0] * percent;\n st.push([k, n]);\n }\n }\n });\n }\n else if(RADIUS_HASH.hasOwnProperty(k)) {\n for(let i = 0; i < 2; i++) {\n st[i][0] += v[i] * percent;\n }\n }\n else if(k === TRANSFORM_ORIGIN || k === PERSPECTIVE_ORIGIN) {\n if(v[0] !== 0) {\n st[0][0] += v[0] * percent;\n }\n if(v[1] !== 0) {\n st[1][0] += v[1] * percent;\n }\n }\n else if(k === BOX_SHADOW) {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n // x/y/blur/spread\n for(let j = 0; j < 4; j++) {\n st[i][j] += v[i][j] * percent;\n }\n // rgba\n for(let j = 0; j < 4; j++) {\n st[i][4][j] += v[i][4][j] * percent;\n }\n }\n }\n else if(k === BACKGROUND_SIZE) {\n st.forEach((item, i) => {\n if(v[i]) {\n item[0][0] += v[i][0] * percent;\n item[1][0] += v[i][1] * percent;\n }\n });\n }\n else if(k === BACKGROUND_POSITION_X || k === BACKGROUND_POSITION_Y) {\n st.forEach((item, i) => {\n if(v[i]) {\n item[0] += v[i] * percent;\n }\n });\n }\n else if(GRADIENT_HASH.hasOwnProperty(k)) {\n st.forEach((st2, i) => {\n let v2 = v[i];\n if(!v2) {\n return;\n }\n let [c, d, p, z] = v2;\n if(GRADIENT_TYPE.hasOwnProperty(st2.k)) {\n for(let i = 0, len = Math.min(st2.v.length, c.length); i < len; i++) {\n let a = st2.v[i];\n let b = c[i];\n a[0][0] += b[0][0] * percent;\n a[0][1] += b[0][1] * percent;\n a[0][2] += b[0][2] * percent;\n a[0][3] += b[0][3] * percent;\n if(a[1] && b[1]) {\n a[1][0] += b[1] * percent;\n }\n }\n if(st2.k === 'linear' && st2.d !== undefined && d !== undefined) {\n if(Array.isArray(d)) {\n st2.d[0] += d[0] * percent;\n st2.d[1] += d[1] * percent;\n st2.d[2] += d[2] * percent;\n st2.d[3] += d[3] * percent;\n }\n else {\n st2.d += d * percent;\n }\n }\n if(st2.k === 'radial') {\n if(st2.z !== undefined && z !== undefined) {\n st2.z[0] += z[0] * percent;\n st2.z[1] += z[1] * percent;\n st2.z[2] += z[2] * percent;\n st2.z[3] += z[3] * percent;\n st2.z[4] += z[4] * percent;\n }\n else if(st2.p !== undefined && p !== undefined) {\n st2.p[0][0] += p[0] * percent;\n st2.p[1][0] += p[1] * percent;\n }\n }\n else if(st2.k === 'conic' && st2.d !== undefined && d !== undefined) {\n st2.d += d * percent;\n st2.p[0][0] += p[0] * percent;\n st2.p[1][0] += p[1] * percent;\n }\n }\n // fill纯色\n else {\n st2[0] += c[0] * percent;\n st2[1] += c[1] * percent;\n st2[2] += c[2] * percent;\n st2[3] += c[3] * percent;\n }\n });\n }\n // color可能超限[0,255],但浏览器已经做了限制,无需关心\n else if(COLOR_HASH.hasOwnProperty(k)) {\n st = st[0];\n st[0] += v[0] * percent;\n st[1] += v[1] * percent;\n st[2] += v[2] * percent;\n st[3] += v[3] * percent;\n }\n else if(GEOM.hasOwnProperty(k)) {\n let st = style[k];\n let tagName = target.tagName;\n if(GEOM[k][tagName] && isFunction(GEOM[k][tagName].calIncrease)) {\n let fn = GEOM[k][tagName].calIncrease;\n if(target.isMulti) {\n style[k] = st.map((item, i) => {\n return fn(item, v[i], percent);\n });\n }\n else {\n style[k] = fn(st, v, percent);\n }\n }\n else if(target.isMulti) {\n if(k === 'points' || k === 'controls') {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n let o = st[i];\n let n = v[i];\n if(!isNil(o) && !isNil(n)) {\n for(let j = 0, len2 = Math.min(o.length, n.length); j < len2; j++) {\n let o2 = o[j];\n let n2 = n[j];\n if(!isNil(o2) && !isNil(n2)) {\n for(let k = 0, len3 = Math.min(o2.length, n2.length); k < len3; k++) {\n if(!isNil(o2[k]) && !isNil(n2[k])) {\n o2[k] += n2[k] * percent;\n }\n }\n }\n }\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n v.forEach((item, i) => {\n let st2 = st[i];\n if(!isNil(item) && !isNil(st2)) {\n for(let i = 0, len = Math.min(st2.length, item.length); i < len; i++) {\n let o = st2[i];\n let n = item[i];\n if(!isNil(o) && !isNil(n)) {\n st2[i] += n * percent;\n }\n }\n }\n });\n }\n else {\n v.forEach((item, i) => {\n if(!isNil(item) && !isNil(st[i])) {\n st[i] += item * percent;\n }\n });\n }\n }\n else {\n if(k === 'points' || k === 'controls') {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n let o = st[i];\n let n = v[i];\n if(!isNil(o) && !isNil(n)) {\n for(let j = 0, len2 = Math.min(o.length, n.length); j < len2; j++) {\n if(!isNil(o[j]) && !isNil(n[j])) {\n o[j] += n[j] * percent;\n }\n }\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n if(!isNil(st[0]) && !isNil(v[0])) {\n st[0] += v[0] * percent;\n }\n if(!isNil(st[1]) && !isNil(v[1])) {\n st[1] += v[1] * percent;\n }\n }\n else {\n if(!isNil(st) && !isNil(v)) {\n style[k] += v * percent;\n }\n }\n }\n }\n else if(k === OPACITY || k === Z_INDEX) {\n style[k] += v * percent;\n // 精度问题可能会超过[0,1]区间\n if(k === OPACITY) {\n if(style[k] < 0) {\n style[k] = 0;\n }\n else if(style[k] > 1) {\n style[k] = 1;\n }\n }\n }\n }\n return style;\n}\n\nfunction gotoOverload(options, cb) {\n if(isFunction(options)) {\n cb = options;\n options = {};\n }\n return [options || {}, cb];\n}\n\nfunction calDiffTime(__config, diff) {\n let playbackRate = __config[I_PLAYBACK_RATE];\n let spfLimit = __config[I_SPF_LIMIT];\n let fps = __config[I_FPS];\n let v = __config[I_CURRENT_TIME] = __config[I_NEXT_TIME];\n // 定帧限制每帧时间间隔最大为spf\n if(spfLimit) {\n if(spfLimit === true) {\n diff = Math.min(diff, 1000 / fps);\n }\n else if(spfLimit > 0) {\n diff = Math.min(diff, spfLimit);\n }\n }\n // 播放时间累加,并且考虑播放速度加成\n if(playbackRate !== 1 && playbackRate > 0) {\n diff *= playbackRate;\n }\n __config[I_NEXT_TIME] += diff;\n return [v, diff];\n}\n\nfunction frameCb(self, __config, diff, isDelay) {\n self.emit(Event.FRAME, diff, isDelay);\n if(__config[I_FIRST_PLAY]) {\n __config[I_FIRST_PLAY] = false;\n self.emit(Event.PLAY);\n }\n let cb = __config[I_PLAY_CB];\n if(isFunction(cb)) {\n cb.call(self, diff, isDelay);\n // 清理要检查,gotoAndStop()这种cb回调中直接再次调用goto的话cb会不一致不能删除\n if(__config[I_PLAY_CB] === cb) {\n __config[I_PLAY_CB] = null;\n }\n }\n}\n\nlet uuid = 0;\n\nclass Animation extends Event {\n constructor(target, list, options) {\n super();\n this.__id = uuid++;\n list = clone(list || []);\n if(Array.isArray(list)) {\n list = list.filter(item => item && isObject(item));\n }\n // 动画过程另外一种形式,object描述k-v形式\n else if(list && isObject(list)) {\n let nl = [];\n Object.keys(list).forEach(k => {\n let v = list[k];\n if(Array.isArray(v)) {\n for(let i = 0, len = v.length; i < len; i++) {\n let o = nl[i] = nl[i] || {\n offset: i / (len - 1),\n };\n o[k] = v[i];\n }\n }\n });\n list = nl;\n }\n else {\n list = [];\n }\n if(isNumber(options)) {\n this.__options = {\n duration: options,\n };\n options = this.__options;\n }\n let op = this.__options = options || {\n duration: 0,\n };\n let root = target.root;\n let config = this.__config = [\n false, // assigning\n false, // inFps\n false, // isDelay\n false, // begin\n false, // end\n false, // finished\n false, // nextBegin\n true, // firstPlay\n null, // playCb\n target,\n root,\n null, // frames\n null, // framesR\n 0, // currentTime\n 0, // nextTime\n {}, // style\n 0, // duration\n 1, // iterations\n 'none', // fill\n 1, // playbackRate\n 0, // playCount\n 'idle',\n false, // destroy\n 0, // startTime\n 0, // fpsTime\n op.easing,\n false, // enterFrame\n 0, // delay\n 0, // endDelay\n null, // keys,\n null, // originStyle,\n null, // currentFrames\n null, // currentFrame\n false, // spfLimit\n 60, // fps\n 'normal', // direction\n true, // firstEnter,\n false, // stayBegin\n false, // stayEnd\n false, // is2\n 0, // endTime\n target.__config, // nodeConfig\n root && root.__config, // rootConfig,destroy后root可能为空\n false, // outBeginDelay\n ];\n let iterations = this.iterations = op.iterations;\n let duration = this.duration = op.duration;\n let [frames, framesR, keys, originStyle] = this.__init(list, iterations, duration, op.easing, target);\n config[I_FRAMES] = frames;\n config[I_FRAMES_R] = framesR;\n config[I_KEYS] = keys;\n config[I_ORIGIN_STYLE] = originStyle;\n if(frames.length === 2) {\n config[I_IS2] = true;\n config[I_END_TIME] = frames[1][FRAME_TIME];\n }\n let fps = parseInt(op.fps) || 0;\n if(fps <= 0) {\n fps = 60;\n }\n this.fps = fps;\n this.spfLimit = op.spfLimit;\n this.delay = op.delay;\n this.endDelay = op.endDelay;\n this.playbackRate = op.playbackRate;\n this.fill = op.fill;\n this.iterations = op.iterations;\n this.direction = op.direction;\n config[I_CURRENT_FRAMES] = {\n reverse: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(op.direction) ? framesR : frames;\n // 时间戳\n config[I_TIME_STAMP] = frame.__now;\n // 性能优化访问\n this[0] = this.__before;\n this[1] = this.__after;\n }\n\n __init(list, iterations, duration, easing, target) {\n if(list.length < 1) {\n return [[], [], [], {}];\n }\n // 过滤时间非法的,过滤后续offset<=前面的\n let offset = -1;\n let tagName = target.tagName;\n for(let i = 0, len = list.length; i < len; i++) {\n let current = list[i];\n if(current.hasOwnProperty('offset')) {\n current.offset = parseFloat(current.offset) || 0;\n current.offset = Math.max(0, current.offset);\n current.offset = Math.min(1, current.offset);\n // 超过区间[0,1]\n if(isNaN(current.offset) || current.offset < 0 || current.offset > 1) {\n list.splice(i, 1);\n i--;\n len--;\n continue;\n }\n // <=前面的\n else if(current.offset <= offset) {\n list.splice(i, 1);\n i--;\n len--;\n continue;\n }\n }\n // 缩写处理\n Object.keys(current).forEach(k => {\n if(abbr.hasOwnProperty(k)) {\n abbr.toFull(current, k);\n }\n });\n // 检查key合法性\n Object.keys(current).forEach(k => {\n if(k !== 'easing' && k !== 'offset' && !change.isValid(tagName, k)) {\n delete current[k];\n }\n });\n }\n // 只有1帧复制出来变成2帧方便运行\n if(list.length === 1) {\n list[0] = clone(list[0]);\n if(list[0].offset === 1) {\n list.unshift({\n offset: 0,\n });\n }\n else {\n let copy = clone(list[0]);\n copy.offset = 1;\n list.push(copy);\n }\n }\n // 强制clone防止同引用\n else {\n list.forEach((item, i) => {\n list[i] = clone(item);\n });\n }\n // 首尾时间偏移强制为[0, 1],不是的话前后加空帧\n let first = list[0];\n if(first.hasOwnProperty('offset') && first.offset > 0) {\n first = {\n offset: 0,\n };\n list.unshift(first);\n }\n else {\n first.offset = 0;\n }\n let last = list[list.length - 1];\n if(last.hasOwnProperty('offset') && last.offset < 1) {\n last = {\n offset: 1,\n };\n list.push(last);\n }\n else {\n last.offset = 1;\n }\n // 计算没有设置offset的时间\n for(let i = 1, len = list.length; i < len; i++) {\n let start = list[i];\n // 从i=1开始offset一定>0,找到下一个有offset的,均分中间无声明的\n if(!start.hasOwnProperty('offset')) {\n let end;\n let j = i + 1;\n for(; j < len; j++) {\n end = list[j];\n if(end.hasOwnProperty('offset')) {\n break;\n }\n }\n let num = j - i + 1;\n start = list[i - 1];\n let per = (end.offset - start.offset) / num;\n for(let k = i; k < j; k++) {\n let item = list[k];\n item.offset = start.offset + per * (k + 1 - i);\n }\n i = j;\n }\n }\n let frames = [];\n // 换算每一关键帧样式标准化\n list.forEach(item => {\n frames.push(framing(item, duration, easing));\n });\n // 为方便两帧之间计算变化,强制统一所有帧的css属性相同,没有写的为节点的当前样式currentStyle\n let keys = unify(frames, target);\n inherit(frames, keys, target);\n let framesR = clone(frames).reverse();\n // 存储原本样式以便恢复用\n let { style, props } = target;\n let originStyle = {};\n keys.forEach(k => {\n if(isGeom(tagName, k)) {\n originStyle[k] = props[k];\n }\n originStyle[k] = style[k];\n });\n // 再计算两帧之间的变化,存入transition属性\n let length = frames.length;\n let prev = frames[0];\n for(let i = 1; i < length; i++) {\n let next = frames[i];\n prev = calFrame(prev, next, keys, target, tagName);\n }\n // 反向存储帧的倒排结果\n framesR.forEach(item => {\n item[FRAME_TIME] = duration - item[FRAME_TIME];\n item[FRAME_TRANSITION] = [];\n });\n prev = framesR[0];\n for(let i = 1; i < length; i++) {\n let next = framesR[i];\n prev = calFrame(prev, next, keys, target, tagName);\n }\n return [frames, framesR, keys, originStyle];\n }\n\n __clean(isFinish) {\n let __config = this.__config;\n this.__cancelTask();\n __config[I_NEXT_TIME] = 0;\n let restore;\n let style = __config[I_STYLE];\n let keys = __config[I_KEYS];\n let target = __config[I_TARGET];\n if(isFinish) {\n // gotoAndStop到一个很大的时间的话,也需要防止超过\n __config[I_CURRENT_TIME] = __config[I_DELAY] + __config[I_DURATION] * __config[I_ITERATIONS] + __config[I_END_DELAY];\n if(__config[I_PLAY_STATE] === 'finish') {\n return;\n }\n __config[I_PLAY_STATE] = 'finish';\n // cancel需要清除finish根据情况保留\n if(!__config[I_STAY_END]) {\n __config[I_STYLE] = {};\n restore = true;\n }\n }\n else {\n __config[I_PLAY_COUNT] = __config[I_CURRENT_TIME] = 0;\n if(__config[I_PLAY_STATE] === 'idle') {\n return;\n }\n __config[I_PLAY_STATE] = 'idle';\n __config[I_STYLE] = {};\n restore = true;\n }\n // 动画取消结束不停留在最后一帧需要还原target原本的样式,需要对比目前是否是由本动画赋值的\n if(restore) {\n keys.forEach(k => {\n if(GEOM.hasOwnProperty(k)) {\n if(target.__currentProps[k] === style[k]) {\n target.__currentProps[k] = target.props[k];\n }\n }\n else {\n if(target.__currentStyle[k] === style[k]) {\n target.__currentStyle[k] = target.style[k];\n }\n }\n });\n }\n }\n\n play(cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n let frames = __config[I_FRAMES];\n if(isDestroyed || duration <= 0 || frames.length < 1) {\n return this;\n }\n if(playState === 'running') {\n return this;\n }\n this.__cancelTask();\n __config[I_PLAY_CB] = cb;\n __config[I_PLAY_STATE] = 'running';\n // 每次play调用标识第一次运行,需响应play事件和回调\n __config[I_FIRST_PLAY] = true;\n // 防止finish/cancel事件重复触发,每次播放重置\n this.__hasFin = false;\n this.__hasCancel = false;\n // 只有第一次调用会进初始化,另外finish/cancel视为销毁也会重新初始化\n if(!__config[I_ENTER_FRAME]) {\n __config[I_ENTER_FRAME] = true;\n let framesR = __config[I_FRAMES_R];\n let direction = __config[I_DIRECTION];\n // 初始化根据方向确定帧序列\n __config[I_CURRENT_FRAMES] = {\n reverse: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(direction) ? framesR : frames;\n __config[I_CURRENT_TIME] = __config[I_NEXT_TIME] = __config[I_FPS_TIME] = 0;\n }\n // 添加每帧回调且立刻执行,本次执行调用refreshTask也是下一帧再渲染,frame的每帧都是下一帧\n // frame.offFrame(this);\n frame.onFrame(this);\n __config[I_START_TIME] = frame.__now;\n __config[I_END] = false;\n return this;\n }\n\n __before(diff) {\n let __config = this.__config;\n __config[I_TIME_STAMP] = frame.__now;\n let target = __config[I_TARGET];\n let fps = __config[I_FPS];\n let playCount = 0;\n let currentFrames = __config[I_CURRENT_FRAMES];\n let iterations = __config[I_ITERATIONS];\n let stayBegin = __config[I_STAY_BEGIN];\n let stayEnd = __config[I_STAY_END];\n let delay = __config[I_DELAY];\n let root = __config[I_ROOT];\n let is2 = __config[I_IS2];\n let endTime = __config[I_END_TIME];\n let duration = __config[I_DURATION];\n let endDelay = __config[I_END_DELAY];\n let length = currentFrames.length;\n // 用本帧和上帧时间差,计算累加运行时间currentTime,以便定位当前应该处于哪个时刻\n let [currentTime, d] = calDiffTime(__config, diff);\n diff = d;\n // 增加的fps功能,当<60时计算跳帧,每帧运行依旧累加时间,达到fps时重置,第一帧强制不跳\n if(!__config[I_FIRST_ENTER] && fps < 60) {\n diff = __config[I_FPS_TIME] += diff;\n if(diff < 1000 / fps) {\n __config[I_IN_FPS] = true;\n return;\n }\n __config[I_FPS_TIME] = 0;\n }\n __config[I_FIRST_ENTER] = false;\n // delay仅第一次生效等待\n if(currentTime < delay) {\n if(stayBegin) {\n let currentFrame = __config[I_CURRENT_FRAME] = currentFrames[0];\n let current = currentFrame[FRAME_STYLE];\n genBeforeRefresh(current, __config[I_KEYS], __config, root, target);\n }\n // 即便不刷新,依旧执行帧回调,同时标明让后续第一帧响应begin\n __config[I_OUT_BEGIN_DELAY] = true;\n __config[I_IS_DELAY] = true;\n return;\n }\n // 减去delay,计算在哪一帧\n currentTime -= delay;\n if(currentTime === 0 || __config[I_OUT_BEGIN_DELAY]) {\n __config[I_OUT_BEGIN_DELAY] = false;\n __config[I_BEGIN] = true;\n }\n // 超过duration非尾轮需处理回到开头,触发新一轮动画事件,这里可能时间间隔非常大直接跳过几轮\n let round;\n while(currentTime >= duration && playCount < iterations - 1) {\n currentTime -= duration;\n playCount++;\n }\n if(__config[I_PLAY_COUNT] < playCount) {\n __config[I_BEGIN] = true;\n round = true;\n }\n __config[I_PLAY_COUNT] = playCount;\n // 如果发生轮换,需重新确定正反向\n if(round) {\n let direction = __config[I_DIRECTION];\n let frames = __config[I_FRAMES];\n let framesR = __config[I_FRAMES_R];\n let isAlternate = {\n alternate: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(direction);\n // 有正反向播放需要重设帧序列\n if(isAlternate) {\n let isEven = playCount % 2 === 0;\n if(direction === 'alternate') {\n currentFrames = __config[I_CURRENT_FRAMES] = isEven ? frames : framesR;\n }\n else {\n currentFrames = __config[I_CURRENT_FRAMES] = isEven ? framesR : frames;\n }\n }\n }\n let isLastCount = playCount >= iterations - 1;\n // 只有2帧可优化,否则2分查找当前帧\n let i, frameTime;\n if(is2) {\n i = currentTime < endTime ? 0 : 1;\n frameTime = endTime;\n }\n else {\n i = binarySearch(0, length - 1, currentTime, currentFrames);\n frameTime = currentFrames[i][FRAME_TIME];\n }\n // 最后一帧结束动画,仅最后一轮才会进入,需处理endDelay\n let isLastFrame = isLastCount && i === length - 1;\n let percent = 0;\n if(isLastFrame) {\n // 无需任何处理\n }\n // 否则根据目前到下一帧的时间差,计算百分比,再反馈到变化数值上\n else if(is2) {\n percent = currentTime / duration;\n }\n else {\n let total = currentFrames[i + 1][FRAME_TIME] - frameTime;\n percent = (currentTime - frameTime) / total;\n }\n let inEndDelay, currentFrame = currentFrames[i], current;\n __config[I_CURRENT_FRAME] = currentFrame;\n /** 这里要考虑全几种场景:\n * 1. 单次播放无endDelay且fill不停留(有/无差异,下同)\n * 2. 单次播放无endDelay且fill停留\n * 3. 单次播放有endDelay且fill不停留\n * 4. 单次播放有endDelay且fill停留\n * 5. 多次播放无endDelay且fill不停留(尾次/非尾次,下同)\n * 6. 多次播放无endDelay且fill停留\n * 7. 多次播放有endDelay且fill不停留\n * 8. 多次播放有endDelay且fill停留\n */\n let needClean;\n if(isLastFrame) {\n inEndDelay = currentTime < duration + endDelay;\n // 停留对比最后一帧,endDelay可能会多次进入这里,第二次进入样式相等不再重绘\n if(stayEnd) {\n current = cloneStyle(currentFrame[FRAME_STYLE], __config[I_KEYS]);\n }\n // 不停留或超过endDelay则计算还原,有endDelay且fill模式不停留会再次进入这里\n else {\n current = cloneStyle(__config[I_ORIGIN_STYLE], __config[I_KEYS]);\n }\n // 进入endDelay或结束阶段触发end事件,注意只触发一次,防重在触发的地方做\n __config[I_NEXT_END] = true;\n if(!inEndDelay) {\n __config[I_PLAY_COUNT]++;\n __config[I_FINISHED] = true;\n frame.offFrame(this);\n needClean = true;\n __config[I_NEXT_TIME] = 0;\n }\n }\n else {\n current = calIntermediateStyle(currentFrame, __config[I_KEYS], percent, target);\n }\n // 无论两帧之间是否有变化,都生成计算结果赋给style,去重在root做\n genBeforeRefresh(current, __config[I_KEYS], __config, root, target);\n if(needClean) {\n let playCb = __config[I_PLAY_CB];\n this.__clean(true);\n // 丑陋的做法,防止gotoAndStop()这样的cb被clean()掉\n if(playCb) {\n __config[I_PLAY_CB] = playCb;\n }\n }\n }\n\n __after(diff) {\n let __config = this.__config;\n __config[I_ASSIGNING] = false;\n if(__config[I_IN_FPS]) {\n __config[I_IN_FPS] = false;\n return;\n }\n frameCb(this, __config, diff, __config[I_IS_DELAY]);\n __config[I_IS_DELAY] = false;\n if(__config[I_BEGIN]) {\n __config[I_BEGIN] = false;\n this.emit(Event.BEGIN, __config[I_PLAY_COUNT]);\n }\n // end事件只触发一次,末轮进入endDelay或直接结束时\n if(__config[I_NEXT_END] && !__config[I_END]) {\n __config[I_END] = true;\n this.emit(Event.END, __config[I_PLAY_COUNT] - 1);\n }\n if(__config[I_FINISHED]) {\n __config[I_BEGIN] = __config[I_END] = __config[I_IS_DELAY] = __config[I_FINISHED]\n = __config[I_IN_FPS] = __config[I_ENTER_FRAME] = false;\n __config[I_PLAY_STATE] = 'finished';\n this.emit(Event.FINISH);\n }\n }\n\n pause(silence) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let { pending } = this;\n if(isDestroyed || duration <= 0 || pending) {\n return this;\n }\n __config[I_PLAY_STATE] = 'paused';\n this.__cancelTask();\n if(!silence) {\n this.emit(Event.PAUSE);\n }\n return this;\n }\n\n resume(cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n if(isDestroyed || duration <= 0 || playState !== 'paused') {\n return this;\n }\n return this.play(cb);\n }\n\n finish(cb) {\n let self = this;\n let __config = self.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n let frames = __config[I_FRAMES];\n if(isDestroyed || duration <= 0 || frames.length < 1 || playState === 'finished' || playState === 'idle') {\n return self;\n }\n // 先清除所有回调任务,多次调用finish也会清除只留最后一次\n self.__cancelTask();\n let root = __config[I_ROOT];\n let originStyle = __config[I_ORIGIN_STYLE];\n if(root) {\n let current;\n // 停留在最后一帧\n if(__config[I_STAY_END]) {\n __config[I_CURRENT_FRAME] = frames[frames.length - 1];\n current = frames[frames.length - 1][FRAME_STYLE];\n }\n else {\n current = originStyle;\n }\n root.addRefreshTask({\n __before() {\n __config[I_ASSIGNING] = true;\n genBeforeRefresh(current, __config[I_KEYS], __config, root, __config[I_TARGET]);\n self.__clean(true);\n },\n __after(diff) {\n if(!self.__hasFin) {\n self.__hasFin = true;\n __config[I_ASSIGNING] = false;\n frameCb(self, __config, diff);\n __config[I_BEGIN] = __config[I_END] = __config[I_IS_DELAY] = __config[I_FINISHED]\n = __config[I_IN_FPS] = __config[I_ENTER_FRAME] = false;\n self.emit(Event.FINISH);\n }\n if(isFunction(cb)) {\n cb.call(self, diff);\n }\n },\n });\n }\n return self;\n }\n\n cancel(cb) {\n let self = this;\n let __config = self.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n let frames = __config[I_FRAMES];\n if(isDestroyed || duration <= 0 || playState === 'idle' || frames.length < 1) {\n return self;\n }\n self.__cancelTask();\n let root = __config[I_ROOT];\n let originStyle = __config[I_ORIGIN_STYLE];\n if(root) {\n root.addRefreshTask({\n __before() {\n __config[I_ASSIGNING] = true;\n genBeforeRefresh(originStyle, __config[I_KEYS], __config, root, __config[I_TARGET]);\n self.__clean();\n },\n __after(diff) {\n if(!self.__hasCancel) {\n self.__hasCancel = true;\n __config[I_ASSIGNING] = false;\n frameCb(self, __config, diff);\n __config[I_BEGIN] = __config[I_END] = __config[I_IS_DELAY] = __config[I_FINISHED]\n = __config[I_IN_FPS] = __config[I_ENTER_FRAME] = false;\n self.emit(Event.CANCEL);\n }\n if(isFunction(cb)) {\n cb.call(self, diff);\n }\n },\n });\n }\n return self;\n }\n\n gotoAndPlay(v, options, cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let frames = __config[I_FRAMES];\n let delay = __config[I_DELAY];\n let endDelay = __config[I_END_DELAY];\n if(isDestroyed || duration <= 0 || frames.length < 1) {\n return this;\n }\n [options, cb] = gotoOverload(options, cb);\n // 计算出时间点直接累加播放\n this.__goto(v, options.isFrame, options.excludeDelay);\n if(v > duration + delay + endDelay) {\n return this.finish(cb);\n }\n return this.play(cb);\n }\n\n gotoAndStop(v, options, cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let frames = __config[I_FRAMES];\n let delay = __config[I_DELAY];\n let endDelay = __config[I_END_DELAY];\n if(isDestroyed || duration <= 0 || frames.length < 1) {\n return this;\n }\n [options, cb] = gotoOverload(options, cb);\n v = this.__goto(v, options.isFrame, options.excludeDelay);\n if(v > duration + delay + endDelay) {\n return this.finish(cb);\n }\n // 先play一帧,回调里模拟暂停\n return this.play(diff => {\n __config[I_PLAY_STATE] = 'paused';\n this.__cancelTask();\n if(isFunction(cb)) {\n cb.call(this, diff);\n }\n });\n }\n\n // 同步赋予,用在extendAnimate\n assignCurrentStyle() {\n let __config = this.__config;\n let style = __config[I_STYLE];\n let target = __config[I_TARGET];\n let keys = __config[I_KEYS];\n keys.forEach(i => {\n if(style.hasOwnProperty(i)) {\n let v = style[i];\n // geom的属性变化\n if(GEOM.hasOwnProperty(i)) {\n target.currentProps[i] = v;\n }\n // 样式\n else {\n // 将动画样式直接赋给currentStyle\n target.currentStyle[i] = v;\n }\n }\n });\n }\n\n // 返回不包含delay且去除多轮的时间\n __goto(v, isFrame, excludeDelay) {\n let __config = this.__config;\n let iterations = __config[I_ITERATIONS];\n let duration = __config[I_DURATION];\n __config[I_PLAY_STATE] = 'paused';\n // this.__cancelTask(); // 应该不需要,gotoAndXxx都会调用play(),里面有\n if(isNaN(v) || v < 0) {\n throw new Error('Param of gotoAnd(Play/Stop) is illegal: ' + v);\n }\n if(isFrame) {\n v = (v - 1) / this.spf;\n }\n if(excludeDelay) {\n v += __config[I_DELAY];\n }\n // 在时间范围内设置好时间,复用play直接跳到播放点\n __config[I_NEXT_TIME] = v;\n v -= __config[I_DELAY];\n // 超过时间长度需要累加次数,这里可以超过iterations,因为设定也许会非常大\n let playCount = 0;\n while(v >= duration && playCount < iterations - 1) {\n playCount++;\n v -= duration;\n }\n __config[I_PLAY_COUNT] = playCount;\n // 防止play()重置时间和当前帧组,提前计算好\n __config[I_ENTER_FRAME] = true;\n let frames = __config[I_FRAMES];\n let framesR = __config[I_FRAMES_R];\n let direction = __config[I_DIRECTION];\n if({\n alternate: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(direction)) {\n let isEven = playCount % 2 === 0;\n if(direction === 'alternate') {\n __config[I_CURRENT_FRAMES] = isEven ? frames : framesR;\n }\n else {\n __config[I_CURRENT_FRAMES] = isEven ? framesR : frames;\n }\n }\n return v;\n }\n\n addControl() {\n let ac = this.root.animateController;\n if(ac) {\n ac.add(this);\n }\n }\n\n removeControl() {\n let ac = this.root.animateController;\n if(ac) {\n ac.remove(this);\n }\n }\n\n __stayBegin() {\n return {\n backwards: true,\n both: true,\n }.hasOwnProperty(this.fill);\n }\n\n __stayEnd() {\n return {\n forwards: true,\n both: true,\n }.hasOwnProperty(this.fill);\n }\n\n __setTarget(target) {\n this.__target = target;\n this.__config[I_TARGET] = target;\n this.__config[I_NODE_CONFIG] = target.__config;\n }\n\n __cancelTask() {\n frame.offFrame(this);\n this.__config[I_PLAY_CB] = null;\n }\n\n __destroy(sync) {\n let self = this;\n let __config = self.__config;\n if(__config[I_DESTROYED]) {\n return;\n }\n self.removeControl();\n // clean异步执行,因为里面的样式还原需要等到下一帧,否则同步执行清除后,紧接着的新同步动画获取不到currentStyle\n if(sync) {\n self.__clean();\n __config[I_TARGET] = null;\n }\n else {\n frame.nextFrame({\n __before() {\n self.__clean();\n __config[I_TARGET] = null;\n },\n });\n }\n __config[I_START_TIME] = 0;\n __config[I_DESTROYED] = true;\n }\n\n __checkModify() {\n let __config = this.__config;\n if(__config[I_PLAY_STATE] !== 'idle' && __config[I_PLAY_STATE] !== 'finished') {\n inject.warn('Modification will not come into effect when animation is running');\n }\n }\n\n get id() {\n return this.__id;\n }\n\n get target() {\n return this.__config[I_TARGET];\n }\n\n get root() {\n return this.__config[I_ROOT];\n }\n\n get keys() {\n return this.__config[I_KEYS];\n }\n\n get style() {\n return this.__config[I_STYLE];\n }\n\n get options() {\n return this.__options;\n }\n\n get duration() {\n return this.__config[I_DURATION];\n }\n\n set duration(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_DURATION] !== v) {\n __config[I_DURATION] = v;\n __config[I_END_TIME] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get delay() {\n return this.__config[I_DELAY];\n }\n\n set delay(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_DELAY] !== v) {\n __config[I_DELAY] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get endDelay() {\n return this.__config[I_END_DELAY];\n }\n\n set endDelay(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_END_DELAY] !== v) {\n __config[I_END_DELAY] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get fps() {\n return this.__config[I_FPS];\n }\n\n set fps(v) {\n v = parseInt(v) || 60;\n let __config = this.__config;\n if(__config[I_FPS] !== v) {\n if(v <= 0) {\n v = 60;\n }\n __config[I_FPS] = v;\n }\n return v;\n }\n\n get spf() {\n return 1 / this.fps;\n }\n\n get iterations() {\n return this.__config[I_ITERATIONS];\n }\n\n set iterations(v) {\n if(v === Infinity || util.isString(v) && v.toLowerCase() === 'infinity') {\n v = Infinity;\n }\n else {\n v = parseInt(v);\n if(isNaN(v) || v < 0) {\n v = 1;\n }\n }\n let __config = this.__config;\n if(__config[I_ITERATIONS] !== v) {\n __config[I_ITERATIONS] = v;\n }\n return v;\n }\n\n get fill() {\n return this.__config[I_FILL];\n }\n\n set fill(v) {\n v = v || 'none';\n let __config = this.__config;\n if(__config[I_FILL] !== v) {\n __config[I_FILL] = v;\n this.__checkModify();\n }\n __config[I_STAY_BEGIN] = {\n backwards: true,\n both: true,\n }.hasOwnProperty(v);\n __config[I_STAY_END] = {\n forwards: true,\n both: true,\n }.hasOwnProperty(v);\n return v;\n }\n\n get direction() {\n return this.__config[I_DIRECTION];\n }\n\n set direction(v) {\n v = v || 'normal';\n let __config = this.__config;\n if(__config[I_DIRECTION] !== v) {\n __config[I_DIRECTION] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get frames() {\n return this.__config[I_FRAMES];\n }\n\n get framesR() {\n return this.__config[I_FRAMES_R];\n }\n\n get playbackRate() {\n return this.__config[I_PLAYBACK_RATE];\n }\n\n set playbackRate(v) {\n v = parseFloat(v) || 1;\n if(v <= 0) {\n v = 1;\n }\n let __config = this.__config;\n if(__config[I_PLAYBACK_RATE] !== v) {\n __config[I_PLAYBACK_RATE] = v;\n }\n return v;\n }\n\n get easing() {\n return this.__config[I_EASING];\n }\n\n get startTime() {\n return this.__config[I_START_TIME];\n }\n\n get currentTime() {\n return this.__config[I_CURRENT_TIME];\n }\n\n set currentTime(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_CURRENT_TIME] !== v) {\n __config[I_CURRENT_TIME] = v;\n __config[I_NEXT_TIME] = v;\n }\n return v;\n }\n\n get nextTime() {\n return this.__config[I_NEXT_TIME];\n }\n\n set nextTime(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_NEXT_TIME] !== v) {\n __config[I_NEXT_TIME] = v;\n }\n return v;\n }\n\n get timestamp() {\n return this.__config[I_TIME_STAMP];\n }\n\n get pending() {\n return this.__config[I_PLAY_STATE] !== 'running';\n }\n\n get finished() {\n return this.__config[I_PLAY_STATE] === 'finished';\n }\n\n get playState() {\n return this.__config[I_PLAY_STATE];\n }\n\n get playCount() {\n return this.__config[I_PLAY_COUNT];\n }\n\n set playCount(v) {\n v = Math.max(0, parseInt(v) || 0);\n let __config = this.__config;\n if(__config[I_PLAY_COUNT] !== v) {\n __config[I_PLAY_COUNT] = v;\n }\n return v;\n }\n\n get isDestroyed() {\n return this.__config[I_DESTROYED];\n }\n\n get animating() {\n let __config = this.__config;\n let playState = __config[I_PLAY_STATE];\n if(playState === 'idle') {\n return false;\n }\n return playState !== 'finished' || __config[I_STAY_END] || __config[I_STAY_BEGIN];\n }\n\n get spfLimit() {\n let __config = this.__config;\n return __config[I_SPF_LIMIT];\n }\n\n set spfLimit(v) {\n if(util.isNumber(v) || /^\\d/.test(v)) {\n v = Math.max(0, parseInt(v) || 0);\n }\n else {\n v = !!v;\n }\n let __config = this.__config;\n if(__config[I_SPF_LIMIT] !== v) {\n __config[I_SPF_LIMIT] = v;\n }\n return v;\n }\n\n get assigning() {\n return this.__config[I_ASSIGNING];\n }\n}\n\nexport default Animation;\n","import mode from '../refresh/mode';\nimport geom from '../math/geom';\nimport blur from '../math/blur';\nimport util from '../util/util';\nimport painter from '../util/painter';\nimport enums from '../util/enums';\n\nconst {\n NODE_KEY: {\n NODE_DEFS_CACHE,\n }\n} = enums;\nconst { int2rgba } = util;\nconst { canvasPolygon, svgPolygon } = painter;\n\nfunction renderBoxShadow(xom, renderMode, ctx, data, x1, y1, x2, y2, w, h, dx = 0, dy = 0) {\n x1 += dx;\n y1 += dy;\n x2 += dx;\n y2 += dy;\n let [x, y, sigma, spread, color, inset] = data;\n let c = int2rgba(color);\n let n = Math.abs(sigma) * 2 + Math.abs(spread) * 2 + Math.abs(x) * 2 + Math.abs(y) * 2;\n // box本身坐标顺时针\n let box = [\n [x1, y1],\n [x2, y1],\n [x2, y2],\n [x1, y2],\n [x1, y1],\n ];\n // 算上各种偏移/扩散的最外层坐标,且逆时针\n let outer = [\n [x1 - n, y1 - n],\n [x1 - n, y2 + n],\n [x2 + n, y2 + n],\n [x2 + n, y1 - n],\n [x1 - n, y1 - n],\n ];\n if(color[3] > 0 && (sigma > 0 || spread > 0)) {\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n ctx.save();\n ctx.beginPath();\n // inset裁剪box外面\n if(inset === 'inset') {\n let xa = x1 + x + spread;\n let ya = y1 + y + spread;\n let xb = x2 + x - spread;\n let yb = y2 + y - spread;\n let spreadBox = [\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [xa, yb],\n ];\n // 是否相交判断需要绘制\n let cross = geom.getRectsIntersection(\n [box[0][0], box[0][1], box[2][0], box[2][1]],\n [spreadBox[0][0], spreadBox[0][1], spreadBox[2][0], spreadBox[2][1]]);\n if(!cross) {\n return;\n }\n cross = [\n [cross[0], cross[1]],\n [cross[2], cross[1]],\n [cross[2], cross[3]],\n [cross[0], cross[3]],\n [cross[0], cross[1]],\n ];\n // 扩散区域类似边框填充\n if(spread) {\n canvasPolygon(ctx, cross);\n canvasPolygon(ctx, box.slice(0).reverse());\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== c) {\n ctx.fillStyle = c;\n }\n canvasPolygon(ctx, box);\n ctx.fill();\n ctx.closePath();\n ctx.restore();\n ctx.save();\n ctx.beginPath();\n canvasPolygon(ctx, cross);\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== '#FFF') {\n ctx.fillStyle = '#FFF';\n }\n ctx.shadowColor = c;\n ctx.shadowBlur = sigma;\n // 画在外围的空心矩形,宽度要比blur大,n考虑了这一情况取了最大值\n canvasPolygon(ctx, [\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [x1 - n, yb],\n [x1 - n, y2 + n],\n [x2 + n, y2 + n],\n [x2 + n, y1 - n],\n [x1 - n, y1 - n],\n [x1 - n, yb],\n [xa, yb],\n [xa, ya],\n ]);\n }\n else {\n canvasPolygon(ctx, box);\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== '#FFF') {\n ctx.fillStyle = '#FFF';\n }\n ctx.shadowOffsetX = x;\n ctx.shadowOffsetY = y;\n ctx.shadowColor = c;\n ctx.shadowBlur = sigma;\n canvasPolygon(ctx, [\n [x1, y1],\n [x2, y1],\n [x2, y2],\n [x1 - n, y2],\n [x1 - n, y2 + n],\n [x2 + n, y2 + n],\n [x2 + n, y1 - n],\n [x1 - n, y1 - n],\n [x1 - n, y2],\n [x1, y2],\n [x1, y1],\n ]);\n }\n }\n // outset需裁减掉box本身的内容,clip()非零环绕显示box外的阴影内容,fill()绘制在内无效\n else {\n let xa = x1 + x - spread;\n let ya = y1 + y - spread;\n let xb = x2 + x + spread;\n let yb = y2 + y + spread;\n let blurBox = [\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [xa, yb],\n ];\n let cross = geom.getRectsIntersection(\n [box[0][0], box[0][1], box[2][0], box[2][1]],\n [blurBox[0][0], blurBox[0][1], blurBox[2][0], blurBox[2][1]]);\n // 分为是否有spread,因模糊成本spread区域将没有模糊\n if(spread) {\n // 扩散区域类似边框填充\n canvasPolygon(ctx, box);\n canvasPolygon(ctx, blurBox.slice(0).reverse());\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== c) {\n ctx.fillStyle = c;\n }\n canvasPolygon(ctx, blurBox);\n ctx.fill();\n ctx.closePath();\n ctx.restore();\n ctx.save();\n ctx.beginPath();\n // 阴影部分看相交情况裁剪,有相交时逆时针绘制相交区域即可排除之\n if(cross) {\n canvasPolygon(ctx, [\n [cross[0], cross[1]],\n [cross[2], cross[1]],\n [cross[2], cross[3]],\n [cross[0], cross[3]],\n [cross[0], cross[1]],\n ].reverse());\n }\n canvasPolygon(ctx, box);\n canvasPolygon(ctx, blurBox);\n canvasPolygon(ctx, outer);\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== '#FFF') {\n ctx.fillStyle = '#FFF';\n }\n ctx.shadowColor = c;\n ctx.shadowBlur = sigma;\n canvasPolygon(ctx, blurBox);\n }\n else {\n canvasPolygon(ctx, box);\n canvasPolygon(ctx, outer);\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== '#FFF') {\n ctx.fillStyle = '#FFF';\n }\n ctx.shadowOffsetX = x;\n ctx.shadowOffsetY = y;\n ctx.shadowColor = c;\n ctx.shadowBlur = sigma;\n canvasPolygon(ctx, box);\n }\n }\n ctx.fill();\n ctx.closePath();\n ctx.restore();\n }\n else if(renderMode === mode.SVG) {\n let d = blur.outerSize(sigma);\n if(inset === 'inset') {\n let xa = x1 + x + spread;\n let ya = y1 + y + spread;\n let xb = x2 + x - spread;\n let yb = y2 + y - spread;\n let spreadBox = [\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [xa, yb],\n ];\n let cross = geom.getRectsIntersection(\n [box[0][0], box[0][1], box[2][0], box[2][1]],\n [spreadBox[0][0], spreadBox[0][1], spreadBox[2][0], spreadBox[2][1]]);\n if(!cross) {\n return;\n }\n cross = [\n [cross[0], cross[1]],\n [cross[2], cross[1]],\n [cross[2], cross[3]],\n [cross[0], cross[3]],\n [cross[0], cross[1]],\n ];\n if(spread) {\n let v = {\n tagName: 'filter',\n props: [\n ['x', -d / w],\n ['y', -d / h],\n ['width', 1 + d * 2 / w],\n ['height', 1 + d * 2 / h],\n ],\n children: [\n {\n tagName: 'feDropShadow',\n props: [\n ['dx', 0],\n ['dy', 0],\n ['stdDeviation', sigma * 0.5],\n ['flood-color', c],\n ],\n },\n ],\n }\n xom.__config[NODE_DEFS_CACHE].push(v);\n let filter = ctx.add(v);\n let v2 = {\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(cross) + svgPolygon(box.slice(0).reverse())],\n ['fill', '#FFF'],\n ],\n }],\n };\n let clip = ctx.add(v2);\n xom.__config[NODE_DEFS_CACHE].push(v2);\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon(box)],\n ['fill', c],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n v = {\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(cross)],\n ['fill', '#FFF'],\n ],\n }],\n };\n clip = ctx.add(v);\n xom.__config[NODE_DEFS_CACHE].push(v);\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon([\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [x1 - n, yb],\n [x1 - n, y2 + n],\n [x2 + n, y2 + n],\n [x2 + n, y1 - n],\n [x1 - n, y1 - n],\n [x1 - n, yb],\n [xa, yb],\n [xa, ya],\n ])],\n ['fill', '#FFF'],\n ['filter', 'url(#' + filter + ')'],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n }\n else {\n let v = {\n tagName: 'filter',\n props: [\n ['x', -d / w],\n ['y', -d / h],\n ['width', 1 + d * 2 / w],\n ['height', 1 + d * 2 / h],\n ],\n children: [\n {\n tagName: 'feDropShadow',\n props: [\n ['dx', x],\n ['dy', y],\n ['stdDeviation', sigma * 0.5],\n ['flood-color', c],\n ],\n },\n ],\n }\n let filter = ctx.add(v);\n xom.__config[NODE_DEFS_CACHE].push(v);\n v = {\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(box)],\n ['fill', '#FFF'],\n ],\n }],\n };\n let clip = ctx.add(v);\n xom.__config[NODE_DEFS_CACHE].push(v);\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon([\n [x1, y1],\n [x2, y1],\n [x2, y2],\n [x1 - n, y2],\n [x1 - n, y2 + n],\n [x2 + n, y2 + n],\n [x2 + n, y1 - n],\n [x1 - n, y1 - n],\n [x1 - n, y2],\n [x1, y2],\n [x1, y1],\n ])],\n ['fill', '#FFF'],\n ['filter', 'url(#' + filter + ')'],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n }\n }\n else {\n let xa = x1 + x - spread;\n let ya = y1 + y - spread;\n let xb = x2 + x + spread;\n let yb = y2 + y + spread;\n let blurBox = [\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [xa, yb],\n ];\n let cross = geom.getRectsIntersection(\n [box[0][0], box[0][1], box[2][0], box[2][1]],\n [blurBox[0][0], blurBox[0][1], blurBox[2][0], blurBox[2][1]]);\n if(spread) {\n let v = {\n tagName: 'filter',\n props: [\n ['x', -d / w],\n ['y', -d / h],\n ['width', 1 + d * 2 / w],\n ['height', 1 + d * 2 / h],\n ],\n children: [\n {\n tagName: 'feDropShadow',\n props: [\n ['dx', 0],\n ['dy', 0],\n ['stdDeviation', sigma * 0.5],\n ['flood-color', c],\n ],\n },\n ],\n };\n let filter = ctx.add(v);\n xom.__config[NODE_DEFS_CACHE].push(v);\n v = {\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(box) + svgPolygon(blurBox.slice(0).reverse())],\n ['fill', '#FFF'],\n ],\n }],\n };\n let clip = ctx.add(v);\n xom.__config[NODE_DEFS_CACHE].push(v);\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon(blurBox)],\n ['fill', c],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n v = {\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', (cross ? svgPolygon([\n [cross[0], cross[1]],\n [cross[2], cross[1]],\n [cross[2], cross[3]],\n [cross[0], cross[3]],\n [cross[0], cross[1]],\n ].reverse()) : '')\n + svgPolygon(box) + svgPolygon(blurBox) + svgPolygon(outer)],\n ['fill', '#FFF'],\n ],\n }],\n };\n clip = ctx.add(v);\n xom.__config[NODE_DEFS_CACHE].push(v);\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon(blurBox)],\n ['fill', '#FFF'],\n ['filter', 'url(#' + filter + ')'],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n }\n else {\n let v = {\n tagName: 'filter',\n props: [\n ['x', -d / w],\n ['y', -d / h],\n ['width', 1 + d * 2 / w],\n ['height', 1 + d * 2 / h],\n ],\n children: [\n {\n tagName: 'feDropShadow',\n props: [\n ['dx', x],\n ['dy', y],\n ['stdDeviation', sigma * 0.5],\n ['flood-color', c],\n ],\n },\n ],\n };\n let filter = ctx.add(v);\n xom.__config[NODE_DEFS_CACHE].push(v);\n v = {\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(box) + svgPolygon(outer)],\n ['fill', '#FFF'],\n ],\n }],\n };\n let clip = ctx.add(v);\n xom.__config[NODE_DEFS_CACHE].push(v);\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon(box)],\n ['fill', '#FFF'],\n ['filter', 'url(#' + filter + ')'],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n }\n }\n }\n }\n}\n\nexport default {\n renderBoxShadow,\n};\n","const MBM_HASH = {\n multiply: true,\n screen: true,\n overlay: true,\n darken: true,\n lighten: true,\n 'color-dodge': true,\n 'color-burn': true,\n 'hard-light': true,\n 'soft-light': true,\n difference: true,\n exclusion: true,\n hue: true,\n saturation: true,\n color: true,\n luminosity: true,\n};\n\nfunction mbmName(v) {\n if(v) {\n return v.replace(/[A-Z]/, function($0) {\n return '-' + $0.toLowerCase();\n });\n }\n}\n\nfunction isValidMbm(v) {\n return MBM_HASH.hasOwnProperty(mbmName(v));\n}\n\nexport default {\n mbmName,\n isValidMbm,\n};\n","import Node from './Node';\nimport Component from './Component';\nimport inline from './inline';\nimport Ellipsis from './Ellipsis';\nimport unit from '../style/unit';\nimport tf from '../style/transform';\nimport gradient from '../style/gradient';\nimport border from '../style/border';\nimport css from '../style/css';\nimport bg from '../style/bg';\nimport blur from '../math/blur';\nimport enums from '../util/enums';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport painter from '../util/painter';\nimport Animation from '../animate/Animation';\nimport frame from '../animate/frame';\nimport mx from '../math/matrix';\nimport geom from '../math/geom';\nimport mode from '../refresh/mode';\nimport change from '../refresh/change';\nimport level from '../refresh/level';\nimport Cache from '../refresh/Cache';\nimport font from '../style/font';\nimport bs from '../style/bs';\nimport mbm from '../style/mbm';\n\nconst { svgPolygon } = painter;\nconst { CANVAS, SVG, WEBGL } = mode;\nconst { LOCAL } = Cache;\n\nconst {\n STYLE_KEY,\n STYLE_RV_KEY,\n style2Upper,\n STYLE_KEY: {\n BORDER_TOP_LEFT_RADIUS,\n BORDER_TOP_RIGHT_RADIUS,\n BORDER_BOTTOM_LEFT_RADIUS,\n BORDER_BOTTOM_RIGHT_RADIUS,\n PADDING_LEFT,\n PADDING_RIGHT,\n PADDING_TOP,\n PADDING_BOTTOM,\n MARGIN_LEFT,\n MARGIN_TOP,\n MARGIN_BOTTOM,\n MARGIN_RIGHT,\n BORDER_LEFT_WIDTH,\n BORDER_TOP_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_RIGHT_WIDTH,\n TOP,\n RIGHT,\n BOTTOM,\n LEFT,\n POSITION,\n DISPLAY,\n WIDTH,\n HEIGHT,\n MATRIX,\n TRANSLATE_X,\n TRANSLATE_Y,\n TRANSLATE_Z,\n TRANSFORM,\n SCALE_X,\n SCALE_Y,\n SCALE_Z,\n ROTATE_X,\n ROTATE_Y,\n ROTATE_Z,\n SKEW_X,\n SKEW_Y,\n PERSPECTIVE,\n PERSPECTIVE_ORIGIN,\n ROTATE_3D,\n TRANSFORM_ORIGIN,\n BACKGROUND_POSITION_X,\n BACKGROUND_POSITION_Y,\n BACKGROUND_SIZE,\n BACKGROUND_COLOR,\n BACKGROUND_IMAGE,\n BACKGROUND_REPEAT,\n BOX_SHADOW,\n OPACITY,\n Z_INDEX,\n BORDER_TOP_STYLE,\n BORDER_RIGHT_STYLE,\n BORDER_BOTTOM_STYLE,\n BORDER_LEFT_STYLE,\n FILTER,\n OVERFLOW,\n MIX_BLEND_MODE,\n TEXT_OVERFLOW,\n BORDER_TOP_COLOR,\n BORDER_BOTTOM_COLOR,\n BORDER_LEFT_COLOR,\n BORDER_RIGHT_COLOR,\n FONT_STYLE,\n COLOR,\n VISIBILITY,\n POINTER_EVENTS,\n BORDER_TOP,\n BORDER_RIGHT,\n BORDER_BOTTOM,\n BORDER_LEFT,\n BACKGROUND_CLIP,\n FONT_SIZE,\n FONT_FAMILY,\n LINE_HEIGHT,\n TEXT_STROKE_COLOR,\n TEXT_STROKE_WIDTH,\n TEXT_STROKE_OVER,\n },\n UPDATE_KEY: {\n UPDATE_NODE,\n UPDATE_FOCUS,\n UPDATE_STYLE,\n UPDATE_OVERWRITE,\n UPDATE_KEYS,\n UPDATE_CONFIG,\n UPDATE_REMOVE_DOM,\n },\n STRUCT_KEY: {\n STRUCT_HAS_MASK,\n },\n NODE_KEY: {\n NODE_TAG_NAME,\n NODE_CACHE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_STYLE,\n NODE_STRUCT,\n NODE_OPACITY,\n NODE_MATRIX_EVENT,\n NODE_MATRIX,\n NODE_LIMIT_CACHE,\n NODE_HAS_CONTENT,\n NODE_REFRESH_LV,\n NODE_CACHE,\n NODE_CACHE_TOTAL,\n NODE_CACHE_FILTER,\n NODE_CACHE_MASK,\n NODE_CACHE_OVERFLOW,\n NODE_IS_DESTROYED,\n NODE_DEFS_CACHE,\n NODE_DOM_PARENT,\n NODE_IS_INLINE,\n NODE_PERSPECTIVE_MATRIX,\n NODE_IS_MASK,\n NODE_VIRTUAL_DOM,\n NODE_CACHE_AS_BITMAP,\n }\n} = enums;\nconst { AUTO, PX, PERCENT, INHERIT, NUMBER, REM, VW, VH, VMAX, VMIN, DEG } = unit;\nconst { int2rgba, rgba2int, joinArr, isNil, isFunction } = util;\nconst { calRelative } = css;\nconst { GEOM } = change;\nconst { mbmName, isValidMbm } = mbm;\nconst { point2d } = mx;\n\nconst {\n contain,\n NONE,\n TRANSFORM: TF,\n REFLOW,\n REPAINT,\n TRANSLATE_X: TX,\n TRANSLATE_Y: TY,\n TRANSLATE_Z: TZ,\n} = level;\n\nfunction getFirstEmptyInlineWidth(xom) {\n let n = 0;\n let flowChildren = xom.flowChildren;\n let length = flowChildren.length;\n for(let i = 0; i < length; i++) {\n let child = flowChildren[i];\n if(child instanceof Xom || child instanceof Component && child.shadowRoot instanceof Xom) {\n if(child.flowChildren.length) {\n n += getFirstEmptyInlineWidth(child);\n break;\n }\n else if(child.__config[NODE_IS_INLINE]) {\n n += child.outerWidth;\n }\n }\n else {\n break;\n }\n }\n return n;\n}\n\nfunction getLastEmptyInlineWidth(xom) {\n let n = 0;\n let flowChildren = xom.flowChildren;\n let length = flowChildren.length;\n for(let i = length - 1; i >= 0; i--) {\n let child = flowChildren[i];\n if(child instanceof Xom || child instanceof Component && child.shadowRoot instanceof Xom) {\n if(child.flowChildren.length) {\n n += getLastEmptyInlineWidth(child);\n break;\n }\n else {\n n += child.outerWidth;\n }\n }\n else {\n break;\n }\n }\n return n;\n}\n\nclass Xom extends Node {\n constructor(tagName, props = {}) {\n super();\n // 构建工具中都是arr,手写可能出现hash情况\n if(Array.isArray(props)) {\n this.props = util.arr2hash(props);\n }\n else {\n this.props = props;\n }\n this.__tagName = tagName;\n this.__style = this.props.style || {}; // style被解析后的k-v形式\n this.__currentStyle = {}; // 动画过程中绘制一开始会merge动画样式\n this.__computedStyle = {}; // 类似getComputedStyle()将currentStyle计算好数值赋给\n this.__listener = {};\n Object.keys(this.props).forEach(k => {\n let v = this.props[k];\n if(/^on[a-zA-Z]/.test(k)) {\n k = k.slice(2).toLowerCase();\n this.listener[k] = v;\n }\n });\n this.__animationList = [];\n this.__loadBgi = {\n // 刷新回调函数,用以destroy取消用\n cb: function() {\n },\n };\n this.__cacheStyle = {}; // 是否缓存重新计算computedStyle的样式key\n this.__cacheDefs = []; // svg专用,缓存渲染时使用已有的defs,diff过程用,否则会defs被清空\n let isClip = this.__isClip = !!this.props.clip;\n let isMask = this.__isMask = isClip || !!this.props.mask;\n let config = this.__config;\n config[NODE_TAG_NAME] = tagName;\n config[NODE_CACHE_STYLE] = this.__cacheStyle;\n config[NODE_CURRENT_STYLE] = this.__currentStyle;\n config[NODE_COMPUTED_STYLE] = this.__computedStyle;\n config[NODE_REFRESH_LV] = REFLOW;\n config[NODE_STYLE] = this.__style;\n config[NODE_MATRIX] = [];\n config[NODE_MATRIX_EVENT] = [];\n config[NODE_DEFS_CACHE] = this.__cacheDefs;\n config[NODE_IS_MASK] = isMask;\n this.__frameAnimateList = [];\n this.__contentBoxList = []; // inline存储内容用\n // this.__json domApi需要获取生成时的json引用,builder过程添加,如appendChild时json也需要跟着变更\n config[NODE_CACHE_AS_BITMAP] = this.__cacheAsBitmap = !!this.props.cacheAsBitmap;\n this.__layoutData = null; // 缓存上次布局x/y/w/h数据\n this.__hasComputeReflow = false; // 每次布局计算缓存标,使得每次开始只computeReflow一次\n this.__parentLineBox = null; // inline时指向\n }\n\n __structure(i, lv, j) {\n let res = super.__structure(i, lv, j);\n if(this.__hasMask) {\n res[STRUCT_HAS_MASK] = this.__hasMask;\n }\n this.__config[NODE_STRUCT] = res;\n return res;\n }\n\n // 设置margin/padding的实际值,layout时执行,inline的垂直方向仍然计算值,但在布局时被忽略\n __mp(currentStyle, computedStyle, w) {\n [\n 'Top',\n 'Right',\n 'Bottom',\n 'Left',\n ].forEach(k => {\n let a = STYLE_KEY[style2Upper('margin' + k)];\n let b = STYLE_KEY[style2Upper('padding' + k)];\n computedStyle[a] = this.__calSize(currentStyle[a], w);\n computedStyle[b] = this.__calSize(currentStyle[b], w);\n });\n }\n\n __calSize(mp, w) {\n if(mp[1] === PX) {\n return mp[0];\n }\n else if(mp[1] === PERCENT) {\n return mp[0] * w * 0.01;\n }\n else if(mp[1] === REM) {\n return mp[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(mp[1] === VW) {\n return mp[0] * this.root.width * 0.01;\n }\n else if(mp[1] === VH) {\n return mp[0] * this.root.height * 0.01;\n }\n else if(mp[1] === VMAX) {\n return mp[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(mp[1] === VMIN) {\n return mp[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n return 0;\n }\n\n // dom常用的几种尺寸赋值\n __ioSize(w, h) {\n let computedStyle = this.computedStyle;\n // 可能不传,在虚拟布局时用不到\n if(!isNil(w)) {\n this.__clientWidth = w += computedStyle[PADDING_LEFT] + computedStyle[PADDING_RIGHT];\n this.__offsetWidth = w += computedStyle[BORDER_LEFT_WIDTH] + computedStyle[BORDER_RIGHT_WIDTH];\n this.__outerWidth = w + computedStyle[MARGIN_LEFT] + computedStyle[MARGIN_RIGHT];\n }\n if(!isNil(h)) {\n this.__clientHeight = h += computedStyle[PADDING_TOP] + computedStyle[PADDING_BOTTOM];\n this.__offsetHeight = h += computedStyle[BORDER_TOP_WIDTH] + computedStyle[BORDER_BOTTOM_WIDTH];\n this.__outerHeight = h + computedStyle[MARGIN_TOP] + computedStyle[MARGIN_BOTTOM];\n }\n }\n\n // 换算margin/padding为px单位,onlyFixedValue只考虑绝对值,不考虑百分比等\n __calMp(v, w, onlyFixedValue) {\n let n = 0;\n if(v[1] === PX) {\n n += v[0];\n }\n else if(v[1] === PERCENT && !onlyFixedValue) {\n v[0] *= w * 0.01;\n v[1] = PX;\n n += v[0];\n }\n else if(v[1] === REM) {\n n += v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n n += v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n n += v[0] * this.root.height * 0.01;\n }\n else if(v[1] === VMAX) {\n n += v[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(v[1] === VMIN) {\n n += v[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n return n;\n }\n\n // 为basis的b/min/max添加mpb,只有当b未显示指定等于w/content时才加,同时返回mpb值\n __addMBP(isDirectionRow, w, currentStyle, computedStyle, res, isDirectItem) {\n let {\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_TOP]: marginTop,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_TOP]: paddingTop,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_BOTTOM]: paddingBottom,\n } = currentStyle;\n let {\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = computedStyle;\n let mbp = this.__calMp(marginLeft, w, !isDirectItem)\n + this.__calMp(marginRight, w, !isDirectItem)\n + this.__calMp(paddingLeft, w, !isDirectItem)\n + this.__calMp(paddingRight, w, !isDirectItem)\n + borderLeftWidth + borderRightWidth;\n if(isDirectionRow) {\n res = res.map(item => item + mbp);\n }\n else {\n let mbp = this.__calMp(marginTop, w, !isDirectItem)\n + this.__calMp(marginBottom, w, !isDirectItem)\n + this.__calMp(paddingTop, w, !isDirectItem)\n + this.__calMp(paddingBottom, w, !isDirectItem)\n + borderTopWidth + borderBottomWidth;\n res = res.map(item => item + mbp);\n }\n return res;\n }\n\n // absolute且无尺寸时,isAbs标明先假布局一次计算尺寸,还有flex列计算时isColumn假布局\n __layout(data, isAbs, isColumn) {\n css.computeReflow(this);\n let { w } = data;\n let { isDestroyed, currentStyle, computedStyle, __config, __ellipsis } = this;\n // 虚拟省略号每次清除\n if(__ellipsis) {\n this.__ellipsis = null;\n }\n this.__parentLineBox = null;\n this.__isIbFull = false;\n let {\n [DISPLAY]: display,\n } = computedStyle;\n let {\n [WIDTH]: width,\n [POSITION]: position,\n } = currentStyle;\n this.__layoutData = {\n x: data.x,\n y: data.y,\n w: data.w,\n h: data.h,\n lx: data.lx,\n };\n // 防止display:none不统计mask,isVirtual忽略,abs/flex布局后续会真正来走一遍\n if(!isAbs && !isColumn) {\n this.clearCache();\n __config[NODE_REFRESH_LV] = REFLOW;\n __config[NODE_LIMIT_CACHE] = false;\n __config[NODE_IS_INLINE] = false;\n let { next } = this;\n // mask关系只有布局才会变更,普通渲染关系不会改变,clip也是mask的一种\n if(!this.isMask && next && (next.isMask)) {\n let count = 0;\n while(next) {\n if(next.isMask) {\n count++;\n }\n else {\n break;\n }\n next = next.next;\n }\n this.__hasMask = count;\n }\n }\n this.__ox = this.__oy = 0;\n if(isDestroyed || display === 'none') {\n this.__width = this.__height\n = this.__clientWidth = this.__clientHeight\n = this.__offsetWidth = this.__offsetHeight\n = this.__outerWidth = this.__outerHeight\n = computedStyle[WIDTH] = computedStyle[HEIGHT] = 0;\n this.__x = data.x;\n this.__y = data.y;\n this.__layoutNone();\n this.__hasComputeReflow = false;\n return;\n }\n // absolute特殊,在自己布局时已计算相对于容器的mbp\n if(position !== 'absolute') {\n this.__mp(currentStyle, computedStyle, w);\n }\n // inline的width/height无效,其它有效\n if(width[1] !== AUTO) {\n if(this.__isRealInline() && computedStyle[DISPLAY] === 'inline') {\n width[0] = 0;\n width[1] = AUTO;\n }\n else {\n switch(width[1]) {\n case PX:\n w = width[0];\n break;\n case PERCENT:\n w *= width[0] * 0.01;\n break;\n case REM:\n w = width[0] * this.root.computedStyle[FONT_SIZE];\n break;\n case VW:\n w = width[0] * this.root.width * 0.01;\n break;\n case VH:\n w = width[0] * this.root.height * 0.01;\n break;\n case VMAX:\n w = width[0] * Math.max(this.root.width, this.root.height) * 0.01;\n break;\n case VMIN:\n w = width[0] * Math.min(this.root.width, this.root.height) * 0.01;\n break;\n }\n }\n }\n // 只有inline会继承计算行数,其它都是原样返回\n let lineClampCount = data.lineClampCount || 0;\n // 4种布局,默认block,inlineBlock基本可以复用inline逻辑,除了尺寸\n if(display === 'flex') {\n data.lineClampCount = 0;\n this.__layoutFlex(data, isAbs, isColumn);\n }\n else if(display === 'inlineBlock' || display === 'inline-block') {\n data.lineClampCount = 0;\n this.__layoutInline(data, isAbs, isColumn);\n }\n else if(display === 'inline') {\n lineClampCount = this.__layoutInline(data, isAbs, isColumn, true);\n }\n else {\n data.lineClampCount = 0;\n this.__layoutBlock(data, isAbs, isColumn);\n }\n // relative渲染时做偏移,百分比基于父元素,若父元素没有定高则为0\n if(!isAbs && !isColumn) {\n if(position === 'relative') {\n let {[TOP]: top, [RIGHT]: right, [BOTTOM]: bottom, [LEFT]: left} = currentStyle;\n let {parent} = this;\n if(top[1] !== AUTO) {\n let n = calRelative(currentStyle, TOP, top, parent);\n this.__offsetY(n);\n computedStyle[TOP] = n;\n computedStyle[BOTTOM] = 'auto';\n }\n else if(bottom[1] !== AUTO) {\n let n = calRelative(currentStyle, BOTTOM, bottom, parent);\n this.__offsetY(-n);\n computedStyle[BOTTOM] = n;\n computedStyle[TOP] = 'auto';\n }\n else {\n computedStyle[TOP] = computedStyle[BOTTOM] = 'auto';\n }\n if(left[1] !== AUTO) {\n let n = calRelative(currentStyle, LEFT, left, parent, true);\n this.__offsetX(n);\n computedStyle[LEFT] = n;\n computedStyle[RIGHT] = 'auto';\n }\n else if (right[1] !== AUTO) {\n let n = calRelative(currentStyle, RIGHT, right, parent, true);\n this.__offsetX(-n);\n computedStyle[RIGHT] = n;\n computedStyle[LEFT] = 'auto';\n }\n else {\n computedStyle[LEFT] = computedStyle[RIGHT] = 'auto';\n }\n }\n else if (position !== 'absolute') {\n computedStyle[TOP] = computedStyle[BOTTOM] = computedStyle[LEFT] = computedStyle[RIGHT] = 'auto';\n }\n // 计算结果存入computedStyle和6个坐标,inline在其inlineSize特殊处理\n let x = this.__sx = this.x + this.ox;\n let y = this.__sy = this.y + this.oy;\n if(!__config[NODE_IS_INLINE]) {\n x = this.__sx1 = x + computedStyle[MARGIN_LEFT];\n x = this.__sx2 = x + computedStyle[BORDER_LEFT_WIDTH];\n x = this.__sx3 = x + computedStyle[PADDING_LEFT];\n x = this.__sx4 = x + this.width;\n x = this.__sx5 = x + computedStyle[PADDING_RIGHT];\n this.__sx6 = x + computedStyle[BORDER_RIGHT_WIDTH];\n y = this.__sy1 = y + computedStyle[MARGIN_TOP];\n y = this.__sy2 = y + computedStyle[BORDER_TOP_WIDTH];\n y = this.__sy3 = y + computedStyle[PADDING_TOP];\n y = this.__sy4 = y + this.height;\n y = this.__sy5 = y + computedStyle[PADDING_BOTTOM];\n this.__sy6 = y + computedStyle[BORDER_BOTTOM_WIDTH];\n }\n computedStyle[WIDTH] = this.width;\n computedStyle[HEIGHT] = this.height;\n // abs为parse的根节点时特殊自己执行,前提是真布局\n if(position !== 'absolute') {\n this.__execAr();\n }\n this.__hasComputeReflow = false;\n }\n return lineClampCount;\n }\n\n __execAr() {\n // 动态json引用时动画暂存,第一次布局时处理这些动画到root的animateController上\n let ar = this.__animateRecords;\n if(ar) {\n this.__animateRecords = null;\n // parse没有dom时,animate的target引用都是json,vd后生成需重新赋值\n ar.list.forEach(item => {\n if(item.target.vd instanceof Xom) {\n item.target = item.target.vd;\n }\n });\n let ac = ar.controller || this.root.animateController;\n // 不自动播放进入记录列表,初始化并等待手动调用\n if(ar.options && ar.options.autoPlay === false) {\n ac.__records2 = ac.__records2.concat(ar.list);\n ac.init(ac.__records2, ac.list2);\n }\n else {\n ac.__records = ac.__records.concat(ar.list);\n ac.__playAuto();\n }\n }\n }\n\n __layoutNone() {\n let { computedStyle } = this;\n computedStyle[DISPLAY] = 'none';\n computedStyle[MARGIN_TOP]\n = computedStyle[MARGIN_RIGHT]\n = computedStyle[MARGIN_BOTTOM]\n = computedStyle[MARGIN_LEFT]\n = computedStyle[BORDER_TOP_WIDTH]\n = computedStyle[BORDER_RIGHT_WIDTH]\n = computedStyle[BORDER_BOTTOM_WIDTH]\n = computedStyle[BORDER_LEFT_WIDTH]\n = computedStyle[PADDING_TOP]\n = computedStyle[PADDING_RIGHT]\n = computedStyle[PADDING_BOTTOM]\n = computedStyle[PADDING_LEFT]\n = computedStyle[WIDTH]\n = computedStyle[HEIGHT]\n = this.__width\n = this.__height\n = 0;\n }\n\n // 预先计算是否是固定宽高,布局点位和尺寸考虑margin/border/padding\n __preLayout(data, isInline) {\n let { x, y, w, h, w2, h2, w3, h3, lx, lineBoxManager, endSpace = 0 } = data;\n this.__x = x;\n this.__y = y;\n let { currentStyle, computedStyle } = this;\n let {\n [WIDTH]: width,\n [HEIGHT]: height,\n } = currentStyle;\n let {\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [MARGIN_TOP]: marginTop,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_BOTTOM]: marginBottom,\n [MARGIN_LEFT]: marginLeft,\n [PADDING_TOP]: paddingTop,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_BOTTOM]: paddingBottom,\n [PADDING_LEFT]: paddingLeft,\n } = computedStyle;\n // 除了auto外都是固定宽高度\n let fixedWidth;\n let fixedHeight;\n // 绝对定位是left+right这种其实等于定义了width,但不能修改原始style,存入特殊变量标识\n if(w2 !== undefined) {\n fixedWidth = true;\n w = w2;\n }\n // flex时也会用到,子级得出目标主尺寸后按这个来\n else if(w3 !== undefined) {\n fixedWidth = true;\n w = w3;\n }\n else if(width[1] !== AUTO) {\n fixedWidth = true;\n switch(width[1]) {\n case PX:\n w = width[0];\n break;\n case PERCENT:\n w *= width[0] * 0.01;\n break;\n case REM:\n w = width[0] * this.root.computedStyle[FONT_SIZE];\n break;\n case VW:\n w = width[0] * this.root.width * 0.01;\n break;\n case VH:\n w = width[0] * this.root.height * 0.01;\n break;\n case VMAX:\n w = width[0] * Math.max(this.root.width, this.root.height) * 0.01;\n break;\n case VMIN:\n w = width[0] * Math.min(this.root.width, this.root.height) * 0.01;\n break;\n }\n }\n if(h2 !== undefined) {\n fixedHeight = true;\n h = h2;\n }\n else if(h3 !== undefined) {\n fixedHeight = true;\n h = h3;\n }\n else if(height[1] !== AUTO) {\n fixedHeight = true;\n switch(height[1]) {\n case PX:\n h = height[0];\n break;\n case PERCENT:\n h *= height[0] * 0.01;\n break;\n case REM:\n h = height[0] * this.root.computedStyle[FONT_SIZE];\n break;\n case VW:\n h = height[0] * this.root.width * 0.01;\n break;\n case VH:\n h = height[0] * this.root.height * 0.01;\n break;\n case VMAX:\n h = height[0] * Math.max(this.root.width, this.root.height) * 0.01;\n break;\n case VMIN:\n h = height[0] * Math.min(this.root.width, this.root.height) * 0.01;\n break;\n }\n }\n // margin/border/padding影响x和y和尺寸,注意inline的y不受mpb影响\n x += borderLeftWidth + marginLeft + paddingLeft;\n data.x = x;\n if(!isInline) {\n y += borderTopWidth + marginTop + paddingTop;\n }\n data.y = y;\n // inline的w/h很特殊,需不考虑inline自身水平的mpb以便换行,因为mpb只在首尾行生效,所以首尾需特殊处理中间忽略\n // 当嵌套inline时更加复杂,假如inline有尾部mpb,最后一行需考虑,如果此inline是父的最后一个且父有mpb需叠加\n let selfEndSpace = 0;\n if(isInline) {\n selfEndSpace = paddingRight + borderRightWidth + marginRight;\n }\n // 传入w3/h3时,flex的item已知目标主尺寸,需减去mbp,其一定是block,和inline互斥\n if(!isInline) {\n if(width[1] === AUTO || w3 !== undefined) {\n w -= borderLeftWidth + borderRightWidth + marginLeft + marginRight + paddingLeft + paddingRight;\n }\n if(height[1] === AUTO || h3 !== undefined) {\n h -= borderTopWidth + borderBottomWidth + marginTop + marginBottom + paddingTop + paddingBottom;\n }\n }\n return {\n fixedWidth,\n fixedHeight,\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n selfEndSpace,\n };\n }\n\n // 处理margin:xx auto居中对齐或右对齐\n __marginAuto(style, data) {\n let {\n [POSITION]: position,\n [DISPLAY]: display,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_RIGHT]: marginRight,\n [WIDTH]: width,\n } = style;\n if(position !== 'absolute' && (display === 'block' || display === 'flex')\n && (width[1] !== AUTO || this.isReplaced) && marginLeft[1] === AUTO && marginRight[1] === AUTO) {\n let ow = this.outerWidth;\n if(ow < data.w) {\n this.__offsetX((data.w - ow) * 0.5, true);\n }\n }\n }\n\n __calMatrix(lv, __cacheStyle, currentStyle, computedStyle, __config, sx1, sy1, offsetWidth, offsetHeight) {\n if(__config[NODE_IS_INLINE]) {\n computedStyle[TRANSFORM_ORIGIN] = [sx1, sy1];\n return __cacheStyle[MATRIX] = mx.identity();\n }\n let matrixCache = __cacheStyle[MATRIX];\n // tx/ty变化特殊优化\n if(matrixCache && lv < REFLOW && !contain(lv, TF)) {\n let x = 0, y = 0, z = 0;\n if(contain(lv, TX)) {\n let v = currentStyle[TRANSLATE_X];\n if(isNil(v)) {\n v = 0;\n }\n else if(v[1] === PERCENT) {\n v = v[0] * this.offsetWidth * 0.01;\n }\n else if(v[1] === REM) {\n v = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * this.root.height * 0.01;\n }\n else if(v[1] === VMAX) {\n v = v[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(v[1] === VMIN) {\n v = v[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n else {\n v = v[0];\n }\n x = v - (computedStyle[TRANSLATE_X] || 0);\n computedStyle[TRANSLATE_X] = v;\n computedStyle[TRANSFORM][12] += x;\n matrixCache[12] += x;\n }\n if(contain(lv, TY)) {\n let v = currentStyle[TRANSLATE_Y];\n if(isNil(v)) {\n v = 0;\n }\n else if(v[1] === PERCENT) {\n v = v[0] * this.offsetHeight * 0.01;\n }\n else if(v[1] === REM) {\n v = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * this.root.height * 0.01;\n }\n else if(v[1] === VMAX) {\n v = v[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(v[1] === VMIN) {\n v = v[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n else {\n v = v[0];\n }\n y = v - (computedStyle[TRANSLATE_Y] || 0);\n computedStyle[TRANSLATE_Y] = v;\n computedStyle[TRANSFORM][13] += y;\n matrixCache[13] += y;\n }\n if(contain(lv, TZ)) {\n let v = currentStyle[TRANSLATE_Z];\n if(isNil(v)) {\n v = 0;\n }\n else if(v[1] === PERCENT) {\n v = v[0] * this.offsetWidth * 0.01;\n }\n else if(v[1] === REM) {\n v = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * this.root.height * 0.01;\n }\n else if(v[1] === VMAX) {\n v = v[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(v[1] === VMIN) {\n v = v[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n else {\n v = v[0];\n }\n z = v - (computedStyle[TRANSLATE_Z] || 0);\n computedStyle[TRANSLATE_Z] = v;\n computedStyle[TRANSFORM][14] += z;\n matrixCache[14] += z;\n }\n __cacheStyle[MATRIX] = matrixCache;\n }\n // 先根据cache计算需要重新计算的computedStyle\n else {\n if(sx1 === undefined) {\n sx1 = this.__sx1;\n sy1 = this.__sy1;\n offsetWidth = this.offsetWidth;\n offsetHeight = this.offsetHeight;\n }\n if(__cacheStyle[TRANSFORM_ORIGIN] === undefined) {\n __cacheStyle[TRANSFORM_ORIGIN] = true;\n matrixCache = null;\n computedStyle[TRANSFORM_ORIGIN] = tf.calOrigin(currentStyle[TRANSFORM_ORIGIN], offsetWidth, offsetHeight, this.root);\n }\n if(__cacheStyle[TRANSFORM] === undefined\n || __cacheStyle[TRANSLATE_X] === undefined\n || __cacheStyle[TRANSLATE_Y] === undefined\n || __cacheStyle[TRANSLATE_Z] === undefined\n || __cacheStyle[ROTATE_X] === undefined\n || __cacheStyle[ROTATE_Y] === undefined\n || __cacheStyle[ROTATE_Z] === undefined\n || __cacheStyle[ROTATE_3D] === undefined\n || __cacheStyle[SCALE_X] === undefined\n || __cacheStyle[SCALE_Y] === undefined\n || __cacheStyle[SCALE_Z] === undefined\n || __cacheStyle[SKEW_X] === undefined\n || __cacheStyle[SKEW_Y] === undefined) {\n __cacheStyle[TRANSFORM]\n = __cacheStyle[TRANSLATE_X]\n = __cacheStyle[TRANSLATE_Y]\n = __cacheStyle[TRANSLATE_Z]\n = __cacheStyle[ROTATE_X]\n = __cacheStyle[ROTATE_Y]\n = __cacheStyle[ROTATE_Z]\n = __cacheStyle[SCALE_X]\n = __cacheStyle[SCALE_Y]\n = __cacheStyle[SCALE_Z]\n = __cacheStyle[SKEW_X]\n = __cacheStyle[SKEW_Y]\n = true;\n matrixCache = null;\n let matrix;\n // transform相对于自身\n if(currentStyle[TRANSFORM]) {\n matrix = tf.calMatrix(currentStyle[TRANSFORM], offsetWidth, offsetHeight, this.root);\n }\n // 没有transform则看是否有扩展的css独立变换属性\n else {\n let temp = [];\n [\n TRANSLATE_X,\n TRANSLATE_Y,\n TRANSLATE_Z,\n ROTATE_X,\n ROTATE_Y,\n ROTATE_Z,\n ROTATE_3D,\n SKEW_X,\n SKEW_Y,\n SCALE_X,\n SCALE_Y,\n SCALE_Z,\n ].forEach(k => {\n // 删除之前遗留的\n delete computedStyle[k];\n let v = currentStyle[k];\n if(isNil(v)) {\n return;\n }\n if(k === ROTATE_3D) {\n computedStyle[k] = [v[0], v[1], v[2], v[3][0]];\n if(v[3][0] === 0) {\n return;\n }\n temp.push([k, v]);\n return;\n }\n computedStyle[k] = v[0];\n // scale为1和其它为0避免计算浪费\n let isScale = k === SCALE_X || k === SCALE_Y || k === SCALE_Z;\n if(v[0] === 1 && isScale || !isScale && v[0] === 0) {\n return;\n }\n if(v[1] === PERCENT) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n computedStyle[k] = v[0] * offsetWidth * 0.01;\n }\n else if(k === TRANSLATE_Y) {\n computedStyle[k] = v[0] * offsetHeight * 0.01;\n }\n }\n else if(v[1] === REM) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n computedStyle[k] = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(k === TRANSLATE_Y) {\n computedStyle[k] = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n }\n else if(v[1] === VW) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n computedStyle[k] = v[0] * this.root.width * 0.01;\n }\n else if(k === TRANSLATE_Y) {\n computedStyle[k] = v[0] * this.root.width * 0.01;\n }\n }\n else if(v[1] === VH) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n computedStyle[k] = v[0] * this.root.height * 0.01;\n }\n else if(k === TRANSLATE_Y) {\n computedStyle[k] = v[0] * this.root.height * 0.01;\n }\n }\n else if(v[1] === VMAX) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n computedStyle[k] = v[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(k === TRANSLATE_Y) {\n computedStyle[k] = v[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n }\n else if(v[1] === VMIN) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n computedStyle[k] = v[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n else if(k === TRANSLATE_Y) {\n computedStyle[k] = v[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n }\n temp.push([k, v]);\n });\n if(temp.length) {\n matrix = tf.calMatrix(temp, offsetWidth, offsetHeight, this.root);\n }\n }\n computedStyle[TRANSFORM] = matrix || mx.identity();\n }\n if(!matrixCache) {\n let m = computedStyle[TRANSFORM];\n let tfo = computedStyle[TRANSFORM_ORIGIN].slice(0);\n tfo[0] += sx1 || 0;\n tfo[1] += sy1 || 0;\n matrixCache = __cacheStyle[MATRIX] = tf.calMatrixByOrigin(m, tfo);\n }\n }\n return matrixCache;\n }\n\n /**\n * 将currentStyle计算为computedStyle,同时存入cacheStyle可缓存的结果防止无变更重复计算\n * @param renderMode\n * @param ctx\n * @param parent\n * @param __cacheStyle\n * @param currentStyle\n * @param computedStyle\n * @param clientWidth\n * @param clientHeight\n * @param offsetWidth\n * @param offsetHeight\n * @param borderTopWidth\n * @param borderRightWidth\n * @param borderBottomWidth\n * @param borderLeftWidth\n * @param paddingTop\n * @param paddingRight\n * @param paddingBottom\n * @param paddingLeft\n * @param x1\n * @param x2\n * @param x3\n * @param x4\n * @param x5\n * @param x6\n * @param y1\n * @param y2\n * @param y3\n * @param y4\n * @param y5\n * @param y6\n * @returns {*[]}\n * @private\n */\n __calCache(renderMode, ctx, parent, __cacheStyle, currentStyle, computedStyle,\n clientWidth, clientHeight, offsetWidth, offsetHeight,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n paddingTop, paddingRight, paddingBottom, paddingLeft,\n x1, x2, x3, x4, x5, x6, y1, y2, y3, y4, y5, y6) {\n let bx1 = x1, by1 = y1, bx2 = x6, by2 = y6;\n let backgroundClip = computedStyle[BACKGROUND_CLIP] = currentStyle[BACKGROUND_CLIP];\n // 默认border-box\n if(backgroundClip === 'paddingBox' || backgroundClip === 'padding-box') {\n bx1 = x2;\n by1 = y2;\n bx2 = x5;\n by2 = y5;\n }\n else if(backgroundClip === 'contentBox' || backgroundClip === 'content-box') {\n bx1 = x3;\n by1 = y3;\n bx2 = x4;\n by2 = y4;\n }\n let isInline = this.__config[NODE_IS_INLINE];\n if(isInline && !this.contentBoxList.length) {\n isInline = false;\n }\n // 这些直接赋值的不需要再算缓存\n [\n OPACITY,\n Z_INDEX,\n BORDER_TOP_STYLE,\n BORDER_RIGHT_STYLE,\n BORDER_BOTTOM_STYLE,\n BORDER_LEFT_STYLE,\n BACKGROUND_REPEAT,\n OVERFLOW,\n MIX_BLEND_MODE,\n TEXT_OVERFLOW,\n BACKGROUND_CLIP,\n ].forEach(k => {\n computedStyle[k] = currentStyle[k];\n });\n if(isNil(__cacheStyle[FILTER])) {\n __cacheStyle[FILTER] = true;\n this.__calFilter(currentStyle, computedStyle);\n }\n if(isNil(__cacheStyle[BACKGROUND_POSITION_X])) {\n __cacheStyle[BACKGROUND_POSITION_X] = true;\n let {\n [BACKGROUND_POSITION_X]: bgX,\n } = currentStyle;\n computedStyle[BACKGROUND_POSITION_X] = (bgX || []).map(item => {\n if(item[1] === PX) {\n return item[0];\n }\n if(item[1] === REM) {\n return item[0] * this.root.computedStyle[FONT_SIZE];\n }\n if(item[1] === VW) {\n return item[0] * this.root.width * 0.01;\n }\n if(item[1] === VH) {\n return item[0] * this.root.height * 0.01;\n }\n if(item[1] === VMAX) {\n return item[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n if(item[1] === VMIN) {\n return item[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(item[1] === PERCENT) {\n return item[0] + '%';\n }\n });\n }\n if(isNil(__cacheStyle[BACKGROUND_POSITION_Y])) {\n __cacheStyle[BACKGROUND_POSITION_Y] = true;\n let {\n [BACKGROUND_POSITION_Y]: bgY,\n } = currentStyle;\n computedStyle[BACKGROUND_POSITION_Y] = (bgY || []).map(item => {\n if(item[1] === PX) {\n return item[0];\n }\n if(item[1] === REM) {\n return item[0] * this.root.computedStyle[FONT_SIZE];\n }\n if(item[1] === VW) {\n return item[0] * this.root.width * 0.01;\n }\n if(item[1] === VH) {\n return item[0] * this.root.height * 0.01;\n }\n if(item[1] === VMAX) {\n return item[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n if(item[1] === VMIN) {\n return item[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(item[1] === PERCENT) {\n return item[0] + '%';\n }\n });\n }\n if(isNil(__cacheStyle[BACKGROUND_SIZE])) {\n __cacheStyle[BACKGROUND_SIZE] = true;\n computedStyle[BACKGROUND_SIZE] = (currentStyle[BACKGROUND_SIZE] || []).map(item => {\n return bg.calBackgroundSize(item, bx2 - bx1, by2 - by1, this.root);\n });\n }\n if(isNil(__cacheStyle[BACKGROUND_IMAGE])) {\n let bgI = computedStyle[BACKGROUND_IMAGE] = currentStyle[BACKGROUND_IMAGE].slice(0);\n __cacheStyle[BACKGROUND_IMAGE] = bgI.map((bgi, i) => {\n if(!bgi) {\n return null;\n }\n // 防止隐藏不加载背景图\n if(util.isString(bgi)) {\n let loadBgi = this.__loadBgi[i] = this.__loadBgi[i] || {};\n let cache = inject.IMG[BACKGROUND_IMAGE];\n if(cache && cache.state === inject.LOADED) {\n loadBgi.url = BACKGROUND_IMAGE;\n loadBgi.source = cache.source;\n loadBgi.width = cache.width;\n loadBgi.height = cache.height;\n }\n else if(loadBgi.url !== bgi) {\n // 可能改变导致多次加载,每次清空,成功后还要比对url是否相同\n loadBgi.url = bgi;\n loadBgi.source = null;\n let node = this;\n let root = node.root;\n inject.measureImg(bgi, data => {\n // 还需判断url,防止重复加载时老的替换新的,失败不绘制bgi\n if(data.success && data.url === loadBgi.url && !this.isDestroyed) {\n loadBgi.source = data.source;\n loadBgi.width = data.width;\n loadBgi.height = data.height;\n root.delRefreshTask(loadBgi.cb);\n root.addRefreshTask(loadBgi.cb = {\n __before() {\n __cacheStyle[BACKGROUND_IMAGE] = undefined;\n let res = {};\n res[UPDATE_NODE] = node;\n res[UPDATE_FOCUS] = REPAINT;\n res[UPDATE_CONFIG] = node.__config;\n root.__addUpdate(node, node.__config, root, root.__config, res);\n },\n });\n }\n }, {\n ctx,\n root,\n width: bx2 - bx1,\n height: by2 - by1,\n });\n }\n return true;\n }\n else if(!isInline && bgi.k) {\n // gradient在渲染时才生成\n return true;\n }\n });\n }\n if(isNil(__cacheStyle[BOX_SHADOW])) {\n __cacheStyle[BOX_SHADOW] = true;\n computedStyle[BOX_SHADOW] = (currentStyle[BOX_SHADOW] || []).map(item => {\n return item.map((item2, i) => {\n if(i > 3) {\n return item2;\n }\n let v = item2[0];\n if(item2[1] === PERCENT) {\n if(i % 2 === 0) {\n v *= 0.01 * (bx2 - bx1);\n }\n else {\n v *= 0.01 * (by2 - by1);\n }\n }\n else if(item2[1] === REM) {\n v = v * this.root.computedStyle[FONT_SIZE];\n }\n else if(item2[1] === VW) {\n v = v * this.root.width * 0.01;\n }\n else if(item2[1] === VH) {\n v = v * this.root.height * 0.01;\n }\n else if(item2[1] === VMAX) {\n v = v * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(item2[1] === VMIN) {\n v = v * Math.min(this.root.width, this.root.height) * 0.01;\n }\n return v;\n });\n });\n }\n [\n BACKGROUND_COLOR,\n BORDER_TOP_COLOR,\n BORDER_RIGHT_COLOR,\n BORDER_BOTTOM_COLOR,\n BORDER_LEFT_COLOR,\n ].forEach(k => {\n if(isNil(__cacheStyle[k])) {\n __cacheStyle[k] = int2rgba(computedStyle[k] = currentStyle[k][0]);\n }\n });\n // 圆角边计算\n if(isNil(__cacheStyle[BORDER_TOP_LEFT_RADIUS])\n || isNil(__cacheStyle[BORDER_TOP_RIGHT_RADIUS])\n || isNil(__cacheStyle[BORDER_BOTTOM_RIGHT_RADIUS])\n || isNil(__cacheStyle[BORDER_BOTTOM_LEFT_RADIUS])) {\n __cacheStyle[BORDER_TOP_LEFT_RADIUS]\n = __cacheStyle[BORDER_TOP_RIGHT_RADIUS]\n = __cacheStyle[BORDER_BOTTOM_RIGHT_RADIUS]\n = __cacheStyle[BORDER_BOTTOM_LEFT_RADIUS]\n = true;\n // 非替代的inline计算看contentBox首尾\n if(isInline) {\n border.calBorderRadiusInline(this.contentBoxList, currentStyle, computedStyle, this.root);\n }\n // 普通block整体计算\n else {\n border.calBorderRadius(offsetWidth, offsetHeight, currentStyle, computedStyle, this.root);\n }\n }\n // width/style/radius影响border,color不影响渲染缓存\n let btlr = computedStyle[BORDER_TOP_LEFT_RADIUS];\n let btrr = computedStyle[BORDER_TOP_RIGHT_RADIUS];\n let bbrr = computedStyle[BORDER_BOTTOM_RIGHT_RADIUS];\n let bblr = computedStyle[BORDER_BOTTOM_LEFT_RADIUS];\n ['Top', 'Right', 'Bottom', 'Left'].forEach(k => {\n k = 'border' + k;\n let k2 = STYLE_KEY[style2Upper(k)];\n let kw = STYLE_KEY[style2Upper(k + 'Width')];\n let ks = STYLE_KEY[style2Upper(k + 'Style')];\n // width/style变更影响border重新计算\n if(isNil(__cacheStyle[kw])) {\n __cacheStyle[kw] = true;\n __cacheStyle[k2] = undefined;\n }\n if(isNil(__cacheStyle[ks])) {\n __cacheStyle[ks] = true;\n __cacheStyle[k2] = undefined;\n }\n if(isNil(__cacheStyle[k2])) {\n if(k2 === BORDER_TOP) {\n if(borderTopWidth > 0) {\n if(!isInline) {\n let deg1 = Math.atan(borderTopWidth / borderLeftWidth);\n let deg2 = Math.atan(borderTopWidth / borderRightWidth);\n __cacheStyle[k2] = border.calPoints(borderTopWidth, computedStyle[ks], deg1, deg2,\n x1, x2, x5, x6, y1, y2, y5, y6, 0, btlr, btrr);\n }\n }\n else {\n __cacheStyle[k2] = [];\n }\n }\n else if(k2 === BORDER_RIGHT) {\n if(borderRightWidth > 0) {\n if(!isInline) {\n let deg1 = Math.atan(borderRightWidth / borderTopWidth);\n let deg2 = Math.atan(borderRightWidth / borderBottomWidth);\n __cacheStyle[k2] = border.calPoints(borderRightWidth, computedStyle[ks], deg1, deg2,\n x1, x2, x5, x6, y1, y2, y5, y6, 1, btrr, bbrr);\n }\n }\n else {\n __cacheStyle[k2] = [];\n }\n }\n else if(k2 === BORDER_BOTTOM) {\n if(borderBottomWidth > 0) {\n if(!isInline) {\n let deg1 = Math.atan(borderBottomWidth / borderLeftWidth);\n let deg2 = Math.atan(borderBottomWidth / borderRightWidth);\n __cacheStyle[k2] = border.calPoints(borderBottomWidth, computedStyle[ks], deg1, deg2,\n x1, x2, x5, x6, y1, y2, y5, y6, 2, bblr, bbrr);\n }\n }\n else {\n __cacheStyle[k2] = [];\n }\n }\n else if(k2 === BORDER_LEFT) {\n if(borderLeftWidth > 0) {\n if(!isInline) {\n let deg1 = Math.atan(borderLeftWidth / borderTopWidth);\n let deg2 = Math.atan(borderLeftWidth / borderBottomWidth);\n __cacheStyle[k2] = border.calPoints(borderLeftWidth, computedStyle[ks], deg1, deg2,\n x1, x2, x5, x6, y1, y2, y5, y6, 3, btlr, bblr);\n }\n }\n else {\n __cacheStyle[k2] = [];\n }\n }\n }\n });\n // 强制计算继承性的\n let parentComputedStyle = parent && parent.computedStyle;\n if(currentStyle[FONT_STYLE][1] === INHERIT) {\n computedStyle[FONT_STYLE] = parent ? parentComputedStyle[FONT_STYLE] : 'normal';\n }\n else if(isNil(__cacheStyle[FONT_STYLE])) {\n computedStyle[FONT_STYLE] = currentStyle[FONT_STYLE][0];\n }\n __cacheStyle[FONT_STYLE] = computedStyle[FONT_STYLE];\n if(currentStyle[COLOR][1] === INHERIT) {\n computedStyle[COLOR] = parent ? parentComputedStyle[COLOR] : [0, 0, 0, 1];\n __cacheStyle[COLOR] = int2rgba(computedStyle[COLOR]);\n }\n else if(isNil(__cacheStyle[COLOR])) {\n computedStyle[COLOR] = rgba2int(currentStyle[COLOR][0]);\n __cacheStyle[COLOR] = int2rgba(computedStyle[COLOR]);\n }\n if(currentStyle[TEXT_STROKE_COLOR][1] === INHERIT) {\n computedStyle[TEXT_STROKE_COLOR] = parent ? parentComputedStyle[TEXT_STROKE_COLOR] : [0, 0, 0, 1];\n __cacheStyle[TEXT_STROKE_COLOR] = int2rgba(computedStyle[TEXT_STROKE_COLOR]);\n }\n else if(isNil(__cacheStyle[TEXT_STROKE_COLOR])) {\n computedStyle[TEXT_STROKE_COLOR] = rgba2int(currentStyle[TEXT_STROKE_COLOR][0]);\n __cacheStyle[TEXT_STROKE_COLOR] = int2rgba(computedStyle[TEXT_STROKE_COLOR]);\n }\n if(currentStyle[TEXT_STROKE_WIDTH][1] === INHERIT) {\n computedStyle[TEXT_STROKE_WIDTH] = parent ? parentComputedStyle[TEXT_STROKE_WIDTH] : 0;\n __cacheStyle[TEXT_STROKE_WIDTH] = true;\n }\n else if(isNil(__cacheStyle[TEXT_STROKE_WIDTH])) {\n let v = currentStyle[TEXT_STROKE_WIDTH];\n if(v[1] === REM) {\n v = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * this.root.height * 0.01;\n }\n else if(v[1] === VMAX) {\n v = v[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(v[1] === VMIN) {\n v = v[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n else {\n v = v[0];\n }\n computedStyle[TEXT_STROKE_WIDTH] = v;\n __cacheStyle[TEXT_STROKE_WIDTH] = true;\n }\n if(currentStyle[TEXT_STROKE_OVER][1] === INHERIT) {\n __cacheStyle[TEXT_STROKE_OVER] = computedStyle[TEXT_STROKE_OVER] = parent ? parentComputedStyle[TEXT_STROKE_OVER] : 'none';\n }\n else {\n __cacheStyle[TEXT_STROKE_OVER] = computedStyle[TEXT_STROKE_OVER] = currentStyle[TEXT_STROKE_OVER][0];\n }\n if(currentStyle[VISIBILITY][1] === INHERIT) {\n computedStyle[VISIBILITY] = parent ? parentComputedStyle[VISIBILITY] : 'visible';\n }\n else if(isNil(__cacheStyle[VISIBILITY])) {\n computedStyle[VISIBILITY] = currentStyle[VISIBILITY][0];\n }\n __cacheStyle[VISIBILITY] = computedStyle[VISIBILITY];\n if(currentStyle[POINTER_EVENTS][1] === INHERIT) {\n computedStyle[POINTER_EVENTS] = parent ? parentComputedStyle[POINTER_EVENTS] : 'auto';\n }\n else if(isNil(__cacheStyle[POINTER_EVENTS])) {\n computedStyle[POINTER_EVENTS] = currentStyle[POINTER_EVENTS][0];\n }\n __cacheStyle[POINTER_EVENTS] = computedStyle[POINTER_EVENTS];\n this.__bx1 = bx1;\n this.__bx2 = bx2;\n this.__by1 = by1;\n this.__by2 = by2;\n return [bx1, by1, bx2, by2];\n }\n\n __calPerspective(__cacheStyle, currentStyle, computedStyle, __config, sx1, sy1) {\n let rebuild;\n if(isNil(__cacheStyle[PERSPECTIVE])) {\n __cacheStyle[PERSPECTIVE] = true;\n rebuild = true;\n let v = currentStyle[PERSPECTIVE];\n let ppt = 0;\n if(v[1] === REM) {\n ppt = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n ppt = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n ppt = v[0] * this.root.height * 0.01;\n }\n else if(v[1] === VMAX) {\n ppt = v[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(v[1] === VMIN) {\n ppt = v[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n else {\n ppt = v[0];\n }\n computedStyle[PERSPECTIVE] = ppt;\n }\n if(isNil(__cacheStyle[PERSPECTIVE_ORIGIN])) {\n __cacheStyle[PERSPECTIVE_ORIGIN] = true;\n rebuild = true;\n computedStyle[PERSPECTIVE_ORIGIN] = tf.calOrigin(currentStyle[PERSPECTIVE_ORIGIN], this.offsetWidth, this.offsetHeight, this.root);\n }\n if(rebuild) {\n if(sx1 === undefined) {\n sx1 = this.__sx1;\n sy1 = this.__sy1;\n }\n let po = computedStyle[PERSPECTIVE_ORIGIN].slice(0);\n po[0] += sx1 || 0;\n po[1] += sy1 || 0;\n __config[NODE_PERSPECTIVE_MATRIX] = tf.calPerspectiveMatrix(computedStyle[PERSPECTIVE], po);\n }\n }\n\n __calFilter(currentStyle, computedStyle) {\n return computedStyle[FILTER] = (currentStyle[FILTER] || []).map(item => {\n let [k, v] = item;\n // 部分%单位的滤镜强制使用数字\n if(v[1] === PX || v[1] === DEG || v[1] === PERCENT || v[1] === NUMBER) {\n v = v[0];\n }\n else if(v[1] === REM) {\n v = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * this.root.height * 0.01;\n }\n else if(v[1] === VMAX) {\n v = v[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(v[1] === VMIN) {\n v = v[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n return [k, v];\n });\n }\n\n __calContent(renderMode, lv, currentStyle, computedStyle) {\n if(renderMode === CANVAS || renderMode === WEBGL) {\n if(lv < REPAINT) {\n return this.__hasContent;\n }\n let visibility = currentStyle[VISIBILITY];\n if(visibility !== 'hidden') {\n let bgI = currentStyle[BACKGROUND_IMAGE];\n if(Array.isArray(bgI)) {\n for(let i = 0, len = bgI.length; i < len; i++) {\n if(bgI[i]) {\n return true;\n }\n }\n }\n if(currentStyle[BACKGROUND_COLOR][0][3] > 0) {\n let width = computedStyle[WIDTH], height = computedStyle[HEIGHT],\n paddingTop = computedStyle[PADDING_TOP], paddingRight = computedStyle[PADDING_RIGHT],\n paddingBottom = computedStyle[PADDING_BOTTOM], paddingLeft = computedStyle[PADDING_LEFT];\n if(width && height || paddingTop || paddingRight || paddingBottom || paddingLeft) {\n return true;\n }\n }\n for(let list = ['Top', 'Right', 'Bottom', 'Left'], i = 0, len = list.length; i < len; i++) {\n let k = list[i];\n if(computedStyle[STYLE_KEY[style2Upper('border' + k + 'Width')]] > 0\n && currentStyle[STYLE_KEY[style2Upper('border' + k + 'Color')]][0][3] > 0) {\n return true;\n }\n }\n let bs = currentStyle[BOX_SHADOW];\n if(Array.isArray(bs)) {\n for(let i = 0, len = bs.length; i < len; i++) {\n let item = bs[i];\n if(item && (item[2] > 0 || item[3] > 0)) {\n return true;\n }\n }\n }\n }\n }\n return false;\n }\n\n /**\n * 渲染基础方法,Dom/Geom公用\n * @param renderMode\n * @see node/mode\n * @param lv\n * @see refresh/level\n * @param ctx canvas/svg/webgl共用\n * @param cache 是否是局部根节点缓存模式下的绘制\n * @see refresh/Cache.NA\n * @param dx cache时偏移x\n * @param dy cache时偏移y\n * @return Object\n * x1/x2/x3/x4/y1/y2/y3/y4 坐标\n * break svg判断无变化提前跳出\n * cacheError 离屏申请失败,仅canvas\n * offscreenBlend 无cache时的离屏canvas,仅canvas\n * offscreenFilter 无cache时的离屏canvas,仅canvas\n * offscreenOverflow 无cache时的离屏canvas,仅canvas\n * offscreenMask 无cache时的离屏canvas,仅canvas\n */\n render(renderMode, lv, ctx, cache, dx = 0, dy = 0) {\n let {\n isDestroyed,\n root,\n __config,\n } = this;\n let __cache = __config[NODE_CACHE];\n let __cacheStyle = __config[NODE_CACHE_STYLE];\n let currentStyle = __config[NODE_CURRENT_STYLE];\n let computedStyle = __config[NODE_COMPUTED_STYLE];\n // 渲染完认为完全无变更,等布局/动画/更新重置\n __config[NODE_REFRESH_LV] = NONE;\n // >=REPAINT清空bbox\n if(lv >= REPAINT) {\n this.__bbox = null;\n }\n if(isDestroyed) {\n return { isDestroyed, break: true };\n }\n let virtualDom;\n // svg设置vd上的lv属性标明lineHeight的话,另外特殊字体如arial拥有lineGap也会产生间隙,背景色不绘制这个间隙\n * x轴根据contentBox的范围坐标,y则固定和font/lineHeight相关\n * 圆角发生在首尾lineBox处,中间不会有,bgi则产生类似bgc作为mask的效果\n * 另外要注意多个时的顺序,必须依次渲染,后面的bb可能会覆盖前面行的\n */\n if(isRealInline) {\n let contentBoxList = this.contentBoxList;\n let length = contentBoxList.length;\n if(contentBoxList[length - 1] instanceof Ellipsis) {\n length--;\n }\n let hasBgi = backgroundImage.some(item => item);\n if(length) {\n let {\n [FONT_SIZE]: fontSize,\n [FONT_FAMILY]: fontFamily,\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n let iw = 0, ih = 0;\n let offscreen, svgBgSymbol = [];\n // bgi视作inline排满一行绘制,然后按分行拆开给每行\n if(hasBgi) {\n iw = inline.getInlineWidth(this, contentBoxList);\n ih = lineHeight;\n if(backgroundClip === 'paddingBox' || backgroundClip === 'padding-box') {\n iw += paddingLeft + paddingRight;\n ih += paddingTop + paddingBottom;\n }\n else if(backgroundClip !== 'contentBox' && backgroundClip !== 'content-box') {\n iw += paddingLeft + paddingRight + borderLeftWidth + borderRightWidth;\n ih += paddingTop + paddingBottom + borderTopWidth + borderBottomWidth;\n }\n if(renderMode === CANVAS || renderMode === WEBGL) {\n offscreen = inject.getCacheCanvas(iw, ih, '__$$INLINE_BGI$$__');\n }\n let length = backgroundImage.length;\n backgroundImage.slice(0).reverse().forEach((bgi, i) => {\n if(!bgi) {\n return;\n }\n i = length - 1 - i;\n if(util.isString(bgi)) {\n let loadBgi = this.__loadBgi[i];\n if(loadBgi.url === backgroundImage[i]) {\n let uuid = bg.renderImage(this, renderMode, offscreen && offscreen.ctx || ctx, loadBgi,\n 0, 0, iw, ih, btlr, btrr, bbrr, bblr,\n currentStyle, i, backgroundSize, backgroundRepeat, __config, true, dx, dy);\n if(renderMode === SVG && uuid) {\n svgBgSymbol.push(uuid);\n }\n }\n }\n else if(bgi.k) {\n let gd = this.__gradient(renderMode, ctx, 0, 0, iw, ih, bgi, dx, dy);\n if(gd) {\n if(gd.k === 'conic') {\n gradient.renderConic(this, renderMode, offscreen && offscreen.ctx || ctx, gd.v, 0, 0, iw, lineHeight,\n btlr, btrr, bbrr, bblr, true);\n }\n else {\n let uuid = bg.renderBgc(this, renderMode, offscreen && offscreen.ctx || ctx, gd.v, null,\n 0, 0, iw, ih, btlr, btrr, bbrr, bblr, 'fill', true);\n if(renderMode === SVG && uuid) {\n svgBgSymbol.push(uuid);\n }\n }\n }\n }\n });\n }\n // 获取当前dom的baseline,再减去lineBox的baseline得出差值,这样渲染范围y就是lineBox的y+差值为起始,lineHeight为高\n let ff = css.getFontFamily(fontFamily);\n let baseline = css.getBaseline(computedStyle);\n // lineGap,一般为0,某些字体如arial有,渲染高度需减去它,最终是lineHeight - diffL\n let diffL = fontSize * (font.info[ff].lgr || 0);\n // 注意只有1个的时候特殊情况,圆角只在首尾行出现\n let isFirst = true;\n let lastContentBox = contentBoxList[0], lastLineBox = lastContentBox.parentLineBox;\n // bgi需统计宽度累计值,将当前行所处理想单行的x范围位置计算出来,并进行bgi贴图绘制,svg还需统计第几行\n let count = 0, countW = 0;\n for(let i = 0; i < length; i++) {\n let contentBox = contentBoxList[i];\n if(contentBox.parentLineBox !== lastLineBox) {\n // 上一行\n let [ix1, iy1, ix2, iy2, bx1, by1, bx2, by2] = inline.getInlineBox(this, contentBoxList,\n lastContentBox, contentBoxList[i - 1], lastLineBox, baseline, lineHeight, diffL, isFirst, false,\n backgroundClip, paddingTop, paddingRight, paddingBottom, paddingLeft,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth);\n // 要算上开头空白inline,可能有多个和递归嵌套\n if(isFirst) {\n let n = getFirstEmptyInlineWidth(this);\n ix1 -= n;\n bx1 -= n;\n }\n if(backgroundColor[3] > 0) {\n bg.renderBgc(this, renderMode, ctx, __cacheStyle[BACKGROUND_COLOR], null,\n ix1, iy1, ix2 - ix1, iy2 - iy1, btlr, [0, 0], [0, 0], bblr, 'fill', false, dx, dy);\n }\n let w = ix2 - ix1;\n // canvas的bg位图裁剪\n if((renderMode === CANVAS || renderMode === WEBGL) && offscreen) {\n ctx.drawImage(offscreen.canvas, countW, 0, w, ih, ix1 + dx, iy1 + dy, w, ih);\n }\n //svg则特殊判断\n else if(renderMode === SVG && svgBgSymbol.length) {\n svgBgSymbol.forEach(symbol => {\n if(symbol) {\n let v = {\n tagName: 'clipPath',\n props: [],\n children: [\n {\n tagName: 'path',\n props: [\n ['d', `M${countW},${0}L${w+countW},${0}L${w+countW},${ih}L${countW},${ih},L${countW},${0}`],\n ],\n }\n ],\n };\n let clip = ctx.add(v);\n __config[NODE_DEFS_CACHE].push(v);\n virtualDom.bb.push({\n type: 'item',\n tagName: 'use',\n props: [\n ['xlink:href', '#' + symbol],\n ['x', ix1 - countW],\n ['y', iy1],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n }\n });\n }\n countW += w;\n if(boxShadow) {\n boxShadow.forEach(item => {\n bs.renderBoxShadow(this, renderMode, ctx, item, bx1, by1, bx2, by2, bx2 - bx1, by2 - by1, dx, dy);\n });\n }\n if(borderTopWidth > 0 && borderTopColor[3] > 0) {\n let deg1 = Math.atan(borderTopWidth / borderLeftWidth);\n let deg2 = Math.atan(borderTopWidth / borderRightWidth);\n let list = border.calPoints(borderTopWidth, computedStyle[BORDER_TOP_STYLE], deg1, deg2,\n bx1, bx1 + borderLeftWidth, bx2, bx2,\n by1, by1 + borderTopWidth, by2 - borderBottomWidth, by2, 0, isFirst ? btlr : [0, 0], [0, 0]);\n border.renderBorder(this, renderMode, ctx, list, __cacheStyle[BORDER_TOP_COLOR], dx, dy);\n }\n if(borderBottomWidth > 0 && borderBottomColor[3] > 0) {\n let deg1 = Math.atan(borderBottomWidth / borderLeftWidth);\n let deg2 = Math.atan(borderBottomWidth / borderRightWidth);\n let list = border.calPoints(borderBottomWidth, computedStyle[BORDER_BOTTOM_STYLE], deg1, deg2,\n bx1, bx1 + borderLeftWidth, bx2, bx2,\n by1, by1 + borderTopWidth, by2 - borderBottomWidth, by2, 2, isFirst ? btlr : [0, 0], [0, 0]);\n border.renderBorder(this, renderMode, ctx, list, __cacheStyle[BORDER_BOTTOM_COLOR], dx, dy);\n }\n if(isFirst && borderLeftWidth > 0 && borderLeftColor[3] > 0) {\n let deg1 = Math.atan(borderLeftWidth / borderTopWidth);\n let deg2 = Math.atan(borderLeftWidth / borderBottomWidth);\n let list = border.calPoints(borderLeftWidth, computedStyle[BORDER_LEFT_STYLE], deg1, deg2,\n bx1, bx1 + borderLeftWidth, bx2 - borderRightWidth, bx2,\n by1, by1 + borderTopWidth, by2 - borderBottomWidth, by2, 3, btlr, btrr);\n border.renderBorder(this, renderMode, ctx, list, __cacheStyle[BORDER_LEFT_COLOR], dx, dy);\n }\n isFirst = false;\n lastContentBox = contentBox;\n lastLineBox = contentBox.parentLineBox;\n count++;\n }\n // 最后一个特殊判断\n if(i === length - 1) {\n let [ix1, iy1, ix2, iy2, bx1, by1, bx2, by2] = inline.getInlineBox(this, contentBoxList,\n lastContentBox, contentBoxList[i], lastLineBox, baseline, lineHeight, diffL, isFirst, true,\n backgroundClip, paddingTop, paddingRight, paddingBottom, paddingLeft,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth);\n // 要算上开头空白inline,可能有多个和递归嵌套\n if(isFirst) {\n let n = getFirstEmptyInlineWidth(this);\n ix1 -= n;\n bx1 -= n;\n }\n // 要算上末尾空白inline,可能有多个和递归嵌套\n let n = getLastEmptyInlineWidth(this);\n ix2 += n;\n bx2 += n;\n if(backgroundColor[3] > 0) {\n bg.renderBgc(this, renderMode, ctx, __cacheStyle[BACKGROUND_COLOR], null,\n ix1, iy1, ix2 - ix1, iy2 - iy1, isFirst ? btlr : [0, 0], btrr, bbrr, isFirst ? bblr : [0, 0],\n 'fill', false, dx, dy);\n }\n let w = ix2 - ix1;\n // canvas的bg位图裁剪\n if((renderMode === CANVAS || renderMode === WEBGL) && offscreen) {\n ctx.drawImage(offscreen.canvas, countW, 0, w, ih, ix1 + dx, iy1 + dy, w, ih);\n }\n //svg则特殊判断\n else if(renderMode === SVG && svgBgSymbol.length) {\n svgBgSymbol.forEach(symbol => {\n if(symbol) {\n let v = {\n tagName: 'clipPath',\n props: [],\n children: [\n {\n tagName: 'path',\n props: [\n ['d', `M${countW},${0}L${w+countW},${0}L${w+countW},${ih}L${countW},${ih},L${countW},${0}`],\n ],\n }\n ],\n };\n let clip = ctx.add(v);\n __config[NODE_DEFS_CACHE].push(v);\n virtualDom.bb.push({\n type: 'item',\n tagName: 'use',\n props: [\n ['xlink:href', '#' + symbol],\n ['x', ix1 - countW],\n ['y', iy1],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n }\n });\n }\n if(boxShadow) {\n boxShadow.forEach(item => {\n bs.renderBoxShadow(this, renderMode, ctx, item, bx1, by1, bx2, by2, bx2 - bx1, by2 - by1, dx, dy);\n });\n }\n if(borderTopWidth > 0 && borderTopColor[3] > 0) {\n let deg1 = Math.atan(borderTopWidth / borderLeftWidth);\n let deg2 = Math.atan(borderTopWidth / borderRightWidth);\n let list = border.calPoints(borderTopWidth, computedStyle[BORDER_TOP_STYLE], deg1, deg2,\n bx1, bx1, bx2 - borderRightWidth, bx2,\n by1, by1 + borderTopWidth, by2 - borderBottomWidth, by2, 0, isFirst ? btlr : [0, 0], btrr);\n border.renderBorder(this, renderMode, ctx, list, __cacheStyle[BORDER_TOP_COLOR], dx, dy);\n }\n if(borderRightWidth > 0 && borderRightColor[3] > 0) {\n let deg1 = Math.atan(borderRightWidth / borderTopWidth);\n let deg2 = Math.atan(borderRightWidth / borderBottomWidth);\n let list = border.calPoints(borderRightWidth, computedStyle[BORDER_RIGHT_STYLE], deg1, deg2,\n bx1, bx1 + borderLeftWidth, bx2 - borderRightWidth, bx2,\n by1, by1 + borderTopWidth, by2 - borderBottomWidth, by2, 1, btlr, btrr);\n border.renderBorder(this, renderMode, ctx, list, __cacheStyle[BORDER_RIGHT_COLOR], dx, dy);\n }\n if(borderBottomWidth > 0 && borderBottomColor[3] > 0) {\n let deg1 = Math.atan(borderBottomWidth / borderLeftWidth);\n let deg2 = Math.atan(borderBottomWidth / borderRightWidth);\n let list = border.calPoints(borderBottomWidth, computedStyle[BORDER_BOTTOM_STYLE], deg1, deg2,\n bx1, bx1, bx2 - borderRightWidth, bx2,\n by1, by1 + borderTopWidth, by2 - borderBottomWidth, by2, 2, isFirst ? btlr : [0, 0], btrr);\n border.renderBorder(this, renderMode, ctx, list, __cacheStyle[BORDER_BOTTOM_COLOR], dx, dy);\n }\n if(isFirst && borderLeftWidth > 0 && borderLeftColor[3] > 0) {\n let deg1 = Math.atan(borderLeftWidth / borderTopWidth);\n let deg2 = Math.atan(borderLeftWidth / borderBottomWidth);\n let list = border.calPoints(borderLeftWidth, computedStyle[BORDER_LEFT_STYLE], deg1, deg2,\n bx1, bx1 + borderLeftWidth, bx2 - borderRightWidth, bx2,\n by1, by1 + borderTopWidth, by2 - borderBottomWidth, by2, 3, btlr, btrr);\n border.renderBorder(this, renderMode, ctx, list, __cacheStyle[BORDER_LEFT_COLOR], dx, dy);\n }\n }\n }\n if(offscreen) {\n offscreen.ctx.clearRect(0, 0, iw, ih);\n }\n return res;\n }\n // 无内容且无尺寸的无需渲染\n else if(bx1 === bx2 || by1 === by2) {\n return res;\n }\n }\n // block渲染,bgc垫底\n if(backgroundColor[3] > 0) {\n bg.renderBgc(this, renderMode, ctx, __cacheStyle[BACKGROUND_COLOR], borderList,\n bx1, by1, bx2 - bx1, by2 - by1, btlr, btrr, bbrr, bblr, 'fill', false, dx, dy);\n }\n // 渐变或图片叠加\n if(backgroundImage) {\n let length = backgroundImage.length;\n backgroundImage.slice(0).reverse().forEach((bgi, i) => {\n if(!bgi) {\n return;\n }\n i = length - 1 - i;\n if(util.isString(bgi)) {\n let loadBgi = this.__loadBgi[i];\n if(loadBgi.url === backgroundImage[i]) {\n bg.renderImage(this, renderMode, ctx, loadBgi,\n bx1, by1, bx2, by2, btlr, btrr, bbrr, bblr,\n currentStyle, i, backgroundSize, backgroundRepeat, __config, false, dx, dy);\n }\n }\n else if(bgi.k) {\n let gd = this.__gradient(renderMode, ctx, bx1, by1, bx2, by2, bgi, dx, dy);\n if(gd) {\n if(gd.k === 'conic') {\n gradient.renderConic(this, renderMode, ctx, gd.v, bx1, by1, bx2 - bx1, by2 - by1,\n btlr, btrr, bbrr, bblr);\n }\n else {\n bg.renderBgc(this, renderMode, ctx, gd.v, borderList,\n bx1, by1, bx2 - bx1, by2 - by1, btlr, btrr, bbrr, bblr, 'fill', false, dx, dy);\n }\n }\n }\n });\n }\n // boxShadow可能会有多个\n if(boxShadow) {\n boxShadow.forEach(item => {\n bs.renderBoxShadow(this, renderMode, ctx, item, x1, y1, x6, y6, x6 - x1, y6 - y1, dx, dy);\n });\n }\n // 边框需考虑尖角,两条相交边平分45°夹角\n if(borderTopWidth > 0 && borderTopColor[3] > 0) {\n border.renderBorder(this, renderMode, ctx, __cacheStyle[BORDER_TOP], __cacheStyle[BORDER_TOP_COLOR], dx, dy);\n }\n if(borderRightWidth > 0 && borderRightColor[3] > 0) {\n border.renderBorder(this, renderMode, ctx, __cacheStyle[BORDER_RIGHT], __cacheStyle[BORDER_RIGHT_COLOR], dx, dy);\n }\n if(borderBottomWidth > 0 && borderBottomColor[3] > 0) {\n border.renderBorder(this, renderMode, ctx, __cacheStyle[BORDER_BOTTOM], __cacheStyle[BORDER_BOTTOM_COLOR], dx, dy);\n }\n if(borderLeftWidth > 0 && borderLeftColor[3] > 0) {\n border.renderBorder(this, renderMode, ctx, __cacheStyle[BORDER_LEFT], __cacheStyle[BORDER_LEFT_COLOR], dx, dy);\n }\n return res;\n }\n\n __destroy() {\n if(this.isDestroyed) {\n return;\n }\n super.__destroy();\n let { root } = this;\n this.clearAnimate();\n this.clearFrameAnimate();\n // root在没有初始化到真实dom渲染的情况下没有\n root && root.delRefreshTask(this.__loadBgi.cb);\n root && root.delRefreshTask(this.__task);\n this.__task = null;\n this.__root = null;\n this.clearCache();\n }\n\n // 先查找到注册了事件的节点,再捕获冒泡判断增加性能\n __emitEvent(e, force) {\n let { isDestroyed, computedStyle, isMask } = this;\n if(isDestroyed || computedStyle[DISPLAY] === 'none' || e.__stopPropagation || isMask) {\n return;\n }\n let { event: { type } } = e;\n let { listener, __hasMask } = this;\n let cb;\n if(listener.hasOwnProperty(type)) {\n cb = listener[type];\n }\n // touchmove之类强制的直接由Root通知即可\n if(force) {\n if(computedStyle[POINTER_EVENTS] !== 'none' && isFunction(cb) && !e.__stopImmediatePropagation) {\n cb.call(this, e);\n }\n return true;\n }\n // 非force的判断事件坐标是否在节点内\n if(this.willResponseEvent(e)) {\n // 如果有mask,点在mask上才行,点在clip外才行\n if(__hasMask) {\n let next = this.next;\n let isClip = next.isClip;\n let hasEmitMask;\n while(next && next.isMask) {\n if(next.willResponseEvent(e, true)) {\n hasEmitMask = true;\n break;\n }\n next = next.next;\n }\n if(!isClip && !hasEmitMask) {\n return;\n }\n }\n if(isFunction(cb) && !e.__stopImmediatePropagation) {\n cb.call(this, e);\n }\n return true;\n }\n }\n\n willResponseEvent(e, ignore) {\n let { x, y } = e;\n let { __sx1, __sy1, offsetWidth, offsetHeight, matrixEvent, computedStyle } = this;\n if(computedStyle[POINTER_EVENTS] === 'none') {\n return;\n }\n let inThis = geom.pointInQuadrilateral(\n x, y,\n __sx1, __sy1,\n __sx1 + offsetWidth, __sy1,\n __sx1 + offsetWidth, __sy1 + offsetHeight,\n __sx1, __sy1 + offsetHeight,\n matrixEvent\n );\n if(inThis) {\n if(!e.target && !ignore) {\n e.target = this;\n // 缓存target给move用\n if(e.event.type === 'touchstart') {\n this.root && (this.root.__touchstartTarget = this);\n }\n }\n return true;\n }\n }\n\n __gradient(renderMode, ctx, bx1, by1, bx2, by2, bgi, dx = 0, dy = 0) {\n let iw = bx2 - bx1;\n let ih = by2 - by1;\n // 无尺寸无需创建渐变\n if(!iw || !ih) {\n return;\n }\n let { k, v, d, s, z, p } = bgi;\n let cx = bx1 + iw * 0.5;\n let cy = by1 + ih * 0.5;\n let res = { k };\n if(k === 'linear') {\n let gd = gradient.getLinear(v, d, bx1, by1, cx, cy, iw, ih, this.root, dx, dy);\n res.v = this.__getLg(renderMode, ctx, gd);\n }\n else if(k === 'radial') {\n let gd = gradient.getRadial(v, s, z, p, bx1, by1, bx2, by2, this.root, dx, dy);\n if(gd) {\n res.v = this.__getRg(renderMode, ctx, gd)\n if(gd.matrix) {\n res.v = [res.v, gd.matrix, gd.cx, gd.cy];\n }\n }\n }\n else if(k === 'conic') {\n let bbox = this.bbox;\n let m1 = Math.max(Math.abs(bbox[2] - bbox[0]), Math.abs(bbox[3] - bbox[1]));\n let m2 = Math.max(Math.abs(iw), Math.abs(ih));\n let gd = gradient.getConic(v, d, p, bx1, by1, bx2, by2, m1 / m2, this.root, dx, dy);\n res.v = this.__getCg(renderMode, ctx, gd);\n }\n return res;\n }\n\n __getLg(renderMode, ctx, gd) {\n if(renderMode === CANVAS || renderMode === WEBGL) {\n let lg = ctx.createLinearGradient(gd.x1, gd.y1, gd.x2, gd.y2);\n gd.stop.forEach(item => {\n lg.addColorStop(item[1], int2rgba(item[0]));\n });\n return lg;\n }\n else if(renderMode === SVG) {\n let v = {\n tagName: 'linearGradient',\n props: [\n ['x1', gd.x1],\n ['y1', gd.y1],\n ['x2', gd.x2],\n ['y2', gd.y2],\n ],\n children: gd.stop.map(item => {\n return {\n tagName: 'stop',\n props: [\n ['stop-color', int2rgba(item[0])],\n ['offset', item[1] * 100 + '%'],\n ],\n };\n }),\n };\n let uuid = ctx.add(v);\n this.__config[NODE_DEFS_CACHE].push(v);\n return 'url(#' + uuid + ')';\n }\n }\n\n __getRg(renderMode, ctx, gd) {\n if(renderMode === CANVAS || renderMode === WEBGL) {\n let rg = ctx.createRadialGradient(gd.cx, gd.cy, 0, gd.tx, gd.ty, gd.r);\n gd.stop.forEach(item => {\n rg.addColorStop(item[1], int2rgba(item[0]));\n });\n return rg;\n }\n else if(renderMode === SVG) {\n let v = {\n tagName: 'radialGradient',\n props: [\n ['cx', gd.tx],\n ['cy', gd.ty],\n ['r', gd.r],\n ],\n children: gd.stop.map(item => {\n return {\n tagName: 'stop',\n props: [\n ['stop-color', int2rgba(item[0])],\n ['offset', item[1] * 100 + '%'],\n ],\n };\n }),\n };\n if(gd.tx !== gd.cx) {\n v.props.push(['fx', gd.cx]);\n }\n if(gd.ty !== gd.cy) {\n v.props.push(['fy', gd.cy]);\n }\n let uuid = ctx.add(v);\n this.__config[NODE_DEFS_CACHE].push(v);\n return 'url(#' + uuid + ')';\n }\n }\n\n __getCg(renderMode, ctx, gd) {\n let { cx, cy, r, deg, stop } = gd;\n let len = stop.length - 1;\n if(stop[len][1] < 1) {\n stop.push([stop[len][0].slice(0), 1]);\n }\n if(stop[0][1] > 0) {\n stop.unshift([stop[0][0].slice(0), 0]);\n }\n // canvas采用点色值计算法,svg则分360度画块\n let res = [];\n if(renderMode === CANVAS || renderMode === WEBGL) {\n return gd;\n }\n return res;\n }\n\n // canvas清空自身cache,cacheTotal在Root的自底向上逻辑做,svg仅有cacheTotal\n clearCache(onlyTotal) {\n let __config = this.__config;\n let __cacheTotal = __config[NODE_CACHE_TOTAL];\n let __cacheFilter = __config[NODE_CACHE_FILTER];\n let __cacheMask = __config[NODE_CACHE_MASK];\n let __cacheOverflow = __config[NODE_CACHE_OVERFLOW];\n if(!onlyTotal) {\n __config[NODE_CACHE_STYLE] = this.__cacheStyle = {};\n let __cache = __config[NODE_CACHE];\n if(__cache) {\n __cache.release();\n }\n }\n if(__cacheTotal) {\n __cacheTotal.release();\n }\n if(__cacheFilter) {\n __cacheFilter.release();\n }\n if(__cacheMask) {\n __cacheMask.release();\n }\n if(__cacheOverflow) {\n __cacheOverflow.release();\n }\n }\n\n updateStyle(style, cb) {\n let node = this;\n let { root, __config } = node;\n let formatStyle = css.normalize(style);\n // 有root说明被添加渲染过了\n if(root) {\n root.addRefreshTask(node.__task = {\n __before() {\n node.__task = null;\n if(__config[NODE_IS_DESTROYED]) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = node;\n res[UPDATE_STYLE] = formatStyle;\n res[UPDATE_OVERWRITE] = style; // 标识盖原有style样式不仅仅是修改currentStyle,不同于animate\n res[UPDATE_KEYS] = Object.keys(formatStyle).map(i => {\n if(!GEOM.hasOwnProperty(i)) {\n i = parseInt(i);\n }\n return i;\n });\n res[UPDATE_CONFIG] = __config;\n root.__addUpdate(node, __config, root, root.__config, res);\n },\n __after(diff) {\n if(isFunction(cb)) {\n cb.call(node, diff);\n }\n },\n });\n }\n // 没有是在如parse()还未添加的时候,可以直接同步覆盖\n else {\n Object.assign(this.currentStyle, formatStyle);\n if(isFunction(cb)) {\n cb.call(node, -1);\n }\n }\n }\n\n // 传入格式化好key/value的样式\n updateFormatStyle(style, cb) {\n let node = this;\n let { root, __config } = node;\n if(root) {\n root.addRefreshTask(node.__task = {\n __before() {\n node.__task = null; // 清除在before,防止after的回调增加新的task误删\n if(__config[NODE_IS_DESTROYED]) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = node;\n res[UPDATE_STYLE] = style;\n res[UPDATE_KEYS] = Object.keys(style).map(i => {\n if(!GEOM.hasOwnProperty(i)) {\n i = parseInt(i);\n }\n return i;\n });\n res[UPDATE_CONFIG] = __config;\n root.__addUpdate(node, __config, root, root.__config, res);\n },\n __after(diff) {\n if(isFunction(cb)) {\n cb.call(node, diff);\n }\n },\n });\n }\n // 没有是在如parse()还未添加的时候,可以直接同步覆盖\n else {\n Object.assign(this.currentStyle, style);\n if(isFunction(cb)) {\n cb.call(node, -1);\n }\n }\n }\n\n animate(list, options = {}) {\n let animation = new Animation(this, list, options);\n if(this.isDestroyed) {\n animation.__destroy(true);\n return animation;\n }\n this.animationList.push(animation);\n if(options.autoPlay === false) {\n return animation;\n }\n return animation.play();\n }\n\n removeAnimate(o) {\n if(o instanceof Animation) {\n let i = this.animationList.indexOf(o);\n if(i > -1) {\n o.cancel();\n o.__destroy();\n this.animationList.splice(i, 1);\n }\n }\n }\n\n clearAnimate() {\n this.animationList.splice(0).forEach(o => {\n o.cancel();\n o.__destroy();\n });\n }\n\n frameAnimate(cb) {\n if(isFunction(cb)) {\n let list = this.__frameAnimateList;\n // 防止重复\n for(let i = 0, len = list.length; i < len; i++) {\n if(list[i].__karasFramecb === cb) {\n return cb;\n }\n }\n let enter = {\n __after(diff) {\n cb(diff);\n },\n __karasFramecb: cb,\n };\n list.push(enter);\n frame.onFrame(enter);\n return cb;\n }\n }\n\n removeFrameAnimate(cb) {\n for(let i = 0, list = this.__frameAnimateList, len = list.length; i < len; i++) {\n if(list[i].__karasFramecb === cb) {\n list.splice(i, 1);\n frame.offFrame(cb);\n return;\n }\n }\n }\n\n clearFrameAnimate() {\n this.__frameAnimateList.splice(0).forEach(o => {\n frame.offFrame(o);\n });\n }\n\n __deepScan(cb, options) {\n return cb(this, options);\n }\n\n // isLayout为false时,为relative/margin/flex/vertical等\n // 注意所有的offset/resize都要避免display:none的,比如合并margin导致block的孩子inline因clamp为none时没有layoutData\n __offsetX(diff, isLayout, lv) {\n if(this.computedStyle[DISPLAY] === 'none') {\n return;\n }\n super.__offsetX(diff, isLayout);\n if(isLayout) {\n this.__layoutData.x += diff;\n this.clearCache();\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.__sx1 += diff;\n this.__sx2 += diff;\n this.__sx3 += diff;\n this.__sx4 += diff;\n this.__sx5 += diff;\n this.__sx6 += diff;\n }\n\n __offsetY(diff, isLayout, lv) {\n if(this.computedStyle[DISPLAY] === 'none') {\n return;\n }\n super.__offsetY(diff, isLayout);\n if(isLayout) {\n this.__layoutData && (this.__layoutData.y += diff);\n this.clearCache();\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.__sy1 += diff;\n this.__sy2 += diff;\n this.__sy3 += diff;\n this.__sy4 += diff;\n this.__sy5 += diff;\n this.__sy6 += diff;\n }\n\n __resizeX(diff, lv) {\n if(this.computedStyle[DISPLAY] === 'none') {\n return;\n }\n this.computedStyle.width = this.__width += diff;\n this.__clientWidth += diff;\n this.__offsetWidth += diff;\n this.__outerWidth += diff;\n this.__layoutData && (this.__layoutData.w += diff);\n this.__sx4 += diff;\n this.__sx5 += diff;\n this.__sx6 += diff;\n if(diff < 0) {\n this.__config[NODE_LIMIT_CACHE] = false;\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.clearCache();\n }\n\n __resizeY(diff, lv) {\n if(this.computedStyle[DISPLAY] === 'none') {\n return;\n }\n this.computedStyle.height = this.__height += diff;\n this.__clientHeight += diff;\n this.__offsetHeight += diff;\n this.__outerHeight += diff;\n this.__layoutData.h += diff;\n this.__sy4 += diff;\n this.__sy5 += diff;\n this.__sy6 += diff;\n if(diff < 0) {\n this.__config[NODE_LIMIT_CACHE] = false;\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.clearCache();\n }\n\n __spreadBbox(boxShadow, filter) {\n let x1 = 0, y1 = 0, x2 = 0, y2 = 0;\n let xl = [], yt = [], xr = [], yb = [];\n if(Array.isArray(boxShadow)) {\n boxShadow.forEach(item => {\n let [x, y, sigma, spread, , inset] = item;\n x1 = x2 = x;\n y1 = y2 = y;\n if(inset !== 'inset') {\n let d = blur.outerSize(sigma);\n d += spread;\n xl.push(x - d);\n xr.push(x + d);\n yt.push(y - d);\n yb.push(y + d);\n }\n });\n }\n if(Array.isArray(filter)) {\n filter.forEach(item => {\n let [k, v] = item;\n let sigma = v[0];\n if(k === 'blur' && sigma > 0) {\n let d = blur.kernelSize(sigma);\n let spread = blur.outerSizeByD(d);\n if(spread) {\n xl.push(-spread);\n xr.push(spread);\n yt.push(-spread);\n yb.push(spread);\n }\n }\n });\n }\n xl.forEach(n => x1 = Math.min(x1, n));\n xr.forEach(n => x2 = Math.max(x2, n));\n yt.forEach(n => y1 = Math.min(y1, n));\n yb.forEach(n => y2 = Math.max(y2, n));\n return [x1, y1, x2, y2];\n }\n\n __releaseWhenEmpty(__cache) {\n if(__cache && __cache.available) {\n __cache.release();\n }\n return true;\n }\n\n getComputedStyle(key) {\n let computedStyle = this.computedStyle;\n let res = {};\n let keys;\n if(key) {\n if(Array.isArray(key)) {\n keys = key;\n }\n else {\n keys = [key];\n }\n keys = keys.map(s => {\n return STYLE_KEY[style2Upper(s)];\n });\n }\n else {\n keys = Object.keys(computedStyle);\n }\n keys.forEach(k => {\n if(GEOM.hasOwnProperty(k)) {\n res[k] = computedStyle[k];\n }\n else {\n res[STYLE_RV_KEY[k]] = computedStyle[k];\n }\n });\n return res;\n }\n\n getBoundingClientRect(includeBbox) {\n let box = [];\n if(includeBbox) {\n box = this.bbox;\n }\n else {\n let { __sx1, __sy1, offsetWidth, offsetHeight } = this;\n box = [__sx1, __sy1, __sx1 + offsetWidth, __sy1 + offsetHeight];\n }\n let matrixEvent = this.matrixEvent;\n let p1 = point2d(mx.calPoint([box[0], box[1]], matrixEvent));\n let p2 = point2d(mx.calPoint([box[2], box[1]], matrixEvent));\n let p3 = point2d(mx.calPoint([box[2], box[3]], matrixEvent));\n let p4 = point2d(mx.calPoint([box[0], box[3]], matrixEvent));\n return {\n left: Math.min(p1[0], Math.min(p2[0], Math.min(p3[0], p4[0]))),\n top: Math.min(p1[1], Math.min(p2[1], Math.min(p3[1], p4[1]))),\n right: Math.max(p1[0], Math.max(p2[0], Math.max(p3[0], p4[0]))),\n bottom: Math.max(p1[1], Math.max(p2[1], Math.max(p3[1], p4[1]))),\n points: [p1, p2, p3, p4],\n };\n }\n\n // img和geom返回false,在inline布局时判断是否是真的inline\n __isRealInline() {\n return true;\n }\n\n remove(cb) {\n let self = this;\n if(self.isDestroyed) {\n inject.warn('Remove target is destroyed.');\n if(isFunction(cb)) {\n cb();\n }\n return;\n }\n let { root, domParent } = self;\n let target = self.isShadowRoot ? self.hostRoot : self;\n // 特殊情况连续append/remove时候,还未被添加进来找不到所以无需删除\n if(domParent.children.indexOf(target) === -1) {\n if(isFunction(cb)) {\n cb();\n }\n return;\n }\n root.delRefreshTask(self.__task);\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null; // 清除在before,防止after的回调增加新的task误删\n let pJson = domParent.__json;\n let i = pJson.children.indexOf(self.isShadowRoot ? self.hostRoot.__json : self.__json);\n let zChildren = domParent.zIndexChildren;\n let j = zChildren.indexOf(self.isShadowRoot ? self.hostRoot : self);\n if(i === -1 || j === -1) {\n throw new Error('Remove index Exception.')\n }\n pJson.children.splice(i, 1);\n domParent.children.splice(i, 1);\n zChildren.splice(j, 1);\n if(self.__prev) {\n self.__prev.__next = self.__next;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = REFLOW;\n res[UPDATE_REMOVE_DOM] = true;\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n __after(diff) {\n self.isShadowRoot ? self.hostRoot.__destroy() : self.__destroy();\n if(isFunction(cb)) {\n cb.call(self, diff);\n }\n },\n });\n }\n\n get tagName() {\n return this.__tagName;\n }\n\n get sx() {\n return this.__sx;\n }\n\n get sy() {\n return this.__sy;\n }\n\n get clientWidth() {\n return this.__clientWidth || 0;\n }\n\n get clientHeight() {\n return this.__clientHeight || 0;\n }\n\n get offsetWidth() {\n return this.__offsetWidth || 0;\n }\n\n get offsetHeight() {\n return this.__offsetHeight || 0;\n }\n\n get outerWidth() {\n return this.__outerWidth || 0;\n }\n\n get outerHeight() {\n return this.__outerHeight || 0;\n }\n\n // 不考虑margin的范围,>=REPAINT渲染或个别有影响的渲染改变(如blur)清空缓存\n get bbox() {\n if(!this.__bbox) {\n let {\n __sx1, __sy1, offsetWidth, offsetHeight,\n currentStyle: {\n [BOX_SHADOW]: boxShadow,\n [FILTER]: filter,\n },\n } = this;\n let [x1, y1, x2, y2] = this.__spreadBbox(boxShadow, filter);\n this.__bbox = [__sx1 + x1, __sy1 + y1, __sx1 + offsetWidth + x2, __sy1 + offsetHeight + y2];\n }\n return this.__bbox;\n }\n\n get listener() {\n return this.__listener;\n }\n\n get matrix() {\n return this.__config[NODE_MATRIX];\n }\n\n get matrixEvent() {\n return this.__config[NODE_MATRIX_EVENT];\n }\n\n get perspectiveMatrix() {\n return this.__config[NODE_PERSPECTIVE_MATRIX];\n }\n\n get style() {\n return this.__style;\n }\n\n get computedStyle() {\n return this.__computedStyle;\n }\n\n get animationList() {\n return this.__animationList;\n }\n\n get currentStyle() {\n return this.__currentStyle;\n }\n\n get cacheStyle() {\n return this.__cacheStyle;\n }\n\n get isShadowRoot() {\n return !this.parent && this.host && this.host !== this.root;\n }\n\n get contentBoxList() {\n return this.__contentBoxList;\n }\n\n get baseline() {\n return this.offsetHeight;\n }\n\n get firstBaseline() {\n return this.offsetHeight;\n }\n\n get isMask() {\n return this.__isMask;\n }\n\n get isClip() {\n return this.__isClip;\n }\n\n get cacheAsBitmap() {\n return this.__cacheAsBitmap;\n }\n\n set cacheAsBitmap(v) {\n this.__config[NODE_CACHE_AS_BITMAP] = this.__cacheAsBitmap = !!v;\n }\n\n get parentLineBox() {\n return this.__parentLineBox;\n }\n}\n\nexport default Xom;\n","import TextBox from './TextBox';\nimport enums from '../util/enums';\nimport css from '../style/css';\n\nconst { STYLE_KEY: {\n DISPLAY,\n MARGIN_LEFT,\n BORDER_LEFT_WIDTH,\n PADDING_LEFT,\n PADDING_RIGHT,\n BORDER_RIGHT_WIDTH,\n MARGIN_RIGHT,\n LINE_HEIGHT,\n} } = enums;\n\n/**\n * css中常见的概念,一行内容,里面可能有若干不同的内容,仅在布局阶段出现,不参与渲染逻辑\n * 本类是个抽象逻辑概念,会包含Text的内容TextBox和inlineBlock等节点,而内容TextBox则属于Text\n * 一个Text可能因为换行产生多个TextBox,从而形成不同行的内容就属于不同的LineBox\n * 本类属于block(包含flex和inlineBlock,下同)节点下,一个dom会有个专门列表,\n * 包含若干个LineBox保存着若干行文本内容TextBox,不直接关联Text,\n * inline则不会有此对象和列表,其复用最近block父层的,这样解决嵌套问题,\n * block在布局时将列表向孩子传递下去,每遇到block会重新生成\n * 每当发生换行时,专门列表中会新生成一个LineBox,让后续内容继续跟随新的LB\n * LB内部要进行垂直对齐,Text内容较简单x字符底部为baseline,inlineBlock等节点按最后一行baseline\n */\nclass LineBox {\n constructor(x, y, lineHeight, baseline) {\n this.__list = [];\n this.__x = x;\n this.__y = y;\n this.__lineHeight = lineHeight; // 可能出现空的inline,因此一个inline进入布局时先设置当前lineBox的最小lineHeight/baseline\n this.__baseline = baseline;\n }\n\n add(item) {\n this.list.push(item);\n item.__parentLineBox = this;\n }\n\n verticalAlign() {\n let baseline = this.baseline;\n let lineHeight = this.lineHeight;\n let increasedHeight = lineHeight;\n let hasReplaced;\n // 只有1个也需要对齐,因为可能内嵌了空inline使得baseline发生变化\n if(this.list.length) {\n this.list.forEach(item => {\n if(item.isReplaced) {\n hasReplaced = true;\n }\n let n = item.baseline;\n if(n !== baseline) {\n let d = baseline - n;\n item.__offsetY(d);\n // text的话对齐下移可能影响整体高度,在同行有img这样的替换元素下,需记录最大偏移导致的高度\n // 比如一个字符和img,字符下调y即字符的baseline和图片底部对齐,导致高度增加lineHeight和baseline的差值\n if(d > 0) {\n increasedHeight = Math.max(increasedHeight, item.height + d);\n }\n }\n });\n }\n let diff = 0;\n // 特殊情况,只有1个img这样的替换元素时,或者只有img没有直接text时,也要进行检查,\n // 因为此时img要参与这一行和baseline的对齐扩充\n if(hasReplaced) {\n diff = this.__lineHeight - this.__baseline;\n }\n // 增加过的高度比最大还大时需要调整\n if(increasedHeight > lineHeight) {\n diff = Math.max(increasedHeight - lineHeight);\n }\n return diff;\n }\n\n __offsetX(diff) {\n this.__x += diff;\n }\n\n __offsetY(diff, isVerticalAlign) {\n this.__y += diff;\n // vertical-align情况特殊对齐,可能替换元素img和text导致偏移,需触发整体和text偏移\n if(isVerticalAlign) {\n this.list.forEach(item => {\n // 是text的第一个的box的话,text也需要偏移\n if(item instanceof TextBox) {\n let text = item.parent;\n if(text.textBoxes[0] === item) {\n text.__offsetY(diff);\n }\n }\n else {\n item.__offsetY(diff);\n }\n });\n }\n }\n\n /**\n * 防止非行首空inline,每当遇到inline就设置当前lineBox的lineHeight/baseline,这样有最小值兜底\n * @param l\n * @param b\n * @private\n */\n __setLB(l, b) {\n this.__lineHeight = Math.max(l, this.__lineHeight);\n this.__baseline = Math.max(b, this.__baseline);\n }\n\n __resetLb(l, b) {\n this.list.forEach(item => {\n let dom = item;\n if(item instanceof TextBox) {\n dom = item.parent.parent;\n }\n let computedStyle = dom.computedStyle;\n while(computedStyle[DISPLAY] === 'inline') {\n l = Math.max(l, computedStyle[LINE_HEIGHT]);\n b = Math.max(b, css.getBaseline(computedStyle));\n dom = dom.domParent;\n computedStyle = dom.computedStyle;\n }\n });\n this.__lineHeight = l;\n this.__baseline = b;\n }\n\n get list() {\n return this.__list;\n }\n\n get size() {\n return this.__list.length;\n }\n\n get x() {\n return this.__x;\n }\n\n get y() {\n return this.__y;\n }\n\n get endY() {\n return this.y + this.height;\n }\n\n get width() {\n let list = this.list;\n let length = list.length;\n if(length) {\n let first = list[0];\n let last = list[length - 1];\n let x1 = first.x;\n let dom = first instanceof TextBox ? first.parent.domParent : first.domParent;\n // 因为inline可以嵌套inline,所以一直向上查找到非inline为止,每层inline如果是首个则减去左侧mbp\n while(true) {\n let list = dom.contentBoxList;\n let {\n [DISPLAY]: display,\n [MARGIN_LEFT]: marginLeft,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [PADDING_LEFT]: paddingLeft,\n } = dom.computedStyle;\n if(display !== 'inline') {\n break;\n }\n if(first === list[0]) {\n x1 -= marginLeft + borderLeftWidth + paddingLeft;\n }\n dom = dom.domParent;\n }\n let x2 = last.x + last.outerWidth;\n dom = last instanceof TextBox ? last.parent.domParent : last.domParent;\n // 同向上查非inline,每层inline如果是最后一个则加上右侧mbp\n while(true) {\n let list = dom.contentBoxList;\n let {\n [DISPLAY]: display,\n [MARGIN_RIGHT]: marginRight,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [PADDING_RIGHT]: paddingRight,\n } = dom.computedStyle;\n if(display !== 'inline') {\n break;\n }\n if(first === list[list.length - 1]) {\n x2 += marginRight + borderRightWidth + paddingRight;\n }\n dom = dom.domParent;\n }\n return x2 - x1;\n }\n return 0;\n }\n\n get height() {\n return this.lineHeight;\n }\n\n get baseline() {\n let baseline = this.__baseline;\n // 只有TextBox和InlineBlock或replaced\n this.list.forEach(item => {\n baseline = Math.max(baseline, item.baseline);\n });\n return baseline;\n }\n\n get lineHeight() {\n let lineHeight = this.__lineHeight;\n // 只有TextBox和InlineBlock或replaced\n this.list.forEach(item => {\n lineHeight = Math.max(lineHeight, item.outerHeight);\n });\n return lineHeight;\n }\n}\n\nexport default LineBox;\n","import LineBox from './LineBox';\n\n/**\n * 维护一个上下文的LineBox,向LineBox中添加Item以及新增下一行的LineBox,多个LineBox组成一个区域\n * 一个block/inlineBlock拥有一个本类对象,上下文即对应这个dom流,而inline则复用最近非inline父元素的\n * 同时LineBox可能连续也可能不连续,不连续的是中间有block之类的隔离开来\n */\nclass LineBoxManager {\n constructor(x, y, lineHeight, baseline) {\n this.__x = this.__lastX = x; // last存储目前最后一行LineBox的结尾位置,供后续inline使用\n this.__y = this.__lastY = y;\n this.__maxX = x;\n this.__domList = [];\n this.__domStack = [];\n this.__list = []; // 包含若干LineBox\n this.__isNewLine = true; // 区域内是否是新行,容器dom(block)开头肯定是\n this.__lineHeight = lineHeight;\n this.__baseline = baseline;\n this.__isEnd = true; // 在dom中是否一个区域处在结尾,外部控制\n this.__spreadYList = []; // verticalAlign时每个区域增加的y高度\n }\n\n /**\n * 每次换行时重新生成LineBox存入列表,同时由于flow流当前一定是流(dom)的结尾,设置isEnd\n * @returns {LineBox}\n */\n genLineBox(x, y) {\n let lineBox = new LineBox(x, y, this.__lineHeight, this.__baseline);\n this.list.push(lineBox);\n this.__isEnd = true;\n return lineBox;\n }\n\n /**\n * inline的特殊调用,防止空内容但有mbp的inline不占位,放入一个有lineHeight的空lineBox\n * 只有新行开头时需要,后面的无论是否有内容都会影响lineHeight\n * @param x\n * @param y\n * @param l\n * @param b\n * @returns {LineBox}\n */\n genLineBoxByInlineIfNewLine(x, y, l, b) {\n let lineHeight = Math.max(this.__lineHeight, l);\n let baseline = Math.max(this.__baseline, b);\n if(this.__isNewLine) {\n let lineBox = new LineBox(x, y, lineHeight, baseline);\n this.list.push(lineBox);\n this.__isEnd = true;\n this.__isNewLine = false;\n return lineBox;\n }\n }\n\n /**\n * 外部设置为结尾,如一个LineBox后出现一个block,此时会被隔断,不再作为流的末尾\n */\n setNotEnd() {\n this.__isEnd = false;\n }\n\n /**\n * 外部设置新行,下次新生成LineBox\n */\n setNewLine() {\n this.__isNewLine = true;\n }\n\n /**\n * 当前LineBox放入一个新项,当新行时(如第一行)产生一个新的LineBox并存入列表\n * 是否新区域和新行都是可以被外部控制,默认第一行是新\n * 当被隔断后会被外部重置新行,这样会生成新的来作为新加项的LineBox\n * 当换行时外部也会调用新行,这样再次添加Item时会自动生成新的LineBox而不是用之前的\n * @param o TextBox/Inline/InlineBlock\n * @param nextNewLine 是否设置newLine,标明下次添加新生成LineBox\n * @returns {LineBox}\n */\n addItem(o, nextNewLine) {\n let lineBox;\n if(this.__isNewLine) {\n this.__isNewLine = false;\n lineBox = this.genLineBox(o.x, o.y);\n }\n else {\n let list = this.list;\n let length = list.length;\n lineBox = list[length - 1];\n }\n // inline递归过程中所有inline父子顺序列表,每个dom都需要对当前内容保存\n this.__domStack.forEach(item => {\n item.__contentBoxList.push(o);\n });\n lineBox.add(o);\n // 设置结束x的位置给next的inline标记用,o可能是TextBox或inlineBlock,当next新行时注意位置\n if(nextNewLine) {\n this.__isNewLine = true;\n this.__lastX = o.x;\n this.__lastY = o.y + o.outerHeight;\n }\n else {\n this.__lastX = o.x + o.outerWidth;\n this.__lastY = o.y;\n }\n this.__maxX = Math.max(this.__maxX, o.x + o.outerWidth);\n return lineBox;\n }\n\n horizonAlign(w, textAlign) {\n this.list.forEach(lineBox => {\n let diff = w - lineBox.width;\n if(diff > 0) {\n if(textAlign === 'center') {\n diff *= 0.5;\n }\n lineBox.__offsetX(diff);\n lineBox.list.forEach(item => {\n item.__offsetX(diff, true);\n });\n }\n });\n }\n\n /**\n * 垂直对齐过程中,如果遇到占位元素如img,可能会导致每行lineBox高度增加,需返回增加量,\n * next行也需要y偏移\n * @returns {number}\n */\n verticalAlign() {\n let syl = this.__spreadYList;\n syl.splice(0);\n let spread = 0;\n this.list.forEach(lineBox => {\n if(spread) {\n lineBox.__offsetY(spread, true);\n }\n spread += lineBox.verticalAlign();\n syl.push(spread);\n });\n return spread;\n }\n\n addX(n) {\n this.__lastX += n;\n }\n\n /**\n * inline递归过程中布局调用,不断出入栈dom对象,获取当前行状态下有哪些dom还在\n * @param dom\n */\n pushContentBoxList(dom) {\n this.__domList.push(dom);\n this.__domStack.push(dom);\n }\n\n popContentBoxList() {\n this.__domStack.pop();\n }\n\n __offsetX(diff) {\n this.list.forEach(lineBox => {\n lineBox.__offsetX(diff);\n });\n }\n\n __offsetY(diff) {\n this.list.forEach(lineBox => {\n lineBox.__offsetY(diff);\n });\n }\n\n /**\n * inline的特殊调用,非行首无论是否有内容都设置lineBox的lineHeight\n * @param l\n * @param b\n * @private\n */\n setLbByInlineIfNotNewLine(l, b) {\n let length = this.list.length;\n if(length && !this.isNewLine) {\n this.list[length - 1].__setLB(l, b, false);\n }\n }\n\n get size() {\n return this.list.length;\n }\n\n get lastX() {\n return this.__lastX;\n }\n\n get lastY() {\n return this.__lastY;\n }\n\n get endY() {\n let list = this.list;\n let length = list.length;\n if(length) {\n return list[length - 1].endY;\n }\n return this.__y;\n }\n\n get isEnd() {\n return this.__isEnd;\n }\n\n get isNewLine() {\n return this.__isNewLine;\n }\n\n get breakLine() {\n return this.list.length > 1;\n }\n\n get domList() {\n return this.__domList;\n }\n\n get baseline() {\n let list = this.list;\n let length = list.length;\n if(length) {\n let n = 0;\n for(let i = 0; i < length - 1; i++) {\n n += list[i].height;\n }\n return n + list[length - 1].baseline;\n }\n return 0;\n }\n\n get firstBaseline() {\n let list = this.list;\n let length = list.length;\n if(length) {\n return list[0].baseline;\n }\n return 0;\n }\n\n get lineHeight() {\n let list = this.list;\n if(list.length) {\n return list[list.length - 1].lineHeight;\n }\n return 0;\n }\n\n get lineBox() {\n let list = this.list;\n if(list.length) {\n return list[list.length - 1];\n }\n }\n\n get list() {\n return this.__list;\n }\n\n get width() {\n let w = 0;\n this.list.forEach(item => {\n w = Math.max(w, item.width);\n });\n return w;\n }\n\n get spreadYList() {\n return this.__spreadYList;\n }\n}\n\nexport default LineBoxManager;\n","const TAG_NAME = {\n 'div': true,\n 'p': true,\n 'span': true,\n 'img': true,\n 'b': true,\n 'strong': true,\n};\n\nconst INLINE = {\n 'span': true,\n 'img': true,\n 'b': true,\n 'strong': true,\n};\n\nconst BOLD = {\n 'b': true,\n 'strong': true,\n}\n\nexport default {\n TAG_NAME,\n INLINE,\n BOLD,\n};\n","import enums from '../util/enums';\nimport unit from '../style/unit';\nimport level from './level';\n\nconst {\n STYLE_KEY: {\n DISPLAY,\n TOP,\n BOTTOM,\n POSITION,\n HEIGHT,\n },\n} = enums;\nconst { AUTO, PX, PERCENT } = unit;\nconst { REFLOW } = level;\n\nfunction offsetAndResizeByNodeOnY(node, root, reflowHash, dy, inDirectAbsList) {\n if(dy) {\n let last;\n do {\n // component的sr没有next兄弟,视为component的next\n while(node.isShadowRoot) {\n node = node.host;\n }\n last = node;\n let isContainer, parent = node.domParent;\n if(parent) {\n let cs = parent.computedStyle;\n let ps = cs[POSITION];\n isContainer = parent === root || parent.isShadowRoot || ps === 'relative' || ps === 'absolute';\n }\n // 先偏移next,忽略有定位的absolute,本身非container也忽略\n let next = node.next;\n let container;\n while(next) {\n if(next.computedStyle[DISPLAY] !== 'none') {\n if(next.currentStyle[POSITION] === 'absolute') {\n let { [TOP]: top, [BOTTOM]: bottom, [HEIGHT]: height } = next.currentStyle;\n if(top[1] === AUTO) {\n if(bottom[1] === AUTO || bottom[1] === PX) {\n next.__offsetY(dy, true, REFLOW);\n next.clearCache();\n }\n else if(bottom[1] === PERCENT) {\n let v = (1 - bottom[0] * 0.01) * dy;\n next.__offsetY(v, true, REFLOW);\n next.clearCache();\n }\n }\n else if(top[1] === PERCENT) {\n let v = top[0] * 0.01 * dy;\n next.__offsetY(v, true, REFLOW);\n next.clearCache();\n }\n // 高度百分比需发生变化的重新布局,需要在容器内\n if(height[1] === PERCENT) {\n if(isContainer) {\n parent.__layoutAbs(parent, parent.__layoutData, next);\n }\n else {\n if(!container) {\n container = parent;\n while(container) {\n if(container === root || container.isShadowRoot) {\n break;\n }\n let cs = container.currentStyle;\n if(cs[POSITION] === 'absolute' || cs[POSITION] === 'relative') {\n break;\n }\n container = container.domParent;\n }\n }\n inDirectAbsList.push([parent, container, next]);\n }\n }\n }\n else {\n next.__offsetY(dy, true, REFLOW);\n next.clearCache();\n }\n }\n next = next.next;\n }\n // root本身没domParent\n if(!parent) {\n break;\n }\n node = parent;\n // parent判断是否要resize\n let { currentStyle } = node;\n let isAbs = currentStyle[POSITION] === 'absolute';\n let need;\n if(isAbs) {\n if(currentStyle[HEIGHT][1] === AUTO\n && (currentStyle[TOP][1] === AUTO || currentStyle[BOTTOM][1] === AUTO)) {\n need = true;\n }\n }\n // height不定则需要\n else if(currentStyle[HEIGHT][1] === AUTO) {\n need = true;\n }\n if(need) {\n node.__resizeY(dy, REFLOW);\n node.clearCache();\n }\n // abs或者高度不需要继续向上调整提前跳出\n else {\n break;\n }\n if(node === root) {\n break;\n }\n }\n while(true);\n // 最后一个递归向上取消总缓存,防止过程中重复next多次无用递归\n while(last) {\n last.clearCache(true);\n last = last.domParent;\n }\n }\n}\n\nfunction clearUniqueReflowId(hash) {\n for(let i in hash) {\n if(hash.hasOwnProperty(i)) {\n let { node } = hash[i];\n delete node.__uniqueReflowId;\n }\n }\n}\n\nfunction getMergeMarginTB(topList, bottomList) {\n let total = 0;\n let max = topList[0];\n let min = topList[0];\n topList.forEach(item => {\n total += item;\n max = Math.max(max, item);\n min = Math.min(min, item);\n });\n bottomList.forEach(item => {\n total += item;\n max = Math.max(max, item);\n min = Math.min(min, item);\n });\n // 正数取最大,负数取最小,正负则相加\n let diff = 0;\n if(max > 0 && min > 0) {\n diff = Math.max(max, min) - total;\n }\n else if(max < 0 && min < 0) {\n diff = Math.min(max, min) - total;\n }\n else if(max !== 0 || min !== 0) {\n diff = max + min - total;\n }\n return diff;\n}\n\nexport default {\n offsetAndResizeByNodeOnY,\n clearUniqueReflowId,\n getMergeMarginTB,\n};\n","import Xom from './Xom';\nimport Text from './Text';\nimport LineBoxManager from './LineBoxManager';\nimport Component from './Component';\nimport tag from './tag';\nimport TextBox from './TextBox';\nimport Ellipsis from './Ellipsis';\nimport reset from '../style/reset';\nimport css from '../style/css';\nimport unit from '../style/unit';\nimport $$type from '../util/$$type';\nimport enums from '../util/enums';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport reflow from '../refresh/reflow';\nimport builder from '../util/builder';\nimport mode from '../refresh/mode';\nimport level from '../refresh/level';\n\nconst {\n STYLE_KEY: {\n POSITION,\n DISPLAY,\n MARGIN_LEFT,\n MARGIN_TOP,\n MARGIN_RIGHT,\n MARGIN_BOTTOM,\n PADDING_LEFT,\n PADDING_BOTTOM,\n PADDING_RIGHT,\n PADDING_TOP,\n BORDER_TOP_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_LEFT_WIDTH,\n TOP,\n RIGHT,\n BOTTOM,\n LEFT,\n WIDTH,\n HEIGHT,\n TEXT_ALIGN,\n FLEX_DIRECTION,\n FLEX_BASIS,\n FLEX_SHRINK,\n FLEX_GROW,\n ALIGN_SELF,\n ALIGN_ITEMS,\n JUSTIFY_CONTENT,\n Z_INDEX,\n WHITE_SPACE,\n LINE_HEIGHT,\n LINE_CLAMP,\n ORDER,\n FLEX_WRAP,\n ALIGN_CONTENT,\n OVERFLOW,\n FONT_SIZE,\n FONT_FAMILY,\n FONT_WEIGHT,\n TEXT_OVERFLOW,\n },\n NODE_KEY: {\n NODE_CURRENT_STYLE,\n NODE_STYLE,\n NODE_STRUCT,\n NODE_DOM_PARENT,\n NODE_IS_INLINE,\n },\n UPDATE_KEY: {\n UPDATE_NODE,\n UPDATE_FOCUS,\n UPDATE_ADD_DOM,\n UPDATE_CONFIG,\n },\n STRUCT_KEY: {\n STRUCT_NUM,\n STRUCT_LV,\n STRUCT_TOTAL,\n STRUCT_CHILD_INDEX,\n STRUCT_INDEX,\n },\n ELLIPSIS,\n} = enums;\nconst { AUTO, PX, PERCENT, REM, VW, VH, VMAX, VMIN } = unit;\nconst { calAbsolute, isRelativeOrAbsolute, calAbsFixedSize, computeReflow } = css;\nconst { extend, isNil, isFunction } = util;\nconst { CANVAS, SVG, WEBGL } = mode;\n\n// 渲染获取zIndex顺序\nfunction genZIndexChildren(dom) {\n let normal = [];\n let hasMc;\n let mcHash = {};\n let lastMaskIndex;\n let children = dom.children;\n children.forEach((item, i) => {\n let child = item;\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n // 遮罩单独保存后特殊排序\n if(item instanceof Xom && item.isMask) {\n // 开头的mc忽略,后续的连续mc以第一次出现为准\n if(lastMaskIndex !== undefined) {\n mcHash[lastMaskIndex].push(item);\n }\n else if(i) {\n lastMaskIndex = i - 1;\n children[lastMaskIndex].__iIndex = lastMaskIndex;\n mcHash[lastMaskIndex] = [item];\n hasMc = true;\n }\n }\n else {\n lastMaskIndex = undefined;\n if(item instanceof Xom) {\n child.__zIndex = item.currentStyle[Z_INDEX];\n if(isRelativeOrAbsolute(item)) {\n // 临时变量为排序使用\n child.__aIndex = true;\n normal.push(child);\n }\n else {\n normal.push(child);\n }\n }\n else {\n child.__zIndex = 0;\n normal.push(child);\n }\n child.__iIndex = i;\n }\n });\n normal.sort(function(a, b) {\n if(a.__zIndex !== b.__zIndex) {\n return a.__zIndex - b.__zIndex;\n }\n // zIndex相等时abs优先flow\n if(a.__aIndex !== b.__aIndex) {\n if(a.__aIndex) {\n return 1;\n }\n return -1;\n }\n // 都相等看索引\n return a.__iIndex - b.__iIndex;\n });\n // 将遮罩插入到对应顺序上\n if(hasMc) {\n for(let i = normal.length - 1; i >= 0; i--) {\n let idx = normal[i].__iIndex;\n if(mcHash.hasOwnProperty(idx)) {\n normal.splice(i + 1, 0, ...mcHash[idx]);\n }\n }\n }\n return normal;\n}\n\n// flex布局阶段顺序,不是渲染也和struct结构无关,可以无视mask\nfunction genOrderChildren(flowChildren) {\n let normal = [];\n flowChildren.forEach((item, i) => {\n let child = item;\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n if(item instanceof Xom) {\n child.__order = item.currentStyle[ORDER];\n }\n else {\n child.__order = 0;\n }\n normal.push(child);\n child.__iIndex = i;\n });\n normal.sort(function(a, b) {\n if(a.__order !== b.__order) {\n return a.__order - b.__order;\n }\n // order相等时看节点索引\n return a.__iIndex - b.__iIndex;\n });\n return normal;\n}\n\n/**\n * lineClamp超出范围时ib作为最后一行最后一个无法挤下时进行回溯\n */\nfunction backtrack(bp, lineBoxManager, lineBox, wl, endSpace) {\n let ew, computedStyle = bp.computedStyle, root = bp.root, renderMode = root.renderMode;\n let list = lineBox.list;\n // 根据textBox里的内容,确定当前内容,索引,x和剩余宽度\n list.forEach(item => {\n wl -= item.outerWidth;\n });\n let ctx;\n if(renderMode === CANVAS || renderMode === WEBGL) {\n ctx = renderMode === WEBGL\n ? inject.getFontCanvas().ctx\n : root.ctx;\n }\n // 临时测量ELLIPSIS的尺寸\n if(renderMode === CANVAS || renderMode === WEBGL) {\n let font = css.setFontStyle(computedStyle);\n if(ctx.font !== font) {\n ctx.font = font;\n }\n ew = ctx.measureText(ELLIPSIS).width;\n }\n else {\n ew = inject.measureTextSync(ELLIPSIS, computedStyle[FONT_FAMILY], computedStyle[FONT_SIZE], computedStyle[FONT_WEIGHT]);\n }\n for(let i = list.length - 1; i >= 0; i--) {\n let item = list[i];\n // 无论删除一个ib还是textBox,放得下的话都可以暂停循环,注意强制保留行首\n if(!i || wl + item.outerWidth >= ew + (1e-10)) {\n if(item instanceof TextBox) {\n let text = item.parent;\n text.__backtrack(bp, lineBoxManager, lineBox, item, wl, endSpace, ew, computedStyle, ctx, renderMode);\n }\n else {\n let ep = new Ellipsis(item.x + item.outerWidth + endSpace, item.y, ew, bp);\n lineBoxManager.addItem(ep, true);\n }\n break;\n }\n // 放不下删除\n else {\n if(item instanceof TextBox) {\n let text = item.parent;\n let i = text.textBoxes.indexOf(item);\n if(i > -1) {\n text.textBoxes.splice(i, 1);\n }\n }\n else {\n item.__layoutNone();\n }\n list.pop();\n wl += item.outerWidth;\n }\n }\n}\n\nclass Dom extends Xom {\n constructor(tagName, props, children) {\n super(tagName, props);\n let { style } = this;\n if(!style.display || !{\n flex: true,\n block: true,\n inline: true,\n inlineBlock: true,\n 'inline-block': true,\n none: true,\n }.hasOwnProperty(style.display)) {\n if(tag.INLINE.hasOwnProperty(this.tagName)) {\n style.display = 'inline';\n }\n else {\n style.display = 'block';\n }\n }\n if(!style[FONT_WEIGHT] && tag.BOLD.hasOwnProperty(tagName)) {\n style.fontWeight = 700;\n }\n this.__style = css.normalize(style, reset.DOM_ENTRY_SET);\n // currentStyle/currentProps不深度clone,继承一层即可,动画时也是extend这样只改一层引用不动原始静态style\n this.__currentStyle = extend({}, this.__style);\n this.__children = children || [];\n this.__flexLine = []; // flex布局多行模式时存储行\n this.__ellipsis = null; // 虚拟节点,有的话渲染\n let config = this.__config;\n config[NODE_CURRENT_STYLE] = this.__currentStyle;\n config[NODE_STYLE] = this.__style;\n }\n\n __structure(i, lv, j) {\n let res = super.__structure(i++, lv, j);\n let arr = [res];\n let zIndexChildren = this.__zIndexChildren = this.__zIndexChildren || genZIndexChildren(this);\n zIndexChildren.forEach((child, j) => {\n let temp = child.__structure(i, lv + 1, j);\n if(Array.isArray(temp)) {\n i += temp.length;\n arr = arr.concat(temp);\n }\n else {\n i++;\n arr.push(temp);\n }\n });\n let total = arr.length - 1;\n res[STRUCT_NUM] = zIndexChildren.length;\n res[STRUCT_TOTAL] = total;\n return arr;\n }\n\n __modifyStruct(root, offset = 0) {\n let __config = this.__config;\n let struct = __config[NODE_STRUCT];\n let total = struct[STRUCT_TOTAL] || 0;\n // 新生成了struct,引用也变了\n let nss = this.__structure(struct[STRUCT_INDEX], struct[STRUCT_LV], struct[STRUCT_CHILD_INDEX]);\n root.__structs.splice(struct[STRUCT_INDEX] + offset, total + 1, ...nss);\n let d = 0;\n if(this !== root) {\n struct = __config[NODE_STRUCT];\n d = (struct[STRUCT_TOTAL] || 0) - total;\n let ps = __config[NODE_DOM_PARENT].__config[NODE_STRUCT];\n ps[STRUCT_TOTAL] = ps[STRUCT_TOTAL] || 0;\n ps[STRUCT_TOTAL] += d;\n }\n return [struct, d];\n }\n\n /**\n * 因为zIndex/abs的变化造成的更新,只需重排这一段顺序即可\n * 即便包含component造成的dom变化也不影响,component作为子节点reflow会再执行,这里重排老的vd\n * @param structs\n * @private\n */\n __updateStruct(structs) {\n let { [STRUCT_INDEX]: index, [STRUCT_TOTAL]: total = 0 } = this.__config[NODE_STRUCT];\n let zIndexChildren = this.__zIndexChildren = genZIndexChildren(this);\n let length = zIndexChildren.length;\n if(length === 1) {\n return;\n }\n zIndexChildren.forEach((child, i) => {\n child.__config[NODE_STRUCT][STRUCT_CHILD_INDEX] = i;\n });\n // 按直接子节点划分为相同数量的若干段进行排序\n let arr = [];\n let source = [];\n for(let i = index + 1; i <= index + total; i++) {\n let child = structs[i];\n let o = {\n child,\n list: structs.slice(child[STRUCT_INDEX], child[STRUCT_INDEX] + child[STRUCT_TOTAL] + 1),\n };\n arr.push(o);\n source.push(o);\n i += child[STRUCT_TOTAL] || 0;\n }\n arr.sort(function(a, b) {\n return a.child[STRUCT_CHILD_INDEX] - b.child[STRUCT_CHILD_INDEX];\n });\n // 是否有变更,有才进行重新计算\n let needSort;\n for(let i = 0, len = source.length; i < len; i++) {\n if(source[i] !== arr[i]) {\n needSort = true;\n break;\n }\n }\n if(needSort) {\n let list = [];\n arr.forEach(item => {\n list = list.concat(item.list);\n });\n list.forEach((struct, i) => {\n struct[STRUCT_INDEX] = index + i + 1;\n })\n structs.splice(index + 1, total, ...list);\n }\n }\n\n /**\n * 给定父宽度情况下,尝试行内放下后的剩余宽度,为负数即放不下,这里只会出现行内级即inline(Block)\n * 调用前提是非行开头的inline尝试计算是否放得下,开头无需且禁止判断,防止出现永远放不下一个字符卡死\n * 返回非负数就是放得下,这样一些尺寸为0的也算\n * @param w 剩余宽度\n * @param total 容器尺寸\n * @returns {number|*}\n * @private\n */\n __tryLayInline(w, total) {\n css.computeReflow(this);\n let { flowChildren, currentStyle: {\n [DISPLAY]: display,\n [WIDTH]: width,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_RIGHT]: marginRight,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_RIGHT]: paddingRight,\n }, computedStyle: {\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n } } = this;\n // inline没w/h,并且尝试孩子第一个能放下即可,如果是文字就是第一个字符\n if(display === 'inline') {\n if(flowChildren.length) {\n let first = flowChildren[0];\n if(first instanceof Component) {\n first = first.shadowRoot;\n }\n if(first instanceof Xom) {\n w = first.__tryLayInline(w, total);\n }\n else {\n w -= first.firstCharWidth;\n }\n }\n }\n // inlineBlock尝试所有孩子在一行上\n else {\n if(width[1] !== AUTO) {\n w -= this.__calSize(width, total);\n }\n else {\n for(let i = 0; i < flowChildren.length; i++) {\n // 当放不下时直接返回,无需继续多余的尝试计算\n if(w < 0) {\n return w;\n }\n let item = flowChildren[i];\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n if(item instanceof Xom) {\n w = item.__tryLayInline(w, total);\n }\n // text强制一行,否则非头就是放不下,需从头开始\n else {\n w -= item.textWidth;\n }\n }\n }\n // ib要减去末尾mpb\n w -= this.__calSize(marginRight, total);\n w -= this.__calSize(paddingRight, total);\n w -= borderRightWidth;\n }\n // 还要减去开头的mpb\n w -= this.__calSize(marginLeft, total);\n w -= this.__calSize(paddingLeft, total);\n w -= borderLeftWidth;\n return w;\n }\n\n // 设置y偏移值,递归包括children,此举在justify-content/margin-auto等对齐用\n __offsetX(diff, isLayout, lv) {\n super.__offsetX(diff, isLayout, lv);\n let ep = this.__ellipsis;\n if(ep) {\n ep.__offsetX(diff, isLayout);\n }\n // 记得偏移LineBox\n if(isLayout && !this.__config[NODE_IS_INLINE] && this.lineBoxManager) {\n this.lineBoxManager.__offsetX(diff);\n }\n this.flowChildren.forEach(item => {\n if(item) {\n item.__offsetX(diff, isLayout, lv);\n }\n });\n }\n\n __offsetY(diff, isLayout, lv) {\n super.__offsetY(diff, isLayout, lv);\n let ep = this.__ellipsis;\n if(ep) {\n ep.__offsetY(diff, isLayout);\n }\n if(isLayout && !this.__config[NODE_IS_INLINE] && this.lineBoxManager) {\n this.lineBoxManager.__offsetY(diff);\n }\n this.flowChildren.forEach(item => {\n if(item) {\n item.__offsetY(diff, isLayout, lv);\n }\n });\n }\n\n\n /**\n * flex布局时,计算basis尺寸,如果有固定声明则以其为标准,content为内容最大尺寸,auto依赖w/h或降级content\n * basis要考虑相加直接item的mpb,非绝对值单位以container为基准,basis为内容时为max值\n * item的孩子为孙子节点需递归,不参与basis计算,只参与min/max,尺寸和mpb均只考虑绝对值\n * 自动计算时影响尺寸的只有换行的text,以及一组inline,均按其中最大尺寸的一个计算\n * auto自动计算递归进行,如果是普通row方向,按最大text的charWidth为准\n * 如果是column方向,则虚拟布局后看text的height\n * 在abs下时进入特殊状态,无论是row/column,都会按row方向尝试最大尺寸,直到舞台边缘或容器声明的w折行\n * 返回b,声明则按css值,否则是auto/content\n * 返回min为最小宽度,遇到字符/inline则单列排版后需要的最大宽度\n * 返回max为最大宽度,理想情况一排最大值,在abs时virtualMode状态参与计算,文本抵达边界才进行换行\n * 当为column方向时,特殊进行虚拟布局isVirtual,需要获取高度\n * @param isDirectionRow\n * @param isAbs\n * @param isColumn\n * @param data\n * @param isDirectChild\n * @private\n */\n __calBasis(isDirectionRow, isAbs, isColumn, data, isDirectChild) {\n computeReflow(this);\n let b = 0;\n let min = 0;\n let max = 0;\n let { flowChildren, currentStyle, computedStyle } = this;\n let { x, y, w, h } = data;\n // 计算需考虑style的属性\n let {\n [FLEX_DIRECTION]: flexDirection,\n [FLEX_BASIS]: flexBasis,\n [WIDTH]: width,\n [HEIGHT]: height,\n } = currentStyle;\n let {\n [LINE_HEIGHT]: lineHeight,\n [DISPLAY]: display,\n } = computedStyle;\n let main = isDirectionRow ? width : height;\n // basis3种情况:auto、固定、content\n let isAuto = flexBasis[1] === AUTO;\n let isFixed = [PX, PERCENT, REM, VW, VH, VMAX, VMIN].indexOf(flexBasis[1]) > -1;\n let isContent = !isAuto && !isFixed;\n let fixedSize;\n // flex的item固定basis计算\n if(isFixed) {\n b = fixedSize = this.__calSize(flexBasis, isDirectionRow ? w : h);\n }\n // 已声明主轴尺寸的,当basis是auto时为main值\n else if(isAuto && ([PX, PERCENT, REM, VW, VH, VMAX, VMIN].indexOf(main[1]) > -1)) {\n b = fixedSize = this.__calSize(main, isDirectionRow ? w : h);\n }\n // 非固定尺寸的basis为auto时降级为content\n else if(isAuto) {\n isContent = true;\n }\n let countMin = 0, countMax = 0;\n // row的flex时,child只需计算宽度的basis/min/max,递归下去也是如此,即便包含递归的flex\n if(isDirectionRow) {\n // flex的item还是flex时\n if(display === 'flex') {\n let isRow = ['column', 'column-reverse', 'columnReverse'].indexOf(flexDirection) === -1;\n flowChildren = genOrderChildren(flowChildren);\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let [, min2, max2] = item.__calBasis(isDirectionRow, isAbs, isColumn, { x, y, w, h }, false);\n if(isRow) {\n min += min2;\n max += max2;\n }\n else {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n }\n else {\n if(isRow) {\n min += item.charWidth;\n max += item.textWidth;\n }\n else {\n min = Math.max(min, item.charWidth);\n max = Math.max(max, item.textWidth);\n }\n }\n });\n }\n // flex的item是block/inline时,inline也会变成block统一对待\n else {\n let lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseline(computedStyle));\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let [, min2, max2] = item.__calBasis(isDirectionRow, isAbs, isColumn, { x, y, w, h, lineBoxManager }, false);\n let display = item.computedStyle[DISPLAY];\n // row看块级最大尺寸和连续行级最大尺寸的宽\n if(display === 'block' || display === 'flex') {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n countMin = countMax = 0;\n }\n else {\n countMin += min2;\n countMax += max2;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n }\n }\n else {\n countMin += item.charWidth;\n countMax += item.textWidth;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n }\n });\n }\n if(fixedSize) {\n max = Math.max(fixedSize, max);\n }\n // row降级为内容时basis等同于max\n if(isContent) {\n b = max;\n }\n }\n // column的flex时,每个child做一次虚拟布局,获取到每个child的高度和宽度\n else {\n this.__layout({\n x,\n y,\n w,\n h,\n }, isAbs, true);\n min = max = b = this.height; // column的child,max和b总相等\n }\n // 直接item的mpb影响basis\n return this.__addMBP(isDirectionRow, w, currentStyle, computedStyle, [b, min, max], isDirectChild);\n }\n\n __layoutNone() {\n super.__layoutNone();\n let { children } = this;\n children.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n item.__layoutNone();\n }\n });\n }\n\n /**\n * block布局,本身固定尺寸优先,否则看内容从上往下从左往右flow流排布\n * 内部inline和inlineBlock组成LineBox,通过LineBoxManager来管理混排的现象\n * LineBoxManager只有block和inlineBlock内部生成,inline会复用最近父级的\n * 内部的block在垂直方向要考虑margin合并的问题,强制所有节点为bfc,精简逻辑\n * @param data\n * @param isAbs abs无尺寸时提前虚拟布局计算尺寸\n * @param isColumn flex列无尺寸时提前虚拟布局计算尺寸\n * @private\n */\n __layoutBlock(data, isAbs, isColumn) {\n let { flowChildren, currentStyle, computedStyle } = this;\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data, false);\n // abs虚拟布局需预知width,固定可提前返回\n if(isAbs && fixedWidth) {\n this.__width = w;\n this.__ioSize(w);\n return;\n }\n if(isColumn && fixedHeight) {\n this.__height = h;\n this.__ioSize(undefined, h);\n }\n let {\n [TEXT_ALIGN]: textAlign,\n [WHITE_SPACE]: whiteSpace,\n [LINE_CLAMP]: lineClamp,\n [LINE_HEIGHT]: lineHeight,\n [OVERFLOW]: overflow,\n [TEXT_OVERFLOW]: textOverflow,\n } = computedStyle;\n // 只有>=1的正整数才有效\n lineClamp = lineClamp || 0;\n let lineClampCount = 0;\n // 虚线管理一个block内部的LineBox列表,使得inline的元素可以中途衔接处理折行\n // 内部维护inline结束的各种坐标来达到目的,遇到block时中断并处理换行坐标\n let lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseline(computedStyle));\n // 因精度问题,统计宽度均从0开始累加每行,最后取最大值,仅在abs布局时isVirtual生效\n let maxW = 0;\n let cw = 0;\n let lx = x; // 行首,考虑了mbp\n // 连续block(flex相同,下面都是)的上下margin合并值记录,合并时从列表中取\n let mergeMarginBottomList = [], mergeMarginTopList = [];\n let length = flowChildren.length;\n let ignoreNextLine; // lineClamp超过后,后面的均忽略并置none,注意block内部行数统计是跨子block的\n let ignoreNextWrap; // whiteSpace单行超过后,后面的均忽略并置none,注意这也是跨block的会被隔断重计\n flowChildren.forEach((item, i) => {\n let isXom = item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom;\n let isInline = isXom && item.currentStyle[DISPLAY] === 'inline';\n let isInlineBlock = isXom && ['inlineBlock', 'inline-block'].indexOf(item.currentStyle[DISPLAY]) > -1;\n let isRealInline = isInline && item.__isRealInline();\n let lastLineClampCount = lineClampCount;\n // 每次循环开始前,这次不是block的话,看之前遗留待合并margin,并重置\n if((!isXom || isInline || isInlineBlock)) {\n if(mergeMarginBottomList.length && mergeMarginTopList.length) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n y += diff;\n }\n }\n mergeMarginTopList = [];\n mergeMarginBottomList = [];\n }\n if(isXom) {\n // inline和inlineBlock的细节不同之处,ib除了w/h之外,更想像block一样占据一行\n // 比如2个inline前面占一半后面比一半多但还是会从一半开始然后第2行换行继续,但ib放不下则重开一行\n // inline和ib能互相嵌套,形成的LineBox中则是TextBox和节点混合\n if(isInlineBlock || isInline) {\n if(ignoreNextLine || ignoreNextWrap) {\n item.__layoutNone();\n return;\n }\n // x开头或者nowrap单行的非block,不用考虑是否放得下直接放\n if(x === lx || whiteSpace === 'nowrap') {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager, // ib内部新生成会内部判断,这里不管统一传入\n lineClamp,\n lineClampCount,\n }, isAbs, isColumn);\n // inlineBlock的特殊之处,一旦w为auto且内部产生折行时,整个变成block独占一块区域,坐标计算和block一样,注意nowrap排除\n if(item.__isIbFull) {\n lineClampCount++;\n }\n if(item.__isIbFull && whiteSpace !== 'nowrap') {\n lineBoxManager.addItem(item, true);\n x = lx;\n y += item.outerHeight;\n lineBoxManager.setNotEnd();\n }\n // inline和不折行的ib,其中ib需要手动存入当前lb中\n else {\n (isInlineBlock || !isRealInline) && lineBoxManager.addItem(item, false);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n // 单行时inline在ellipsis会导致行数变化,否则判断坐标尺寸(恰好有点空剩余inline排不下),注意前提是非abs,其虚拟计算尺寸无视限制\n if(!isAbs && overflow === 'hidden' && whiteSpace === 'nowrap'\n && (x - lx > w + (1e-10) || lineClampCount > lastLineClampCount)) {\n ignoreNextWrap = true;\n }\n else if(lineClamp && lineClampCount >= lineClamp) {\n ignoreNextLine = true;\n }\n // abs统计宽度,注意nowrap时累加\n if(isAbs) {\n if(whiteSpace === 'nowrap') {\n cw += item.outerWidth;\n }\n else {\n cw = item.outerWidth;\n if(lineClampCount > lastLineClampCount) {\n cw = Math.max(cw, w);\n }\n }\n maxW = Math.max(maxW, cw);\n }\n }\n else {\n // 非开头先尝试是否放得下,内部判断了inline/ib,ib要考虑是否有width\n let fw = item.__tryLayInline(w + lx - x, w);\n // 放得下继续,奇怪的精度问题,加上阈值\n if(fw >= (-1e-10)) {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isAbs, isColumn);\n // ib放得下要么内部没有折行,要么声明了width限制,都需手动存入当前lb\n (isInlineBlock || !isRealInline) && lineBoxManager.addItem(item, false);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n if(lineClamp && lineClampCount >= lineClamp) {\n ignoreNextLine = true;\n }\n if(isAbs) {\n // ib和非换行inline累加\n if(isInlineBlock || lineClampCount === lastLineClampCount) {\n cw += item.outerWidth;\n maxW = Math.max(maxW, cw);\n }\n // inline换行时一定超过边界至少撑满w\n else {\n maxW = Math.max(maxW, w);\n cw = x - lx;\n maxW = Math.max(maxW, cw);\n }\n }\n }\n // 放不下处理之前的lineBox,并考虑重新开头或截断\n else {\n lineClampCount++;\n x = lx;\n y = lineBoxManager.endY;\n lineBoxManager.setNewLine();\n // 超过行数,整个block共用计数器\n if(lineClamp && lineClampCount >= lineClamp) {\n item.__layoutNone();\n ignoreNextLine = true;\n let list = lineBoxManager.list;\n let lineBox = list[list.length - 1];\n backtrack(this, lineBoxManager, lineBox, w, 0);\n return;\n }\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isAbs, isColumn);\n // 重新开头的ib和上面开头处一样逻辑\n if(item.__isIbFull) {\n lineBoxManager.addItem(item, false);\n x = lx;\n y += item.outerHeight;\n lineBoxManager.setNotEnd();\n lineClampCount++;\n }\n // inline和不折行的ib,其中ib需要手动存入当前lb中\n else {\n (isInlineBlock || !isRealInline) && lineBoxManager.addItem(item, false);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n if(lineClamp && lineClampCount >= lineClamp) {\n ignoreNextLine = true;\n }\n if(isAbs) {\n maxW = Math.max(maxW, cw);\n // 此处发生换行撑满\n maxW = Math.max(maxW, w);\n // 新行重计\n cw = item.outerWidth;\n maxW = Math.max(maxW, cw);\n }\n }\n }\n }\n // block/flex先处理之前可能遗留的最后一行LineBox,然后递归时不传lineBoxManager,其内部生成新的\n else {\n ignoreNextWrap = false; // block出现的话只隔断单行,不影响多行计数器\n // 非开头,说明之前的text/ib未换行,需要增加行数\n if(x > lx) {\n lineClampCount++;\n }\n if(lineClamp && lineClampCount >= lineClamp) {\n ignoreNextLine = true;\n }\n x = lx;\n if(lineBoxManager.isEnd) {\n y = lineBoxManager.endY;\n lineBoxManager.setNotEnd();\n lineBoxManager.setNewLine();\n }\n item.__layout({\n x,\n y,\n w,\n h,\n }, isAbs, isColumn);\n // 自身无内容\n let isNone = item.currentStyle[DISPLAY] === 'none';\n let isEmptyBlock;\n if(!isNone && item.flowChildren && item.flowChildren.length === 0) {\n let {\n [MARGIN_TOP]: marginTop,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_TOP]: paddingTop,\n [PADDING_BOTTOM]: paddingBottom,\n [HEIGHT]: height,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n } = item.computedStyle;\n // 无内容高度为0的空block特殊情况,记录2个margin下来等后续循环判断处理\n if(paddingTop <= 0 && paddingBottom <= 0 && height <= 0 && borderTopWidth <= 0 && borderBottomWidth <= 0) {\n mergeMarginBottomList.push(marginBottom);\n mergeMarginTopList.push(marginTop);\n isEmptyBlock = true;\n }\n }\n y += item.outerHeight;\n lineBoxManager.__lastY = y;\n // absolute/flex前置虚拟计算\n if(isAbs) {\n maxW = Math.max(maxW, item.outerWidth);\n cw = 0;\n }\n // 空block要留下轮循环看,除非是最后一个,此处非空本轮处理掉看是否要合并\n if(!isNone && !isEmptyBlock) {\n let { [MARGIN_TOP]: marginTop, [MARGIN_BOTTOM]: marginBottom } = item.computedStyle;\n // 有bottom值说明之前有紧邻的block,任意个甚至空block,自己有个top所以无需判断top\n // 如果是只有紧邻的2个非空block,也被包含在情况内,取上下各1合并\n if(mergeMarginBottomList.length) {\n mergeMarginTopList.push(marginTop);\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n item.__offsetY(diff, true);\n y += diff;\n }\n }\n // 同时自己保存bottom,为后续block准备\n mergeMarginTopList = [];\n mergeMarginBottomList = [marginBottom];\n }\n // 最后一个空block当是正正和负负时要处理,正负在outHeight处理了结果是0\n else if(i === length - 1) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n y += diff;\n }\n }\n }\n }\n // 文字和inline类似\n else {\n if(ignoreNextLine || ignoreNextWrap) {\n item.__layoutNone();\n return;\n }\n // x开头,不用考虑是否放得下直接放\n if(x === lx || whiteSpace === 'nowrap') {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isAbs, isColumn);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n // 和inline很像,只是没有ib\n if(!isAbs && overflow === 'hidden' && whiteSpace === 'nowrap'\n && (x - lx > w + (1e-10) || lineClampCount > lastLineClampCount)) {\n ignoreNextWrap = true;\n }\n else if(lineClamp && lineClampCount >= lineClamp) {\n ignoreNextLine = true;\n }\n // abs统计宽度,注意nowrap时累加\n if(isAbs) {\n if(whiteSpace === 'nowrap') {\n cw += item.width;\n }\n else {\n cw = item.width;\n if(lineClampCount > lastLineClampCount) {\n cw = Math.max(cw, w);\n }\n }\n maxW = Math.max(maxW, cw);\n }\n }\n else {\n // 非开头先尝试是否放得下\n let fw = item.__tryLayInline(w - x + lx);\n // 放得下继续\n if(fw >= (-1e-10)) {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isAbs, isColumn);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n if(lineClamp && lineClampCount >= lineClamp) {\n ignoreNextLine = true;\n }\n if(isAbs) {\n if(lineClampCount === lastLineClampCount) {\n cw += item.outerWidth;\n maxW = Math.max(maxW, cw);\n }\n // inline换行一定超过边界\n else {\n maxW = Math.max(maxW, w);\n cw = x - lx;\n maxW = Math.max(maxW, cw);\n }\n }\n }\n // 放不下处理之前的lineBox,并重新开头\n else {\n lineClampCount++;\n x = lx;\n y = lineBoxManager.endY;\n lineBoxManager.setNewLine();\n // 和inline/ib一样\n if(lineClamp && lineClampCount >= lineClamp) {\n item.__layoutNone();\n ignoreNextLine = true;\n let list = lineBoxManager.list;\n let lineBox = list[list.length - 1];\n backtrack(this, lineBoxManager, lineBox, w, 0);\n return;\n }\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isAbs, isColumn);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n if(lineClamp && lineClampCount >= lineClamp) {\n ignoreNextLine = true;\n }\n if(isAbs) {\n maxW = Math.max(maxW, cw);\n // 此处发生换行撑满\n maxW = Math.max(maxW, w);\n // 新行重计\n cw = item.outerWidth;\n maxW = Math.max(maxW, cw);\n }\n }\n }\n }\n });\n // 结束后如果是以LineBox结尾,则需要设置y到这里,否则流布局中block会设置\n // 当以block换行时,新行是true,否则是false即结尾\n if(lineBoxManager.isEnd) {\n y = lineBoxManager.endY;\n }\n let tw = this.__width = (fixedWidth || !isAbs) ? w : maxW;\n let th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\n // 不管是否虚拟,都需要垂直对齐,因为img这种占位元素会影响lineBox高度\n let spread = lineBoxManager.verticalAlign();\n if(spread) {\n if(!fixedHeight) {\n this.__resizeY(spread);\n }\n /**\n * parent以及parent的next无需处理,因为深度遍历后面还会进行,\n * 但自己的block需处理,因为对齐只处理了inline元素,忽略了block,\n * 同时由于block和inline区域可能不连续,每个增加的y不一样,\n * 需要按照每个不同区域来判断,区域是按索引次序依次增大的\n */\n let count = 0, syl = lineBoxManager.spreadYList;\n let isLastBlock = false;\n flowChildren.forEach(item => {\n let isXom = item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom;\n let isBlock = isXom && item.computedStyle[DISPLAY] === 'block';\n if(isBlock) {\n isLastBlock = true;\n item.__offsetY(syl[count], true);\n }\n else {\n if(isLastBlock) {\n count++;\n }\n isLastBlock = false;\n }\n });\n }\n // 非abs提前的虚拟布局,真实布局情况下最后为所有行内元素进行2个方向上的对齐\n if(!isAbs && !isColumn) {\n if(['center', 'right'].indexOf(textAlign) > -1) {\n lineBoxManager.horizonAlign(tw, textAlign);\n // 直接text需计算size\n flowChildren.forEach(item => {\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n if(item instanceof Text) {\n item.__inlineSize();\n }\n });\n }\n // 所有inline计算size\n lineBoxManager.domList.forEach(item => {\n item.__inlineSize(tw, textAlign);\n });\n this.__marginAuto(currentStyle, data);\n }\n }\n\n // 弹性布局时的计算位置\n __layoutFlex(data, isAbs, isColumn) {\n let { flowChildren, currentStyle, computedStyle, __flexLine } = this;\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data, false);\n if(isAbs && fixedWidth) {\n this.__width = w;\n this.__ioSize(w);\n return;\n }\n if(isColumn && fixedHeight) {\n if(isColumn && fixedHeight) {\n this.__height = h;\n this.__ioSize(undefined, h);\n }\n }\n // 每次布局情况多行内容\n __flexLine.splice(0);\n let {\n [FLEX_DIRECTION]: flexDirection,\n [JUSTIFY_CONTENT]: justifyContent,\n [ALIGN_ITEMS]: alignItems,\n [LINE_CLAMP]: lineClamp,\n [FLEX_WRAP]: flexWrap,\n [ALIGN_CONTENT]: alignContent,\n [LINE_HEIGHT]: lineHeight,\n [TEXT_ALIGN]: textAlign,\n } = computedStyle;\n // 只有>=1的正整数才有效\n lineClamp = lineClamp || 0;\n let lineClampCount = 0;\n let isDirectionRow = ['column', 'column-reverse', 'columnReverse'].indexOf(flexDirection) === -1;\n // 计算伸缩基数\n let growList = [];\n let shrinkList = [];\n let basisList = [];\n let maxList = [];\n let minList = [];\n let orderChildren = genOrderChildren(flowChildren);\n orderChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let { currentStyle, computedStyle } = item;\n let [b, min, max] = item.__calBasis(isDirectionRow, isAbs, isColumn, { x, y, w, h }, true);\n let { [FLEX_GROW]: flexGrow, [FLEX_SHRINK]: flexShrink } = currentStyle;\n computedStyle[FLEX_BASIS] = b;\n growList.push(flexGrow);\n shrinkList.push(flexShrink);\n // 根据basis不同,计算方式不同\n basisList.push(b);\n maxList.push(max);\n minList.push(min);\n }\n // 文本\n else {\n growList.push(0);\n shrinkList.push(1);\n if(isDirectionRow) {\n let cw = item.charWidth;\n let tw = item.textWidth;\n basisList.push(tw);\n maxList.push(tw);\n minList.push(cw);\n }\n else {\n let lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseline(computedStyle));\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isAbs, isColumn);\n let hh = item.height;\n basisList.push(hh);\n maxList.push(hh);\n minList.push(hh);\n }\n }\n });\n let containerSize = isDirectionRow ? w : h;\n let isMultiLine = flexWrap === 'wrap' || ['wrap-reverse', 'wrapReverse'].indexOf(flexWrap) > -1;\n /**\n * 判断是否需要分行,根据假设主尺寸来统计尺寸和计算,假设主尺寸是clamp(min_main_size, flex_base_size, max_main_size)\n * 当多行时,由于每行一定有最小限制,所以每行一般情况都不是shrink状态,\n * 但也有极端情况,比如一行只能放下1个元素时,且此元素比容器小,会是shrink\n */\n let line = [], sum = 0, hypotheticalList = [];\n basisList.forEach((item, i) => {\n let min = minList[i], max = maxList[i];\n let hypothetical;\n if(item < min) {\n hypothetical = min;\n }\n else if(item > max) {\n hypothetical = max;\n }\n else {\n hypothetical = item;\n }\n hypotheticalList.push(hypothetical);\n if(isMultiLine) {\n // 超过尺寸时,要防止sum为0即1个也会超过尺寸\n if(sum + hypothetical > containerSize) {\n if(sum) {\n __flexLine.push(line);\n line = [orderChildren[i]];\n sum = hypothetical;\n }\n else {\n line.push(orderChildren[i]);\n __flexLine.push(line);\n line = [];\n sum = 0;\n }\n }\n else {\n line.push(orderChildren[i]);\n sum += hypothetical;\n }\n }\n else {\n line.push(orderChildren[i]);\n }\n });\n if(line.length) {\n __flexLine.push(line);\n }\n let offset = 0, clone = { x, y, w, h };\n let maxCrossList = [];\n __flexLine.forEach(item => {\n let length = item.length;\n let end = offset + length;\n let [x1, y1, maxCross] = this.__layoutFlexLine(clone, isDirectionRow, isAbs, isColumn, containerSize,\n fixedWidth, fixedHeight, lineClamp, lineClampCount,\n lineHeight, computedStyle, justifyContent, alignItems,\n orderChildren.slice(offset, end), item, textAlign,\n growList.slice(offset, end), shrinkList.slice(offset, end), basisList.slice(offset, end),\n hypotheticalList.slice(offset, end), minList.slice(offset, end));\n // 下一行/列更新坐标\n if(isDirectionRow) {\n clone.y = y1;\n }\n else {\n clone.x = x1;\n }\n x = Math.max(x, x1);\n y = Math.max(y, y1);\n maxCrossList.push(maxCross);\n offset += length;\n });\n // abs预布局只计算宽度无需对齐\n if(isAbs) {\n let maxW = 0;\n __flexLine.forEach(line => {\n let count = 0;\n line.forEach(item => {\n if(isDirectionRow) {\n count += item.outerWidth;\n }\n else {\n count = Math.max(count, item.outerWidth);\n }\n // 文字发生换行无论row/column一定放不下需占满容器尺寸\n if(item instanceof Text && item.textWidth > w) {\n maxW = Math.max(maxW, w);\n }\n });\n maxW = Math.max(maxW, count);\n });\n let tw = this.__width = maxW;\n this.__ioSize(tw);\n return;\n }\n let tw = this.__width = w;\n let th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\n if(isColumn) {\n return;\n }\n // flexDirection当有reverse时交换每line的主轴序\n if(flexDirection === 'row-reverse' || flexDirection === 'rowReverse') {\n __flexLine.forEach(line => {\n line.forEach(item => {\n // 一个矩形内的子矩形进行镜像移动,用外w减去内w再减去开头空白的2倍即可\n let diff = tw - item.outerWidth - (item.x - data.x) * 2;\n if(diff) {\n item.__offsetX(diff, true);\n }\n });\n });\n }\n else if(flexDirection === 'column-reverse' || flexDirection === 'columnReverse') {\n __flexLine.forEach(line => {\n line.forEach(item => {\n // 一个矩形内的子矩形进行镜像移动,用外w减去内w再减去开头空白的2倍即可\n let diff = th - item.outerHeight - (item.y - data.y) * 2;\n if(diff) {\n item.__offsetY(diff, true);\n }\n });\n });\n }\n // wrap-reverse且多轴线时交换轴线序,需要2行及以上才行\n let length = __flexLine.length;\n if(['wrapReverse', 'wrap-reverse'].indexOf(flexWrap) > -1 && length > 1) {\n let crossSum = 0, crossSumList = [];\n maxCrossList.forEach(item => {\n crossSumList.push(crossSum);\n crossSum += item;\n });\n let count = 0;\n for(let i = length - 1; i >= 0; i--) {\n let line = __flexLine[i];\n let source = crossSumList[i];\n let diff = count - source;\n if(diff) {\n line.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(diff, true);\n }\n else {\n item.__offsetX(diff, true);\n }\n });\n }\n count += maxCrossList[i];\n }\n __flexLine.reverse();\n }\n // 侧轴对齐分flexLine做,要考虑整体的alignContent的stretch和每行的alignItems的stretch\n // 先做整体的,得出交叉轴空白再均分给每一行做单行的,整体的只有1行忽略\n let per;\n if(length > 1 && (fixedHeight && isDirectionRow || !isDirectionRow)) {\n let diff = isDirectionRow ? th - (y - data.y) : tw - (x - data.x);\n // 有空余时才进行对齐\n if(diff > 0) {\n if(alignContent === 'center') {\n let per = diff * 0.5;\n orderChildren.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(per, true);\n }\n else {\n item.__offsetX(per, true);\n }\n });\n }\n else if(alignContent === 'flex-start' || alignContent === 'flexStart') {}\n else if(alignContent === 'flex-end' || alignContent === 'flexEnd') {\n orderChildren.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(diff, true);\n }\n else {\n item.__offsetX(diff, true);\n }\n });\n }\n else if(alignContent === 'space-between' || alignContent === 'spaceBetween') {\n let between = diff / (length - 1);\n // 除了第1行其它进行偏移\n __flexLine.forEach((item, i) => {\n if(i) {\n item.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(between, true);\n }\n else {\n item.__offsetX(between, true);\n }\n });\n }\n });\n }\n else if(alignContent === 'space-around' || alignContent === 'spaceAround') {\n let around = diff / (length + 1);\n __flexLine.forEach((item, i) => {\n item.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(around * (i + 1), true);\n }\n else {\n item.__offsetX(around * (i + 1), true);\n }\n });\n });\n }\n // 默认stretch\n else {\n per = diff / length;\n // 除了第1行其它进行偏移\n __flexLine.forEach((item, i) => {\n if(i) {\n item.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(per * i, true);\n }\n else {\n item.__offsetX(per * i, true);\n }\n });\n }\n });\n }\n }\n }\n // 每行再进行cross对齐,在alignContent为stretch时计算每行的高度\n if(!isColumn) {\n if(length > 1) {\n __flexLine.forEach((item, i) => {\n let maxCross = maxCrossList[i];\n if(per) {\n maxCross += per;\n }\n this.__crossAlign(item, alignItems, isDirectionRow, maxCross);\n });\n }\n else if(length) {\n let maxCross = maxCrossList[0];\n if(isDirectionRow) {\n if(fixedHeight) {\n maxCross = h;\n }\n }\n else {\n maxCross = w;\n }\n this.__crossAlign(__flexLine[0], alignItems, isDirectionRow, maxCross);\n }\n this.__marginAuto(currentStyle, data);\n }\n }\n\n /**\n * 计算获取子元素的b/min/max完毕后,尝试进行flex每行布局\n * https://www.w3.org/TR/css-flexbox-1/#layout-algorithm\n * 假想主尺寸,其为clamp(min_main_size, flex_base_size, max_main_size)\n * 随后按算法一步步来 https://zhuanlan.zhihu.com/p/354567655\n * 规范没提到mpb,item的要计算,孙子的只考虑绝对值\n * 先收集basis和假设主尺寸\n */\n __layoutFlexLine(data, isDirectionRow, isAbs, isColumn, containerSize,\n fixedWidth, fixedHeight, lineClamp, lineClampCount,\n lineHeight, computedStyle, justifyContent, alignItems,\n orderChildren, flexLine, textAlign,\n growList, shrinkList, basisList, hypotheticalList, minList) {\n let { x, y, w, h } = data;\n let hypotheticalSum = 0;\n hypotheticalList.forEach(item => {\n hypotheticalSum += item;\n });\n // 根据假设尺寸确定使用grow还是shrink,冻结非弹性项并设置target尺寸,确定剩余未冻结数量\n let isOverflow = hypotheticalSum >= containerSize;\n let targetMainList = [];\n basisList.forEach((item, i) => {\n if(isOverflow) {\n if(!shrinkList[i] || (basisList[i] < hypotheticalList[i])) {\n targetMainList[i] = hypotheticalList[i];\n }\n }\n else {\n if(!growList[i] || (basisList[i] > hypotheticalList[i])) {\n targetMainList[i] = hypotheticalList[i];\n }\n }\n });\n // 初始可用空间,冻结使用确定的target尺寸,未冻结使用假想\n let free = 0;\n basisList.forEach((item, i) => {\n if(targetMainList[i] !== undefined) {\n free += targetMainList[i];\n }\n else {\n free += item;\n }\n });\n let total = Infinity;\n if(isDirectionRow) {\n total = w;\n }\n else if(fixedHeight) {\n total = h;\n }\n else {\n total = free;\n }\n free = Math.abs(total - free);\n // 循环,文档算法不够简练,其合并了grow和shrink,实际拆开写更简单\n let factorSum = 0;\n if(isOverflow) {\n // 计算真正的因子占比,同时得出缩小尺寸数值\n // 还需判断每个item收缩不能 {\n if(targetMainList[i] === undefined) {\n let n = item * basisList[i];\n factorSum += n;\n return n;\n }\n });\n while(true) {\n if(factorSum < 1) {\n free *= factorSum;\n }\n let needReset, factorSum2 = 0;\n factorList.forEach((item, i) => {\n if(item) {\n let r = item / factorSum;\n let s = r * free; // 需要收缩的尺寸\n let n = basisList[i] - s; // 实际尺寸\n // 比min还小设置为min,同时设0剔除\n if(n < minList[i]) {\n targetMainList[i] = minList[i];\n factorList[i] = 0;\n needReset = true;\n free -= basisList[i] - minList[i]; // 超出的尺寸也要减去实际收缩的尺寸\n }\n // 先按照没有超限的设置,正常情况直接跳出,如果有超限,记录sum2给下轮赋值重新计算\n else {\n targetMainList[i] = n;\n factorSum2 += item;\n }\n }\n });\n if(!needReset) {\n break;\n }\n factorSum = factorSum2;\n }\n }\n else {\n let factorList = growList.map((item, i) => {\n if(targetMainList[i] === undefined) {\n factorSum += item;\n return item;\n }\n });\n while(true) {\n if(factorSum < 1) {\n free *= factorSum;\n }\n let needReset, factorSum2 = 0;\n factorList.forEach((item, i) => {\n if(item) {\n let r = item / factorSum;\n let s = r * free; // 需要扩展的尺寸\n let n = basisList[i] + s; // 实际尺寸\n // 比min还小设置为min,同时设0剔除\n if(n < minList[i]) {\n targetMainList[i] = minList[i];\n factorList[i] = 0;\n needReset = true;\n free -= basisList[i] - minList[i]; // 超出的尺寸也要减去实际收缩的尺寸\n }\n // 先按照没有超限的设置,正常情况直接跳出,如果有超限,记录sum2给下轮赋值重新计算\n else {\n targetMainList[i] = n;\n factorSum2 += item;\n }\n }\n });\n if(!needReset) {\n break;\n }\n factorSum = factorSum2;\n }\n }\n let maxCross = 0;\n let lbmList = [];\n orderChildren.forEach((item, i) => {\n let main = targetMainList[i];\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n if(isDirectionRow) {\n item.__layout({\n x,\n y,\n w: main,\n h,\n w3: main, // w3假设固定宽度,忽略原始style中的设置\n }, isAbs, isColumn);\n }\n else {\n let {\n [ALIGN_SELF]: alignSelf,\n [WIDTH]: width,\n } = item.currentStyle;\n // column的child真布局时,如果是stretch宽度,则可以直接生成animateRecord,否则自适应调整后才进行\n if(!isAbs && !isColumn) {\n let needGenAr;\n if(width[1] !== AUTO || alignSelf === 'stretch') {\n needGenAr = true;\n }\n else if(alignSelf === 'auto' && alignItems === 'stretch') {\n needGenAr = true;\n }\n if(needGenAr) {\n item.__layout({\n x,\n y,\n w,\n h: main,\n h3: main, // 同w2\n }, isAbs, isColumn);\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h: main,\n h3: main, // 同w2\n }, true, isColumn);\n item.__layout({\n x,\n y,\n w,\n w3: item.outerWidth,\n h: main,\n h3: main, // 同w2\n }, isAbs, isColumn);\n }\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h: main,\n h3: main, // 同w2\n }, isAbs, isColumn);\n }\n }\n }\n else {\n let lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseline(computedStyle));\n lbmList.push(lineBoxManager);\n item.__layout({\n x,\n y,\n w: isDirectionRow ? main : w,\n h: isDirectionRow ? h : main,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isAbs, isDirectionRow);\n }\n if(isDirectionRow) {\n x += item.outerWidth;\n maxCross = Math.max(maxCross, item.outerHeight);\n }\n else {\n y += item.outerHeight;\n maxCross = Math.max(maxCross, item.outerWidth);\n }\n });\n // 计算主轴剩余时要用真实剩余空间而不能用伸缩剩余空间\n let diff = isDirectionRow ? (w - x + data.x) : (h - y + data.y);\n // 主轴对齐方式\n if(!isAbs && diff > 0) {\n let len = orderChildren.length;\n if(justifyContent === 'flexEnd' || justifyContent === 'flex-end') {\n for(let i = 0; i < len; i++) {\n let child = orderChildren[i];\n isDirectionRow ? child.__offsetX(diff, true) : child.__offsetY(diff, true);\n }\n }\n else if(justifyContent === 'center') {\n let center = diff * 0.5;\n for(let i = 0; i < len; i++) {\n let child = orderChildren[i];\n isDirectionRow ? child.__offsetX(center, true) : child.__offsetY(center, true);\n }\n }\n else if(justifyContent === 'spaceBetween' || justifyContent === 'space-between') {\n let between = diff / (len - 1);\n for(let i = 1; i < len; i++) {\n let child = orderChildren[i];\n isDirectionRow ? child.__offsetX(between * i, true) : child.__offsetY(between * i, true);\n }\n }\n else if(justifyContent === 'spaceAround' || justifyContent === 'space-around') {\n let around = diff / (len + 1);\n for(let i = 0; i < len; i++) {\n let child = orderChildren[i];\n isDirectionRow ? child.__offsetX(around * (i + 1), true) : child.__offsetY(around * (i + 1), true);\n }\n }\n }\n if(isDirectionRow) {\n y += maxCross;\n }\n else {\n x += maxCross;\n }\n // flex的直接text对齐比较特殊\n if(!isAbs && ['center', 'right'].indexOf(textAlign) > -1) {\n lbmList.forEach(item => {\n item.horizonAlign(item.width, textAlign);\n })\n }\n return [x, y, maxCross];\n }\n\n // 每个flexLine的侧轴对齐,单行时就是一行对齐\n __crossAlign(line, alignItems, isDirectionRow, maxCross) {\n let baseline = 0;\n line.forEach(item => {\n baseline = Math.max(baseline, item.firstBaseline);\n });\n line.forEach(item => {\n let { currentStyle: { [ALIGN_SELF]: alignSelf } } = item;\n if(isDirectionRow) {\n if(alignSelf === 'flexStart' || alignSelf === 'flex-start') {}\n else if(alignSelf === 'flexEnd' || alignSelf === 'flex-end') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n else if(alignSelf === 'center') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff * 0.5, true);\n }\n }\n else if(alignSelf === 'stretch') {\n let { computedStyle, currentStyle: { [HEIGHT]: height } } = item;\n let {\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [MARGIN_TOP]: marginTop,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_TOP]: paddingTop,\n [PADDING_BOTTOM]: paddingBottom,\n } = computedStyle;\n if(height[1] === AUTO) {\n let old = item.height;\n let v = item.__height = computedStyle[HEIGHT] = maxCross - marginTop - marginBottom - paddingTop - paddingBottom - borderTopWidth - borderBottomWidth;\n let d = v - old;\n item.__sy4 += d;\n item.__sy5 += d;\n item.__sy6 += d;\n item.__height += d;\n item.__clientHeight += d;\n item.__offsetHeight += d;\n item.__outerHeight += d;\n }\n }\n else if(alignSelf === 'baseline') {\n let diff = baseline - item.firstBaseline;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n // 默认auto,取alignItems\n else {\n if(alignItems === 'flexStart' || alignSelf === 'flex-start') {}\n else if(alignItems === 'center') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff * 0.5, true);\n }\n }\n else if(alignItems === 'flexEnd' || alignItems === 'flex-end') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n else if(alignItems === 'baseline') {\n let diff = baseline - item.firstBaseline;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n // 默认stretch\n else {\n let { computedStyle, currentStyle: {\n [DISPLAY]: display,\n [FLEX_DIRECTION]: flexDirection,\n [HEIGHT]: height,\n } } = item;\n // row的孩子还是flex且column且不定高时,如果高度<侧轴拉伸高度则重新布局\n if(isDirectionRow && display === 'flex' && flexDirection === 'column' && height[1] === AUTO && item.outerHeight < maxCross) {\n item.__layout(Object.assign(item.__layoutData, { h3: maxCross }));\n }\n let {\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [MARGIN_TOP]: marginTop,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_TOP]: paddingTop,\n [PADDING_BOTTOM]: paddingBottom,\n } = computedStyle;\n if(height[1] === AUTO) {\n let old = item.height;\n let v = maxCross - marginTop - marginBottom - paddingTop - paddingBottom - borderTopWidth - borderBottomWidth;\n let d = v - old;\n item.__sy4 += d;\n item.__sy5 += d;\n item.__sy6 += d;\n item.__height += d;\n item.__clientHeight += d;\n item.__offsetHeight += d;\n item.__outerHeight += d;\n }\n }\n }\n }\n // column\n else {\n if(alignSelf === 'flexStart' || alignSelf === 'flex-start') {}\n else if(alignSelf === 'flexEnd' || alignSelf === 'flex-end') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff, true);\n }\n }\n else if(alignSelf === 'center') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff * 0.5, true);\n }\n }\n else if(alignSelf === 'stretch') {\n let { computedStyle, currentStyle: { [WIDTH]: width } } = item;\n let {\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_LEFT]: marginLeft,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_LEFT]: paddingLeft,\n } = computedStyle;\n if(width[1] === AUTO) {\n let old = item.width;\n let v = item.__width = computedStyle[WIDTH] = maxCross - marginLeft - marginRight - paddingLeft - paddingRight - borderRightWidth - borderLeftWidth;\n let d = v - old;\n item.__sx4 += d;\n item.__sx5 += d;\n item.__sx6 += d;\n item.__width += d;\n item.__clientWidth += d;\n item.__offsetWidth += d;\n item.__outerWidth += d;\n }\n }\n else if(alignItems === 'baseline') {\n let diff = baseline - item.firstBaseline;\n if(diff !== 0) {\n item.__offsetX(diff, true);\n }\n }\n // 默认auto,取alignItems\n else {\n if(alignItems === 'flexStart' || alignSelf === 'flex-start') {}\n else if(alignItems === 'center') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff * 0.5, true);\n }\n }\n else if(alignItems === 'flexEnd' || alignItems === 'flex-end') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff, true);\n }\n }\n else if(alignItems === 'baseline') {\n let diff = baseline - item.firstBaseline;\n if(diff !== 0) {\n item.__offsetX(diff, true);\n }\n }\n // 默认stretch\n else {\n let { computedStyle, currentStyle: {\n [WIDTH]: width,\n } } = item;\n let {\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_LEFT]: marginLeft,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_LEFT]: paddingLeft,\n } = computedStyle;\n if(width[1] === AUTO) {\n let old = item.width;\n let v = item.__width = computedStyle[WIDTH] = maxCross - marginLeft - marginRight - paddingLeft - paddingRight - borderRightWidth - borderLeftWidth;\n let d = v - old;\n item.__sx4 += d;\n item.__sx5 += d;\n item.__sx6 += d;\n item.__width += d;\n item.__clientWidth += d;\n item.__offsetWidth += d;\n item.__outerWidth += d;\n }\n }\n }\n }\n });\n }\n\n /**\n * inline比较特殊,先简单顶部对齐,后续还需根据vertical和lineHeight计算y偏移\n * inlineBlock复用逻辑,可以设置w/h,在混排时表现不同,inlineBlock换行限制在规定的矩形内,\n * 且ib会在没设置width且换行的时候撑满上一行,即便内部尺寸没抵达边界\n * 而inline换行则会从父容器start处开始,且首尾可能占用矩形不同\n * 嵌套inline情况十分复杂,尾部mpb空白可能产生叠加情况,因此endSpace表示自身,\n * 然后根据是否在最后一个元素进行叠加父元素的,多层嵌套则多层尾部叠加,均以最后一个元素为依据判断\n * Text获取这个叠加的endSpace值即可,无需感知是否最后一个,外层(此处)进行逻辑封装\n * @param data\n * @param isAbs\n * @param isColumn\n * @param isInline\n * @private\n */\n __layoutInline(data, isAbs, isColumn, isInline) {\n let { flowChildren, currentStyle, computedStyle } = this;\n let { fixedWidth, fixedHeight, x, y, w, h, lx,\n lineBoxManager, endSpace, selfEndSpace } = this.__preLayout(data, isInline);\n // abs虚拟布局需预知width,固定可提前返回\n if(isAbs && fixedWidth) {\n this.__width = w;\n this.__ioSize(w);\n return;\n }\n let {\n [WIDTH]: width,\n } = currentStyle;\n let {\n [TEXT_ALIGN]: textAlign,\n [WHITE_SPACE]: whiteSpace,\n [LINE_CLAMP]: lineClamp,\n [LINE_HEIGHT]: lineHeight,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_RIGHT]: marginRight,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_RIGHT]: paddingRight,\n } = computedStyle;\n let lineClampCount = data.lineClampCount || 0;\n if(isInline && !this.__isRealInline()) {\n isInline = false;\n }\n // 只有inline的孩子需要考虑换行后从行首开始,而ib不需要,因此重置行首标识lx为x,末尾空白为0\n // 而inline的LineBoxManager复用最近非inline父dom的,ib需要重新生成,末尾空白叠加\n if(isInline) {\n this.__config[NODE_IS_INLINE] = true;\n this.__lineBoxManager = lineBoxManager;\n let baseline = css.getBaseline(computedStyle);\n // 特殊inline调用,有内容的话(如左右mbp),默认生成一个lineBox,即便是空,也要形成占位,只有开头时需要\n if(marginLeft || marginRight\n || paddingLeft || paddingRight\n || borderLeftWidth || borderRightWidth) {\n if(lineBoxManager.isNewLine) {\n lineBoxManager.genLineBoxByInlineIfNewLine(x, y, lineHeight, baseline);\n }\n else {\n lineBoxManager.setLbByInlineIfNotNewLine(lineHeight, baseline);\n }\n }\n else {\n lineBoxManager.setLbByInlineIfNotNewLine(lineHeight, baseline);\n }\n lineClamp = data.lineClamp || 0;\n }\n else {\n lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseline(computedStyle));\n lx = x;\n endSpace = selfEndSpace = lineClampCount = 0;\n }\n // 存LineBox里的内容列表专用,布局过程中由lineBoxManager存入,递归情况每个inline节点都保存contentBox\n let contentBoxList;\n if(isInline) {\n contentBoxList = this.__contentBoxList = [];\n lineBoxManager.pushContentBoxList(this);\n }\n // ib的bp是自己,inline是最近的非inline\n let bp = this;\n while(bp.computedStyle[DISPLAY] === 'inline') {\n bp = bp.domParent;\n }\n let {\n [OVERFLOW]: overflow,\n [TEXT_OVERFLOW]: textOverflow,\n } = bp.computedStyle;\n let isIbFull = false; // ib时不限定w情况下发生折行则撑满行,即便内容没有撑满边界\n let length = flowChildren.length;\n let ignoreNextLine = false; // lineClamp超过后,后面的均忽略并置none,注意ib内部自己统计类似block\n let ignoreNextWrap = false; // whiteSpace单行超过后,后面的均忽略并置none,注意和block不一样不隔断\n let hasAddEndSpace; // 最后一行生效,只加1次防重复\n flowChildren.forEach((item, i) => {\n // 和block不太一样可以提前判断,因为不可能包含block隔断区域了\n if(ignoreNextLine || ignoreNextWrap) {\n item.__layoutNone();\n return;\n }\n let isXom = item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom;\n let isInline2 = isXom && item.currentStyle[DISPLAY] === 'inline';\n let isInlineBlock2 = isXom && ['inlineBlock', 'inline-block'].indexOf(item.currentStyle[DISPLAY]) > -1;\n let isRealInline = isInline2 && item.__isRealInline();\n // 最后一个元素会产生最后一行,叠加父元素的尾部mpb,注意只执行一次防止重复叠加\n let isEnd = isInline && !hasAddEndSpace\n && (whiteSpace === 'nowrap' || (!isXom && i === length - 1)\n || ((lineClamp && i === length - 1) || lineClampCount === lineClamp - 1));\n if(isEnd) {\n hasAddEndSpace = true;\n endSpace += selfEndSpace;\n }\n let lastLineClampCount = lineClampCount;\n if(isXom) {\n if(!isInline2 && !isInlineBlock2) {\n item.currentStyle[DISPLAY] = item.computedStyle[DISPLAY] = 'inlineBlock';\n isInlineBlock2 = true;\n inject.warn('Inline can not contain block/flex');\n }\n // x开头或者nowrap单行,不用考虑是否放得下直接放,因为有beginSpace所以要多判断i为0\n if(x === lx || !i || whiteSpace === 'nowrap') {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isAbs, isColumn);\n // 同block布局\n if(item.__isIbFull) {\n lineClampCount++;\n }\n if(item.__isIbFull && whiteSpace !== 'nowrap') {\n w[1] === AUTO && (isIbFull = true);\n lineBoxManager.addItem(item, true);\n x = lx;\n y += item.outerHeight;\n lineBoxManager.setNotEnd();\n }\n // inline和不折行的ib,其中ib需要手动存入当前lb中,以计算宽度\n else {\n (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item, false);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n if(!isAbs && overflow === 'hidden' && whiteSpace === 'nowrap'\n && (x - lx > w + (1e-10) || lineClampCount > lastLineClampCount)) {\n ignoreNextWrap = true;\n }\n else if(lineClamp && lineClampCount >= lineClamp) {\n ignoreNextLine = true;\n }\n }\n else {\n // 不换行继续排,换行非开头先尝试是否放得下,结尾要考虑mpb因此减去endSpace\n let fw = item.__tryLayInline(w - x + lx - endSpace, w);\n // 放得下继续\n if(fw >= (-1e-10)) {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isAbs, isColumn);\n if(lineClamp && lineClampCount >= lineClamp) {\n ignoreNextLine = true;\n }\n // ib放得下要么内部没有折行,要么声明了width限制,都需手动存入当前lb\n (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item, false);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n // 放不下处理之前的lineBox,并重新开头\n else {\n lineClampCount++;\n x = lx;\n y = lineBoxManager.endY;\n lineBoxManager.setNewLine();\n // 可能超行了,无需继续,并且进行回溯\n if(lineClamp && lineClampCount >= lineClamp) {\n item.__layoutNone();\n ignoreNextLine = true;\n let list = lineBoxManager.list;\n let lineBox = list[list.length - 1];\n backtrack(bp, lineBoxManager, lineBox, w, endSpace);\n return;\n }\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isAbs, isColumn);\n // 重新开头的ib和上面开头处一样逻辑\n if(item.__isIbFull) {\n lineBoxManager.addItem(item, true);\n x = lx;\n y += item.outerHeight;\n lineBoxManager.setNotEnd();\n lineClampCount++;\n }\n // inline和不折行的ib,其中ib需要手动存入当前lb中\n else {\n (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item, false);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n if(lineClamp && lineClampCount >= lineClamp) {\n ignoreNextLine = true;\n }\n }\n }\n }\n // inline里的其它只有文本,可能开始紧跟着之前的x,也可能换行后从lx行头开始\n // 紧跟着x可能出现在前面有节点换行后第2行,此时不一定放得下,因此不能作为判断依据,开头仅有lx\n else {\n let n = lineBoxManager.size;\n // i为0时强制不换行\n if(x === lx || !i || whiteSpace === 'nowrap') {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isAbs, isColumn);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n // ib情况发生折行,且非定宽\n if(!isInline && (lineBoxManager.size - n) > 1 && width[1] === AUTO) {\n isIbFull = true;\n }\n if(!isAbs && overflow === 'hidden' && whiteSpace === 'nowrap'\n && (x - lx > w + (1e-10) || lineClampCount > lastLineClampCount)) {\n ignoreNextWrap = true;\n }\n else if(lineClamp && lineClampCount >= lineClamp) {\n ignoreNextLine = true;\n }\n }\n else {\n // 非开头先尝试是否放得下,如果放得下再看是否end,加end且只有1个字时放不下要换行,否则可以放,换行由text内部做\n let fw = item.__tryLayInline(w + lx - x - endSpace);\n // 放得下继续\n if(fw >= (-1e-10)) {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isAbs, isColumn);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n if(lineClamp && lineClampCount >= lineClamp) {\n ignoreNextLine = true;\n }\n // 这里ib放得下一定是要么没换行要么固定宽度,所以无需判断isIbFull\n }\n // 放不下处理之前的lineBox,并重新开头\n else {\n lineClampCount++;\n x = lx;\n y = lineBoxManager.endY;\n lineBoxManager.setNewLine();\n // 可能超行了,无需继续,并且进行回溯\n if(lineClamp && lineClampCount >= lineClamp) {\n item.__layoutNone();\n ignoreNextLine = true;\n let list = lineBoxManager.list;\n let lineBox = list[list.length - 1];\n backtrack(bp, lineBoxManager, lineBox, w, endSpace);\n return;\n }\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isAbs, isColumn);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n // ib情况发生折行\n if(!isInline && (lineBoxManager.size - n) > 1 && width[1] === AUTO) {\n isIbFull = true;\n }\n if(lineClamp && lineClampCount >= lineClamp) {\n ignoreNextLine = true;\n }\n }\n }\n }\n });\n // 同block结尾,不过这里一定是lineBox结束,无需判断\n y = lineBoxManager.endY;\n // 标识ib情况同block一样占满行\n this.__isIbFull = isIbFull;\n // 元素的width在固定情况或者ibFull情况已被计算出来,否则为最大延展尺寸,inline没有固定尺寸概念\n let tw, th;\n if(isInline) {\n // inline最后的x要算上右侧mpb,为next行元素提供x坐标基准,同时其尺寸计算比较特殊\n if(selfEndSpace) {\n lineBoxManager.addX(selfEndSpace);\n }\n // 如果没有内容,空白还要加上开头即左侧mpb\n if(!flowChildren.length) {\n let {\n [MARGIN_LEFT]: marginLeft,\n [PADDING_LEFT]: paddingLeft,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = computedStyle;\n lineBoxManager.addX(marginLeft + paddingLeft + borderLeftWidth);\n }\n // 结束出栈contentBox,递归情况结束子inline获取contentBox,父inline继续\n lineBoxManager.popContentBoxList();\n // abs非固定w时预计算,本来是最近非inline父层统一计算,但在abs时不算,\n if(isAbs) {\n this.__inlineSize();\n }\n }\n else {\n // ib在满时很特殊,取最大值,可能w本身很小不足排下1个字符,此时要用maxW\n let maxW = lineBoxManager.__maxX - data.x;\n tw = this.__width = fixedWidth ? w : (isIbFull ? Math.max(w, maxW) : maxW);\n th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\n }\n // 非abs提前虚拟布局,真实布局情况下最后为所有行内元素进行2个方向上的对齐,inline会被父级调用这里只看ib\n if(!isAbs && !isInline) {\n lineBoxManager.verticalAlign();\n if(['center', 'right'].indexOf(textAlign) > -1) {\n lineBoxManager.horizonAlign(tw, textAlign);\n // 直接text需计算size\n flowChildren.forEach(item => {\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n if(item instanceof Text) {\n item.__inlineSize();\n }\n });\n }\n // block的所有inline计算size\n lineBoxManager.domList.forEach(item => {\n item.__inlineSize(tw, textAlign);\n });\n }\n // inlineBlock新开上下文,但父级block遇到要处理换行\n return lineClampCount;\n }\n\n /**\n * inline的尺寸计算非常特殊,并非一个矩形区域,而是由字体行高结合节点下多个LineBox中的内容决定,\n * 且这个尺寸又并非真实LineBox中的内容直接合并计算而来,比如包含了个更大尺寸的ib却不会计入\n * 具体方法为遍历持有的LineBox下的内容,x取两侧极值,同时首尾要考虑mpb,y值取上下极值,同样首尾考虑mpb\n * 首尾行LineBox可能不是不是占满一行,比如前后都有同行inline的情况,非首尾行则肯定占满\n * 绘制内容(如背景色)的区域也很特殊,每行LineBox根据lineHeight对齐baseline得来,并非LineBox全部\n * 当LineBox只有直属Text时如果font没有lineGap则等价于全部,如有则需减去\n * 另外其client/offset/outer的w/h尺寸计算也很特殊,皆因首尾x方向的mpb导致\n * @private\n */\n __inlineSize(tw, textAlign) {\n let { contentBoxList, computedStyle, __ox, __oy } = this;\n let {\n [DISPLAY]: display,\n [MARGIN_TOP]: marginTop,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_BOTTOM]: marginBottom,\n [MARGIN_LEFT]: marginLeft,\n [PADDING_TOP]: paddingTop,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_BOTTOM]: paddingBottom,\n [PADDING_LEFT]: paddingLeft,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n // 可能因为Ellipsis回溯变成none\n if(display === 'none') {\n return;\n }\n // x/clientX/offsetX/outerX\n let maxX, maxY, minX, minY, maxCX, maxCY, minCX, minCY, maxFX, maxFY, minFX, minFY, maxOX, maxOY, minOX, minOY;\n let length = contentBoxList.length;\n if(length) {\n // 遍历contentBox,里面存的是LineBox内容,根据父LineBox引用判断是否换行\n contentBoxList.forEach((item, i) => {\n // 非第一个除了minY不用看其它都要,minX是换行导致,而maxX在最后一个要考虑右侧mpb,中间的无需考虑嵌套inline的mpb\n if(i) {\n minX = Math.min(minX, item.x);\n minCX = Math.min(minCX, item.x);\n minFX = Math.min(minFX, item.x);\n minOX = Math.min(minOX, item.x);\n if(i === length - 1) {\n maxX = maxCX = maxFX = maxOX = Math.max(maxX, item.x + item.outerWidth);\n maxY = maxCY = maxFY = maxOY = Math.max(maxY, item.y + item.outerHeight);\n maxCX += paddingRight;\n maxCY += paddingBottom;\n maxFX += paddingRight + borderRightWidth;\n maxFY += paddingBottom + borderBottomWidth;\n maxOX += borderRightWidth + paddingRight + marginRight\n maxOY += borderBottomWidth + paddingBottom + marginBottom;\n }\n else {\n maxX = maxCX = maxFX = maxOX = Math.max(maxX, item.x + item.outerWidth);\n }\n }\n // 第一个初始化\n else {\n minX = item.x;\n minY = item.y;\n minCX = minX - paddingLeft;\n minCY = minY - paddingTop;\n minFX = minCX - borderLeftWidth;\n minFY = minCY - borderTopWidth;\n minOX = minFX - marginLeft;\n minOY = minFY - marginTop;\n maxX = maxCX = maxFX = maxOX = item.x + item.outerWidth;\n maxY = maxCY = maxFY = maxOY = item.y + item.outerHeight;\n if(i === length - 1) {\n maxCX += paddingRight;\n maxCY += paddingBottom;\n maxFX += paddingRight + borderRightWidth;\n maxFY += paddingBottom + borderBottomWidth;\n maxOX += borderRightWidth + paddingRight + marginRight\n maxOY += borderBottomWidth + paddingBottom + marginBottom;\n }\n }\n });\n this.__x = minOX;\n this.__y = minOY;\n this.__width = computedStyle[WIDTH] = maxX - minX;\n // 防止比自己最小高度lineHeight还小,比如内容是个小字体\n this.__height = computedStyle[HEIGHT] = Math.max(lineHeight, maxY - minY);\n this.__clientWidth = maxCX - minCX;\n this.__clientHeight = maxCY - minCY;\n this.__offsetWidth = maxFX - minFX;\n this.__offsetHeight = maxFY - minFY;\n this.__outerWidth = maxOX - minOX;\n this.__outerHeight = maxOY - minOY;\n this.__sx = minOX + __ox;\n this.__sy = minOY + __oy;\n this.__sx1 = minFX + __ox;\n this.__sy1 = minFY + __oy;\n this.__sx2 = minCX + __ox;\n this.__sy2 = minCY + __oy;\n this.__sx3 = minX + __ox;\n this.__sy3 = minY + __oy;\n this.__sx4 = maxX + __ox;\n this.__sy4 = maxY + __oy;\n this.__sx5 = maxCX + __ox;\n this.__sy5 = maxCY + __oy;\n this.__sx6 = maxFX + __ox;\n this.__sy6 = maxFY + __oy;\n // inline的text整体设置相同\n if(['center', 'right'].indexOf(textAlign) > -1) {\n this.children.forEach(item => {\n if(item instanceof Text) {\n item.__inlineSize();\n }\n });\n }\n }\n // 如果没有内容,宽度为0高度为lineHeight,对齐也特殊处理,lineBoxManager不会处理\n else {\n if(['center', 'right'].indexOf(textAlign) > -1) {\n let diff = tw;\n if(textAlign === 'center') {\n diff *= 0.5;\n }\n if(diff) {\n this.__offsetX(diff, true);\n }\n }\n this.__width = computedStyle[WIDTH] = 0;\n let th = this.__height = computedStyle[HEIGHT] = lineHeight;\n this.__ioSize(0, th);\n this.__sy -= marginTop + paddingTop + borderTopWidth;\n this.__sx1 = this.sx + marginLeft;\n this.__sy1 = this.sy + marginTop;\n this.__sx2 = this.__sx1 + borderLeftWidth;\n this.__sy2 = this.__sy1 + borderTopWidth;\n this.__sx4 = this.__sx3 = this.__sx2 + paddingLeft;\n this.__sy4 = this.__sy3 = this.__sy2 + paddingTop;\n this.__sx5 = this.__sx4 + paddingRight;\n this.__sy5 = this.__sy4 + th + paddingBottom;\n this.__sx6 = this.__sx5 + borderRightWidth;\n this.__sy6 = this.__sy5 + borderBottomWidth;\n this.__clientWidth = this.__sx5 - this.__sx2;\n this.__clientHeight = this.__sy5 - this.__sy2;\n this.__offsetWidth = this.__sx6 - this.__sx1;\n this.__offsetHeight = this.__sy6 - this.__sy1;\n this.__outerWidth = this.__offsetWidth + marginLeft + marginRight;\n this.__outerHeight = this.__offsetHeight + marginTop + marginBottom;\n }\n }\n\n /**\n * 只针对绝对定位children布局\n * @param container\n * @param data\n * @param target 可选,只针对某个abs的child特定布局,在局部更新时用\n * @private\n */\n __layoutAbs(container, data, target) {\n let { sx: x, sy: y, clientWidth, clientHeight, computedStyle } = container;\n let { isDestroyed, children, absChildren } = this;\n let {\n [DISPLAY]: display,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [MARGIN_TOP]: marginTop,\n [MARGIN_LEFT]: marginLeft,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_TOP]: paddingTop,\n } = computedStyle;\n if(isDestroyed || display === 'none') {\n this.__layoutNone();\n return;\n }\n x += marginLeft + borderLeftWidth;\n y += marginTop + borderTopWidth;\n // 对absolute的元素进行相对容器布局\n absChildren.forEach(item => {\n if(target) {\n // 传入target局部布局更新,这时候如果是Component引发的,当setState时是Cp自身,当layout时是sr\n let node = item;\n if(node instanceof Component) {\n node = item.shadowRoot;\n }\n // 所以得2个都对比\n if(target !== node && target !== item) {\n return;\n }\n }\n let { currentStyle, computedStyle } = item;\n if(item.isDestroyed || currentStyle[DISPLAY] === 'none') {\n item.__layoutNone();\n return;\n }\n // 先根据容器宽度计算margin/padding,匿名块对象特殊处理,此时没有computedStyle\n computeReflow(item);\n item.__mp(currentStyle, computedStyle, clientWidth);\n let {\n [LEFT]: left,\n [TOP]: top,\n [RIGHT]: right,\n [BOTTOM]: bottom,\n [WIDTH]: width,\n [HEIGHT]: height,\n } = currentStyle;\n let x2, y2, w2, h2;\n let onlyRight;\n let onlyBottom;\n let fixedTop;\n let fixedRight;\n let fixedBottom;\n let fixedLeft;\n // 判断何种方式的定位,比如左+宽度,左+右之类\n if(left[1] !== AUTO) {\n fixedLeft = true;\n computedStyle[LEFT] = calAbsolute(currentStyle, 'left', left, clientWidth, this.root);\n }\n else {\n computedStyle[LEFT] = 'auto';\n }\n if(right[1] !== AUTO) {\n fixedRight = true;\n computedStyle[RIGHT] = calAbsolute(currentStyle, 'right', right, clientWidth, this.root);\n }\n else {\n computedStyle[RIGHT] = 'auto';\n }\n if(top[1] !== AUTO) {\n fixedTop = true;\n computedStyle[TOP] = calAbsolute(currentStyle, 'top', top, clientHeight, this.root);\n }\n else {\n computedStyle[TOP] = 'auto';\n }\n if(bottom[1] !== AUTO) {\n fixedBottom = true;\n computedStyle[BOTTOM] = calAbsolute(currentStyle, 'bottom', bottom, clientHeight, this.root);\n }\n else {\n computedStyle[BOTTOM] = 'auto';\n }\n // 优先级最高left+right,其次left+width,再次right+width,再次仅申明单个,最次全部auto\n if(fixedLeft && fixedRight) {\n x2 = x + computedStyle[LEFT];\n w2 = clientWidth - computedStyle[RIGHT] - computedStyle[LEFT];\n }\n else if(fixedLeft) {\n x2 = x + computedStyle[LEFT];\n if(width[1] !== AUTO) {\n w2 = calAbsFixedSize(width, clientWidth, this.root);\n }\n }\n else if(fixedRight) {\n if(width[1] !== AUTO) {\n w2 = calAbsFixedSize(width, clientWidth, this.root);\n }\n else {\n onlyRight = true;\n }\n x2 = x + clientWidth - computedStyle[RIGHT] - (w2 || 0);\n // 右对齐有尺寸时还需减去margin/border/padding的\n x2 -= computedStyle[MARGIN_LEFT];\n x2 -= computedStyle[MARGIN_RIGHT];\n x2 -= computedStyle[PADDING_LEFT];\n x2 -= computedStyle[PADDING_RIGHT];\n x2 -= computedStyle[BORDER_LEFT_WIDTH];\n x2 -= computedStyle[BORDER_RIGHT_WIDTH];\n }\n else {\n x2 = x + paddingLeft;\n if(width[1] !== AUTO) {\n w2 = calAbsFixedSize(width, clientWidth, this.root);\n }\n }\n // top/bottom/height优先级同上\n if(fixedTop && fixedBottom) {\n y2 = y + computedStyle[TOP];\n h2 = clientHeight - computedStyle[TOP] - computedStyle[BOTTOM];\n }\n else if(fixedTop) {\n y2 = y + computedStyle[TOP];\n if(height[1] !== AUTO) {\n h2 = calAbsFixedSize(height, clientHeight, this.root);\n }\n }\n else if(fixedBottom) {\n if(height[1] !== AUTO) {\n h2 = calAbsFixedSize(height, clientHeight, this.root);\n }\n else {\n onlyBottom = true;\n }\n y2 = y + clientHeight - computedStyle[BOTTOM] - (h2 || 0);\n // 底对齐有尺寸时y值还需减去margin/border/padding的\n y2 -= computedStyle[MARGIN_TOP];\n y2 -= computedStyle[MARGIN_BOTTOM];\n y2 -= computedStyle[PADDING_TOP];\n y2 -= computedStyle[PADDING_BOTTOM];\n y2 -= computedStyle[BORDER_TOP_WIDTH];\n y2 -= computedStyle[BORDER_BOTTOM_WIDTH];\n }\n // 未声明y的找到之前的流布局child,紧随其下\n else {\n y2 = y + paddingTop;\n let prev = item.prev;\n while(prev) {\n // 以前面的flow的最近的prev末尾为准\n if(prev instanceof Text || prev.computedStyle[POSITION] !== 'absolute') {\n y2 = prev.y + prev.outerHeight;\n break;\n }\n prev = prev.prev;\n }\n if(height[1] !== AUTO) {\n h2 = calAbsFixedSize(height, clientHeight, this.root);\n }\n }\n // onlyRight时做的布局其实是以那个点位为left/top布局然后offset,limit要特殊计算,从本点向左侧为边界\n let widthLimit = onlyRight ? x2 - x : clientWidth + x - x2;\n // onlyBottom相同,正常情况是左上到右下的尺寸限制\n let heightLimit = onlyBottom ? y2 - y : clientHeight + y - y2;\n // 未直接或间接定义尺寸,取特殊孩子宽度的最大值,同时不能超限\n if(w2 === undefined) {\n item.__layout({\n x: x2,\n y: y2,\n w: widthLimit,\n h: heightLimit,\n }, true, false);\n widthLimit = item.outerWidth;\n }\n item.__layout({\n x: x2,\n y: y2,\n w: widthLimit,\n h: heightLimit,\n w2, // left+right这种等于有宽度,但不能修改style,继续传入到__preLayout中特殊对待\n h2,\n }, false, false);\n if(onlyRight) {\n item.__offsetX(-item.outerWidth, true);\n }\n if(onlyBottom) {\n item.__offsetY(-item.outerHeight, true);\n }\n });\n // 递归进行,遇到absolute/relative/component的设置新容器\n children.forEach(item => {\n if(target) {\n // 传入target局部布局更新,这时候如果是Component引发的,当setState时是Cp自身,当layout时是sr\n let node = item;\n if(node instanceof Component) {\n node = item.shadowRoot;\n }\n // 所以得2个都对比\n if(target !== node && target !== item) {\n return;\n }\n }\n if(item instanceof Dom) {\n item.__layoutAbs(isRelativeOrAbsolute(item) ? item : container, data);\n }\n else if(item instanceof Component) {\n let sr = item.shadowRoot;\n if(sr instanceof Dom) {\n sr.__layoutAbs(sr, data);\n }\n }\n });\n // 根节点自己特殊执行,不在layout统一\n this.__execAr();\n }\n\n render(renderMode, lv, ctx, cache, dx, dy) {\n let res = super.render(renderMode, lv, ctx, cache, dx, dy);\n let ep = this.__ellipsis;\n if(ep) {\n ep.render(renderMode, lv, res.ctx, cache, dx, dy)\n }\n if(renderMode === SVG) {\n this.virtualDom.type = 'dom';\n }\n return res;\n }\n\n __destroy() {\n if(this.isDestroyed) {\n return;\n }\n this.children.forEach(child => {\n // 有可能为空,因为diff过程中相同的cp被移到新的vd中,老的防止destroy设null\n if(child) {\n child.__destroy();\n }\n });\n if(this.__ellipsis) {\n this.__ellipsis.__destroy();\n }\n super.__destroy();\n }\n\n __emitEvent(e, force) {\n if(force) {\n return super.__emitEvent(e, force);\n }\n let { isDestroyed, computedStyle, isMask } = this;\n if(isDestroyed || computedStyle[DISPLAY] === 'none' || e.__stopPropagation || isMask) {\n return;\n }\n // 检查perspective嵌套状态,自身有perspective则设置10位,自身有transform的p矩阵则设置01位\n // if(computedStyle[PERSPECTIVE]) {\n // perspectiveNest++;\n // }\n // if(tf.isPerspectiveMatrix(computedStyle[TRANSFORM])) {\n // perspectiveTfNest++;\n // }\n // overflow:hidden时还需要判断是否超出范围外,如果是则无效\n if(computedStyle[OVERFLOW] === 'hidden' && !this.willResponseEvent(e, true)) {\n return;\n }\n // 找到对应的callback\n let { event: { type } } = e;\n let { listener, zIndexChildren } = this;\n let cb;\n if(listener.hasOwnProperty(type)) {\n cb = listener[type];\n }\n // child触发则parent一定触发\n for(let i = zIndexChildren.length - 1; i >=0; i--) {\n let child = zIndexChildren[i];\n if(child instanceof Xom\n || child instanceof Component && child.shadowRoot instanceof Xom) {\n if(child.__emitEvent(e)) {\n // 孩子阻止冒泡\n if(e.__stopPropagation) {\n return;\n }\n if(isFunction(cb) && !e.__stopImmediatePropagation) {\n cb.call(this, e);\n }\n return true;\n }\n }\n }\n // child不触发再看自己\n return super.__emitEvent(e);\n }\n\n // 深度遍历执行所有子节点,包含自己,如果cb返回true,提前跳出不继续深度遍历\n __deepScan(cb, options) {\n if(super.__deepScan(cb, options)) {\n return;\n }\n this.children.forEach(node => {\n node.__deepScan(cb, options);\n });\n }\n\n appendChild(json, cb) {\n let self = this;\n if(!isNil(json) && !self.isDestroyed) {\n let { root, host } = self;\n if([$$type.TYPE_VD, $$type.TYPE_GM, $$type.TYPE_CP].indexOf(json.$$type) > -1) {\n if(json.vd) {\n root.delRefreshTask(json.vd.__task);\n json.vd.remove();\n }\n let vd;\n if($$type.TYPE_CP === json.$$type) {\n vd = builder.initCp2(json, root, host, self);\n }\n else {\n vd = builder.initDom(json, root, host, self);\n }\n root.addRefreshTask(vd.__task = {\n __before() {\n vd.__task = null; // 清除在before,防止after的回调增加新的task误删\n self.__json.children.push(json);\n let len = self.children.length;\n if(len) {\n let last = self.children[len - 1];\n last.__next = vd;\n vd.__prev = last;\n }\n self.children.push(vd);\n self.__zIndexChildren = null;\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = vd;\n res[UPDATE_FOCUS] = level.REFLOW;\n res[UPDATE_ADD_DOM] = true;\n res[UPDATE_CONFIG] = vd.__config;\n root.__addUpdate(vd, vd.__config, root, root.__config, res);\n },\n __after(diff) {\n if(isFunction(cb)) {\n cb.call(vd, diff);\n }\n },\n });\n }\n else {\n throw new Error('Invalid parameter in appendChild.');\n }\n }\n }\n\n prependChild(json, cb) {\n let self = this;\n if(!isNil(json) && !self.isDestroyed) {\n let { root, host } = self;\n if([$$type.TYPE_VD, $$type.TYPE_GM, $$type.TYPE_CP].indexOf(json.$$type) > -1) {\n if(json.vd) {\n root.delRefreshTask(json.vd.__task);\n json.vd.remove();\n }\n let vd;\n if($$type.TYPE_CP === json.$$type) {\n vd = builder.initCp2(json, root, host, self);\n }\n else {\n vd = builder.initDom(json, root, host, self);\n }\n root.addRefreshTask(vd.__task = {\n __before() {\n vd.__task = null;\n self.__json.children.unshift(json);\n let len = self.children.length;\n if(len) {\n let first = self.children[0];\n first.__prev = vd;\n vd.__next = first;\n }\n self.children.unshift(vd);\n self.__zIndexChildren = null;\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = vd;\n res[UPDATE_FOCUS] = level.REFLOW;\n res[UPDATE_ADD_DOM] = true;\n res[UPDATE_CONFIG] = vd.__config;\n root.__addUpdate(vd, vd.__config, root, root.__config, res);\n },\n __after(diff) {\n if(isFunction(cb)) {\n cb.call(vd, diff);\n }\n },\n });\n }\n else {\n throw new Error('Invalid parameter in prependChild.');\n }\n }\n }\n\n insertBefore(json, cb) {\n let self = this;\n if(!isNil(json) && !self.isDestroyed && self.domParent) {\n let { root, domParent } = self;\n let host = domParent.hostRoot;\n if([$$type.TYPE_VD, $$type.TYPE_GM, $$type.TYPE_CP].indexOf(json.$$type) > -1) {\n if(json.vd) {\n root.delRefreshTask(json.vd.__task);\n json.vd.remove();\n }\n let vd;\n if($$type.TYPE_CP === json.$$type) {\n vd = builder.initCp2(json, root, host, domParent);\n }\n else {\n vd = builder.initDom(json, root, host, domParent);\n }\n root.addRefreshTask(vd.__task = {\n __before() {\n vd.__task = null;\n let i = 0, has, __json = domParent.__json, children = __json.children, len = children.length;\n let pJson = self.isShadowRoot ? self.hostRoot.__json : self.__json;\n for(; i < len; i++) {\n if(children[i] === pJson) {\n has = true;\n break;\n }\n }\n if(!has) {\n throw new Error('InsertBefore exception.');\n }\n // 插入注意开头位置处理\n if(i) {\n children.splice(i, 0, json);\n vd.__next = self;\n vd.__prev = self.__prev;\n self.__prev = vd;\n domParent.children.splice(i, 0, vd);\n }\n else {\n if(len) {\n let first = domParent.children[0];\n first.__prev = vd;\n vd.__next = first;\n }\n children.unshift(json);\n domParent.children.unshift(vd);\n }\n domParent.__zIndexChildren = null;\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = vd;\n res[UPDATE_FOCUS] = level.REFLOW;\n res[UPDATE_ADD_DOM] = true;\n res[UPDATE_CONFIG] = vd.__config;\n root.__addUpdate(vd, vd.__config, root, root.__config, res);\n },\n __after(diff) {\n if(isFunction(cb)) {\n cb.call(vd, diff);\n }\n },\n });\n }\n else {\n throw new Error('Invalid parameter in insertBefore.');\n }\n }\n }\n\n insertAfter(json, cb) {\n let self = this;\n if(!isNil(json) && !self.isDestroyed && self.domParent) {\n let { root, domParent } = self;\n let host = domParent.hostRoot;\n if([$$type.TYPE_VD, $$type.TYPE_GM, $$type.TYPE_CP].indexOf(json.$$type) > -1) {\n if(json.vd) {\n root.delRefreshTask(json.vd.__task);\n json.vd.remove();\n }\n let vd;\n if($$type.TYPE_CP === json.$$type) {\n vd = builder.initCp2(json, root, host, domParent);\n }\n else {\n vd = builder.initDom(json, root, host, domParent);\n }\n root.addRefreshTask(vd.__task = {\n __before() {\n vd.__task = null;\n let i = 0, has, __json = domParent.__json, children = __json.children, len = children.length;\n let pJson = self.isShadowRoot ? self.hostRoot.__json : self.__json;\n for(; i < len; i++) {\n if(children[i] === pJson) {\n has = true;\n break;\n }\n }\n if(!has) {\n throw new Error('insertAfter exception.');\n }\n // 插入注意末尾位置处理\n if(i < len - 1) {\n children.splice(i + 1, 0, json);\n vd.__prev = self;\n vd.__next = self.__next;\n self.__next = vd;\n domParent.children.splice(i + 1, 0, vd);\n }\n else {\n if(len) {\n let last = domParent.children[len - 1];\n last.__next = vd;\n vd.__prev = last;\n }\n children.push(json);\n domParent.children.push(vd);\n }\n domParent.__zIndexChildren = null;\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = vd;\n res[UPDATE_FOCUS] = level.REFLOW;\n res[UPDATE_ADD_DOM] = true;\n res[UPDATE_CONFIG] = vd.__config;\n root.__addUpdate(vd, vd.__config, root, root.__config, res);\n },\n __after(diff) {\n if(isFunction(cb)) {\n cb.call(vd, diff);\n }\n },\n });\n }\n else {\n throw new Error('Invalid parameter in insertAfter.');\n }\n }\n }\n\n removeChild(target, cb) {\n if(target.parent === this && (target instanceof Xom || target instanceof Component)) {\n if(this.isDestroyed) {\n inject.warn('Remove parent is destroyed.');\n if(isFunction(cb)) {\n cb();\n }\n return;\n }\n target.remove(cb);\n }\n else {\n throw new Error('Invalid parameter in removeChild.');\n }\n }\n\n get children() {\n return this.__children;\n }\n\n get flowChildren() {\n return this.children.filter(item => {\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n return item instanceof Text || item.currentStyle[POSITION] !== 'absolute';\n });\n }\n\n get absChildren() {\n return this.children.filter(item => {\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n return item instanceof Xom && item.currentStyle[POSITION] === 'absolute';\n });\n }\n\n get zIndexChildren() {\n return this.__zIndexChildren;\n }\n\n get lineBoxManager() {\n return this.__lineBoxManager;\n }\n\n get baseline() {\n if(!this.lineBoxManager || !this.lineBoxManager.size) {\n return this.offsetHeight;\n }\n let {\n [MARGIN_TOP]: marginTop,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [PADDING_TOP]: paddingTop,\n } = this.computedStyle;\n return marginTop + borderTopWidth + paddingTop + this.lineBoxManager.baseline;\n }\n\n get firstBaseline() {\n if(!this.lineBoxManager || !this.lineBoxManager.size) {\n return this.offsetHeight;\n }\n let {\n [MARGIN_TOP]: marginTop,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [PADDING_TOP]: paddingTop,\n } = this.computedStyle;\n return marginTop + borderTopWidth + paddingTop + this.lineBoxManager.firstBaseline;\n }\n}\n\nexport default Dom;\n","import Dom from './Dom';\nimport mode from '../refresh/mode';\nimport painter from '../util/painter';\nimport inject from '../util/inject';\nimport util from '../util/util';\nimport enums from '../util/enums';\nimport unit from '../style/unit';\nimport image from '../style/image';\nimport border from '../style/border';\nimport level from '../refresh/level';\nimport mx from '../math/matrix';\nimport geom from '../math/geom';\nimport css from '../style/css';\n\nconst {\n STYLE_KEY: {\n WIDTH,\n HEIGHT,\n DISPLAY,\n BORDER_TOP_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_LEFT_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_TOP_LEFT_RADIUS,\n BORDER_TOP_RIGHT_RADIUS,\n BORDER_BOTTOM_RIGHT_RADIUS,\n BORDER_BOTTOM_LEFT_RADIUS,\n VISIBILITY,\n BACKGROUND_IMAGE,\n BACKGROUND_COLOR,\n BOX_SHADOW,\n MIX_BLEND_MODE,\n MARGIN_RIGHT,\n MARGIN_LEFT,\n PADDING_RIGHT,\n PADDING_LEFT,\n FONT_SIZE,\n FLEX_BASIS,\n },\n UPDATE_KEY: {\n UPDATE_NODE,\n UPDATE_FOCUS,\n UPDATE_CONFIG,\n },\n NODE_KEY: {\n NODE_CACHE,\n NODE_DEFS_CACHE,\n NODE_IS_MASK,\n },\n} = enums;\nconst { AUTO, PX, PERCENT, REM, VW, VH, VMAX, VMIN, RGBA } = unit;\nconst { canvasPolygon, svgPolygon } = painter;\nconst { isFunction } = util;\nconst { computeReflow } = css;\n\nclass Img extends Dom {\n constructor(tagName, props) {\n super(tagName, props);\n let src = this.props.src;\n let loadImg = this.__loadImg = {\n src,\n };\n // 空url用错误图代替\n if(!src) {\n loadImg.error = true;\n }\n else {\n let ca = inject.IMG[src];\n if(ca && ca.state === inject.LOADED) {\n loadImg.source = ca.source;\n loadImg.width = ca.width;\n loadImg.height = ca.height;\n }\n }\n let config = this.__config;\n if(config[NODE_IS_MASK]) {\n let { style, currentStyle } = this;\n style[BACKGROUND_IMAGE] = currentStyle[BACKGROUND_IMAGE] = [null];\n style[BACKGROUND_COLOR] = currentStyle[BACKGROUND_COLOR] = [[0, 0, 0, 0], RGBA];\n style[BORDER_TOP_WIDTH] = currentStyle[BORDER_TOP_WIDTH] = [0, PX];\n style[BORDER_RIGHT_WIDTH] = currentStyle[BORDER_RIGHT_WIDTH] = [0, PX];\n style[BORDER_LEFT_WIDTH] = currentStyle[BORDER_LEFT_WIDTH] = [0, PX];\n style[BORDER_BOTTOM_WIDTH] = currentStyle[BORDER_BOTTOM_WIDTH] = [0, PX];\n style[BOX_SHADOW] = currentStyle[BOX_SHADOW] = null;\n style[MIX_BLEND_MODE] = currentStyle[MIX_BLEND_MODE] = 'normal';\n }\n }\n\n /**\n * 覆盖xom的方法,在__layout()3个分支中会首先被调用\n * 当样式中固定宽高时,图片按样式尺寸,加载后重新绘制即可\n * 只固定宽高一个时,加载完要计算缩放比,重新布局绘制\n * 都没有固定,按照图片尺寸,重新布局绘制\n * 这里计算非固定的情况,将其改为固定供布局渲染使用,未加载完成为0\n * @param data\n * @param isInline\n * @returns {{fixedWidth: boolean, w: *, x: *, h: *, y: *, fixedHeight: boolean}}\n * @private\n */\n __preLayout(data, isInline) {\n let res = super.__preLayout(data, isInline);\n let loadImg = this.__loadImg;\n // 可能已提前加载好了,或有缓存,为减少刷新直接使用\n if(!loadImg.error) {\n let src = loadImg.src;\n let cache = inject.IMG[src];\n if(cache && cache.state === inject.LOADED) {\n loadImg.source = cache.source;\n loadImg.width = cache.width;\n loadImg.height = cache.height;\n }\n loadImg.cache = false;\n }\n if(res.fixedWidth && res.fixedHeight) {\n return res;\n }\n if(loadImg.error && !this.props.placeholder) {\n if(res.fixedWidth) {\n res.h = res.w;\n }\n else if(res.fixedHeight) {\n res.w = res.h;\n }\n else {\n res.w = res.h = 32;\n }\n }\n else if(loadImg.source) {\n if(res.fixedWidth) {\n res.h = res.w * loadImg.height / loadImg.width;\n }\n else if(res.fixedHeight) {\n res.w = res.h * loadImg.width / loadImg.height;\n }\n else {\n res.w = loadImg.width;\n res.h = loadImg.height;\n }\n }\n else {\n res.w = res.h = 0;\n }\n res.fixedWidth = true;\n res.fixedHeight = true;\n return res;\n }\n\n __addGeom(tagName, props) {\n props = util.hash2arr(props);\n this.virtualDom.children.push({\n type: 'item',\n tagName,\n props,\n });\n }\n\n __destroy() {\n this.root.delRefreshTask(this.__task);\n super.__destroy();\n this.__task = null;\n }\n\n // img根据加载情况更新__hasContent\n __calContent(renderMode, lv, currentStyle, computedStyle) {\n let res = super.__calContent(renderMode, lv, currentStyle, computedStyle);\n if(!res) {\n let {\n __loadImg: loadImg,\n } = this;\n if(computedStyle[VISIBILITY] !== 'hidden' && (computedStyle[WIDTH] || computedStyle[HEIGHT])\n && loadImg.source) {\n res = true;\n }\n }\n return res;\n }\n\n render(renderMode, lv, ctx, cache, dx = 0, dy = 0) {\n let res = super.render(renderMode, lv, ctx, cache, dx, dy);\n if(renderMode === mode.WEBGL) {\n dx = res.dx;\n dy = res.dy;\n }\n let {\n offscreenBlend, offscreenMask, offscreenFilter, offscreenOverflow,\n } = res;\n let {\n width, height, isDestroyed,\n props: {\n placeholder,\n },\n computedStyle,\n computedStyle: {\n [DISPLAY]: display,\n [BORDER_TOP_LEFT_RADIUS]: borderTopLeftRadius,\n [BORDER_TOP_RIGHT_RADIUS]: borderTopRightRadius,\n [BORDER_BOTTOM_RIGHT_RADIUS]: borderBottomRightRadius,\n [BORDER_BOTTOM_LEFT_RADIUS]: borderBottomLeftRadius,\n [VISIBILITY]: visibility,\n },\n virtualDom,\n __config,\n __loadImg: loadImg,\n root,\n } = this;\n if(offscreenBlend) {\n ctx = offscreenBlend.target.ctx;\n }\n if(offscreenMask) {\n ctx = offscreenMask.target.ctx;\n }\n if(offscreenFilter) {\n ctx = offscreenFilter.target.ctx;\n }\n if(offscreenOverflow) {\n ctx = offscreenOverflow.target.ctx;\n }\n // 没source且不error时加载图片\n if(!loadImg.source && !loadImg.error && !loadImg.loading) {\n this.__loadAndRefresh(loadImg, root, ctx, placeholder, computedStyle, width, height);\n }\n if(isDestroyed || display === 'none' || visibility === 'hidden') {\n return res;\n }\n let __cache = __config[NODE_CACHE];\n if(cache && __cache && __cache.enabled) {\n ctx = __cache.ctx;\n }\n let originX, originY;\n originX = res.x3 + dx;\n originY = res.y3 + dy;\n // 根据配置以及占位图显示error\n let source = loadImg.source;\n if(loadImg.error && !placeholder && Img.showError) {\n let strokeWidth = Math.min(width, height) * 0.02;\n let stroke = '#CCC';\n let fill = '#DDD';\n let cx = originX + width * 0.7;\n let cy = originY + height * 0.3;\n let r = strokeWidth * 5;\n let pts = [\n [originX + width * 0.15, originY + height * 0.7],\n [originX + width * 0.3, originY + height * 0.4],\n [originX + width * 0.5, originY + height * 0.6],\n [originX + width * 0.6, originY + height * 0.5],\n [originX + width * 0.9, originY + height * 0.8],\n [originX + width * 0.15, originY + height * 0.8]\n ];\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n ctx.strokeStyle = stroke;\n ctx.lineWidth = strokeWidth;\n ctx.fillStyle = fill;\n ctx.beginPath();\n ctx.moveTo(originX, originY);\n ctx.lineTo(originX + width, originY);\n ctx.lineTo(originX + width, originY + height);\n ctx.lineTo(originX, originY + height);\n ctx.lineTo(originX, originY);\n ctx.stroke();\n ctx.closePath();\n ctx.beginPath();\n let points = geom.ellipsePoints(cx, cy, r, r);\n painter.canvasPolygon(ctx, points, 0, 0);\n ctx.fill();\n ctx.closePath();\n ctx.beginPath();\n ctx.moveTo(pts[0][0], pts[0][1]);\n for(let i = 1, len = pts.length; i < len; i++) {\n let point = pts[i];\n ctx.lineTo(point[0], point[1]);\n }\n ctx.lineTo(pts[0][0], pts[0][1]);\n ctx.fill();\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n this.__addGeom('rect', [\n ['x', originX],\n ['y', originY],\n ['width', width],\n ['height', height],\n ['stroke', stroke],\n ['stroke-width', strokeWidth],\n ['fill', 'rgba(0,0,0,0)']\n ]);\n this.__addGeom('circle', [\n ['cx', cx],\n ['cy', cy],\n ['r', r],\n ['fill', fill],\n ]);\n let s = '';\n for(let i = 0, len = pts.length; i < len; i++) {\n let point = pts[i];\n if(i) {\n s += ' ';\n }\n s += point[0] + ',' + point[1];\n }\n this.__addGeom('polygon', [\n ['points', s],\n ['fill', fill]\n ]);\n }\n }\n else if(source) {\n // 圆角需要生成一个mask\n let list = border.calRadius(originX, originY, width, height,\n borderTopLeftRadius, borderTopRightRadius, borderBottomRightRadius, borderBottomLeftRadius);\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n // 有border-radius需模拟遮罩裁剪\n if(list) {\n ctx.save();\n ctx.beginPath();\n canvasPolygon(ctx, list, dx, dy);\n ctx.clip();\n ctx.closePath();\n ctx.drawImage(source, originX, originY, width, height);\n ctx.restore();\n }\n else {\n ctx.drawImage(source, originX, originY, width, height);\n }\n }\n else if(renderMode === mode.SVG) {\n // img没有变化无需diff,直接用上次的vd\n if(loadImg.cache) {\n loadImg.cache.cache = true;\n virtualDom.children = [loadImg.cache];\n // 但是还是要校验是否有borderRadius变化,引发img的圆角遮罩\n if(!virtualDom.cache && list) {\n let d = svgPolygon(list);\n let v = {\n tagName: 'clipPath',\n props: [],\n children: [\n {\n type: 'item',\n tagName: 'path',\n props: [\n ['d', d],\n ['fill', '#FFF'],\n ],\n }\n ],\n };\n let id = ctx.add(v);\n __config[NODE_DEFS_CACHE].push(v);\n virtualDom.conClip = 'url(#' + id + ')';\n }\n return;\n }\n // 缩放图片,无需考虑原先矩阵,xom里对父层已经变换过了\n let matrix;\n if(width !== loadImg.width || height !== loadImg.height) {\n matrix = image.matrixResize(loadImg.width, loadImg.height, width, height, originX, originY, width, height);\n }\n let props = [\n ['xlink:href', loadImg.error ? placeholder : loadImg.src],\n ['x', originX],\n ['y', originY],\n ['width', loadImg.width],\n ['height', loadImg.height]\n ];\n if(list) {\n let d = svgPolygon(list);\n let v = {\n tagName: 'clipPath',\n props: [],\n children: [\n {\n type: 'item',\n tagName: 'path',\n props: [\n ['d', d],\n ['fill', '#FFF']\n ],\n }\n ],\n };\n let id = ctx.add(v);\n __config[NODE_DEFS_CACHE].push(v);\n virtualDom.conClip = 'url(#' + id + ')';\n delete virtualDom.cache;\n }\n if(matrix && !mx.isE(matrix)) {\n props.push(['transform', 'matrix(' + util.joinArr(mx.m2m6(matrix), ',') + ')']);\n }\n let vd = {\n type: 'img',\n tagName: 'image',\n props,\n };\n virtualDom.children = [vd];\n loadImg.cache = vd;\n }\n }\n return res;\n }\n\n // img没加载时,清空,这样Xom就认为没内容不生成cache,防止img先绘制cache再绘制主屏,重复\n __releaseWhenEmpty(__cache) {\n if(!this.__loadImg.error && !this.__loadImg.source) {\n return super.__releaseWhenEmpty(__cache);\n }\n }\n\n __isRealInline() {\n return false;\n }\n\n // overwrite\n __tryLayInline(w, total) {\n let { currentStyle: {\n [WIDTH]: width,\n [HEIGHT]: height,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_RIGHT]: marginRight,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_RIGHT]: paddingRight,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n } } = this;\n if(width[1] === PX) {\n w -= width[0];\n }\n else if(width[1] === PERCENT) {\n w -= total * width[0] * 0.01;\n }\n else if(width[1] === REM) {\n w -= width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w -= width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w -= width[0] * this.root.height * 0.01;\n }\n else if(width[1] === VMAX) {\n w -= width[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(width[1] === VMIN) {\n w -= width[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n else {\n let loadImg = this.__loadImg;\n // 加载成功计算缩放后的宽度\n if(loadImg.source) {\n if(height[1] === PX) {\n w -= loadImg.width * height[0] / loadImg.height;\n }\n else if(height[1] === PERCENT) {\n w -= loadImg.width * height[0] * total * 0.01 / loadImg.height;\n }\n else if(height[1] === REM) {\n w -= loadImg.width * height[0] * this.root.computedStyle[FONT_SIZE] / loadImg.height;\n }\n else if(height[1] === VW) {\n w -= loadImg.width * height[0] * this.root.width * 0.01 / loadImg.height;\n }\n else if(height[1] === VH) {\n w -= loadImg.width * height[0] * this.root.height * 0.01 / loadImg.height;\n }\n else if(height[1] === VMAX) {\n w -= height[0] * Math.max(this.root.width, this.root.height) * 0.01 / loadImg.height;\n }\n else if(height[1] === VMIN) {\n w -= height[0] * Math.min(this.root.width, this.root.height) * 0.01 / loadImg.height;\n }\n else {\n w -= loadImg.width;\n }\n }\n }\n // 减去水平mbp\n if(marginLeft[1] === PX) {\n w -= marginLeft[0];\n }\n else if(marginLeft[1] === PERCENT) {\n w -= marginLeft[0] * total * 0.01;\n }\n else if(marginLeft[1] === REM) {\n w -= marginLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginLeft[1] === VW) {\n w -= marginLeft[0] * this.root.width * 0.01;\n }\n else if(marginLeft[1] === VH) {\n w -= marginLeft[0] * this.root.height * 0.01;\n }\n else if(marginLeft[1] === VMAX) {\n w -= marginLeft[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(marginLeft[1] === VMIN) {\n w -= marginLeft[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(paddingLeft[1] === PX) {\n w -= paddingLeft[0];\n }\n else if(paddingLeft[1] === PERCENT) {\n w -= paddingLeft[0] * total * 0.01;\n }\n else if(paddingLeft[1] === REM) {\n w -= paddingLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingLeft[1] === VW) {\n w -= paddingLeft[0] * this.root.width * 0.01;\n }\n else if(paddingLeft[1] === VH) {\n w -= paddingLeft[0] * this.root.height * 0.01;\n }\n else if(paddingLeft[1] === VMAX) {\n w -= paddingLeft[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(paddingLeft[1] === VMIN) {\n w -= paddingLeft[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(borderLeftWidth[1] === PX) {\n w -= borderLeftWidth[0];\n }\n else if(borderLeftWidth[1] === REM) {\n w -= borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderLeftWidth[1] === VW) {\n w -= borderLeftWidth[0] * this.root.width * 0.01;\n }\n else if(borderLeftWidth[1] === VH) {\n w -= borderLeftWidth[0] * this.root.height * 0.01;\n }\n else if(borderLeftWidth[1] === VMAX) {\n w -= borderLeftWidth[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(borderLeftWidth[1] === VMIN) {\n w -= borderLeftWidth[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(marginRight[1] === PX) {\n w -= marginRight[0];\n }\n else if(marginRight[1] === PERCENT) {\n w -= marginRight[0] * total * 0.01;\n }\n else if(marginRight[1] === REM) {\n w -= marginRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginRight[1] === VW) {\n w -= marginRight[0] * this.root.width * 0.01;\n }\n else if(marginRight[1] === VH) {\n w -= marginRight[0] * this.root.height * 0.01;\n }\n else if(marginRight[1] === VMAX) {\n w -= marginRight[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(marginRight[1] === VMIN) {\n w -= marginRight[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(paddingRight[1] === PX) {\n w -= paddingRight[0];\n }\n else if(paddingRight[1] === PERCENT) {\n w -= paddingRight[0] * total * 0.01;\n }\n else if(paddingRight[1] === REM) {\n w -= paddingRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingRight[1] === VW) {\n w -= paddingRight[0] * this.root.width * 0.01;\n }\n else if(paddingRight[1] === VH) {\n w -= paddingRight[0] * this.root.height * 0.01;\n }\n else if(paddingRight[1] === VMAX) {\n w -= paddingRight[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(paddingRight[1] === VMIN) {\n w -= paddingRight[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(borderRightWidth[1] === PX) {\n w -= borderRightWidth[0];\n }\n else if(borderRightWidth[1] === REM) {\n w -= borderRightWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderRightWidth[1] === VW) {\n w -= borderRightWidth[0] * this.root.width * 0.01;\n }\n else if(borderRightWidth[1] === VH) {\n w -= borderRightWidth[0] * this.root.height * 0.01;\n }\n else if(borderRightWidth[1] === VMAX) {\n w -= borderRightWidth[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(borderRightWidth[1] === VMIN) {\n w -= borderRightWidth[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n return w;\n }\n\n __calBasis(isDirectionRow, isAbs, isColumn, data, isDirectChild) {\n computeReflow(this);\n let b = 0;\n let min = 0;\n let max = 0;\n let { currentStyle, computedStyle, __loadImg } = this;\n let { w, h } = data;\n // 计算需考虑style的属性\n let {\n [FLEX_BASIS]: flexBasis,\n [WIDTH]: width,\n [HEIGHT]: height,\n } = currentStyle;\n let main = isDirectionRow ? width : height;\n let cross = isDirectionRow ? height : width;\n // basis3种情况:auto、固定、content,只区分固定和其它\n let isFixed = [PX, PERCENT, REM, VW, VH, VMAX, VMIN].indexOf(flexBasis[1]) > -1;\n if(isFixed) {\n if(flexBasis[1] === PX) {\n b = max = min = flexBasis[0];\n }\n else if(flexBasis[1] === PERCENT) {\n b = max = min = flexBasis[0] * 0.01 * (isDirectionRow ? w : h);\n }\n else if(flexBasis[1] === REM) {\n b = max = min = flexBasis[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(flexBasis[1] === VW) {\n b = max = min = flexBasis[0] * this.root.width * 0.01;\n }\n else if(flexBasis[1] === VH) {\n b = max = min = flexBasis[0] * this.root.height * 0.01;\n }\n else if(flexBasis[1] === VMAX) {\n b = max = min = flexBasis[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(flexBasis[1] === VMIN) {\n b = max = min = flexBasis[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n }\n else if(([PX, PERCENT, REM, VW, VH, VMAX, VMIN].indexOf(main[1]) > -1)) {\n if(main[1] === PX) {\n b = max = min = main[0];\n }\n else if(main[1] === PERCENT) {\n b = max = min = main[0] * 0.01 * (isDirectionRow ? w : h);\n }\n else if(main[1] === REM) {\n b = max = min = main[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(main[1] === VW) {\n b = max = min = main[0] * this.root.width * 0.01;\n }\n else if(main[1] === VH) {\n b = max = min = main[0] * this.root.height * 0.01;\n }\n else if(main[1] === VMAX) {\n b = max = min = main[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(main[1] === VMIN) {\n b = max = min = main[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n }\n // auto和content固定尺寸比例计算\n else if(__loadImg.source || __loadImg.error) {\n let res = this.__preLayout(data);\n if(cross[1] !== AUTO) {\n if(cross[1] === PX) {\n cross = cross[0];\n }\n else if(cross[1] === PERCENT) {\n cross = cross[0] * 0.01 * (isDirectionRow ? h : w);\n }\n else if(cross[1] === REM) {\n cross = cross[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(cross[1] === VW) {\n cross = cross[0] * this.root.width * 0.01;\n }\n else if(cross[1] === VH) {\n cross = cross[0] * this.root.height * 0.01;\n }\n else if(cross[1] === VMAX) {\n cross = cross[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(cross[1] === VMIN) {\n cross = cross[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n let ratio = res.w / res.h;\n b = max = min = isDirectionRow ? cross * ratio : cross / ratio;\n }\n else {\n b = max = min = isDirectionRow ? res.w : res.h;\n }\n }\n // 直接item的mpb影响basis\n return this.__addMBP(isDirectionRow, w, currentStyle, computedStyle, [b, min, max], isDirectChild);\n }\n\n __loadAndRefresh(loadImg, root, ctx, placeholder, computedStyle, width, height, cb) {\n let self = this;\n // 先清空之前可能的\n if(loadImg.source || loadImg.error) {\n root.delRefreshTask(self.__task);\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null; // 清除在before,防止after的回调增加新的task误删\n if(self.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REFLOW; // 没有样式变化但内容尺寸发生了变化强制执行\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n });\n loadImg.source = null;\n }\n loadImg.loading = true;\n // 再测量,可能瞬间完成替换掉上面的\n inject.measureImg(loadImg.src, data => {\n // 还需判断url,防止重复加载时老的替换新的,失败走error绘制\n if(data.url === loadImg.src && !self.isDestroyed) {\n loadImg.cache && (loadImg.cache.cache = false);\n loadImg.loading = false;\n function reload() {\n let { currentStyle: { [WIDTH]: width, [HEIGHT]: height } } = self;\n root.delRefreshTask(self.__task);\n if(width[1] !== AUTO && height[1] !== AUTO) {\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null;\n if(self.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REPAINT;\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n __after() {\n if(isFunction(cb)) {\n cb.call(self);\n }\n },\n });\n }\n else {\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null;\n if(self.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REFLOW; // 没有样式变化但内容尺寸发生了变化强制执行\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n __after() {\n if(isFunction(cb)) {\n cb.call(self);\n }\n },\n });\n }\n }\n if(data.success) {\n loadImg.source = data.source;\n loadImg.width = data.width;\n loadImg.height = data.height;\n }\n else if(placeholder) {\n inject.measureImg(placeholder, data => {\n if(data.success) {\n loadImg.error = true;\n loadImg.source = data.source;\n loadImg.width = data.width;\n loadImg.height = data.height;\n reload();\n }\n }, {\n ctx,\n root,\n width,\n height,\n });\n return;\n }\n else {\n loadImg.error = true;\n }\n // 可见状态进行刷新操作,visibility某些情况需要刷新,可能宽高未定义要重新布局\n if(computedStyle[DISPLAY] !== 'none') {\n reload();\n }\n }\n }, {\n ctx,\n root,\n width,\n height,\n });\n }\n\n updateSrc(v, cb) {\n let self = this;\n let loadImg = self.__loadImg;\n let root = this.root;\n // 相等或空且当前error直接返回\n if(v === loadImg.src || !v && loadImg.error) {\n if(isFunction(cb)) {\n cb(-1);\n }\n }\n else if(v) {\n loadImg.src = v;\n self.__loadAndRefresh(loadImg, root, root.ctx, self.props.placeholder, self.computedStyle, self.width, self.height, cb);\n }\n else {\n loadImg.src = v;\n loadImg.source = null;\n loadImg.error = true;\n root.delRefreshTask(self.__task);\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null;\n if(self.isDestroyed) {\n return;\n }\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REFLOW;\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, self.__config, res);\n },\n __after(diff) {\n if(isFunction(cb)) {\n cb(diff);\n }\n },\n });\n }\n }\n\n appendChild() {\n inject.error('Img can not appendChild.');\n }\n\n get src() {\n return this.__loadImg.src;\n }\n\n get isReplaced() {\n return true;\n }\n\n static showError = true;\n}\n\nexport default Img;\n","class Defs {\n constructor(uuid) {\n this.id = uuid;\n this.count = 0;\n this.list = [];\n this.cacheHash = {}; // 每次svg渲染前重置,存储前次渲染不变的缓存id\n }\n add(data) {\n let uuid = this.count;\n let hash = this.cacheHash;\n while(hash.hasOwnProperty(uuid)) {\n uuid++;\n }\n this.count = uuid + 1;\n data.id = uuid;\n data.uuid = 'karas-defs-' + this.id + '-' + uuid;\n data.index = this.list.length;\n this.list.push(data);\n return data.uuid;\n }\n addCache(data) {\n data.index = this.list.length;\n this.list.push(data);\n this.cacheHash[data.id] = true;\n return data.uuid;\n }\n clear() {\n this.list = [];\n this.count = 0;\n this.cacheHash = {};\n }\n removeCache(data) {\n let list = this.list;\n let i = data.index;\n // 一般情况index即位置,但每次渲染过程中,可能会删掉一些,此时位置会往前,但index不变,因此遍历\n for(; i >= 0; i--) {\n if(list[i] === data) {\n list.splice(i, 1);\n return;\n }\n }\n }\n\n get value() {\n return this.list;\n }\n\n static getInstance(uuid) {\n return new Defs(uuid);\n }\n}\n\nexport default Defs;\n","import Xom from '../Xom';\nimport reset from '../../style/reset';\nimport css from '../../style/css';\nimport unit from '../../style/unit';\nimport enums from '../../util/enums';\nimport mode from '../../refresh/mode';\nimport util from '../../util/util';\nimport painter from '../../util/painter';\nimport transform from '../../style/transform';\nimport mx from '../../math/matrix';\nimport inject from '../../util/inject';\nimport gradient from '../../math/gradient';\n\nconst {\n STYLE_KEY: {\n MARGIN_RIGHT,\n MARGIN_LEFT,\n PADDING_RIGHT,\n PADDING_LEFT,\n WIDTH,\n HEIGHT,\n BORDER_RIGHT_WIDTH,\n BORDER_LEFT_WIDTH,\n FILL,\n STROKE,\n STROKE_MITERLIMIT,\n STROKE_WIDTH,\n STROKE_LINECAP,\n STROKE_LINEJOIN,\n STROKE_DASHARRAY,\n STROKE_DASHARRAY_STR,\n FILL_RULE,\n VISIBILITY,\n FONT_SIZE,\n FLEX_BASIS,\n },\n NODE_KEY: {\n NODE_CACHE_PROPS,\n NODE_CURRENT_PROPS,\n NODE_CURRENT_STYLE,\n NODE_STYLE,\n NODE_DEFS_CACHE,\n NODE_CACHE,\n }\n} = enums;\nconst { PX, PERCENT, REM, VW, VH, VMAX, VMIN } = unit;\nconst { int2rgba, isNil, joinArr } = util;\nconst { canvasPolygon, svgPolygon } = painter;\nconst { WEBGL } = mode;\nconst { computeReflow } = css;\n\nconst REGISTER = {};\n\nclass Geom extends Xom {\n constructor(tagName, props) {\n super(tagName, props);\n this.__isMulti = !!this.props.multi;\n this.__style = css.normalize(this.style, reset.DOM_ENTRY_SET.concat(reset.GEOM_ENTRY_SET));\n this.__currentStyle = util.extend({}, this.__style);\n this.__currentProps = util.clone(this.props);\n let config = this.__config;\n config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n config[NODE_CURRENT_PROPS] = this.__currentProps;\n config[NODE_CURRENT_STYLE] = this.__currentStyle;\n config[NODE_STYLE] = this.__style;\n }\n\n __tryLayInline(w, total) {\n // 无children,直接以style的width为宽度,不定义则为0\n let { currentStyle: {\n [WIDTH]: width,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_RIGHT]: marginRight,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_RIGHT]: paddingRight,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n } } = this;\n if(width[1] === PX) {\n w -= width[0];\n }\n else if(width[1] === PERCENT) {\n w -= total * width[0] * 0.01;\n }\n else if(width[1] === REM) {\n w -= width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w -= width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w -= width[0] * this.root.height * 0.01;\n }\n else if(width[1] === VMAX) {\n w -= width[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(width[1] === VMIN) {\n w -= width[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n // 减去水平mbp\n if(marginLeft[1] === PX) {\n w -= marginLeft[0];\n }\n else if(marginLeft[1] === PERCENT) {\n w -= marginLeft[0] * total * 0.01;\n }\n else if(marginLeft[1] === REM) {\n w -= marginLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginLeft[1] === VW) {\n w -= marginLeft[0] * this.root.width * 0.01;\n }\n else if(marginLeft[1] === VH) {\n w -= marginLeft[0] * this.root.height * 0.01;\n }\n else if(marginLeft[1] === VMAX) {\n w -= marginLeft[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(marginLeft[1] === VMIN) {\n w -= marginLeft[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(paddingLeft[1] === PX) {\n w -= paddingLeft[0];\n }\n else if(paddingLeft[1] === PERCENT) {\n w -= paddingLeft[0] * total * 0.01;\n }\n else if(paddingLeft[1] === REM) {\n w -= paddingLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingLeft[1] === VW) {\n w -= paddingLeft[0] * this.root.width * 0.01;\n }\n else if(paddingLeft[1] === VH) {\n w -= paddingLeft[0] * this.root.height * 0.01;\n }\n else if(paddingLeft[1] === VMAX) {\n w -= paddingLeft[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(paddingLeft[1] === VMIN) {\n w -= paddingLeft[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(borderLeftWidth[1] === PX) {\n w -= borderLeftWidth[0];\n }\n else if(borderLeftWidth[1] === REM) {\n w -= borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderLeftWidth[1] === VW) {\n w -= borderLeftWidth[0] * this.root.width * 0.01;\n }\n else if(borderLeftWidth[1] === VH) {\n w -= borderLeftWidth[0] * this.root.height * 0.01;\n }\n else if(borderLeftWidth[1] === VMAX) {\n w -= borderLeftWidth[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(borderLeftWidth[1] === VMIN) {\n w -= borderLeftWidth[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(marginRight[1] === PX) {\n w -= marginRight[0];\n }\n else if(marginRight[1] === PERCENT) {\n w -= marginRight[0] * total * 0.01;\n }\n else if(marginRight[1] === REM) {\n w -= marginRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginRight[1] === VW) {\n w -= marginRight[0] * this.root.width * 0.01;\n }\n else if(marginRight[1] === VH) {\n w -= marginRight[0] * this.root.height * 0.01;\n }\n else if(marginRight[1] === VMAX) {\n w -= marginRight[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(marginRight[1] === VMIN) {\n w -= marginRight[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(paddingRight[1] === PX) {\n w -= paddingRight[0];\n }\n else if(paddingRight[1] === PERCENT) {\n w -= paddingRight[0] * total * 0.01;\n }\n else if(paddingRight[1] === REM) {\n w -= paddingRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingRight[1] === VW) {\n w -= paddingRight[0] * this.root.width * 0.01;\n }\n else if(paddingRight[1] === VH) {\n w -= paddingRight[0] * this.root.height * 0.01;\n }\n else if(paddingRight[1] === VMAX) {\n w -= paddingRight[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(paddingRight[1] === VMIN) {\n w -= paddingRight[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(borderRightWidth[1] === PX) {\n w -= borderRightWidth[0];\n }\n else if(borderRightWidth[1] === REM) {\n w -= borderRightWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderRightWidth[1] === VW) {\n w -= borderRightWidth[0] * this.root.width * 0.01;\n }\n else if(borderRightWidth[1] === VH) {\n w -= borderRightWidth[0] * this.root.height * 0.01;\n }\n else if(borderRightWidth[1] === VMAX) {\n w -= borderRightWidth[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(borderRightWidth[1] === VMIN) {\n w -= borderRightWidth[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n return w;\n }\n\n __calBasis(isDirectionRow, isAbs, isColumn, data, isDirectChild) {\n computeReflow(this);\n let b = 0;\n let min = 0;\n let max = 0;\n let { currentStyle, computedStyle } = this;\n let { w, h } = data;\n // 计算需考虑style的属性\n let {\n [FLEX_BASIS]: flexBasis,\n [WIDTH]: width,\n [HEIGHT]: height,\n } = currentStyle;\n let main = isDirectionRow ? width : height;\n // basis3种情况:auto、固定、content,只区分固定和其它\n let isFixed = [PX, PERCENT, REM, VW, VH, VMAX, VMIN].indexOf(flexBasis[1]) > -1;\n if(isFixed) {\n if(flexBasis[1] === PX) {\n b = max = min = flexBasis[0];\n }\n else if(flexBasis[1] === PERCENT) {\n b = max = min = flexBasis[0] * 0.01 * (isDirectionRow ? w : h);\n }\n else if(flexBasis[1] === REM) {\n b = max = min = flexBasis[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(flexBasis[1] === VW) {\n b = max = min = flexBasis[0] * this.root.width * 0.01;\n }\n else if(flexBasis[1] === VH) {\n b = max = min = flexBasis[0] * this.root.height * 0.01;\n }\n else if(flexBasis[1] === VMAX) {\n b = max = min = flexBasis[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(flexBasis[1] === VMIN) {\n b = max = min = flexBasis[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n }\n else if(([PX, PERCENT, REM, VW, VH, VMAX, VMIN].indexOf(main[1]) > -1)) {\n if(main[1] === PX) {\n b = max = min = main[0];\n }\n else if(main[1] === PERCENT) {\n b = max = min = main[0] * 0.01 * (isDirectionRow ? w : h);\n }\n else if(main[1] === REM) {\n b = max = min = main[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(main[1] === VW) {\n b = max = min = main[0] * this.root.width * 0.01;\n }\n else if(main[1] === VH) {\n b = max = min = main[0] * this.root.height * 0.01;\n }\n else if(main[1] === VMAX) {\n b = max = min = main[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(main[1] === VMIN) {\n b = max = min = main[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n }\n // 直接item的mpb影响basis\n return this.__addMBP(isDirectionRow, w, currentStyle, computedStyle, [b, min, max], isDirectChild);\n }\n\n __layoutBlock(data, isVirtual) {\n let { fixedWidth, fixedHeight, w, h } = this.__preLayout(data, false);\n this.__height = fixedHeight ? h : 0;\n if(isVirtual) {\n w = this.__width = fixedWidth ? w : 0;\n this.__ioSize(w);\n return;\n }\n this.__width = w;\n this.__ioSize(w, this.height);\n this.__marginAuto(this.currentStyle, data);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __layoutFlex(data, isVirtual) {\n // 无children所以等同于block\n this.__layoutBlock(data, isVirtual);\n }\n\n __layoutInline(data, isVirtual, isInline) {\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data, isInline);\n // 元素的width不能超过父元素w\n let tw = this.__width = fixedWidth ? w : x - data.x;\n let th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __calCache(renderMode, ctx, parent, __cacheStyle, currentStyle, computedStyle,\n clientWidth, clientHeight, offsetWidth, offsetHeight,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n paddingTop, paddingRight, paddingBottom, paddingLeft,\n x1, x2, x3, x4, x5, x6, y1, y2, y3, y4, y5, y6) {\n let res = super.__calCache(renderMode, ctx, parent, __cacheStyle, currentStyle, computedStyle,\n clientWidth, clientHeight, offsetWidth, offsetHeight,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n paddingTop, paddingRight, paddingBottom, paddingLeft,\n x1, x2, x3, x4, x5, x6, y1, y2, y3, y4, y5, y6);\n if(isNil(__cacheStyle[STROKE_WIDTH])) {\n __cacheStyle[STROKE_WIDTH] = true;\n let strokeWidth = currentStyle[STROKE_WIDTH] || [];\n let w = this.width;\n computedStyle[STROKE_WIDTH] = strokeWidth.map(item => {\n if(item[1] === PX) {\n return item[0];\n }\n else if(item[1] === PERCENT) {\n return item[0] * w * 0.01;\n }\n else if(item[1] === REM) {\n return item[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(item[1] === VW) {\n return item[0] * this.root.width * 0.01;\n }\n else if(item[1] === VH) {\n return item[0] * this.root.height * 0.01;\n }\n else if(item[1] === VMAX) {\n return item[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(item[1] === VMIN) {\n return item[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n else {\n return 0;\n }\n });\n }\n if(isNil(__cacheStyle[STROKE_DASHARRAY])) {\n __cacheStyle[STROKE_DASHARRAY] = true;\n computedStyle[STROKE_DASHARRAY] = currentStyle[STROKE_DASHARRAY] || [];\n __cacheStyle[STROKE_DASHARRAY_STR] = computedStyle[STROKE_DASHARRAY].map(item => joinArr(item, ','));\n }\n // 直接赋值的\n [\n STROKE_LINECAP,\n STROKE_LINEJOIN,\n STROKE_MITERLIMIT,\n FILL_RULE,\n ].forEach(k => {\n computedStyle[k] = currentStyle[k];\n });\n // stroke/fll移至render里处理,因为cache涉及渐变坐标偏移\n [STROKE, FILL].forEach(k => {\n if(isNil(__cacheStyle[k])) {\n let v = currentStyle[k];\n computedStyle[k] = v;\n let res = [];\n if(Array.isArray(v)) {\n v.forEach(item => {\n if(item && (item.k === 'linear' || item.k === 'radial' || item.k === 'conic')) {\n if(renderMode === WEBGL) {\n let cache = this.__config[NODE_CACHE];\n x3 += cache.dx;\n x4 += cache.dx;\n y3 += cache.dy;\n y4 += cache.dy;\n }\n res.push(this.__gradient(renderMode, ctx, x3, y3, x4, y4, item));\n }\n else if(item[3] > 0) {\n res.push(int2rgba(item));\n }\n else {\n res.push('none');\n }\n });\n }\n __cacheStyle[k] = res;\n }\n });\n return res;\n }\n\n __calContent(renderMode, lv, currentStyle, computedStyle) {\n // Geom强制有内容\n return computedStyle[VISIBILITY] !== 'hidden';\n }\n\n __preSet(res) {\n let { width, height, __cacheStyle, computedStyle } = this;\n let cx = res.sx3 + width * 0.5;\n let cy = res.sy3 + height * 0.5;\n let {\n [FILL]: fill,\n [STROKE]: stroke,\n [STROKE_DASHARRAY_STR]: strokeDasharrayStr,\n } = __cacheStyle;\n let {\n [STROKE_WIDTH]: strokeWidth,\n [STROKE_LINECAP]: strokeLinecap,\n [STROKE_LINEJOIN]: strokeLinejoin,\n [STROKE_MITERLIMIT]: strokeMiterlimit,\n [STROKE_DASHARRAY]: strokeDasharray,\n [FILL_RULE]: fillRule,\n } = computedStyle;\n return {\n cx,\n cy,\n stroke,\n strokeWidth,\n strokeDasharray,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n fill,\n fillRule,\n };\n }\n\n __preSetCanvas(renderMode, ctx, res) {\n let {\n stroke,\n strokeWidth,\n strokeDasharray,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n fill,\n } = res;\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n if(fill) {\n if(fill.k === 'linear') {\n ctx.fillStyle = fill.v;\n }\n else if(fill.k === 'radial' && !Array.isArray(fill.v)) {\n ctx.fillStyle = fill.v;\n }\n else if(fill.k === 'conic') {\n //\n }\n else if(!fill.k && ctx.fillStyle !== fill) {\n ctx.fillStyle = fill;\n }\n }\n if(stroke) {\n if(stroke.k === 'linear') {\n ctx.strokeStyle = stroke.v;\n }\n else if(stroke.k === 'radial' && !Array.isArray(stroke.v)) {\n ctx.strokeStyle = stroke.v;\n }\n else if(stroke.k === 'conic') {\n //\n }\n else if(!stroke.k && ctx.strokeStyle !== stroke) {\n ctx.strokeStyle = stroke;\n }\n }\n if(strokeWidth !== undefined && ctx.lineWidth !== strokeWidth) {\n ctx.lineWidth = strokeWidth;\n }\n if(strokeLinecap !== undefined && ctx.lineCap !== strokeLinecap) {\n ctx.lineCap = strokeLinecap;\n }\n if(strokeLinejoin !== undefined && ctx.lineJoin !== strokeLinejoin) {\n ctx.lineJoin = strokeLinejoin;\n }\n if(strokeMiterlimit !== undefined && ctx.miterLimit !== strokeMiterlimit) {\n ctx.miterLimit = strokeMiterlimit;\n }\n // 小程序没这个方法\n if(util.isFunction(ctx.getLineDash)) {\n if(strokeDasharray && !util.equalArr(ctx.getLineDash(), strokeDasharray)) {\n ctx.setLineDash(strokeDasharray);\n }\n }\n else if(strokeDasharray) {\n ctx.setLineDash(strokeDasharray);\n }\n }\n }\n\n render(renderMode, lv, ctx, cache, dx, dy) {\n let res = super.render(renderMode, lv, ctx, cache, dx, dy);\n if(renderMode === mode.SVG) {\n this.virtualDom.type = 'geom';\n }\n // 无论canvas/svg,break可提前跳出省略计算\n if(res.break) {\n return res;\n }\n // data在无cache时没有提前设置\n let preData = this.__preSet(res);\n return Object.assign(res, preData);\n }\n\n __renderPolygon(renderMode, ctx, res) {\n let {\n fill: fills,\n fillRule: fillRules,\n stroke: strokes,\n strokeWidth: strokeWidths,\n strokeDasharray: strokeDasharrays,\n strokeDasharrayStr: strokeDasharrayStrs,\n strokeLinecap: strokeLinecaps,\n strokeLinejoin: strokeLinejoins,\n strokeMiterlimit: strokeMiterlimits,\n dx,\n dy,\n } = res;\n let { __cacheProps: { list }, isMulti, bbox } = this;\n // 普通情况下只有1个,按普通情况走\n if(fills.length <= 1 && strokes.length <= 1) {\n let o = {\n fill: fills[0],\n fillRule: fillRules[0],\n stroke: strokes[0],\n strokeWidth: strokeWidths[0],\n strokeDasharray: strokeDasharrays[0],\n strokeDasharrayStr: strokeDasharrayStrs[0],\n strokeLinecap: strokeLinecaps[0],\n strokeLinejoin: strokeLinejoins[0],\n strokeMiterlimit: strokeMiterlimits[0],\n dx,\n dy,\n bbox,\n };\n this.__renderOnePolygon(renderMode, ctx, isMulti, list, o);\n }\n // 多个需要fill在下面,stroke在上面,依次循环\n else {\n for(let i = 0, len = fills.length; i < len; i++) {\n let fill = fills[i];\n if(fill) {\n let o = {\n fill,\n fillRule: fillRules[i],\n dx,\n dy,\n bbox,\n };\n this.__renderOnePolygon(renderMode, ctx, isMulti, list, o);\n }\n }\n for(let i = 0, len = strokes.length; i < len; i++) {\n let stroke = strokes[i];\n if(stroke) {\n let o = {\n stroke,\n strokeWidth: strokeWidths[i],\n strokeDasharray: strokeDasharrays[i],\n strokeDasharrayStr: strokeDasharrayStrs[i],\n strokeLinecap: strokeLinecaps[i],\n strokeLinejoin: strokeLinejoins[i],\n strokeMiterlimit: strokeMiterlimits[i],\n dx,\n dy,\n bbox,\n };\n this.__renderOnePolygon(renderMode, ctx, isMulti, list, o);\n }\n }\n }\n }\n\n __renderOnePolygon(renderMode, ctx, isMulti, list, res) {\n let {\n fill,\n stroke,\n strokeWidth,\n } = res;\n let isFillCE = fill && fill.k === 'conic';\n let isStrokeCE = stroke && stroke.k === 'conic';\n // 椭圆是array\n let isFillRE = fill && fill.k === 'radial' && Array.isArray(fill.v);\n let isStrokeRE = strokeWidth && strokeWidth > 0 && stroke && stroke.k === 'radial' && Array.isArray(stroke.v);\n if(isFillCE || isStrokeCE) {\n if(isFillCE) {\n this.__conicGradient(renderMode, ctx, list, isMulti, res);\n }\n else if(fill !== 'none') {\n this.__drawPolygon(renderMode, ctx, isMulti, list, res, true);\n }\n if(strokeWidth && strokeWidth > 0 && isStrokeCE) {\n inject.warn('Stroke style can not use conic-gradient');\n }\n else if(strokeWidth && strokeWidth > 0 && stroke !== 'none') {\n this.__drawPolygon(renderMode, ctx, isMulti, list, res, false, true);\n }\n }\n else if(isFillRE || isStrokeRE) {\n if(isFillRE) {\n this.__radialEllipse(renderMode, ctx, list, isMulti, res, 'fill');\n }\n else if(fill !== 'none') {\n this.__drawPolygon(renderMode, ctx, isMulti, list, res, true);\n }\n // stroke椭圆渐变matrix会变形,降级为圆\n if(strokeWidth && strokeWidth > 0 && isStrokeRE) {\n inject.warn('Stroke style can not use radial-gradient for ellipse');\n res.stroke.v = res.stroke.v[0];\n this.__drawPolygon(renderMode, ctx, isMulti, list, res, false, true);\n }\n else if(strokeWidth && strokeWidth > 0 && stroke !== 'none') {\n this.__drawPolygon(renderMode, ctx, isMulti, list, res, false, true);\n }\n }\n else {\n this.__drawPolygon(renderMode, ctx, isMulti, list, res, true, true);\n }\n }\n\n __drawPolygon(renderMode, ctx, isMulti, list, res, isFill, isStroke) {\n let {\n fill,\n stroke,\n strokeWidth,\n fillRule,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n dx,\n dy,\n } = res;\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n this.__preSetCanvas(renderMode, ctx, res);\n ctx.beginPath();\n if(isMulti) {\n list.forEach(item => canvasPolygon(ctx, item, dx, dy));\n }\n else {\n canvasPolygon(ctx, list, dx, dy);\n }\n if(isFill && fill && fill !== 'none') {\n ctx.fill(fillRule);\n }\n if(isStroke && stroke && stroke !== 'none' && strokeWidth && strokeWidth > 0) {\n ctx.stroke();\n }\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n let d = '';\n if(isMulti) {\n list.forEach(item => d += svgPolygon(item));\n }\n else {\n d = svgPolygon(list);\n }\n let props = [\n ['d', d],\n ];\n // 2个都没有常出现在多fill/stroke时,也有可能特殊单个故意这样写的\n if((!fill || fill === 'none') && (!stroke || stroke === 'none')) {\n return;\n }\n if(isFill && fill && fill !== 'none') {\n props.push(['fill', fill.v || fill]);\n if(fillRule && fillRule !== 'nonzero') {\n props.push(['fill-rule', fillRule]);\n }\n }\n else {\n props.push(['fill', 'none']);\n }\n if(isStroke && stroke && stroke !== 'none' && strokeWidth && strokeWidth > 0) {\n props.push(['stroke', stroke.v || stroke]);\n props.push(['stroke-width', strokeWidth]);\n this.__propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit);\n }\n else {\n props.push(['stroke-width', 0]);\n }\n this.addGeom('path', props);\n }\n }\n\n __inversePtList(list, isMulti, t) {\n if(isMulti) {\n return list.map(item => {\n if(!item || !item.length) {\n return null;\n }\n return item.map(item => {\n if(!item || !item.length) {\n return null;\n }\n let arr = [];\n for(let i = 0, len = item.length; i < len; i += 2) {\n let p = mx.calPoint([item[i], item[i + 1]], t);\n arr.push(p[0]);\n arr.push(p[1]);\n }\n return arr;\n });\n });\n }\n else {\n return list.map(item => {\n if(!item || !item.length) {\n return null;\n }\n let arr = [];\n for(let i = 0, len = item.length; i < len; i += 2) {\n let p = mx.calPoint([item[i], item[i + 1]], t);\n arr.push(p[0]);\n arr.push(p[1]);\n }\n return arr;\n });\n }\n }\n\n __radialEllipse(renderMode, ctx, list, isMulti, res, method) {\n let {\n strokeWidth,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n dx,\n dy,\n } = res;\n let [color, matrix, cx, cy] = res[method].v;\n // 椭圆渐变的转换,顶点逆矩阵变换\n let tfo = [cx, cy];\n matrix = transform.calMatrixByOrigin(matrix, tfo);\n let t = mx.inverse(matrix);\n list = this.__inversePtList(list, isMulti, t);\n // 用正向matrix渲染\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n if(matrix) {\n ctx.save();\n let me = this.matrixEvent;\n matrix = mx.multiply(me, matrix);\n ctx.setTransform(matrix[0], matrix[1], matrix[4], matrix[5], matrix[12], matrix[13]);\n }\n ctx.beginPath();\n if(ctx[method + 'Style'] !== color) {\n ctx[method + 'Style'] = color;\n }\n if(isMulti) {\n list.forEach(item => painter.canvasPolygon(ctx, item, dx, dy));\n }\n else {\n canvasPolygon(ctx, list, dx, dy);\n }\n ctx[method]();\n ctx.closePath();\n if(matrix) {\n ctx.restore();\n }\n }\n else if(renderMode === mode.SVG) {\n let d = '';\n if(isMulti) {\n list.forEach(item => d += svgPolygon(item));\n }\n else {\n d = svgPolygon(list);\n }\n let props = [\n ['d', d],\n ];\n if(method === 'fill') {\n props.push(['fill', color]);\n props.push(['strokeWidth', 0]);\n }\n else if(method === 'stroke') {\n props.push(['fill', 'none']);\n props.push(['stroke', color]);\n props.push(['stroke-width', strokeWidth]);\n this.__propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit);\n }\n props.push(['transform', `matrix(${joinArr(mx.m2m6(matrix), ',')})`]);\n this.addGeom('path', props);\n }\n }\n\n __conicGradient(renderMode, ctx, list, isMulti, res) {\n let {\n fill,\n bbox,\n dx = 0,\n dy = 0,\n } = res;\n let color = fill.v;\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n let [x1, y1, x2, y2] = bbox;\n let w = x2 - x1, h = y2 - y1;\n let offscreen = inject.getCacheCanvas(w, h, '__$$CONIC_GRADIENT$$__');\n let imgData = offscreen.ctx.getImageData(0,0, w, h);\n gradient.getConicGradientImage(w * 0.5, h * 0.5, w, h, fill.v.stop, imgData.data);\n offscreen.ctx.putImageData(imgData, 0, 0);\n if(isMulti) {\n list.forEach(item => {\n ctx.save();\n ctx.beginPath();\n canvasPolygon(ctx, item, dx, dy);\n ctx.clip();\n ctx.closePath();\n ctx.drawImage(offscreen.canvas, x1 + dx, y1 + dy);\n ctx.restore();\n });\n }\n else {\n ctx.save();\n ctx.beginPath();\n canvasPolygon(ctx, list, dx, dy);\n ctx.clip();\n ctx.closePath();\n ctx.drawImage(offscreen.canvas, x1 + dx, y1 + dy);\n ctx.restore();\n }\n offscreen.ctx.clearRect(0, 0, w, h);\n }\n else if(renderMode === mode.SVG) {\n if(isMulti) {\n list.forEach(item => {\n let v = {\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(item)],\n ],\n }],\n };\n let clip = ctx.add(v);\n this.__config[NODE_DEFS_CACHE].push(v);\n color.forEach(item => {\n this.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon(item[0])],\n ['fill', item[1]],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n });\n });\n }\n else {\n let v = {\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(list)],\n ],\n }],\n };\n let clip = ctx.add(v);\n this.__config[NODE_DEFS_CACHE].push(v);\n color.forEach(item => {\n this.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon(item[0])],\n ['fill', item[1]],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n });\n }\n }\n }\n\n __propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit) {\n if(strokeDasharrayStr) {\n props.push(['stroke-dasharray', strokeDasharrayStr]);\n }\n if(strokeLinecap && strokeLinecap !== 'butt') {\n props.push(['stroke-linecap', strokeLinecap]);\n }\n if(strokeLinejoin && strokeLinejoin !== 'miter') {\n props.push(['stroke-linejoin', strokeLinejoin]);\n }\n if(strokeMiterlimit && strokeMiterlimit !== 4) {\n props.push(['stroke-miterlimit', strokeMiterlimit]);\n }\n }\n\n // geom的cache无内容也不清除,因为子类不清楚内容,除非看不见\n __releaseWhenEmpty(cache, computedStyle) {\n return computedStyle[VISIBILITY] === 'hidden';\n }\n\n // offset/resize时要多一步清空props上记录的缓存\n __offsetX(diff, isLayout, lv) {\n super.__offsetX(diff, isLayout, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __offsetY(diff, isLayout, lv) {\n super.__offsetY(diff, isLayout, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __resizeX(diff, lv) {\n super.__resizeX(diff, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __resizeY(diff, lv) {\n super.__resizeY(diff, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n addGeom(tagName, props) {\n props = util.hash2arr(props);\n this.virtualDom.children.push({\n type: 'item',\n tagName,\n props,\n });\n }\n\n getProps(k) {\n let v = this.currentProps[k];\n if(!isNil(v)) {\n return v;\n }\n return this['__' + k];\n }\n\n __isRealInline() {\n return false;\n }\n\n get isMulti() {\n return this.__isMulti;\n }\n\n get currentProps() {\n return this.__currentProps;\n }\n\n static get REGISTER() {\n return REGISTER;\n }\n\n static getRegister(name) {\n if(!name || !util.isString(name) || name.charAt(0) !== '$') {\n throw new Error('Invalid param');\n }\n if(!REGISTER.hasOwnProperty(name)) {\n throw new Error(`Geom has not register: ${name}`);\n }\n return REGISTER[name];\n }\n\n static register(name, obj) {\n if(!name || !util.isString(name) || name.charAt(0) !== '$'\n || !obj.prototype || !(obj.prototype instanceof Geom)) {\n throw new Error('Invalid param');\n }\n if(Geom.hasRegister(name)) {\n throw new Error(`Geom has already register: ${name}`);\n }\n REGISTER[name] = obj;\n }\n\n static hasRegister(name) {\n return name && REGISTER.hasOwnProperty(name);\n }\n\n static delRegister(name) {\n if(Geom.hasRegister(name)) {\n delete REGISTER[name];\n }\n }\n}\n\nexport default Geom;\n","import Xom from '../node/Xom';\nimport Dom from '../node/Dom';\nimport Component from '../node/Component';\nimport util from './util';\nimport inject from './inject';\nimport flatten from './flatten';\nimport $$type from './$$type';\nimport enums from './enums';\n\nconst {\n NODE_KEY: {\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_DOM_PARENT,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n NODE_STRUCT,\n },\n} = enums;\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet updateList = [];\nlet removeList = [];\n\nconst KEY_FLAG = {};\n\n/**\n * setState后刷新前先根遍历检查组件开始进行shouldComponentUpdate判断\n */\nfunction check(vd) {\n if(vd instanceof Dom) {\n vd.children.forEach(child => {\n if(child instanceof Dom) {\n check(child);\n }\n // 当组件有setState更新时,从叶子到根链路会标识__hasCpUpdate,以便节约遍历成本忽略那些没变化的链路\n else if(child instanceof Component && child.__hasCpUpdate) {\n child.__hasCpUpdate = false;\n checkCp(child, child.props);\n }\n });\n }\n // 高阶组件会进入此分支,被父组件调用\n else if(vd instanceof Component && vd.__hasCpUpdate) {\n vd.__hasCpUpdate = false;\n checkCp(vd, vd.props);\n }\n}\n\n/**\n * 检查cp是否有state变更,注意递归检查时需要看shadow不能看shadowRoot,\n * 否则高阶组件会被跳过,其更新无法触发update生命周期\n * @param cp\n * @param nextProps\n * @param forceCheckUpdate,被render()后的json的二级组件,发现props有变更强制检查更新,否则可以跳过\n */\nfunction checkCp(cp, nextProps, forceCheckUpdate) {\n if(cp.__nextState || forceCheckUpdate) {\n let shouldUpdate;\n if(util.isFunction(cp.shouldComponentUpdate)) {\n shouldUpdate = cp.shouldComponentUpdate(nextProps, cp.__nextState || cp.state);\n }\n else {\n // 没有默认更新\n shouldUpdate = true;\n }\n if(shouldUpdate) {\n updateCp(cp, nextProps, cp.__nextState || cp.state);\n }\n // 不更新则递归检查子tree的cp\n else {\n cp.props = nextProps;\n cp.state = cp.__nextState || cp.state;\n check(cp.shadow);\n }\n }\n else {\n check(cp.shadow);\n }\n}\n\n/**\n * 更新组件的props和state,清空__nextState\n * @param cp\n * @param props\n * @param state\n */\nfunction updateCp(cp, props, state) {\n cp.props = props;\n cp.state = state;\n cp.__nextState = null; // 同步在refresh前清除component的新state标识,这样frame动画在after回调中可以新设\n let oldS = cp.shadow;\n let oldSr = cp.shadowRoot;\n let oldJson = cp.__cd;\n let json = flatten(cp.render());\n // 对比新老render()返回的内容,更新后重新生成sr\n diffSr(oldS, oldJson, json);\n cp.__init(json);\n // 为了局部dom布局需要知道老的css信息\n let sr = cp.shadowRoot;\n if(sr instanceof Xom) {\n [\n '__outerWidth',\n '__outerHeight',\n '__sx',\n '__sy',\n '__sx2',\n '__sx3',\n '__sx4',\n '__sx5',\n '__sx6',\n '__sy2',\n '__sy3',\n '__sy4',\n '__sy5',\n '__sy6',\n ].forEach(k => {\n sr[k] = oldSr[k];\n });\n sr.__computedStyle = sr.__config[NODE_COMPUTED_STYLE] = oldSr.computedStyle;\n }\n else {\n let domParent = cp.domParent;\n [\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n ].forEach(k => {\n sr.__config[k] = domParent.__config[k];\n });\n }\n [\n '__x',\n '__y',\n '__width',\n '__height',\n '__sx1', // text和xom\n '__sy1',\n '__layoutData',\n '__parent',\n '__domParent',\n ].forEach(k => {\n sr[k] = oldSr[k];\n });\n sr.__config[NODE_DOM_PARENT] = oldSr.domParent;\n sr.__config[NODE_STRUCT] = oldSr.__config[NODE_STRUCT];\n updateList.push(cp);\n // 老的需回收,diff会生成新的dom,唯一列外是cp直接返回一个没变化的cp\n if(!util.isObject(json) || !json.__placeholder) {\n removeList.push(oldS);\n }\n // 子组件使用老的json时标识,更新后删除,render()返回空会没json对象\n if(json && json.__placeholder) {\n delete json.__placeholder;\n }\n if(json && json.__inheritAnimate) {\n delete json.__inheritAnimate;\n }\n if(json && json.__animateRecords) {\n delete json.__animateRecords;\n }\n // 高阶组件时需判断,子组件更新后生成新的sr,父组件的sr/host需要同时更新引用\n let host = cp.host;\n while(host) {\n if(host.shadow === cp) {\n host.__shadowRoot = sr;\n sr.__hostRoot = host;\n cp = host;\n host = host.host;\n }\n else {\n break;\n }\n }\n}\n\n/**\n * 非一级组件sr进行对比,key相同的无需重新生成且继承动画\n * @param vd\n * @param oj oldJson\n * @param nj\n */\nfunction diffSr(vd, oj, nj) {\n // 先遍历检查key相同的,将没有变化的key暂存下来,深度优先,这样叶子节点出现在前面,当key的叶子也有key时,确保叶子先对比\n let ojk = getKeyHash(oj, {}, vd);\n let njk = getKeyHash(nj, {});\n let keyList = [];\n let cpList = [];\n // 先对比key对应的节点,如果新老有一方对不上则落空\n Object.keys(ojk).forEach(k => {\n let o = ojk[k];\n let n = njk[k];\n if(!n) {\n o.json.key = KEY_FLAG;\n }\n });\n Object.keys(njk).forEach(k => {\n let o = ojk[k];\n let n = njk[k];\n // 有可能老的没有这个key,新key落空\n if(!o) {\n n.json.key = KEY_FLAG;\n return;\n }\n let oj = o.json;\n let nj = n.json;\n let vd = o.vd;\n // 相同class的组件进行对比替换\n if(oj.$$type === TYPE_CP && nj.$$type === TYPE_CP) {\n if(oj.klass === nj.klass) {\n // 对比props和children看是否全等,是则直接替换新json类型为占位符,引用老vd,否则强制更新\n diffCp(oj, nj, vd);\n // 标识对比过了\n oj.key = nj.key = KEY_FLAG;\n // 老的sr里需删除这个vd,因为老sr会回收\n cpList.push(vd);\n }\n }\n // 相同类型的vd进行对比继承动画\n else if(oj.$$type === nj.$$type && oj.tagName === nj.tagName) {\n // 需判断矢量标签mutil是否相等\n if(nj.$$type !== TYPE_GM || oj.props.multi === nj.props.multi) {\n nj.__inheritAnimate = vd;\n }\n oj.key = nj.key = KEY_FLAG;\n // key相同的dom暂存下来\n if(nj.$$type === TYPE_VD) {\n keyList.push({\n vd,\n oj,\n nj,\n });\n }\n }\n });\n // key相同的dom对比children,下面非key逻辑就不做了\n keyList.forEach(item => {\n diffChildren(item.vd, item.oj, item.nj);\n });\n // 整体tree进行对比\n diffChild(vd, oj, nj);\n // 已更新的cp需被老sr删除,因为老sr会回收,而此cp继续存在于新sr中不能回收,这里处理key的\n cpList.forEach(vd => {\n removeCpFromOldTree(vd);\n });\n}\n\n/**\n * 递归检查dom的children,相同的无需重新生成,用PL类型占位符代替直接返回老vd\n * @param vd\n * @param oj\n * @param nj\n */\nfunction diffChild(vd, oj, nj) {\n if(util.isObject(nj)) {\n if(nj.$$type === TYPE_CP) {\n // key对比过了忽略\n if(nj.key === KEY_FLAG) {\n return;\n }\n // 相同class的组件处理\n if(oj && oj.$$type === nj.$$type && oj.klass === nj.klass) {\n diffCp(oj, nj, vd);\n // 已更新的cp需被老sr删除,因为老sr会回收,而此cp继续存在于新sr中不能回收\n removeCpFromOldTree(vd);\n }\n }\n else if(nj.$$type === TYPE_GM && oj && oj.$$type === TYPE_GM) {\n // $geom的multi必须一致\n if(oj.tagName === nj.tagName && oj.props.multi === nj.props.multi) {\n nj.__inheritAnimate = vd;\n }\n }\n // dom类型递归children\n else if(nj.$$type === TYPE_VD && oj && oj.$$type === TYPE_VD) {\n if(oj.tagName === nj.tagName) {\n nj.__inheritAnimate = vd;\n }\n diffChildren(vd, oj, nj);\n }\n }\n}\n\n/**\n * dom类型的vd对比children\n * @param vd\n * @param oj\n * @param nj\n */\nfunction diffChildren(vd, oj, nj) {\n let oc = oj.children;\n let nc = nj.children;\n let ol = oc.length;\n let nl = nc.length;\n let children = vd.children;\n for(let i = 0, of = 0, nf = 0, len = Math.min(ol, nl); i < len; i++) {\n let o = oc[i + of];\n let n = nc[i + nf];\n // 新老都是key直接跳过\n if(o.key === KEY_FLAG && n.key === KEY_FLAG) {\n }\n // 其中一个是key对比过了调整索引和长度\n else if(o.key === KEY_FLAG) {\n of++;\n i--;\n ol--;\n len = Math.min(ol, nl);\n }\n else if(n.key === KEY_FLAG) {\n nf++;\n i--;\n nl--;\n len = Math.min(ol, nl);\n }\n else {\n diffChild(children[i + of], o, n);\n }\n }\n // 长度不同增减的无需关注,新json创建cp有didMount,老vd会调用cp的destroy\n}\n\n/**\n * 根据json对比看cp如何更新,被render()后的json的二级组件对比才会出现\n * @param oj\n * @param nj\n * @param vd\n */\nfunction diffCp(oj, nj, vd) {\n // props全等,直接替换新json类型为占位符,引用老vd内容,无需重新创建,暂时存在json的placeholder上\n // 否则需要强制触发组件更新,包含setState内容\n nj.__placeholder = vd;\n let sr = vd.shadowRoot;\n // 对比需忽略on开头的事件,直接改老的引用到新的上,这样只变了on的话无需更新\n let exist = {};\n Object.keys(oj.props).forEach(k => {\n let v = oj.props[k];\n exist[k] = v;\n });\n Object.keys(nj.props).forEach(k => {\n let v = nj.props[k];\n if(/^on[a-zA-Z]/.test(k)) {\n oj.props[k] = v;\n let ex = exist[k];\n if(ex) {\n delete exist[k];\n if(ex !== v) {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n }\n else {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n }\n else if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n oj.props[k] = v;\n let ex = exist[k];\n if(ex) {\n delete exist[k];\n if(ex !== v) {\n k = k.slice(2).toLowerCase();\n vd.off(k, exist[k]);\n vd.on(k, v);\n }\n delete exist[k];\n }\n else {\n k = k.slice(2).toLowerCase();\n vd.on(k, v);\n }\n }\n });\n // 新的少的事件取消\n Object.keys(exist).forEach(k => {\n let v = exist[k];\n if(/^on[a-zA-Z]/.test(k)) {\n nj.props[k] = v;\n k = k.slice(2).toLowerCase();\n delete sr.listener[k];\n }\n else if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n nj.props[k] = v;\n k = k.slice(2).toLowerCase();\n vd.off(k, v);\n }\n });\n checkCp(vd, nj.props, !util.equal(oj.props, nj.props));\n}\n\n/**\n * 深度优先遍历json,将有key的记录在hash中,如果传入根vd,同步递归保存对应位置的vd\n * @param json\n * @param hash\n * @param vd\n * @returns {*}\n */\nfunction getKeyHash(json, hash, vd) {\n if(Array.isArray(json)) {\n json.forEach((item, i) => getKeyHash(item, hash, vd && vd[i]));\n }\n else if(util.isObject(json)) {\n if(json.$$type === TYPE_VD || json.$$type === TYPE_GM || json.$$type === TYPE_CP) {\n // 深度优先\n if(json.$$type === TYPE_VD) {\n getKeyHash(json.children, hash, vd && vd.children);\n }\n let key = json.props.key;\n if(!util.isNil(key) && key !== '') {\n // 重复key错误警告\n if(hash.hasOwnProperty(key)) {\n inject.warn('Component ' + vd.tagName + ' has duplicate key: ' + key);\n }\n hash[key] = {\n json,\n vd,\n };\n }\n }\n }\n return hash;\n}\n\n/**\n * 非一级组件diff发生更新时,其需要从sr的tree中移除,因为sr会销毁\n */\nfunction removeCpFromOldTree(vd) {\n // root下的一级组件不会发生回收情况,忽略\n if(!vd.host) {\n return;\n }\n let parent = vd.parent;\n if(parent) {\n let i = parent.children.indexOf(vd);\n if(i > -1) {\n parent.children[i] = null;\n }\n else {\n throw new Error('Can not find child: ' + vd.tagName);\n }\n }\n}\n\n/**\n * 执行componentDidUpdate/destroy\n */\nfunction did() {\n updateList.forEach(item => {\n if(util.isFunction(item.componentDidUpdate)) {\n item.componentDidUpdate();\n }\n });\n updateList.splice(0);\n removeList.forEach(item => {\n item.__destroy();\n });\n removeList = [];\n}\n\nexport default {\n updateList,\n check,\n did,\n};\n","import util from './util';\nimport level from '../refresh/level';\n\nconst { joinVd, joinDef } = util;\nconst { contain, NONE, TRANSFORM_ALL, OPACITY, FILTER, MIX_BLEND_MODE } = level;\n\nfunction diff(elem, ovd, nvd) {\n let cns = elem.childNodes;\n diffDefs(cns[0], ovd.defs, nvd.defs);\n // = i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinDef(nd[i]));\n }\n }\n}\n\nfunction diffDef(elem, od, nd) {\n if(od.tagName !== nd.tagName) {\n insertAdjacentHTML(elem, 'beforebegin', joinDef(nd));\n // elem.insertAdjacentHTML('beforebegin', joinDef(nd));\n elem.parentNode.removeChild(elem);\n }\n else {\n if(od.uuid !== nd.uuid) {\n elem.setAttribute('id', nd.uuid);\n }\n let op = {};\n for(let i = 0, len = (od.props || []).length; i < len; i++) {\n let prop = od.props[i];\n let [k, v] = prop;\n op[k] = v;\n }\n for(let i = 0, len = (nd.props || []).length; i < len; i++) {\n let prop = nd.props[i];\n let [k, v] = prop;\n // 已有不等更新,没有添加\n if(op.hasOwnProperty(k)) {\n if(op[k] !== v) {\n elem.setAttribute(k, v);\n }\n delete op[k];\n }\n else {\n elem.setAttribute(k, v);\n }\n }\n // 多余的删除\n Object.keys(op).forEach(i => {\n elem.removeAttribute(i);\n });\n let cns = elem.childNodes;\n let ol = od.children.length;\n let nl = nd.children.length;\n let i = 0;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(elem, i, od.children[i], nd.children[i]);\n }\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinVd(nd.children[i]));\n }\n }\n }\n}\n\nfunction diffChild(elem, ovd, nvd) {\n if(ovd.type === 'dom') {\n if(nvd.type === 'dom') {\n diffD2D(elem, ovd, nvd);\n }\n else if(nvd.type === 'geom') {\n diffD2G(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n else if(ovd.type === 'text') {\n if(nvd.type === 'text') {\n diffT2T(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n else if(ovd.type === 'geom') {\n if(nvd.type === 'dom') {\n diffG2D(elem, ovd, nvd);\n }\n else if(nvd.type === 'geom') {\n diffG2G(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n else if(ovd.type === 'img') {\n if(nvd.type === 'img') {\n diffItemSelf(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n // 特殊情况,当有连续2个img,后面1个发生error时,其children内容不是type为img的图片,而是矢量图item,会进入此分支\n else if(ovd.type === 'item' && nvd.type === 'item') {\n diffItemSelf(elem, ovd, nvd);\n }\n}\n\nfunction diffX2X(elem, ovd, nvd) {\n let { transform, opacity, visibility, mask, overflow, filter, mixBlendMode, conClip } = nvd;\n if(ovd.transform !== transform) {\n if(transform) {\n elem.setAttribute('transform', transform);\n }\n else {\n elem.removeAttribute('transform');\n }\n }\n if(ovd.opacity !== opacity) {\n if(opacity !== 1 && opacity !== undefined) {\n elem.setAttribute('opacity', opacity);\n }\n else {\n elem.removeAttribute('opacity');\n }\n }\n if(ovd.visibility !== visibility) {\n elem.setAttribute('visibility', visibility);\n }\n if(ovd.mask !== mask) {\n if(mask) {\n elem.setAttribute('mask', mask);\n }\n else {\n elem.removeAttribute('mask');\n }\n }\n if(ovd.filter !== filter || ovd.mixBlendMode !== mixBlendMode) {\n let s = (filter ? `filter:${filter};` : '') + (mixBlendMode ? `mix-blend-mode:${mixBlendMode};` : '');\n if(s) {\n elem.setAttribute('style', s);\n }\n else {\n elem.removeAttribute('filter');\n }\n }\n // if(ovd.filter !== filter) {\n // if(filter) {\n // elem.setAttribute('filter', filter);\n // }\n // else {\n // elem.removeAttribute('filter');\n // }\n // }\n if(ovd.overflow !== overflow) {\n if(overflow) {\n elem.setAttribute('clipPath', overflow);\n }\n else {\n elem.removeAttribute('overflow');\n }\n }\n if(ovd.conClip !== conClip) {\n if(conClip) {\n elem.childNodes[1].setAttribute('clip-path', conClip);\n }\n else {\n elem.childNodes[1].removeAttribute('clip-path');\n }\n }\n}\n\nfunction diffByLessLv(elem, ovd, nvd, lv) {\n let { transform, opacity, mask, filter, mixBlendMode } = nvd;\n if(mask) {\n elem.setAttribute('mask', mask);\n }\n else {\n elem.removeAttribute('mask');\n }\n if(lv === NONE) {\n return;\n }\n if(contain(lv, TRANSFORM_ALL)) {\n if(transform) {\n elem.setAttribute('transform', transform);\n }\n else {\n elem.removeAttribute('transform');\n }\n }\n if(contain(lv, OPACITY)) {\n if(opacity !== 1 && opacity !== undefined) {\n elem.setAttribute('opacity', opacity);\n }\n else {\n elem.removeAttribute('opacity');\n }\n }\n if(contain(lv, FILTER) || contain(lv, MIX_BLEND_MODE)) {\n let s = (filter ? `filter:${filter};` : '') + (mixBlendMode ? `mix-blend-mode:${mixBlendMode};` : '');\n if(s) {\n elem.setAttribute('style', s);\n }\n else {\n elem.removeAttribute('style');\n }\n }\n}\n\nfunction diffD2D(elem, ovd, nvd, root) {\n // cache表明children无变化缓存,一定是REPAINT以下的,只需看自身的lv以及mask\n if(nvd.cache) {\n diffByLessLv(elem, ovd, nvd, nvd.lv);\n return;\n }\n // 无cache且= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffD2G(elem, ovd, nvd) {\n diffX2X(elem, ovd, nvd);\n diffBb(elem.firstChild, ovd.bb, nvd.bb);\n let ol = ovd.children.length;\n let nl = nvd.children.length;\n let i = 0;\n let lastChild = elem.lastChild;\n let cns = lastChild.childNodes;\n for(; i < Math.min(ol, nl); i++) {\n replaceWith(cns[i], nvd.children[i]);\n }\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffT2T(elem, ovd, nvd) {\n if(nvd.cache) {\n return;\n }\n let ol = ovd.children.length;\n let nl = nvd.children.length;\n let i = 0;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(elem, i, ovd.children[i], nvd.children[i], true);\n }\n let cns = elem.childNodes;\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffG2D(elem, ovd, nvd) {\n diffD2G(elem, ovd, nvd);\n}\n\nfunction diffG2G(elem, ovd, nvd) {\n if(nvd.cache) {\n diffByLessLv(elem, ovd, nvd, nvd.lv);\n return;\n }\n // 无cache且= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n }\n}\n\nfunction diffBb(elem, obb, nbb) {\n let ol = obb.length;\n let nl = nbb.length;\n let i = 0;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(elem, i, obb[i], nbb[i]);\n }\n let cns = elem.childNodes;\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinVd(nbb[i]));\n }\n }\n}\n\nfunction diffItem(elem, i, ovd, nvd, isText) {\n let cns = elem.childNodes;\n if(ovd.tagName !== nvd.tagName) {\n replaceWith(cns[i], nvd);\n }\n else {\n diffItemSelf(cns[i], ovd, nvd);\n if(isText && ovd.content !== nvd.content) {\n cns[i].innerHTML = nvd.content;\n }\n }\n}\n\nfunction diffItemSelf(elem, ovd, nvd) {\n if(nvd.cache) {\n return;\n }\n let op = {};\n for(let i = 0, len = (ovd.props || []).length; i < len; i++) {\n let prop = ovd.props[i];\n let [k, v] = prop;\n op[k] = v;\n }\n for(let i = 0, len = (nvd.props || []).length; i < len; i++) {\n let prop = nvd.props[i];\n let [k, v] = prop;\n // 已有不等更新,没有添加\n if(op.hasOwnProperty(k)) {\n if(op[k] !== v) {\n elem.setAttribute(k, v);\n }\n delete op[k];\n }\n else {\n elem.setAttribute(k, v);\n }\n }\n // 多余的删除\n Object.keys(op).forEach(i => {\n elem.removeAttribute(i);\n });\n}\n\nfunction replaceWith(elem, vd) {\n let res;\n if(Array.isArray(vd)) {\n res = '';\n vd.forEach(item => {\n res += joinVd(item);\n });\n }\n else {\n res = joinVd(vd);\n }\n insertAdjacentHTML(elem, 'beforebegin', res);\n // elem.insertAdjacentHTML('beforebegin', res);\n elem.parentNode.removeChild(elem);\n}\n\nfunction insertAt(elem, cns, index, html) {\n if(index >= cns.length) {\n insertAdjacentHTML(elem, 'beforeend', html);\n // elem.insertAdjacentHTML('beforeend', html);\n }\n else {\n insertAdjacentHTML(cns[index], 'beforebegin', html);\n // cns[index].insertAdjacentHTML('beforebegin', html);\n }\n}\n\nfunction removeAt(elem, cns, index) {\n if(cns[index]) {\n elem.removeChild(cns[index]);\n }\n}\n\nlet svg;\nfunction insertAdjacentHTML(elem, where, content) {\n if(elem.insertAdjacentHTML) {\n elem.insertAdjacentHTML(where, content);\n }\n else {\n switch(where) {\n case 'beforeend':\n elem.innerHTML += content;\n break;\n case 'beforebegin':\n svg = svg || document.createElement('svg');\n svg.innerHTML = content;\n elem.parentNode.insertBefore(svg.childNodes[0], elem);\n break;\n }\n }\n}\n\nexport default diff;\n","import util from '../util/util';\n\nconst { isFunction } = util;\n\nclass Controller {\n constructor() {\n this.__records = []; // 默认记录和自动记录\n this.__records2 = []; // 非自动播放的动画记录\n this.__list = [] // 默认初始化播放列表,自动播放也存这里\n this.__list2 = []; // json中autoPlay为false的初始化存入这里\n this.__onList = []; // list中已存在的侦听事件,list2初始化时也需要增加上\n this.__lastTime = {}; // 每个类型的上次触发时间,防止重复emit\n }\n\n add(v, list = this.list) {\n if(list.indexOf(v) === -1) {\n list.push(v);\n }\n }\n\n remove(v) {\n let i = this.list.indexOf(v);\n if(i > -1) {\n this.list.splice(i, 1);\n }\n }\n\n __destroy() {\n this.__records = [];\n this.__records2 = [];\n this.__list = [];\n this.__list2 = [];\n }\n\n __action(k, args) {\n this.list.forEach(item => {\n item[k].apply(item, args);\n });\n }\n\n init(records = this.__records, list = this.list) {\n // 检查尚未初始化的record,并初始化,后面才能调用各种控制方法\n if(records.length) {\n // 清除防止重复调用,并且新的json还会进入整体逻辑\n records.splice(0).forEach(item => {\n let { target, animate } = item;\n if(target.isDestroyed) {\n return;\n }\n if(Array.isArray(animate)) {\n animate.forEach(animate => {\n let { value, options } = animate;\n options.autoPlay = false;\n let o = target.animate(value, options);\n this.add(o, list);\n });\n }\n else {\n let { value, options } = animate;\n options.autoPlay = false;\n let o = target.animate(value, options);\n this.add(o, list);\n }\n });\n }\n // 非自动播放后初始化需检测事件,给非自动播放添加上,并清空本次\n if(records === this.__records2) {\n let onList = this.__onList;\n let list2 = this.list2;\n if(list2.length && onList.length) {\n list2.forEach(item => {\n onList.forEach(arr => {\n item.off(arr[0], arr[1]);\n item.on(arr[0], arr[1]);\n });\n });\n }\n }\n }\n\n __playAuto() {\n this.init();\n this.__action('play');\n }\n\n play(cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('play', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n pause() {\n this.__action('pause');\n }\n\n resume(cb) {\n let once = true;\n this.__action('resume', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n __mergeAuto() {\n this.init();\n this.init(this.__records2);\n if(this.__list2.length) {\n this.__list = this.__list.concat(this.__list2);\n this.__list2 = [];\n }\n }\n\n cancel(cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('cancel', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n finish(cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('finish', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n gotoAndStop(v, options, cb) {\n this.__mergeAuto();\n this.__onList = [];\n if(isFunction(options)) {\n cb = options;\n options = {};\n }\n let once = true;\n this.__action('gotoAndStop', [v, options, cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n gotoAndPlay(v, options, cb) {\n this.__mergeAuto();\n this.__onList = [];\n if(isFunction(options)) {\n cb = options;\n options = {};\n }\n let once = true;\n this.__action('gotoAndPlay', [v, options, cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n on(id, handle) {\n if(!isFunction(handle)) {\n return;\n }\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n this.__on(id[i], handle);\n }\n this.__onList.push([id, handle]);\n }\n else {\n this.__on(id, handle);\n this.__onList.push([id, handle]);\n }\n }\n\n __on(id, handle) {\n this.list.forEach(item => {\n let cb = () => {\n let time = item.timestamp;\n if(time !== this.__lastTime[id]) {\n this.__lastTime[id] = time;\n handle();\n }\n };\n cb.__karasEventCb = handle;\n item.on(id, cb);\n });\n }\n\n off(id, handle) {\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n this.off(id[i], handle);\n }\n }\n else {\n this.list.forEach(item => {\n item.off(id, handle);\n });\n }\n }\n\n get list() {\n return this.__list;\n }\n\n get list2() {\n return this.__list2;\n }\n\n __set(key, value) {\n this.list.forEach(item => {\n item[key] = value;\n });\n }\n\n set playbackRate(v) {\n this.__set('playbackRate', v);\n }\n\n set iterations(v) {\n this.__set('iterations', v);\n }\n\n set playCount(v) {\n this.__set('playCount', v);\n }\n\n set fps(v) {\n this.__set('fps', v);\n }\n\n set currentTime(v) {\n this.__set('currentTime', v);\n }\n\n set spfLimit(v) {\n this.__set('spfLimit', v);\n }\n\n set delay(v) {\n this.__set('delay', v);\n }\n\n set endDelay(v) {\n this.__set('endDelay', v);\n }\n\n set fill(v) {\n this.__set('fill', v);\n }\n\n set direction(v) {\n this.__set('direction', v);\n }\n}\n\nexport default Controller;\n","import inject from '../util/inject';\nimport painter from '../util/painter';\n\nconst { canvasPolygon } = painter;\n\n// 无cache时应用离屏时的优先级,从小到大,OFFSCREEN_MASK2是个特殊的\nconst OFFSCREEN_OVERFLOW = 0;\nconst OFFSCREEN_FILTER = 1;\nconst OFFSCREEN_MASK = 2;\nconst OFFSCREEN_BLEND = 3;\nconst OFFSCREEN_MASK2 = 4;\n\nfunction applyOffscreen(ctx, list, width, height) {\n list.sort(function(a, b) {\n if(a[1] === b[1]) {\n if(a[0] === b[0]) {\n return a[2] - b[2];\n }\n return b[0] - a[0];\n }\n return b[1] - a[1];\n });\n list.forEach(item => {\n let [, , type, offscreen] = item;\n if(type === OFFSCREEN_OVERFLOW) {\n let { matrix, target, ctx: origin, x, y, offsetWidth, offsetHeight, list } = offscreen;\n ctx.globalCompositeOperation = 'destination-in';\n ctx.globalAlpha = 1;\n ctx.setTransform(matrix[0], matrix[1], matrix[4], matrix[5], matrix[12], matrix[13]);\n ctx.fillStyle = '#FFF';\n ctx.beginPath();\n if(list) {\n canvasPolygon(ctx, list);\n }\n else {\n ctx.rect(x, y, offsetWidth, offsetHeight);\n }\n ctx.fill();\n ctx.closePath();\n ctx.globalCompositeOperation = 'source-over';\n target.draw();\n ctx = origin;\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.globalAlpha = 1;\n if(width && height) {\n ctx.drawImage(target.canvas, 0, 0, width, height, 0, 0, width, height);\n }\n ctx.draw && ctx.draw(true);\n target.ctx.setTransform(1, 0, 0, 1, 0, 0);\n target.ctx.clearRect(0, 0, width, height);\n target.draw();\n inject.releaseCacheCanvas(target.canvas);\n }\n else if(type === OFFSCREEN_FILTER) {\n let { target, ctx: origin, filter } = offscreen;\n // 申请一个新的离屏,应用blur并绘制,如没有则降级,默认ctx.filter为'none'\n if(ctx.filter) {\n let apply = inject.getCacheCanvas(width, height, null, 'filter');\n apply.ctx.filter = painter.canvasFilter(filter);\n if(width && height) {\n apply.ctx.drawImage(target.canvas, 0, 0, width, height, 0, 0, width, height);\n }\n apply.ctx.filter = 'none';\n apply.draw();\n target.ctx.globalAlpha = 1;\n target.ctx.setTransform(1, 0, 0, 1, 0, 0);\n target.ctx.clearRect(0, 0, width, height);\n if(width && height) {\n target.ctx.drawImage(apply.canvas, 0, 0, width, height, 0, 0, width, height);\n }\n target.draw();\n apply.ctx.setTransform(1, 0, 0, 1, 0, 0);\n apply.ctx.clearRect(0, 0, width, height);\n apply.draw();\n inject.releaseCacheCanvas(apply.canvas);\n }\n // 绘制回主画布,如果不支持则等同无filter原样绘制\n ctx = origin;\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.globalAlpha = 1;\n if(width && height) {\n ctx.drawImage(target.canvas, 0, 0, width, height, 0, 0, width, height);\n }\n ctx.draw && ctx.draw(true);\n target.ctx.setTransform(1, 0, 0, 1, 0, 0);\n target.ctx.globalAlpha = 1;\n target.ctx.clearRect(0, 0, width, height);\n target.draw();\n inject.releaseCacheCanvas(target.canvas);\n }\n else if(type === OFFSCREEN_MASK) {\n let { mask, isClip } = offscreen;\n if(isClip) {\n offscreen.target.draw();\n ctx = mask.ctx;\n ctx.globalCompositeOperation = 'source-out';\n ctx.globalAlpha = 1;\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n if(width && height) {\n ctx.drawImage(offscreen.target.canvas, 0, 0, width, height, 0, 0, width, height);\n }\n mask.draw();\n ctx.globalCompositeOperation = 'source-over';\n offscreen.target.ctx.setTransform(1, 0, 0, 1, 0, 0);\n offscreen.target.ctx.clearRect(0, 0, width, height);\n offscreen.target.draw();\n inject.releaseCacheCanvas(offscreen.target.canvas);\n ctx = offscreen.ctx;\n ctx.globalAlpha = 1;\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n if(width && height) {\n ctx.drawImage(mask.canvas, 0, 0, width, height, 0, 0, width, height);\n }\n ctx.draw && ctx.draw(true);\n mask.ctx.setTransform(1, 0, 0, 1, 0, 0);\n mask.ctx.clearRect(0, 0, width, height);\n mask.draw();\n inject.releaseCacheCanvas(mask.canvas);\n }\n else {\n mask.draw();\n let target = offscreen.target;\n ctx = target.ctx;\n ctx.globalCompositeOperation = 'destination-in';\n ctx.globalAlpha = 1;\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n if(width && height) {\n ctx.drawImage(mask.canvas, 0, 0, width, height, 0, 0, width, height);\n }\n ctx.globalCompositeOperation = 'source-over';\n target.draw();\n mask.ctx.setTransform(1, 0, 0, 1, 0, 0);\n mask.ctx.clearRect(0, 0, width, height);\n mask.draw();\n inject.releaseCacheCanvas(mask.canvas);\n ctx = offscreen.ctx;\n ctx.globalAlpha = 1;\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n if(width && height) {\n ctx.drawImage(target.canvas, 0, 0, width, height, 0, 0, width, height);\n }\n ctx.draw && ctx.draw(true);\n target.ctx.setTransform(1, 0, 0, 1, 0, 0);\n target.ctx.clearRect(0, 0, width, height);\n target.draw();\n inject.releaseCacheCanvas(target.canvas);\n }\n }\n else if(type === OFFSCREEN_BLEND) {\n let target = offscreen.target;\n ctx = offscreen.ctx;\n ctx.globalCompositeOperation = offscreen.mixBlendMode;\n target.draw();\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.globalAlpha = 1;\n if(width && height) {\n ctx.drawImage(target.canvas, 0, 0, width, height, 0, 0, width, height);\n }\n ctx.globalCompositeOperation = 'source-over';\n ctx.draw && ctx.draw(true);\n target.ctx.globalAlpha = 1;\n target.ctx.setTransform(1, 0, 0, 1, 0, 0);\n target.ctx.clearRect(0, 0, width, height);\n target.draw();\n inject.releaseCacheCanvas(target.canvas);\n }\n // 特殊的mask节点汇总结束,还原ctx\n else if(type === OFFSCREEN_MASK2) {\n ctx = offscreen.ctx;\n }\n });\n return ctx;\n}\n\nexport default {\n OFFSCREEN_OVERFLOW,\n OFFSCREEN_FILTER,\n OFFSCREEN_MASK,\n OFFSCREEN_BLEND,\n OFFSCREEN_MASK2,\n applyOffscreen,\n};\n","import Page from '../refresh/Page';\nimport inject from '../util/inject';\n\nclass MockPage {\n constructor(texture, width, height) {\n this.uuid = Page.genUuid();\n this.time = inject.now();\n this.texture = texture;\n this.width = width;\n this.height = height;\n }\n}\n\nexport default MockPage;\n","import MockPage from './MockPage';\n\n/**\n * 一个fbo离屏纹理,mock成cache,当webgl需要局部根节点汇总时生成,即cacheTotal,\n * 基于此纹理进行filter、mask等后处理渲染\n */\nclass MockCache {\n constructor(gl, texture, sx1, sy1, width, height, bbox) {\n this.gl = gl;\n this.x = 0;\n this.y = 0;\n this.sx1 = sx1;\n this.sy1 = sy1;\n this.width = width;\n this.height = height;\n this.bbox = bbox;\n this.available = true;\n this.__page = new MockPage(texture, width, height);\n this.dx = -bbox[0];\n this.dy = -bbox[1];\n this.dbx = sx1 - bbox[0];\n this.dby = sy1 - bbox[1];\n }\n\n release() {\n this.available = false;\n this.gl.deleteTexture(this.page.texture);\n }\n\n get page() {\n return this.__page;\n }\n}\n\nexport default MockCache;\n","import Cache from './Cache';\nimport offscreen from './offscreen';\nimport Text from '../node/Text';\nimport Dom from '../node/Dom';\nimport Img from '../node/Img';\nimport mode from './mode';\nimport mx from '../math/matrix';\nimport geom from '../math/geom';\nimport level from './level';\nimport painter from '../util/painter';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport tf from '../style/transform';\nimport mbm from '../style/mbm';\nimport enums from '../util/enums';\nimport webgl from '../gl/webgl';\nimport MockCache from '../gl/MockCache';\nimport blur from '../math/blur';\nimport vertexBlur from '../gl/filter/blur.vert';\nimport fragmentBlur from '../gl/filter/blur.frag';\nimport vertexMbm from '../gl/mbm/mbm.vert';\nimport fragmentMultiply from '../gl/mbm/multiply.frag';\nimport fragmentScreen from '../gl/mbm/screen.frag';\nimport fragmentOverlay from '../gl/mbm/overlay.frag';\nimport fragmentDarken from '../gl/mbm/darken.frag';\nimport fragmentLighten from '../gl/mbm/lighten.frag';\nimport fragmentColorDodge from '../gl/mbm/color-dodge.frag';\nimport fragmentColorBurn from '../gl/mbm/color-burn.frag';\nimport fragmentHardLight from '../gl/mbm/hard-light.frag';\nimport fragmentSoftLight from '../gl/mbm/soft-light.frag';\nimport fragmentDifference from '../gl/mbm/difference.frag';\nimport fragmentExclusion from '../gl/mbm/exclusion.frag';\nimport fragmentHue from '../gl/mbm/hue.frag';\nimport fragmentSaturation from '../gl/mbm/saturation.frag';\nimport fragmentColor from '../gl/mbm/color.frag';\nimport fragmentLuminosity from '../gl/mbm/luminosity.frag';\n\nconst { NA, LOCAL, CHILD, SELF, getCache } = Cache;\nconst {\n OFFSCREEN_OVERFLOW,\n OFFSCREEN_FILTER,\n OFFSCREEN_MASK,\n OFFSCREEN_BLEND,\n OFFSCREEN_MASK2,\n applyOffscreen,\n} = offscreen;\n\nconst {\n STYLE_KEY: {\n DISPLAY,\n OPACITY,\n VISIBILITY,\n FILTER,\n OVERFLOW,\n MIX_BLEND_MODE,\n FILL,\n TRANSFORM,\n TRANSFORM_ORIGIN,\n PERSPECTIVE,\n PERSPECTIVE_ORIGIN,\n PADDING_LEFT,\n PADDING_RIGHT,\n PADDING_TOP,\n PADDING_BOTTOM,\n BORDER_TOP_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_LEFT_WIDTH,\n MATRIX,\n },\n NODE_KEY: {\n NODE_CACHE,\n NODE_CACHE_TOTAL,\n NODE_CACHE_OVERFLOW,\n NODE_CACHE_MASK,\n NODE_CACHE_FILTER,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n NODE_OPACITY,\n NODE_COMPUTED_STYLE,\n NODE_CURRENT_STYLE,\n NODE_LIMIT_CACHE,\n NODE_REFRESH_LV,\n NODE_CACHE_STYLE,\n NODE_DEFS_CACHE,\n NODE_IS_MASK,\n NODE_DOM_PARENT,\n NODE_PERSPECTIVE_MATRIX,\n NODE_VIRTUAL_DOM,\n NODE_CACHE_AS_BITMAP,\n NODE_STRUCT,\n },\n STRUCT_KEY: {\n STRUCT_NODE,\n STRUCT_INDEX,\n STRUCT_TOTAL,\n STRUCT_HAS_MASK,\n STRUCT_LV,\n },\n} = enums;\nconst {\n NONE,\n TRANSFORM_ALL,\n OPACITY: OP,\n FILTER: FT,\n REPAINT,\n contain,\n MIX_BLEND_MODE: MBM,\n PERSPECTIVE: PPT,\n} = level;\nconst { isE, inverse, multiply } = mx;\nconst { mbmName, isValidMbm } = mbm;\nconst { assignMatrix, transformBbox } = util;\n\n/**\n * 生成一个节点及其子节点所包含的矩形范围盒,canvas和webgl的最大尺寸限制不一样,由外部传入\n * 如果某个子节点超限,则视为整个超限,超限返回空\n * @param node\n * @param __structs\n * @param index\n * @param total\n * @param parentIndexHash\n * @param opacityHash\n * @param MAX\n * @param includeLimitCache webgl时即便超限也要强制生成total,所以标识不能跳出\n * @returns {*}\n */\nfunction genBboxTotal(node, __structs, index, total, parentIndexHash, opacityHash, MAX, includeLimitCache) {\n let { __sx1: sx1, __sy1: sy1, __config } = node;\n let {\n [NODE_CACHE]: cache,\n [NODE_COMPUTED_STYLE]: {\n [FILTER]: filter,\n [PERSPECTIVE]: perspective,\n [PERSPECTIVE_ORIGIN]: perspectiveOrigin,\n },\n } = __config;\n // 先将局部根节点的bbox算好,可能没内容是空\n let bboxTotal;\n if(cache && cache.available) {\n bboxTotal = cache.bbox.slice(0);\n }\n else {\n bboxTotal = node.bbox.slice(0);\n }\n // 局部根节点如有perspective,则计算pm,这里不会出现嵌套,因为每个出现都会生成局部根节点\n let pm;\n if(perspective) {\n pm = tf.calPerspectiveMatrix(perspective, perspectiveOrigin);\n }\n // 广度遍历,不断一层层循环下去,用2个hash暂存每层的父matrix和opacity,blur只需记住顶层,因为子的如果有一定是cacheFilter\n let list = [index];\n let d = 0;\n filter.forEach(item => {\n let [k, v] = item;\n if(k === 'blur') {\n d = blur.outerSize(v);\n }\n });\n opacityHash[index] = 1;\n // opacity可以保存下来层级相乘结果供外部使用,但matrix不可以,因为这里按画布原点为坐标系计算,外部合并局部根节点以bbox左上角为原点\n let matrixHash = {};\n while(list.length) {\n let arr = list.splice(0);\n for(let i = 0, len = arr.length; i < len; i++) {\n let parentIndex = arr[i];\n let total = __structs[parentIndex][STRUCT_TOTAL] || 0;\n for(let i = parentIndex + 1, len = parentIndex + total + 1; i < len; i++) {\n let {\n [STRUCT_NODE]: node2,\n [STRUCT_TOTAL]: total,\n } = __structs[i];\n // mask也不占bbox位置\n if(node2.isMask) {\n continue;\n }\n let {\n __sx1,\n __sy1,\n __config: {\n [NODE_LIMIT_CACHE]: limitCache,\n [NODE_CACHE]: __cache,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_COMPUTED_STYLE]: {\n [DISPLAY]: display,\n [VISIBILITY]: visibility,\n [TRANSFORM]: transform,\n [TRANSFORM_ORIGIN]: transformOrigin,\n [OPACITY]: opacity,\n },\n },\n } = node2;\n // webgl不能跳过超限\n if(limitCache && !includeLimitCache) {\n return;\n }\n // display:none跳过整个节点树,visibility只跳过自身\n if(display === 'none') {\n i += total || 0;\n continue;\n }\n if(visibility === 'hidden') {\n continue;\n }\n parentIndexHash[i] = parentIndex;\n opacityHash[i] = opacityHash[parentIndex] * opacity;\n // 防止text的情况,其一定属于某个node,其bbox被计算过,text不应该计算\n if(node2 instanceof Text) {\n continue;\n }\n let bbox, dx = 0, dy = 0, hasTotal;\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal]);\n if(target) {\n bbox = target.bbox.slice(0);\n dx = target.dbx;\n dy = target.dby;\n i += total || 0;\n hasTotal = true;\n }\n else if(__cache && __cache.available) {\n bbox = __cache.bbox.slice(0);\n dx = __cache.dbx;\n dy = __cache.dby;\n }\n else {\n bbox = node2.bbox.slice(0);\n }\n // 可能Xom没有内容\n if(bbox) {\n bbox[0] -= sx1;\n bbox[1] -= sy1;\n bbox[2] -= sx1;\n bbox[3] -= sy1;\n let matrix = matrixHash[parentIndex];\n // 父级matrix初始化E为null,自身不为E时才运算,可以加速\n if(transform && !isE(transform)) {\n let tfo = transformOrigin.slice(0);\n // total下的节点tfo的计算,以total为原点,差值坐标即相对坐标\n tfo[0] += __sx1 - sx1 + dx;\n tfo[1] += __sy1 - sy1 + dy;\n let m = tf.calMatrixByOrigin(transform, tfo);\n if(matrix) {\n matrix = multiply(matrix, m);\n }\n else {\n matrix = m;\n }\n }\n if(matrix) {\n matrixHash[i] = matrix;\n }\n if(pm) {\n matrix = multiply(pm, matrix);\n }\n bbox = transformBbox(bbox, matrix, d, d);\n // 有孩子才继续存入下层级广度运算\n if(total && !hasTotal) {\n list.push(i);\n }\n mergeBbox(bboxTotal, bbox, sx1, sy1);\n }\n }\n }\n }\n return [bboxTotal, pm];\n}\n\nfunction mergeBbox(bbox, t, sx1, sy1) {\n bbox[0] = Math.min(bbox[0], sx1 + t[0]);\n bbox[1] = Math.min(bbox[1], sy1 + t[1]);\n bbox[2] = Math.max(bbox[2], sx1 + t[2]);\n bbox[3] = Math.max(bbox[3], sy1 + t[3]);\n}\n\n/**\n * 生成局部根节点离屏缓存,超限时除外\n * cache是每个节点自身的缓存,且共享离屏canvas\n * cacheTotal是基础\n * cacheFilter基于total\n * cacheOverflow基于filter\n * cacheMask基于overflow\n * cacheBlend基于mask\n * @param renderMode\n * @param node\n * @param config\n * @param index\n * @param lv\n * @param total\n * @param __structs\n * @param hasMask\n * @param width\n * @param height\n * @returns {{enabled}|Cache|*}\n */\nfunction genTotal(renderMode, node, config, index, lv, total, __structs, hasMask, width, height) {\n let {\n [NODE_CACHE_TOTAL]: cacheTotal,\n [NODE_CACHE_FILTER]: cacheFilter,\n [NODE_CACHE_MASK]: cacheMask,\n [NODE_CACHE_OVERFLOW]: cacheOverflow,\n [NODE_CURRENT_STYLE]: currentStyle,\n [NODE_COMPUTED_STYLE]: computedStyle,\n } = config;\n let needGen;\n // 先绘制形成基础的total,有可能已经存在无变化,就可省略\n if(!cacheTotal || !cacheTotal.available) {\n needGen = true; // total重新生成了,其它基于的也一定需要重新生成\n let bboxTotal, baseMatrix;\n let { __sx1: sx1, __sy1: sy1 } = node;\n // 栈代替递归,存父节点的matrix/opacity,matrix为E时存null省略计算\n let matrixList = [];\n let parentMatrix;\n let opacityList = [];\n let parentOpacity = 1;\n let lastConfig;\n let lastLv = lv;\n // 先遍历每个节点,以局部根节点左上角为原点,求得所占的总的bbox,即合并所有bbox\n for(let i = index, len = index + (total || 0) + 1; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_LV]: lv,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n } = __structs[i];\n // 排除Text\n if(node instanceof Text) {\n let bbox = node.bbox;\n if(!isE(parentMatrix)) {\n bbox = transformBbox(bbox, parentMatrix, 0, 0);\n }\n mergeBbox(bboxTotal, bbox, 0, 0);\n continue;\n }\n let __config = node.__config;\n let {\n [NODE_REFRESH_LV]: refreshLevel,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_COMPUTED_STYLE]: computedStyle,\n [NODE_IS_MASK]: isMask,\n } = __config;\n // 跳过display:none元素和它的所有子节点和mask\n if(computedStyle[DISPLAY] === 'none') {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n continue;\n }\n // mask不占bbox,本身除外\n if(i !== index && isMask) {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n continue;\n }\n // lv变大说明是child,相等是sibling,变小可能是parent或另一棵子树,根节点是第一个特殊处理\n if(i === index) {}\n else if(lv > lastLv) {\n parentMatrix = lastConfig[NODE_MATRIX_EVENT];\n if(isE(parentMatrix)) {\n parentMatrix = null;\n }\n matrixList.push(parentMatrix);\n parentOpacity = lastConfig[NODE_OPACITY];\n opacityList.push(parentOpacity);\n }\n // 变小出栈索引需注意,可能不止一层,多层计算diff层级\n else if(lv < lastLv) {\n let diff = lastLv - lv;\n matrixList.splice(-diff);\n parentMatrix = matrixList[lv - 1];\n opacityList.splice(-diff);\n parentOpacity = opacityList[lv - 1];\n }\n // 不变是同级兄弟,无需特殊处理 else {}\n lastConfig = __config;\n lastLv = lv;\n let {\n [NODE_CURRENT_STYLE]: currentStyle,\n [NODE_CACHE_STYLE]: __cacheStyle,\n } = __config;\n let matrix, opacity;\n /**\n * lv=REPAINT重新渲染,bbox重新生成,matrix重新生成,filter重新生成\n */\n else {\n node.__bbox = null;\n if(i === index) {\n node.__calFilter(currentStyle, computedStyle);\n }\n matrix = node.__calMatrix(refreshLevel, __cacheStyle, currentStyle, computedStyle, __config);\n assignMatrix(__config[NODE_MATRIX], matrix);\n opacity = computedStyle[OPACITY] = currentStyle[OPACITY];\n }\n // opacity可临时赋值下面循环渲染用,matrixEvent可能需重新计算,因为局部根节点为E没考虑继承,这里仅计算bbox用\n if(i === index) {\n opacity = 1;\n baseMatrix = matrix;\n matrix = mx.identity();\n }\n else if(!isE(parentMatrix)) {\n matrix = multiply(parentMatrix, matrix);\n }\n assignMatrix(__config[NODE_MATRIX_EVENT], matrix);\n __config[NODE_OPACITY] = parentOpacity * opacity;\n let bbox;\n // 子元素有cacheTotal优先使用,一定是子元素,局部根节点available为false不会进\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal]);\n if(target) {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n bbox = target.bbox;\n }\n else {\n bbox = node.bbox;\n }\n // 老的不变,新的会各自重新生成,根据matrixEvent合并bboxTotal\n bbox = transformBbox(bbox, matrix, 0, 0);\n if(i === index) {\n bboxTotal = bbox.slice(0);\n }\n else {\n mergeBbox(bboxTotal, bbox, 0, 0);\n }\n }\n // 生成cacheTotal,获取偏移dx/dy\n config[NODE_CACHE_TOTAL] = cacheTotal = Cache.getInstance(bboxTotal, sx1, sy1);\n if(!cacheTotal || !cacheTotal.enabled) {\n return;\n }\n cacheTotal.__available = true;\n let { dx, dy, dbx, dby, x: tx, y: ty } = cacheTotal;\n let ctxTotal = cacheTotal.ctx;\n /**\n * 再次遍历每个节点,以局部根节点左上角为基准原点,将所有节点绘制上去\n * 每个子节点的opacity有父继承计算在上面循环已经做好了,直接获取\n * 但matrixEvent可能需要重算,因为原点不一定是根节点的原点,影响tfo\n * 另外每个节点的refreshLevel需要设置REPAINT\n * 这样cacheTotal取消时子节点需确保重新计算一次matrix/opacity/filter,保证下次和父元素继承正确\n */\n parentMatrix = null;\n let lastMatrix;\n lastLv = lv;\n // 和外面没cache的类似,mask生成hash记录\n let maskStartHash = {};\n let offscreenHash = {};\n for(let i = index, len = index + (total || 0) + 1; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_LV]: lv,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n } = __structs[i];\n // 排除Text\n if(node instanceof Text) {\n node.render(renderMode, REPAINT, ctxTotal, CHILD, dx, dy);\n if(offscreenHash.hasOwnProperty(i)) {\n ctxTotal = applyOffscreen(ctxTotal, offscreenHash[i], width, height);\n }\n }\n else {\n let __config = node.__config;\n let {\n [NODE_REFRESH_LV]: refreshLevel,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_COMPUTED_STYLE]: computedStyle,\n } = __config;\n if(maskStartHash.hasOwnProperty(i)) {\n let [idx, n, offscreenMask] = maskStartHash[i];\n let target = inject.getCacheCanvas(width, height, null, 'mask2');\n offscreenMask.mask = target; // 应用mask用到\n offscreenMask.isClip = node.isClip;\n // 定位到最后一个mask元素上的末尾\n let j = i + (total || 0) + 1;\n while(--n) {\n let { [STRUCT_TOTAL]: total } = __structs[j];\n j += (total || 0) + 1;\n }\n j--;\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([idx, lv, OFFSCREEN_MASK, offscreenMask]);\n list.push([j, lv, OFFSCREEN_MASK2, {\n ctx: ctxTotal, // 保存等待OFFSCREEN_MASK2时还原\n target,\n }]);\n ctxTotal = target.ctx;\n }\n // lv变大说明是child,相等是sibling,变小可能是parent或另一棵子树,根节点是第一个特殊处理\n if(i === index) {}\n else if(lv > lastLv) {\n parentMatrix = lastMatrix;\n if(isE(parentMatrix)) {\n parentMatrix = null;\n }\n matrixList.push(parentMatrix);\n }\n // 变小出栈索引需注意,可能不止一层,多层计算diff层级\n else if(lv < lastLv) {\n let diff = lastLv - lv;\n matrixList.splice(-diff);\n parentMatrix = matrixList[lv - 1];\n }\n // 不变是同级兄弟,无需特殊处理 else {}\n let {\n [TRANSFORM]: transform,\n [TRANSFORM_ORIGIN]: tfo,\n [DISPLAY]: display,\n } = computedStyle;\n // 特殊渲染的matrix,局部根节点为原点考虑,当需要计算时再计算\n let m;\n if(i !== index && (!isE(parentMatrix) || !isE(transform))) {\n tfo = tfo.slice(0);\n tfo[0] += dbx + node.__sx1 - sx1 + tx;\n tfo[1] += dby + node.__sy1 - sy1 + ty;\n m = tf.calMatrixByOrigin(transform, tfo);\n if(!isE(parentMatrix)) {\n m = multiply(parentMatrix, m);\n }\n }\n else {\n m = null;\n }\n if(m) {\n ctxTotal.setTransform(m[0], m[1], m[4], m[5], m[12], m[13]);\n }\n else {\n ctxTotal.setTransform(1, 0, 0, 1, 0, 0);\n }\n lastLv = lv;\n lastMatrix = m;\n // 子元素有cacheTotal优先使用,也一定是子元素,局部根节点不会进\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal]);\n if(i !== index && target) {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n // 跳过display:none元素和它的所有子节点\n if(display === 'none') {\n continue;\n }\n let mixBlendMode = computedStyle[MIX_BLEND_MODE];\n if(isValidMbm(mixBlendMode)) {\n ctxTotal.globalCompositeOperation = mbmName(mixBlendMode);\n }\n else {\n ctxTotal.globalCompositeOperation = 'source-over';\n }\n ctxTotal.globalAlpha = __config[NODE_OPACITY];\n Cache.drawCache(target, cacheTotal);\n ctxTotal.globalCompositeOperation = 'source-over';\n }\n else {\n if(refreshLevel >= REPAINT) {\n // 手动计算cacheStyle和根据border-box的坐标再渲染\n node.__calCache(renderMode, ctxTotal, __config[NODE_DOM_PARENT],\n __config[NODE_CACHE_STYLE], __config[NODE_CURRENT_STYLE], computedStyle,\n node.clientWidth, node.clientHeight, node.offsetWidth, node.offsetHeight,\n computedStyle[BORDER_TOP_WIDTH], computedStyle[BORDER_RIGHT_WIDTH],\n computedStyle[BORDER_BOTTOM_WIDTH], computedStyle[BORDER_LEFT_WIDTH],\n computedStyle[PADDING_TOP], computedStyle[PADDING_RIGHT],\n computedStyle[PADDING_BOTTOM], computedStyle[PADDING_LEFT],\n node.__sx1, node.__sx2, node.__sx3, node.__sx4, node.__sx5, node.__sx6,\n node.__sy1, node.__sy2, node.__sy3, node.__sy4, node.__sy5, node.__sy6);\n }\n let res = node.render(renderMode, refreshLevel, ctxTotal, i === index ? LOCAL : CHILD, dx, dy);\n __config[NODE_REFRESH_LV] = REPAINT;\n let { offscreenBlend, offscreenMask, offscreenFilter, offscreenOverflow } = res || {};\n // 这里离屏顺序和xom里返回的一致,和下面应用离屏时的list相反\n if(offscreenBlend) {\n let j = i + (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([i, lv, OFFSCREEN_BLEND, offscreenBlend]);\n ctxTotal = offscreenBlend.target.ctx;\n }\n // 被遮罩的节点要为第一个遮罩和最后一个遮罩的索引打标,被遮罩的本身在一个离屏canvas,遮罩的元素在另外一个\n // 最后一个遮罩索引因数量不好计算,放在maskStartHash做\n if(offscreenMask) {\n let j = i + (total || 0);\n maskStartHash[j + 1] = [i, hasMask, offscreenMask];\n ctxTotal = offscreenMask.target.ctx;\n }\n // filter造成的离屏,需要将后续一段孩子节点区域的ctx替换,并在结束后应用结果,再替换回来\n if(offscreenFilter) {\n let j = i + (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([i, lv, OFFSCREEN_FILTER, offscreenFilter]);\n ctxTotal = offscreenFilter.target.ctx;\n }\n // overflow:hidden的离屏,最后孩子进行截取\n if(offscreenOverflow) {\n let j = i + (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([i, lv, OFFSCREEN_OVERFLOW, offscreenOverflow]);\n ctxTotal = offscreenOverflow.target.ctx;\n }\n // 离屏应用,按照lv从大到小即子节点在前先应用,同一个节点多个效果按offscreen优先级从小到大来,\n // 由于mask特殊索引影响,所有离屏都在最后一个mask索引判断,此时mask本身优先结算,以index序大到小判断\n if(offscreenHash.hasOwnProperty(i)) {\n ctxTotal = applyOffscreen(ctxTotal, offscreenHash[i], width, height);\n }\n // render后判断可见状态,此时computedStyle才有值\n if(display === 'none') {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n }\n }\n }\n }\n // 恢复,且局部根节点设置NONE\n assignMatrix(config[NODE_MATRIX_EVENT], baseMatrix);\n config[NODE_REFRESH_LV] = NONE;\n }\n // cacheTotal仍在说明 lastLv) {\n parentMatrix = lastMatrix;\n if(isE(parentMatrix)) {\n parentMatrix = null;\n }\n matrixList.push(parentMatrix);\n parentOpacity = lastOpacity;\n opacityList.push(parentOpacity);\n }\n // 变小出栈索引需注意,可能不止一层,多层计算diff层级\n else if(lv < lastLv) {\n let diff = lastLv - lv;\n matrixList.splice(-diff);\n parentMatrix = matrixList[lv - 1];\n opacityList.splice(-diff);\n parentOpacity = opacityList[lv - 1];\n }\n // 不变是同级兄弟,无需特殊处理 else {}\n lastLv = lv;\n // 计算临时的matrix\n let {\n [DISPLAY]: display,\n [TRANSFORM]: transform,\n [TRANSFORM_ORIGIN]: tfo,\n } = computedStyle;\n // 特殊渲染的matrix,局部根节点为原点考虑,本节点需inverse反向\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal]);\n if(target) {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n // 跳过display:none元素和它的所有子节点\n if(display === 'none') {\n continue;\n }\n let mixBlendMode = computedStyle[MIX_BLEND_MODE];\n if(isValidMbm(mixBlendMode)) {\n ctx.globalCompositeOperation = mbmName(mixBlendMode);\n }\n else {\n ctx.globalCompositeOperation = 'source-over';\n }\n ctx.globalAlpha = __config[NODE_OPACITY];\n Cache.drawCache(target, cacheMask, transform, mx.identity(), tfo.slice(0), parentMatrix, inverse);\n ctx.globalCompositeOperation = 'source-over';\n }\n // 等于将外面bbox计算和渲染合一的过程,但不需要bbox本身的内容\n else {\n let {\n [NODE_CURRENT_STYLE]: currentStyle,\n [NODE_CACHE_STYLE]: __cacheStyle,\n } = __config;\n let matrix, opacity;\n if(refreshLevel < REPAINT) {\n if(contain(refreshLevel, TRANSFORM_ALL)) {\n matrix = node.__calMatrix(refreshLevel, __cacheStyle, currentStyle, computedStyle, __config);\n assignMatrix(__config[NODE_MATRIX], matrix);\n }\n else {\n matrix = __config[NODE_MATRIX];\n }\n if(contain(refreshLevel, OP)) {\n computedStyle[OPACITY] = currentStyle[OPACITY];\n }\n opacity = computedStyle[OPACITY];\n if(contain(refreshLevel, FT)) {\n node.__bbox = null;\n node.__calFilter(currentStyle, computedStyle);\n }\n matrix = __config[NODE_MATRIX];\n if(contain(refreshLevel, MBM)) {\n computedStyle[MIX_BLEND_MODE] = currentStyle[MIX_BLEND_MODE];\n }\n }\n else {\n node.__bbox = null;\n if(i === index) {\n node.__calFilter(currentStyle, computedStyle);\n }\n matrix = node.__calMatrix(refreshLevel, __cacheStyle, currentStyle, computedStyle, __config);\n assignMatrix(__config[NODE_MATRIX], matrix);\n opacity = computedStyle[OPACITY] = currentStyle[OPACITY];\n }\n // opacity可临时赋值下面循环渲染用,matrixEvent可能需重新计算,因为局部根节点为E没考虑继承,这里仅计算bbox用\n if(i === index) {\n opacity = 1;\n matrix = mx.identity();\n }\n else if(parentMatrix) {\n matrix = multiply(parentMatrix, matrix);\n }\n assignMatrix(__config[NODE_MATRIX_EVENT], matrix);\n lastOpacity = __config[NODE_OPACITY] = parentOpacity * opacity;\n // 特殊渲染的matrix,局部根节点为原点考虑,当需要计算时再计算\n let m;\n if(i !== index && (!isE(parentMatrix) || !isE(transform))) {\n tfo = tfo.slice(0);\n tfo[0] += dbx + node.__sx1 - sx1 + tx;\n tfo[1] += dby + node.__sy1 - sy1 + ty;\n m = tf.calMatrixByOrigin(transform, tfo);\n if(!isE(parentMatrix)) {\n m = multiply(parentMatrix, m);\n }\n }\n else {\n m = null;\n }\n lastMatrix = m;\n if(m) {\n // 很多情况mask和target相同matrix,可简化计算\n if(util.equalArr(m, inverse)) {\n m = mx.identity();\n }\n else {\n inverse = mx.inverse(inverse);\n m = mx.multiply(inverse, m);\n }\n }\n if(m) {\n ctx.setTransform(m[0], m[1], m[4], m[5], m[12], m[13]);\n }\n else {\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n }\n if(refreshLevel >= REPAINT) {\n // 手动计算cacheStyle和根据border-box的坐标再渲染\n node.__calCache(renderMode, ctx, __config[NODE_DOM_PARENT],\n __config[NODE_CACHE_STYLE], __config[NODE_CURRENT_STYLE], computedStyle,\n node.clientWidth, node.clientHeight, node.offsetWidth, node.offsetHeight,\n computedStyle[BORDER_TOP_WIDTH], computedStyle[BORDER_RIGHT_WIDTH],\n computedStyle[BORDER_BOTTOM_WIDTH], computedStyle[BORDER_LEFT_WIDTH],\n computedStyle[PADDING_TOP], computedStyle[PADDING_RIGHT],\n computedStyle[PADDING_BOTTOM], computedStyle[PADDING_LEFT],\n node.__sx1, node.__sx2, node.__sx3, node.__sx4, node.__sx5, node.__sx6,\n node.__sy1, node.__sy2, node.__sy3, node.__sy4, node.__sy5, node.__sy6);\n }\n let res = node.render(renderMode, refreshLevel, ctx, CHILD, dx, dy);\n __config[NODE_REFRESH_LV] = REPAINT;\n let { offscreenBlend, offscreenMask, offscreenFilter, offscreenOverflow } = res || {};\n // 这里离屏顺序和xom里返回的一致,和下面应用离屏时的list相反\n if(offscreenBlend) {\n let j = i + (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([i, lv, OFFSCREEN_BLEND, offscreenBlend]);\n ctx = offscreenBlend.target.ctx;\n }\n // 被遮罩的节点要为第一个遮罩和最后一个遮罩的索引打标,被遮罩的本身在一个离屏canvas,遮罩的元素在另外一个\n // 最后一个遮罩索引因数量不好计算,放在maskStartHash做\n if(offscreenMask) {\n let j = i + (total || 0);\n maskStartHash[j + 1] = [i, hasMask, offscreenMask];\n ctx = offscreenMask.target.ctx;\n }\n // filter造成的离屏,需要将后续一段孩子节点区域的ctx替换,并在结束后应用结果,再替换回来\n if(offscreenFilter) {\n let j = i + (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([i, lv, OFFSCREEN_FILTER, offscreenFilter]);\n ctx = offscreenFilter.target.ctx;\n }\n // overflow:hidden的离屏,最后孩子进行截取\n if(offscreenOverflow) {\n let j = i + (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([i, lv, OFFSCREEN_OVERFLOW, offscreenOverflow]);\n ctx = offscreenOverflow.target.ctx;\n }\n // 离屏应用,按照lv从大到小即子节点在前先应用,同一个节点多个效果按offscreen优先级从小到大来,\n // 由于mask特殊索引影响,所有离屏都在最后一个mask索引判断,此时mask本身优先结算,以index序大到小判断\n if(offscreenHash.hasOwnProperty(i)) {\n ctx = applyOffscreen(ctx, offscreenHash[i], width, height);\n }\n // render后判断可见状态,此时computedStyle才有值\n if(display === 'none') {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n }\n }\n }\n }\n });\n }\n }\n}\n\nfunction genFilter(node, cache, v) {\n return Cache.genFilter(cache, v);\n}\n\nfunction genMask(node, cache, cb) {\n return Cache.genMask(cache, node, cb);\n}\n\nfunction genOverflow(node, cache) {\n let sbox = node.bbox;\n let bbox = cache.bbox;\n // 没超过无需生成\n if(bbox[0] >= sbox[0] && bbox[1] >= sbox[1] && bbox[2] <= sbox[2] && bbox[3] <= sbox[3]) {\n return;\n }\n return Cache.genOverflow(cache, node);\n}\n\nfunction resetMatrixCacheTotal(__structs, index, total, lv, matrixEvent) {\n let matrixList = [];\n let parentMatrix;\n let lastMatrix = matrixEvent;\n let lastLv = lv;\n for(let i = index + 1, len = index + (total || 0) + 1; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_LV]: lv,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n } = __structs[i];\n // 排除Text\n if(node instanceof Text) {\n continue;\n }\n let __config = node.__config;\n let {\n [NODE_MATRIX_EVENT]: old,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CURRENT_STYLE]: currentStyle,\n [NODE_COMPUTED_STYLE]: computedStyle,\n [NODE_CACHE_STYLE]: cacheStyle,\n } = __config;\n // 跳过display:none元素和它的所有子节点和mask\n if(computedStyle[DISPLAY] === 'none') {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n continue;\n }\n // lv变大说明是child,相等是sibling,变小可能是parent或另一棵子树\n if(lv > lastLv) {\n parentMatrix = lastMatrix;\n if(isE(parentMatrix)) {\n parentMatrix = null;\n }\n matrixList.push(parentMatrix);\n }\n // 变小出栈索引需注意,可能不止一层,多层计算diff层级\n else if(lv < lastLv) {\n let diff = lastLv - lv;\n matrixList.splice(-diff);\n parentMatrix = matrixList[lv - 1];\n }\n // 不变是同级兄弟,无需特殊处理 else {}\n lastLv = lv;\n old = old.slice(0);\n // 计算真正的相对于root原点的matrix\n cacheStyle[MATRIX] = null;\n let matrix = node.__calMatrix(REPAINT, cacheStyle, currentStyle, computedStyle, __config);\n assignMatrix(__config[NODE_MATRIX], matrix);\n if(!isE(parentMatrix)) {\n matrix = multiply(parentMatrix, matrix);\n }\n assignMatrix(__config[NODE_MATRIX_EVENT], matrix);\n lastMatrix = matrix;\n // 深度遍历递归进行\n if(__cacheTotal && __cacheTotal.available) {\n let needReset = __cacheTotal.isNew;\n if(!needReset && !util.equalArr(old, matrix)) {\n needReset = true;\n }\n if(needReset) {\n resetMatrixCacheTotal(__structs, i, total || 0, lv, matrix);\n }\n __cacheTotal.__isNew = false;\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n }\n }\n}\n\n/**\n * canvas/webgl支持任意节点为mask,不像svg仅单节点\n * hasMask的num是指遮罩对象后面的兄弟节点数,需要换算成包含子节点的总数\n * @param __structs\n * @param start\n * @param hasMask\n */\nfunction countMaskNum(__structs, start, hasMask) {\n let count = 0;\n while(hasMask--) {\n let {\n [STRUCT_TOTAL]: total,\n } = __structs[start];\n count += total || 0;\n start += total || 0;\n // total不算自身,所以还得+1\n count++;\n start++;\n }\n return count;\n}\n\n// webgl不太一样,使用fbo离屏绘制到一个纹理上进行汇总\nfunction genFrameBufferWithTexture(gl, texCache, width, height) {\n let n = texCache.lockOneChannel();\n let texture = webgl.createTexture(gl, null, n, width, height);\n let frameBuffer = gl.createFramebuffer();\n gl.bindFramebuffer(gl.FRAMEBUFFER, frameBuffer);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);\n let check = gl.checkFramebufferStatus(gl.FRAMEBUFFER);\n if(check !== gl.FRAMEBUFFER_COMPLETE) {\n inject.error('Framebuffer object is incomplete: ' + check.toString());\n }\n // 离屏窗口0开始\n gl.viewport(0, 0, width, height);\n gl.clearColor(0, 0, 0, 0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n return [n, frameBuffer, texture];\n}\n\n/**\n * 局部根节点复合图层生成,汇总所有子节点到一颗局部树上的位图缓存,包含超限特殊情况\n * 即便只有自己一个也要返回,因为webgl生成total的原因是有类似filter/mask等必须离屏处理的东西\n * @param gl\n * @param texCache\n * @param node\n * @param __config\n * @param index\n * @param total\n * @param __structs\n * @param cache\n * @param limitCache\n * @param hasMbm\n * @param W\n * @param H\n * @returns {*}\n */\nfunction genTotalWebgl(gl, texCache, node, __config, index, total, __structs, cache, limitCache, hasMbm, W, H) {\n // 存每层父亲的matrix和opacity和index,bbox计算过程中生成,缓存给下面渲染过程用\n let parentIndexHash = {};\n let opacityHash = {};\n let [bboxTotal, parentPm] = genBboxTotal(node, __structs, index, total, parentIndexHash, opacityHash,\n gl.getParameter(gl.MAX_TEXTURE_SIZE), limitCache);\n // 可能局部根节点合成过程中发现整体超限\n let totalLimitCache;\n if(!bboxTotal) {\n totalLimitCache = true;\n }\n // 超限情况生成画布大小的特殊纹理\n if(limitCache || totalLimitCache) {\n bboxTotal = [0, 0, W, H];\n }\n let width = bboxTotal[2] - bboxTotal[0];\n let height = bboxTotal[3] - bboxTotal[1];\n let [n, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n // 以bboxTotal的左上角为原点生成离屏texture\n let { __sx1: sx1, __sy1: sy1 } = node;\n let cx = width * 0.5, cy = height * 0.5;\n let dx = -bboxTotal[0], dy = -bboxTotal[1];\n let dbx = sx1 - bboxTotal[0], dby = sy1 - bboxTotal[1];\n // 先绘制自己的cache,起点所以matrix视作E为空,opacity固定1\n if(cache && cache.available) {\n texCache.addTexAndDrawWhenLimit(gl, cache, 1, null, cx, cy, dx, dy, false);\n }\n // limitCache无cache需先绘制到统一的离屏画布上\n else if(limitCache) {\n let c = inject.getCacheCanvas(width, height, '__$$OVERSIZE$$__');\n node.render(mode.WEBGL, 0, gl, NA, 0, 0);\n let j = texCache.lockOneChannel();\n let texture = webgl.createTexture(gl, c.canvas, j);\n let mockCache = new MockCache(gl, texture, 0, 0, width, height, [0, 0, width, height]);\n texCache.addTexAndDrawWhenLimit(gl, mockCache, 1, null, cx, cy, 0, 0, false);\n texCache.refresh(gl, cx, cy);\n c.ctx.setTransform(1, 0, 0, 1, 0, 0);\n c.ctx.globalAlpha = 1;\n c.ctx.clearRect(0, 0, width, height);\n mockCache.release();\n texCache.releaseLockChannel(j);\n }\n // 因为cacheTotal不总是以左上角原点为开始,所以必须每个节点重算matrix,合并box时计算的无法用到\n let matrixHash = {};\n // 先序遍历汇总到total\n for(let i = index + 1, len = index + (total || 0) + 1; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n } = __structs[i];\n let __config = node.__config;\n let parentIndex = parentIndexHash[i];\n let matrix = matrixHash[parentIndex]; // 父节点的在每个节点计算后保存,第一个为top的默认为E(空)\n let opacity = opacityHash[i]; // opacity在合并box时已经计算可以直接用\n // 先看text,visibility会在内部判断,display会被parent判断\n if(node instanceof Text) {\n if(parentPm) {\n matrix = multiply(parentPm, matrix);\n }\n texCache.addTexAndDrawWhenLimit(gl, __config[NODE_CACHE], opacity, matrix, cx, cy, dx, dy, false);\n }\n // 再看total缓存/cache,都没有的是无内容的Xom节点\n else {\n let {\n [NODE_CACHE]: __cache,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_IS_MASK]: isMask,\n [NODE_COMPUTED_STYLE]: {\n [DISPLAY]: display,\n [VISIBILITY]: visibility,\n [TRANSFORM]: transform,\n [TRANSFORM_ORIGIN]: transformOrigin,\n [MIX_BLEND_MODE]: mixBlendMode,\n },\n } = __config;\n if(display === 'none') {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n continue;\n }\n // mask和不可见不能被汇总到top上\n if((visibility === 'hidden' || isMask) && !node.hookGlRender) {\n continue;\n }\n if(transform && !isE(transform)) {\n let tfo = transformOrigin.slice(0);\n // total下的节点tfo的计算,以total为原点,差值坐标即相对坐标\n if(__cache && __cache.available) {\n tfo[0] += __cache.sx1;\n tfo[1] += __cache.sy1;\n }\n else {\n tfo[0] += node.__sx1;\n tfo[1] += node.__sy1;\n }\n let dx = -sx1 + dbx;\n let dy = -sy1 + dby;\n tfo[0] += dx;\n tfo[1] += dy;\n let m = tf.calMatrixByOrigin(transform, tfo);\n if(matrix) {\n matrix = multiply(matrix, m);\n }\n else {\n matrix = m;\n }\n }\n if(matrix) {\n matrixHash[i] = matrix;\n }\n if(parentPm) {\n matrix = multiply(parentPm, matrix);\n }\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal, __cache]);\n if(target) {\n // 局部的mbm和主画布一样,先刷新当前fbo,然后把后面这个mbm节点绘入一个新的等画布尺寸的fbo中,再进行2者mbm合成\n if(isValidMbm(mixBlendMode)) {\n texCache.refresh(gl, cx, cy);\n let [n2, frameBuffer2, texture2] = genFrameBufferWithTexture(gl, texCache, width, height);\n texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrix, cx, cy, dx, dy, false);\n texCache.refresh(gl, cx, cy);\n // 合成结果作为当前frameBuffer,以及纹理和单元,等于替代了当前fbo作为绘制对象\n [n, frameBuffer, texture] = genMbmWebgl(gl, texCache, n, n2, frameBuffer, texture, mbmName(mixBlendMode), width, height);\n gl.deleteFramebuffer(frameBuffer2);\n gl.deleteTexture(texture2);\n }\n else {\n texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrix, cx, cy, dx, dy, false);\n }\n if(target !== __cache) {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n }\n }\n // webgl特殊的外部钩子,比如粒子组件自定义渲染时调用\n if(node.hookGlRender) {\n node.hookGlRender(gl, opacity, matrix, cx, cy, dx, dy, false);\n }\n }\n }\n if(node.hookGlRender) {\n node.hookGlRender(gl, 1, null, cx, cy, dx, dy, false);\n }\n // 绘制到fbo的纹理对象上并删除fbo恢复\n texCache.refresh(gl, cx, cy);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.viewport(0, 0, W, H);\n gl.deleteFramebuffer(frameBuffer);\n // 生成的纹理对象本身已绑定一个纹理单元了,释放lock的同时可以给texCache的channel缓存,避免重复上传\n let mockCache = new MockCache(gl, texture, sx1, sy1, width, height, bboxTotal);\n texCache.releaseLockChannel(n, mockCache.page);\n return [limitCache || totalLimitCache, mockCache];\n}\n\nfunction genFilterWebgl(gl, texCache, node, cache, filter, W, H) {\n let { sx1, sy1, width, height, bbox } = cache;\n let mockCache = cache;\n filter.forEach(item => {\n let [k, v] = item;\n if(k === 'blur' && v > 0) {\n let res = genBlurWebgl(gl, texCache, mockCache, v, width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'hue-rotate') {\n let rotation = geom.d2r(v % 360);\n let cosR = Math.cos(rotation);\n let sinR = Math.sin(rotation);\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n 0.213 + cosR * 0.787 - sinR * 0.213, 0.715 - cosR * 0.715 - sinR * 0.715, 0.072 - cosR * 0.072 + sinR * 0.928, 0, 0,\n 0.213 - cosR * 0.213 + sinR * 0.143, 0.715 + cosR * 0.285 + sinR * 0.140, 0.072 - cosR * 0.072 - sinR * 0.283, 0, 0,\n 0.213 - cosR * 0.213 - sinR * 0.787, 0.715 - cosR * 0.715 + sinR * 0.715, 0.072 + cosR * 0.928 + sinR * 0.072, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'saturate' && v !== 100) {\n let amount = v * 0.01;\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n 0.213 + 0.787 * amount, 0.715 - 0.715 * amount, 0.072 - 0.072 * amount, 0, 0,\n 0.213 - 0.213 * amount, 0.715 + 0.285 * amount, 0.072 - 0.072 * amount, 0, 0,\n 0.213 - 0.213 * amount, 0.715 - 0.715 * amount, 0.072 + 0.928 * amount, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'brightness' && v !== 100) {\n let b = v * 0.01;\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n b, 0, 0, 0, 0,\n 0, b, 0, 0, 0,\n 0, 0, b, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'grayscale' && v > 0) {\n v = Math.min(v, 100);\n let oneMinusAmount = 1 - v * 0.01;\n if(oneMinusAmount < 0) {\n oneMinusAmount = 0;\n }\n else if(oneMinusAmount > 1) {\n oneMinusAmount = 1;\n }\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n 0.2126 + 0.7874 * oneMinusAmount, 0.7152 - 0.7152 * oneMinusAmount, 0.0722 - 0.0722 * oneMinusAmount, 0, 0,\n 0.2126 - 0.2126 * oneMinusAmount, 0.7152 + 0.2848 * oneMinusAmount, 0.0722 - 0.0722 * oneMinusAmount, 0, 0,\n 0.2126 - 0.2126 * oneMinusAmount, 0.7152 - 0.7152 * oneMinusAmount, 0.0722 + 0.9278 * oneMinusAmount, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'contrast' && v !== 100) {\n let amount = v * 0.01;\n let o = -0.5 * amount + 0.5;\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n amount, 0, 0, 0, o,\n 0, amount, 0, 0, o,\n 0, 0, amount, 0, o,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'sepia' && v > 0) {\n v = Math.min(v, 100);\n let oneMinusAmount = 1 - v * 0.01;\n if(oneMinusAmount < 0) {\n oneMinusAmount = 0;\n }\n else if(oneMinusAmount > 1) {\n oneMinusAmount = 1;\n }\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n 0.393 + 0.607 * oneMinusAmount, 0.769 - 0.769 * oneMinusAmount, 0.189 - 0.189 * oneMinusAmount, 0, 0,\n 0.349 - 0.349 * oneMinusAmount, 0.686 + 0.314 * oneMinusAmount, 0.168 - 0.168 * oneMinusAmount, 0, 0,\n 0.272 - 0.272 * oneMinusAmount, 0.534 - 0.534 * oneMinusAmount, 0.131 + 0.869 * oneMinusAmount, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'invert' && v > 0) {\n v = Math.min(v, 100);\n let o = v * 0.01;\n let amount = 1 - 2 * o;\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n amount, 0, 0, 0, o,\n 0, amount, 0, 0, o,\n 0, 0, amount, 0, o,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n });\n // 切换回主程序\n gl.useProgram(gl.program);\n gl.viewport(0, 0, W, H);\n return mockCache;\n}\n\n/**\n * https://www.w3.org/TR/2018/WD-filter-effects-1-20181218/#feGaussianBlurElement\n * 根据cacheTotal生成cacheFilter,按照css规范的优化方法执行3次,避免卷积核d扩大3倍性能慢\n * 规范的优化方法对d的值分奇偶优化,这里再次简化,d一定是奇数,即卷积核大小\n * 先动态生成gl程序,默认3核源码示例已注释,根据sigma获得d(一定奇数),再计算权重\n * 然后将d尺寸和权重拼接成真正程序并编译成program,再开始绘制\n */\nfunction genBlurWebgl(gl, texCache, cache, sigma, width, height, sx1, sy1, bbox) {\n let d = blur.kernelSize(sigma);\n let max = Math.max(15, gl.getParameter(gl.MAX_VARYING_VECTORS));\n while(d > max) {\n d -= 2;\n }\n let spread = blur.outerSizeByD(d);\n width += spread * 2;\n height += spread * 2;\n // 防止超限,webgl最大纹理尺寸限制\n let limit = gl.getParameter(gl.MAX_TEXTURE_SIZE);\n if(width > limit || height > limit) {\n return;\n }\n bbox = bbox.slice(0);\n bbox[0] -= spread;\n bbox[1] -= spread;\n bbox[2] += spread;\n bbox[3] += spread;\n let cx = width * 0.5, cy = height * 0.5;\n let weights = blur.gaussianWeight(sigma, d);\n let vert = '';\n let frag = '';\n let r = Math.floor(d * 0.5);\n for(let i = 0; i < r; i++) {\n let c = (r - i) * 0.01;\n vert += `v_texCoordsBlur[${i}] = a_texCoords + vec2(-${c}, -${c}) * u_direction;`;\n frag += `gl_FragColor += texture2D(u_texture, v_texCoordsBlur[${i}]) * ${weights[i]};`;\n }\n vert += `v_texCoordsBlur[${r}] = a_texCoords;`;\n frag += `gl_FragColor += texture2D(u_texture, v_texCoordsBlur[${r}]) * ${weights[r]};`;\n for(let i = 0; i < r; i++) {\n let c = (i + 1) * 0.01;\n vert += `v_texCoordsBlur[${i + r + 1}] = a_texCoords + vec2(${c}, ${c}) * u_direction;`;\n frag += `gl_FragColor += texture2D(u_texture, v_texCoordsBlur[${i + r + 1}]) * ${weights[i + r + 1]};`;\n }\n vert = vertexBlur.replace('[3]', '[' + d + ']').replace(/}$/, vert + '}');\n frag = fragmentBlur.replace('[3]', '[' + d + ']').replace(/}$/, frag + '}');\n let program = webgl.initShaders(gl, vert, frag);\n gl.useProgram(program);\n let [i, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n // 将本身total的page纹理放入一个单元,一般刚生成已经在了,少部分情况变更引发的可能不在\n let j = texCache.findExistTexChannel(cache.page);\n if(j === -1) {\n // 直接绑定,因为一定是个mockCache\n j = texCache.lockOneChannel();\n webgl.bindTexture(gl, cache.page.texture, j);\n }\n else {\n texCache.lockChannel(j);\n }\n texture = webgl.drawBlur(gl, program, frameBuffer, texCache, texture, cache.page.texture, i, j,\n width, height, cx, cy, spread, d, sigma);\n // 销毁这个临时program\n gl.deleteShader(program.vertexShader);\n gl.deleteShader(program.fragmentShader);\n gl.deleteProgram(program);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.deleteFramebuffer(frameBuffer);\n texCache.releaseLockChannel(j);\n let mockCache = new MockCache(gl, texture, sx1, sy1, width, height, bbox);\n texCache.releaseLockChannel(i, mockCache.page);\n return [mockCache, width, height, bbox];\n}\n\nfunction genColorMatrixWebgl(gl, texCache, cache, m, width, height, sx1, sy1, bbox) {\n // 生成最终纹理,尺寸为被遮罩节点大小\n let [i, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n // 将本身total的page纹理放入一个单元,一般刚生成已经在了,少部分情况变更引发的可能不在\n let j = texCache.findExistTexChannel(cache.page);\n if(j === -1) {\n // 直接绑定,因为一定是个mockCache\n j = texCache.lockOneChannel();\n webgl.bindTexture(gl, cache.page.texture, j);\n }\n else {\n texCache.lockChannel(j);\n }\n gl.useProgram(gl.programCm);\n webgl.drawCm(gl, gl.programCm, j, m);\n texCache.releaseLockChannel(j);\n // 切回\n gl.useProgram(gl.program);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.deleteFramebuffer(frameBuffer);\n // 同total一样生成一个mockCache\n let mockCache = new MockCache(gl, texture, sx1, sy1, width, height, bbox.slice(0));\n texCache.releaseLockChannel(i, mockCache.page);\n return [mockCache, width, height, bbox];\n}\n\nfunction genOverflowWebgl(gl, texCache, node, cache, W, H) {\n let sbox = node.bbox.slice(0);\n let bbox = cache.bbox;\n // 没超过无需生成\n if(bbox[0] >= sbox[0] && bbox[1] >= sbox[1] && bbox[2] <= sbox[2] && bbox[3] <= sbox[3]) {\n return;\n }\n let width = sbox[2] - sbox[0], height = sbox[3] - sbox[1];\n // 生成最终纹理,尺寸为被遮罩节点大小\n let [i, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n // 将本身total的page纹理放入一个单元,一般刚生成已经在了,少部分情况变更引发的可能不在\n let j = texCache.findExistTexChannel(cache.page);\n if(j === -1) {\n // 直接绑定,因为一定是个mockCache\n j = texCache.lockOneChannel();\n webgl.bindTexture(gl, cache.page.texture, j);\n }\n else {\n texCache.lockChannel(j);\n }\n // 绘制,根据坐标裁剪使用原本纹理的一部分\n gl.useProgram(gl.programOverflow);\n webgl.drawOverflow(gl, j, sbox[0] - bbox[0], sbox[1] - bbox[1], width, height, cache.width, cache.height);\n texCache.releaseLockChannel(j);\n // 切回\n gl.useProgram(gl.program);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.viewport(0, 0, W, H);\n gl.deleteFramebuffer(frameBuffer);\n // 同total一样生成一个mockCache\n let overflowCache = new MockCache(gl, texture, cache.sx1, cache.sy1, width, height, sbox);\n texCache.releaseLockChannel(i, overflowCache.page);\n return overflowCache;\n}\n\nfunction genMaskWebgl(gl, texCache, node, __config, cache, W, H, lv, __structs) {\n let { sx1, sy1, width, height, bbox, dx, dy } = cache;\n // cache一定是mockCache,可能是total/filter/overflow一种\n let cx = width * 0.5, cy = height * 0.5;\n // 先求得被遮罩的matrix,用作inverse给mask计算\n let {\n [NODE_COMPUTED_STYLE]: {\n [TRANSFORM]: transform,\n [TRANSFORM_ORIGIN]: transformOrigin,\n },\n } = __config;\n let inverse;\n if(isE(transform)) {\n inverse = mx.identity();\n }\n else {\n let tfo = transformOrigin.slice(0);\n tfo[0] += sx1 + dx;\n tfo[1] += sy1 + dy;\n inverse = tf.calMatrixByOrigin(transform, tfo);\n }\n inverse = mx.inverse(inverse);\n // 将所有mask绘入一个单独纹理中,尺寸和原点与被遮罩total相同,才能做到顶点坐标一致\n let [i, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n let next = node.next;\n let isClip = next.isClip;\n let list = [];\n while(next && next.isMask && next.isClip === isClip) {\n list.push(next);\n next = next.next;\n }\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n let matrixList = [];\n let parentMatrix;\n let lastMatrix;\n let opacityList = [];\n let parentOpacity = 1;\n let lastOpacity;\n let lastLv = lv;\n let {\n [STRUCT_INDEX]: index,\n [STRUCT_TOTAL]: total,\n } = item.__config[NODE_STRUCT];\n // 可以忽略mbm,因为只有透明遮罩\n for(let i = index, len = index + (total || 0) + 1; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_LV]: lv,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n } = __structs[i];\n let __config = node.__config;\n let {\n [NODE_CACHE]: __cache,\n [NODE_COMPUTED_STYLE]: computedStyle,\n [NODE_LIMIT_CACHE]: limitCache,\n } = __config;\n // 跳过display:none元素和它的所有子节点和mask\n if(computedStyle[DISPLAY] === 'none') {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n continue;\n }\n if(node instanceof Text) {\n if(__cache && __cache.available) {\n // text用父级的matrixEvent,在之前texCache添加到末尾了\n texCache.addTexAndDrawWhenLimit(gl, __cache, parentOpacity, texCache.last[2], cx, cy, 0, 0,true);\n }\n else if(limitCache) {\n return;\n }\n }\n else {\n let {\n [NODE_CACHE]: __cache,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_COMPUTED_STYLE]: {\n [OPACITY]: opacity,\n [TRANSFORM]: transform,\n [TRANSFORM_ORIGIN]: transformOrigin,\n },\n } = __config;\n // lv变大说明是child,相等是sibling,变小可能是parent或另一棵子树,根节点是第一个特殊处理\n if(i === index) {}\n else if(lv > lastLv) {\n parentMatrix = lastMatrix;\n if(isE(parentMatrix)) {\n parentMatrix = null;\n }\n matrixList.push(parentMatrix);\n parentOpacity = lastOpacity;\n opacityList.push(parentOpacity);\n }\n // 变小出栈索引需注意,可能不止一层,多层计算diff层级\n else if(lv < lastLv) {\n let diff = lastLv - lv;\n matrixList.splice(-diff);\n parentMatrix = matrixList[lv - 1];\n opacityList.splice(-diff);\n parentOpacity = opacityList[lv - 1];\n }\n // 不变是同级兄弟,无需特殊处理 else {}\n lastLv = lv;\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal, __cache]);\n // total和自身cache的尝试,visibility不可见时没有cache\n if(target) {\n let m;\n if(isE(transform)) {\n m = mx.identity();\n }\n else {\n let tfo = transformOrigin.slice(0);\n tfo[0] += target.bbox[0] + dx;\n tfo[1] += target.bbox[1] + dy;\n m = tf.calMatrixByOrigin(transform, tfo);\n }\n m = mx.multiply(inverse, m);\n let tfo = transformOrigin.slice(0);\n tfo[0] += target.bbox[0] + dx;\n tfo[1] += target.bbox[1] + dy;\n lastMatrix = tf.calMatrixByOrigin(transform, tfo);\n if(!isE(parentMatrix)) {\n lastMatrix = multiply(parentMatrix, lastMatrix);\n }\n lastOpacity = parentOpacity * opacity;\n texCache.addTexAndDrawWhenLimit(gl, target, lastOpacity, m, cx, cy, dx, dy, true);\n if(target !== __cache) {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n }\n }\n else if(limitCache) {\n return;\n }\n }\n }\n }\n texCache.refresh(gl, cx, cy);\n gl.deleteFramebuffer(frameBuffer);\n // 将本身total的page纹理放入一个单元,一般刚生成已经在了,少部分情况mask变更引发的可能不在\n let j = texCache.findExistTexChannel(cache.page);\n if(j === -1) {\n // 直接绑定,因为一定是个mockCache\n j = texCache.lockOneChannel();\n webgl.bindTexture(gl, cache.page.texture, j);\n }\n else {\n texCache.lockChannel(j);\n }\n // 生成最终纹理,汇总total和maskCache\n let [n, frameBuffer2, texture2] = genFrameBufferWithTexture(gl, texCache, width, height);\n let program;\n if(isClip) {\n program = gl.programClip;\n }\n else {\n program = gl.programMask;\n }\n gl.useProgram(program);\n webgl.drawMask(gl, i, j, program);\n gl.deleteTexture(texture);\n texCache.releaseLockChannel(i);\n texCache.releaseLockChannel(j);\n // 切换回主程序\n gl.useProgram(gl.program);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.viewport(0, 0, W, H);\n gl.deleteFramebuffer(frameBuffer2);\n // 同total一样生成一个mockCache\n let maskCache = new MockCache(gl, texture2, sx1, sy1, width, height, bbox);\n texCache.releaseLockChannel(n, maskCache.page);\n return maskCache;\n}\n\n/**\n * 生成blendMode混合fbo纹理结果,原本是所有元素向一个fbo记A进行绘制,当出现mbm时,进入到这里,\n * 先生成一个新的fbo记B,将A和待混合节点进行对应的mbm模式混合,结果绘制到B中,然后返回B来替换A,包括纹理单元\n * @param gl\n * @param texCache\n * @param i 之前已有的fbo和纹理单元\n * @param j 当前节点绘制的fbo和纹理单元\n * @param mbm\n * @param fbo 之前舞台绑定的fbo和纹理\n * @param tex\n * @param W\n * @param H\n * @returns {number|*}\n */\nfunction genMbmWebgl(gl, texCache, i, j, fbo, tex, mbm, W, H) {\n let frag;\n mbm = mbmName(mbm);\n if(mbm === 'multiply') {\n frag = fragmentMultiply;\n }\n else if(mbm === 'screen') {\n frag = fragmentScreen;\n }\n else if(mbm === 'overlay') {\n frag = fragmentOverlay;\n }\n else if(mbm === 'darken') {\n frag = fragmentDarken;\n }\n else if(mbm === 'lighten') {\n frag = fragmentLighten;\n }\n else if(mbm === 'color-dodge') {\n frag = fragmentColorDodge;\n }\n else if(mbm === 'color-burn') {\n frag = fragmentColorBurn;\n }\n else if(mbm === 'hard-light') {\n frag = fragmentHardLight;\n }\n else if(mbm === 'soft-light') {\n frag = fragmentSoftLight;\n }\n else if(mbm === 'difference') {\n frag = fragmentDifference;\n }\n else if(mbm === 'exclusion') {\n frag = fragmentExclusion;\n }\n else if(mbm === 'hue') {\n frag = fragmentHue;\n }\n else if(mbm === 'saturation') {\n frag = fragmentSaturation;\n }\n else if(mbm === 'color') {\n frag = fragmentColor;\n }\n else if(mbm === 'luminosity') {\n frag = fragmentLuminosity;\n }\n let program = webgl.initShaders(gl, vertexMbm, frag);\n gl.useProgram(program);\n // 生成新的fbo,将混合结果绘入\n let [n, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, W, H);\n webgl.drawMbm(gl, program, i, j, W, H);\n // 切换回主程序并销毁这个临时program\n gl.useProgram(gl.program);\n gl.deleteShader(program.vertexShader);\n gl.deleteShader(program.fragmentShader);\n gl.deleteProgram(program);\n gl.deleteFramebuffer(fbo);\n gl.deleteTexture(tex);\n texCache.releaseLockChannel(i);\n texCache.releaseLockChannel(j);\n return [n, frameBuffer, texture];\n}\n\nfunction renderSvg(renderMode, ctx, root, isFirst) {\n let { __structs, width, height } = root;\n // mask节点很特殊,本身有matrix会影响,本身没改变但对象节点有改变也需要计算逆矩阵应用顶点\n let maskEffectHash = {};\n if(!isFirst) {\n // 先遍历一遍收集完全不变的defs,缓存起来id,随后再执行遍历渲染生成新的,避免掉重复的id\n for(let i = 0, len = __structs.length; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n } = __structs[i];\n let {\n [NODE_REFRESH_LV]: refreshLevel,\n [NODE_DEFS_CACHE]: defsCache,\n } = node.__config;\n // 只要涉及到matrix和opacity就影响mask\n let hasEffectMask = hasMask && (refreshLevel >= REPAINT || contain(refreshLevel, TRANSFORM_ALL | OP));\n if(hasEffectMask) {\n let start = i + (total || 0) + 1;\n let end = start + hasMask;\n // mask索引遍历时处理,暂存遮罩对象的刷新lv\n maskEffectHash[end - 1] = refreshLevel;\n }\n // >=REPAINT重绘生成走render()跳过这里\n if(refreshLevel < REPAINT) {\n // 特殊的mask判断,遮罩对象影响这个mask了,除去filter、遮罩对象无TRANSFORM变化外都可缓存\n if(maskEffectHash.hasOwnProperty(i)) {\n let v = maskEffectHash[i];\n if(!contain(refreshLevel, TRANSFORM_ALL) && v < REPAINT && !contain(v, TRANSFORM_ALL)) {\n defsCache.forEach(item => {\n ctx.addCache(item);\n });\n }\n }\n // 去除特殊的filter,普通节点或不影响的mask在 {\n ctx.addCache(item);\n });\n }\n }\n }\n }\n let maskHash = {};\n // 栈代替递归,存父节点的matrix/opacity,matrix为E时存null省略计算\n let matrixList = [];\n let parentMatrix;\n let vdList = [];\n let parentVd;\n let lastLv = 0;\n let lastConfig;\n for(let i = 0, len = __structs.length; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n [STRUCT_LV]: lv,\n } = __structs[i];\n let __config = node.__config;\n let {\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_REFRESH_LV]: refreshLevel,\n [NODE_DEFS_CACHE]: defsCache,\n [NODE_COMPUTED_STYLE]: computedStyle,\n } = __config;\n let display = computedStyle[DISPLAY];\n // 将随后的若干个mask节点范围存下来\n if(hasMask && display !== 'none') {\n let start = i + (total || 0) + 1;\n let end = start + hasMask;\n // svg限制了只能Geom单节点,不可能是Dom,所以end只有唯一\n maskHash[end - 1] = {\n index: i,\n start,\n end,\n isClip: __structs[start][STRUCT_NODE].isClip, // 第一个节点是clip为准\n };\n }\n // lv变大说明是child,相等是sibling,变小可能是parent或另一棵子树,Root节点第一个特殊处理\n if(lv < lastLv) {\n let diff = lastLv - lv;\n matrixList.splice(-diff);\n parentMatrix = matrixList[lv - 1];\n vdList.splice(-diff);\n parentVd = vdList[lv - 1];\n }\n else if(lv > lastLv) {\n matrixList.push(lastConfig[NODE_MATRIX]);\n let vd = lastConfig[NODE_VIRTUAL_DOM];\n vdList.push(vd);\n parentVd = vd;\n }\n lastConfig = __config;\n let virtualDom;\n // svg小刷新等级时直接修改vd,这样Geom不再感知\n if(refreshLevel < REPAINT && !(node instanceof Text)) {\n __config[NODE_REFRESH_LV] = NONE;\n virtualDom = __config[NODE_VIRTUAL_DOM];\n // total可以跳过所有孩子节点省略循环\n if(__cacheTotal && __cacheTotal.available) {\n i += (total || 0);\n virtualDom.cache = true;\n }\n else {\n __cacheTotal && (__cacheTotal.available = true);\n virtualDom = __config[NODE_VIRTUAL_DOM] = node.__virtualDom = util.extend({}, virtualDom);\n // dom要清除children缓存,geom和img无需\n if(node instanceof Dom && !(node instanceof Img)) {\n virtualDom.children = [];\n }\n // 还得判断,和img加载混在一起时,触发刷新如果display:none,则还有cacheTotal\n if(display === 'none') {\n i += (total || 0);\n if(hasMask) {\n i += hasMask;\n }\n }\n else {\n delete virtualDom.cache;\n }\n }\n let {\n [NODE_CURRENT_STYLE]: currentStyle,\n [NODE_COMPUTED_STYLE]: computedStyle,\n [NODE_CACHE_STYLE]: __cacheStyle,\n } = __config;\n if(contain(refreshLevel, TRANSFORM_ALL)) {\n let matrix = node.__calMatrix(refreshLevel, __cacheStyle, currentStyle, computedStyle, __config);\n // 恶心的v8性能优化\n let m = __config[NODE_MATRIX];\n assignMatrix(m, matrix);\n if(!matrix || isE(matrix)) {\n delete virtualDom.transform;\n }\n else {\n virtualDom.transform = 'matrix(' + util.joinArr(mx.m2m6(matrix), ',') + ')';\n }\n if(parentMatrix && matrix) {\n matrix = multiply(parentMatrix, matrix);\n }\n // 恶心的v8性能优化\n m = __config[NODE_MATRIX_EVENT];\n assignMatrix(m, matrix);\n }\n if(contain(refreshLevel, OP)) {\n let opacity = computedStyle[OPACITY] = currentStyle[OPACITY];\n if(opacity === 1) {\n delete virtualDom.opacity;\n }\n else {\n virtualDom.opacity = opacity;\n }\n }\n if(contain(refreshLevel, FT)) {\n let filter = node.__calFilter(currentStyle, computedStyle);\n let s = painter.svgFilter(filter);\n if(s) {\n virtualDom.filter = s;\n }\n else {\n delete virtualDom.filter;\n }\n }\n if(contain(refreshLevel, MBM)) {\n let mixBlendMode = computedStyle[MIX_BLEND_MODE] = currentStyle[MIX_BLEND_MODE];\n if(isValidMbm(mixBlendMode)) {\n virtualDom.mixBlendMode = mbmName(mixBlendMode);\n }\n else {\n delete virtualDom.mixBlendMode;\n }\n }\n virtualDom.lv = refreshLevel;\n }\n else {\n // >=REPAINT会调用render,重新生成defsCache,text没有这个东西\n __config[NODE_DEFS_CACHE] && __config[NODE_DEFS_CACHE].splice(0);\n node.render(renderMode, refreshLevel, ctx, NA, 0, 0);\n virtualDom = __config[NODE_VIRTUAL_DOM];\n // 渲染后更新取值\n display = computedStyle[DISPLAY];\n if(display === 'none') {\n i += (total || 0);\n if(hasMask) {\n i += hasMask;\n }\n }\n }\n /**\n * mask会在join时过滤掉,这里将假设正常渲染的vd的内容获取出来组成defs的mask内容\n * 另外最初遍历时记录了会影响的mask,在=REPAINT始终重新设置\n * 本身有matrix也需要重设\n */\n if(maskHash.hasOwnProperty(i) && (maskEffectHash.hasOwnProperty(i) || refreshLevel >= REPAINT || contain(refreshLevel, TRANSFORM_ALL | OP))) {\n let { index, start, end, isClip } = maskHash[i];\n let target = __structs[index];\n let dom = target[STRUCT_NODE];\n let mChildren = [];\n // clip模式时,先添加兜底整个白色使得全部都可见,mask本身变反色(黑色)\n if(isClip) {\n mChildren.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', `M0,0L${width},0L${width},${height}L0,${height}L0,0`],\n ['fill', 'rgba(255,255,255,1)'],\n ['stroke-width', 0],\n ],\n });\n }\n for(let j = start; j < end; j++) {\n let node = __structs[j][STRUCT_NODE];\n let { computedStyle: { [DISPLAY]: display, [VISIBILITY]: visibility, [FILL]: fill },\n virtualDom: { children, opacity } } = node;\n if(display !== 'none' && visibility !== 'hidden') {\n // 引用相同无法diff,需要clone\n children = util.clone(children);\n mChildren = mChildren.concat(children);\n for(let k = 0, len = children.length; k < len; k++) {\n let { tagName, props } = children[k];\n if(tagName === 'path') {\n if(isClip) {\n for(let j = 0, len = props.length; j < len; j++) {\n let item = props[j];\n if(item[0] === 'fill') {\n item[1] = util.int2invert(fill[0]);\n }\n }\n }\n let matrix = node.matrix;\n let ivs = inverse(dom.matrix);\n matrix = multiply(ivs, matrix);\n // path没有transform属性,在vd上,需要弥补\n props.push(['transform', `matrix(${util.joinArr(mx.m2m6(matrix), ',')})`]);\n // path没有opacity属性,在vd上,需要弥补\n if(!util.isNil(opacity) && opacity !== 1) {\n props.push(['opacity', opacity]);\n }\n }\n // img可能有matrix属性,需判断\n else if(tagName === 'image') {\n let hasTransform = -1;\n for(let m = 0, len = props.length; m < len; m++) {\n if(props[m][0] === 'transform') {\n hasTransform = m;\n break;\n }\n }\n if(hasTransform === -1) {\n let ivs = inverse(dom.matrix);\n if(!isE(ivs)) {\n props.push(['transform', `matrix(${util.joinArr(mx.m2m6(ivs), ',')})`]);\n }\n }\n else {\n let matrix = props[hasTransform][1].match(/[\\d.]+/g).map(i => parseFloat(i));\n let ivs = inverse(dom.matrix);\n matrix = multiply(ivs, matrix);\n props[hasTransform][1] = `matrix(${util.joinArr(mx.m2m6(matrix), ',')})`;\n }\n }\n }\n }\n }\n // 清掉上次的\n for(let i = defsCache.length - 1; i >= 0; i--) {\n let item = defsCache[i];\n if(item.tagName === 'mask') {\n defsCache.splice(i, 1);\n }\n }\n let o = {\n tagName: 'mask',\n props: [],\n children: mChildren,\n };\n let id = ctx.add(o);\n defsCache.push(o);\n id = 'url(#' + id + ')';\n dom.virtualDom.mask = id;\n }\n // mask不入children\n if(parentVd && !node.isMask) {\n parentVd.children.push(virtualDom);\n }\n if(i === 0) {\n parentMatrix = __config[NODE_MATRIX];\n parentVd = virtualDom;\n }\n lastLv = lv;\n }\n}\n\nfunction renderWebgl(renderMode, gl, root) {\n let { __structs, width, height, texCache } = root;\n let cx = width * 0.5, cy = height * 0.5;\n // 栈代替递归,存父节点的matrix/opacity,matrix为E时存null省略计算\n let matrixList = [];\n let parentMatrix;\n let opacityList = [];\n let parentOpacity = 1;\n let pmList = [];\n let parentPm;\n let lastRefreshLevel;\n let lastConfig;\n let lastLv = 0;\n let mergeList = [];\n let hasMbm; // 是否有混合模式出现\n /**\n * 先一遍先序遍历每个节点绘制到自己__cache上,排除Text和已有的缓存以及局部根缓存,\n * 根据refreshLevel进行等级区分,可能是=REPAINT,REFLOW布局已前置处理完。\n * 首次绘制没有catchTotal等,后续则可能会有,在= REPAINT) {\n node.render(renderMode, REPAINT, gl, SELF, 0, 0);\n }\n continue;\n }\n let __config = node.__config;\n let refreshLevel = __config[NODE_REFRESH_LV];\n // lv变大说明是child,相等是sibling,变小可能是parent或另一棵子树,Root节点是第一个特殊处理\n if(i === 0) {}\n else if(lv > lastLv) {\n parentMatrix = lastConfig[NODE_MATRIX_EVENT];\n if(isE(parentMatrix)) {\n parentMatrix = null;\n }\n matrixList.push(parentMatrix);\n parentOpacity = lastConfig[NODE_OPACITY];\n opacityList.push(parentOpacity);\n parentPm = lastConfig[NODE_PERSPECTIVE_MATRIX];\n if(isE(parentPm)) {\n parentPm = null;\n }\n pmList.push(parentPm);\n }\n // 变小出栈索引需注意,可能不止一层,多层计算diff层级\n else if(lv < lastLv) {\n let diff = lastLv - lv;\n matrixList.splice(-diff);\n parentMatrix = matrixList[lv - 1];\n opacityList.splice(-diff);\n parentOpacity = opacityList[lv - 1];\n pmList.splice(-diff);\n parentPm = pmList[lv - 1];\n }\n // 不变是同级兄弟,无需特殊处理 else {}\n lastRefreshLevel = refreshLevel;\n lastConfig = __config;\n lastLv = lv;\n let {\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_COMPUTED_STYLE]: computedStyle,\n } = __config;\n // 跳过display:none元素和它的所有子节点\n if(computedStyle[DISPLAY] === 'none') {\n i += (total || 0);\n // 只跳过自身不能跳过后面的mask,mask要渲染自身并进行缓存cache,以备对象切换display用\n continue;\n }\n let hasRecordAsMask;\n /**\n * lv=REPAINT那里,小变化不动\n * 当有遮罩时,如果被遮罩节点本身无变更,需要检查其next的遮罩节点有无变更,\n * 但其实不用检查,因为next变更一定会清空cacheMask,只要检查cacheMask即可\n * 如果没有或无效,直接添加,无视节点本身变化,后面防重即可\n */\n if(refreshLevel < REPAINT) {\n __config[NODE_REFRESH_LV] = NONE;\n if(hasMask) {\n let cacheMask = __config[NODE_CACHE_MASK];\n if(!cacheMask || !cacheMask.available) {\n hasRecordAsMask = [i, lv, total, node, __config, null, hasMask];\n mergeList.push(hasRecordAsMask);\n }\n }\n let {\n [NODE_CURRENT_STYLE]: currentStyle,\n [NODE_CACHE_STYLE]: __cacheStyle,\n [NODE_MATRIX_EVENT]: matrixEvent,\n } = __config;\n if(contain(refreshLevel, PPT)) {\n node.__calPerspective(__cacheStyle, currentStyle, computedStyle, __config);\n }\n // transform变化,父元素的perspective变化也会在Root特殊处理重新计算\n let matrix;\n if(contain(refreshLevel, TRANSFORM_ALL)) {\n matrix = node.__calMatrix(refreshLevel, __cacheStyle, currentStyle, computedStyle, __config);\n assignMatrix(__config[NODE_MATRIX], matrix);\n }\n else {\n matrix = __config[NODE_MATRIX];\n }\n // node本身有或者父有perspective都认为需要生成3d渲染上下文\n if(tf.isPerspectiveMatrix(matrix) || parentPm) {\n if(hasRecordAsMask) {\n hasRecordAsMask[9] = true;\n }\n else {\n hasRecordAsMask = [i, lv, total, node, __config, null, null, null, null, true];\n }\n }\n // 先左乘perspective的矩阵,再左乘父级的总矩阵\n if(parentPm) {\n matrix = multiply(parentPm, matrix);\n }\n if(parentMatrix) {\n matrix = multiply(parentMatrix, matrix);\n }\n // 恶心的v8性能优化\n assignMatrix(matrixEvent, matrix);\n let opacity;\n if(contain(refreshLevel, OP)) {\n opacity = computedStyle[OPACITY] = currentStyle[OPACITY];\n }\n else {\n opacity = computedStyle[OPACITY];\n }\n __config[NODE_OPACITY] = parentOpacity * opacity;\n // filter会改变bbox范围\n if(contain(refreshLevel, FT)) {\n node.__bbox = null;\n let filter = node.__calFilter(currentStyle, computedStyle);\n // 防重\n if(hasRecordAsMask) {\n hasRecordAsMask[7] = filter;\n }\n else {\n // 强制存hasMask,因为filter改变影响mask\n hasRecordAsMask = [i, lv, total, node, __config, null, hasMask, filter];\n mergeList.push(hasRecordAsMask);\n }\n }\n if(contain(refreshLevel, MBM)) {\n computedStyle[MIX_BLEND_MODE] = currentStyle[MIX_BLEND_MODE];\n }\n // total可以跳过所有孩子节点省略循环,filter/mask等的强制前提是有total\n if(__cacheTotal && __cacheTotal.available) {\n i += (total || 0);\n continue;\n }\n }\n /**\n * >=REPAINT重新渲染,并根据结果判断是否离屏限制错误\n * Geom没有子节点无需汇总局部根,Dom中Img也是,它们的局部根等于自身的cache,其它符合条件的Dom需要生成\n */\n else {\n let res = node.render(renderMode, refreshLevel, gl, SELF, 0, 0);\n // geom可返回texture纹理,替代原有xom的__cache纹理\n if(res && inject.isWebGLTexture(res.texture)) {\n let { __sx1: sx1, __sy1: sy1, offsetWidth: w, offsetHeight: h, bbox } = node;\n __config[NODE_CACHE] = new MockCache(gl, res.texture, sx1, sy1, w, h, bbox);\n gl.viewport(0, 0, width, height);\n gl.useProgram(gl.program);\n }\n }\n // 每个元素检查cacheTotal生成,已有的上面会continue跳过\n let {\n [NODE_LIMIT_CACHE]: limitCache,\n [NODE_CACHE_AS_BITMAP]: cacheAsBitmap,\n } = __config;\n let {\n [OVERFLOW]: overflow,\n [FILTER]: filter,\n [MIX_BLEND_MODE]: mixBlendMode,\n [TRANSFORM]: transform,\n } = computedStyle;\n let validMbm = isValidMbm(mixBlendMode);\n // 3d渲染上下文\n let isPerspective = tf.isPerspectiveMatrix(transform) || parentPm;\n if(cacheAsBitmap || hasMask || filter.length || (overflow === 'hidden' && total) || validMbm || isPerspective) {\n if(validMbm) {\n hasMbm = true;\n }\n if(hasRecordAsMask) {\n hasRecordAsMask[5] = limitCache;\n hasRecordAsMask[7] = filter;\n hasRecordAsMask[8] = overflow;\n hasRecordAsMask[9] = isPerspective;\n hasRecordAsMask[10] = cacheAsBitmap;\n }\n else {\n mergeList.push([i, lv, total, node, __config, limitCache, hasMask, filter, overflow, isPerspective, cacheAsBitmap]);\n }\n }\n }\n let limitHash = {};\n // 根据收集的需要合并局部根的索引,尝试合并,按照层级从大到小,索引从大到小的顺序,\n // 这样保证子节点在前,后节点在前,后节点是为了mask先应用自身如filter之后再进行遮罩\n if(mergeList.length) {\n mergeList.sort(function(a, b) {\n if(a[1] === b[1]) {\n return b[0] - a[0];\n }\n return b[1] - a[1];\n });\n // ppt只有嵌套才需要生成,最下面的孩子节点的ppt无需,因此记录一个hash存index,\n // 同时因为是后序遍历,孩子先存所有父亲的index即可保证父亲才能生成cacheTotal\n let pptHash = {};\n mergeList.forEach(item => {\n let [i, lv, total, node, __config, limitCache, hasMask, filter, overflow, isPerspective, cacheAsBitmap] = item;\n // 有ppt的,向上查找所有父亲index记录,可能出现重复记得提前跳出\n if(isPerspective) {\n let parent = __config[NODE_DOM_PARENT];\n while(parent) {\n let config = parent.__config;\n let idx = config[NODE_STRUCT][STRUCT_INDEX];\n if(pptHash[idx]) {\n break;\n }\n if(tf.isPerspectiveMatrix(config[NODE_MATRIX]) || config[NODE_PERSPECTIVE_MATRIX]) {\n pptHash[idx] = true;\n }\n parent = config[NODE_DOM_PARENT];\n }\n if(!pptHash[i] && !hasMask && !filter.length && overflow !== 'hidden' && !cacheAsBitmap) {\n return;\n }\n }\n let {\n [NODE_CACHE]: __cache,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n } = __config;\n let needGen;\n // 可能没变化,比如被遮罩节点、filter变更等\n if(!__cacheTotal || !__cacheTotal.available) {\n let [limit, res] = genTotalWebgl(gl, texCache, node, __config, i, total || 0, __structs, __cache, limitCache, hasMbm, width, height);\n __cacheTotal = res;\n needGen = true;\n limitCache = limit;\n // 返回的limit包含各种情况超限,一旦超限,只能生成临时cacheTotal不能保存\n if(!limitCache) {\n __config[NODE_CACHE_TOTAL] = res;\n }\n }\n // 即使超限,也有total结果\n let target = __cacheTotal;\n if(overflow === 'hidden') {\n if(!__cacheOverflow || !__cacheOverflow.available || needGen) {\n let temp = genOverflowWebgl(gl, texCache, node, target, width, height);\n if(temp) {\n target = temp;\n needGen = true;\n if(!limitCache) {\n __config[NODE_CACHE_FILTER] = target;\n }\n }\n }\n }\n if(filter.length) {\n if(!__cacheFilter || !__cacheFilter.available || needGen) {\n let old = target;\n target = genFilterWebgl(gl, texCache, node, target, filter, width, height);\n if(target !== old) {\n needGen = true;\n if(!limitCache) {\n __config[NODE_CACHE_FILTER] = target;\n }\n }\n }\n }\n if(hasMask && (!__cacheMask || !__cacheMask.available || needGen)) {\n target = genMaskWebgl(gl, texCache, node, __config, target, width, height, lv, __structs);\n if(!limitCache) {\n __config[NODE_CACHE_MASK] = target;\n }\n }\n // 保存临时的局部根节点\n if(limitCache) {\n limitHash[i] = target;\n }\n });\n }\n /**\n * 最后先序遍历一次应用__cacheTotal即可,没有的用__cache,以及剩下的超尺寸的和Text\n * 由于mixBlendMode的存在,需先申请个fbo纹理,所有绘制默认向该纹理绘制,最后fbo纹理再进入主画布\n * 前面循环时有记录是否出现mbm,只有出现才申请,否则不浪费直接输出到主画布\n * 超尺寸的要走无cache逻辑render,和canvas很像,除了离屏canvas超限,汇总total也会纹理超限\n */\n let n, frameBuffer, texture;\n if(hasMbm) {\n [n, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n }\n for(let i = 0, len = __structs.length; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n } = __structs[i];\n let __config = node.__config;\n // text如果display不可见,parent会直接跳过,不会走到这里,这里一定是直接绘制到root的,visibility在其内部判断\n if(node instanceof Text) {\n // text特殊之处,__config部分是复用parent的\n let {\n [NODE_CACHE]: __cache,\n [NODE_LIMIT_CACHE]: limitCache,\n [NODE_DOM_PARENT]: {\n __config: {\n [NODE_MATRIX_EVENT]: matrixEvent,\n [NODE_OPACITY]: opacity,\n },\n },\n } = __config;\n if(__cache && __cache.available) {\n texCache.addTexAndDrawWhenLimit(gl, __cache, opacity, matrixEvent, cx, cy, 0, 0,true);\n }\n // 超限特殊处理,先生成画布尺寸大小的纹理然后原始位置绘制\n else if(limitCache) {\n let c = inject.getCacheCanvas(width, height, '__$$OVERSIZE$$__');\n node.render(renderMode, 0, gl, NA, 0, 0);\n let j = texCache.lockOneChannel();\n let texture = webgl.createTexture(gl, c.canvas, j);\n let mockCache = new MockCache(gl, texture, 0, 0, width, height, [0, 0, width, height]);\n texCache.addTexAndDrawWhenLimit(gl, mockCache, opacity, matrixEvent, cx, cy, 0, 0, true);\n texCache.refresh(gl, cx, cy, true);\n c.ctx.setTransform(1, 0, 0, 1, 0, 0);\n c.ctx.globalAlpha = 1;\n c.ctx.clearRect(0, 0, width, height);\n mockCache.release();\n texCache.releaseLockChannel(j);\n }\n }\n else {\n let {\n [NODE_OPACITY]: opacity,\n [NODE_MATRIX_EVENT]: matrixEvent,\n [NODE_LIMIT_CACHE]: limitCache,\n [NODE_CACHE]: __cache,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_REFRESH_LV]: refreshLevel,\n [NODE_COMPUTED_STYLE]: {\n [DISPLAY]: display,\n [VISIBILITY]: visibility,\n [MIX_BLEND_MODE]: mixBlendMode,\n },\n } = __config;\n if(display === 'none') {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n continue;\n }\n // 有total的可以直接绘制并跳过子节点索引,忽略total本身,其独占用纹理单元,注意特殊不取cacheTotal,\n // 这种情况发生在只有overflow:hidden声明但无效没有生成__cacheOverflow的情况,\n // 因为webgl纹理单元缓存原因,所以不用cacheTotal防止切换性能损耗\n // 已取消,因为perspective需要进行独立上下文渲染\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal, __cache]);\n // total和自身cache的尝试,visibility不可见时没有cache\n if(target) {\n // 有mbm先刷新当前fbo,然后把后面这个mbm节点绘入一个新的等画布尺寸的fbo中,再进行2者mbm合成\n if(hasMbm && isValidMbm(mixBlendMode)) {\n texCache.refresh(gl, cx, cy, true);\n let [n2, frameBuffer2, texture2] = genFrameBufferWithTexture(gl, texCache, width, height);\n texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrixEvent, cx, cy, 0, 0, true);\n texCache.refresh(gl, cx, cy, true);\n // 合成结果作为当前frameBuffer,以及纹理和单元,等于替代了当前画布作为绘制对象\n [n, frameBuffer, texture] = genMbmWebgl(gl, texCache, n, n2, frameBuffer, texture, mbmName(mixBlendMode), width, height);\n gl.deleteFramebuffer(frameBuffer2);\n gl.deleteTexture(texture2);\n }\n else {\n texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrixEvent, cx, cy, 0, 0, true);\n }\n if(target !== __cache) {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n }\n }\n else if(limitHash.hasOwnProperty(i)) {\n let target = limitHash[i];\n if(hasMbm && isValidMbm(mixBlendMode)) {\n texCache.refresh(gl, cx, cy, true);\n let [n2, frameBuffer2, texture2] = genFrameBufferWithTexture(gl, texCache, width, height);\n texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrixEvent, cx, cy, 0, 0, true);\n texCache.refresh(gl, cx, cy, true);\n // 合成结果作为当前frameBuffer,以及纹理和单元,等于替代了当前画布作为绘制对象\n [n, frameBuffer, texture] = genMbmWebgl(gl, texCache, n, n2, frameBuffer, texture, mbmName(mixBlendMode), width, height);\n gl.deleteFramebuffer(frameBuffer2);\n gl.deleteTexture(texture2);\n }\n else {\n texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrixEvent, cx, cy, 0, 0, true);\n }\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n }\n // 超限的情况,这里是普通单节点超限,没有合成total后再合成特殊cache如filter/mask/mbm之类的,\n // 直接按原始位置绘制到离屏canvas,再作为纹理绘制即可,特殊的在total那做过降级了\n else if(limitCache && display !== 'none' && visibility !== 'hidden') {\n let c = inject.getCacheCanvas(width, height, '__$$OVERSIZE$$__');\n node.render(renderMode, refreshLevel, gl, NA, 0, 0);\n let j = texCache.lockOneChannel();\n let texture = webgl.createTexture(gl, c.canvas, j);\n let mockCache = new MockCache(gl, texture, 0, 0, width, height, [0, 0, width, height]);\n texCache.addTexAndDrawWhenLimit(gl, mockCache, opacity, matrixEvent, cx, cy, 0, 0, true);\n texCache.refresh(gl, cx, cy, true);\n c.ctx.setTransform(1, 0, 0, 1, 0, 0);\n c.ctx.globalAlpha = 1;\n c.ctx.clearRect(0, 0, width, height);\n mockCache.release();\n texCache.releaseLockChannel(j);\n }\n // webgl特殊的外部钩子,比如粒子组件自定义渲染时调用\n if(node.hookGlRender) {\n node.hookGlRender(gl, opacity, matrixEvent, cx, cy, 0, 0, true);\n }\n }\n }\n texCache.refresh(gl, cx, cy, true);\n // 有mbm时将汇总的fbo绘入主画布,否则本身就是到主画布无需多余操作\n if(hasMbm) {\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n texCache.releaseLockChannel(n);\n gl.deleteFramebuffer(frameBuffer);\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(gl.program, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n 0, 0,\n 0, 1,\n 1, 0,\n 0, 1,\n 1, 0,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(gl.program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // opacity buffer\n let opacityBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, opacityBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, 1, 1, 1, 1]), gl.STATIC_DRAW);\n let a_opacity = gl.getAttribLocation(gl.program, 'a_opacity');\n gl.vertexAttribPointer(a_opacity, 1, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_opacity);\n // 纹理单元\n let u_texture = gl.getUniformLocation(gl.program, 'u_texture');\n gl.uniform1i(u_texture, n);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.deleteBuffer(opacityBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n gl.deleteTexture(texture);\n }\n}\n\nfunction renderCanvas(renderMode, ctx, root) {\n let { __structs, width, height } = root;\n let mergeList = [];\n /**\n * 先一遍先序遍历收集cacheAsBitmap的节点,说明这棵子树需要缓存,可能出现嵌套,高层级优先\n * 可能遇到已有缓存没变化的,这时候不要收集忽略掉,没有缓存的走后面遍历普通渲染\n */\n for(let i = 0, len = __structs.length; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_LV]: lv,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n } = __structs[i];\n // 排除Text,要么根节点直接绘制,要么被局部根节点汇总,自身并不缓存(fillText比位图更快)\n if(node instanceof Text) {\n continue;\n }\n let __config = node.__config;\n let {\n [NODE_REFRESH_LV]: refreshLevel,\n [NODE_CACHE_AS_BITMAP]: cacheAsBitmap,\n [NODE_COMPUTED_STYLE]: computedStyle,\n } = __config;\n if(refreshLevel >= REPAINT) {\n node.__calCache(renderMode, ctx, __config[NODE_DOM_PARENT],\n __config[NODE_CACHE_STYLE], __config[NODE_CURRENT_STYLE], computedStyle,\n node.clientWidth, node.clientHeight, node.offsetWidth, node.offsetHeight,\n computedStyle[BORDER_TOP_WIDTH], computedStyle[BORDER_RIGHT_WIDTH],\n computedStyle[BORDER_BOTTOM_WIDTH], computedStyle[BORDER_LEFT_WIDTH],\n computedStyle[PADDING_TOP], computedStyle[PADDING_RIGHT],\n computedStyle[PADDING_BOTTOM], computedStyle[PADDING_LEFT],\n node.__sx1, node.__sx2, node.__sx3, node.__sx4, node.__sx5, node.__sx6,\n node.__sy1, node.__sy2, node.__sy3, node.__sy4, node.__sy5, node.__sy6);\n }\n if(cacheAsBitmap) {\n // 跳过display:none元素和它的所有子节点\n if(computedStyle[DISPLAY] === 'none') {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n continue;\n }\n mergeList.push([i, lv, total, node, __config, hasMask]);\n }\n }\n /**\n * 根据收集的需要合并局部根的索引,尝试合并,按照层级从大到小,索引从大到小的顺序,\n * 这样保证子节点在前,后节点在前(mask在后面),渲染顺序正确\n */\n if(mergeList.length) {\n mergeList.sort(function(a, b) {\n if(a[1] === b[1]) {\n return b[0] - a[0];\n }\n return b[1] - a[1];\n });\n mergeList.forEach(item => {\n let [i, lv, total, node, __config, hasMask] = item;\n genTotal(renderMode, node, __config, i, lv, total || 0, __structs, hasMask, width, height);\n });\n }\n /**\n * 最后先序遍历一次并应用__cacheTotal即可,没有的普通绘制,以及剩下的超尺寸的和Text\n * 特殊离屏和cacheAsBitmap的离屏都已经产生了cacheTotal,除非超限\n * 离屏功能的数据结构和算法逻辑非常复杂,需用到下面2个hash,来完成一些filter、mask等离屏才能完成的绘制\n * 其中overflow、filter、mix-blend-mode是对自身及子节点,mask则是对自身和后续next遮罩节点\n * 一个节点在Xom渲染中申请离屏canvas,是按照一定顺序来的,且多个离屏后面的有前面的ctx引用,第一个则引用最初非离屏的ctx\n * 这个顺序在应用离屏时以反向顺序开始,这样最后ctx被还原到最初的ctx\n * mask是个十分特殊的离屏,因为除了自身外,next节点也需要汇总到另外一个离屏上,为了逻辑一致性\n * 所有离屏应用的索引都以最后一个节点的索引为准,即有mask时以最后一个mask,无mask则以自身节点的最后一个(+total)为索引\n * 由于存在普通非cache绘制,所以依然要用到栈代替递归计算matrix\n */\n let maskStartHash = {};\n let offscreenHash = {};\n for(let i = 0, len = __structs.length; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_LV]: lv,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n } = __structs[i];\n // text如果display不可见,parent会直接跳过,不会走到这里,这里一定是直接绘制到root的,visibility在其内部判断\n if(node instanceof Text) {\n node.render(renderMode, REPAINT, ctx, NA, 0, 0);\n if(offscreenHash.hasOwnProperty(i)) {\n ctx = applyOffscreen(ctx, offscreenHash[i], width, height);\n }\n }\n else {\n let __config = node.__config;\n let {\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_REFRESH_LV]: refreshLevel,\n [NODE_COMPUTED_STYLE]: {\n [DISPLAY]: display,\n [MIX_BLEND_MODE]: mixBlendMode,\n [OPACITY]: opacity,\n },\n } = __config;\n // 遮罩对象申请了个离屏,其第一个mask申请另外一个离屏mask2,开始聚集所有mask元素的绘制,\n // 这是一个十分特殊的逻辑,保存的index是最后一个节点的索引,OFFSCREEN_MASK2是最低优先级,\n // 这样当mask本身有filter时优先自身,然后才是OFFSCREEN_MASK2\n if(maskStartHash.hasOwnProperty(i)) {\n let [idx, n, offscreenMask] = maskStartHash[i];\n let target = inject.getCacheCanvas(width, height, null, 'mask2');\n offscreenMask.mask = target; // 应用mask用到\n offscreenMask.isClip = node.isClip;\n // 定位到最后一个mask元素上的末尾\n let j = i + (total || 0) + 1;\n while(--n) {\n let { [STRUCT_TOTAL]: total } = __structs[j];\n j += (total || 0) + 1;\n }\n j--;\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([idx, lv, OFFSCREEN_MASK, offscreenMask]);\n list.push([j, lv, OFFSCREEN_MASK2, {\n ctx, // 保存等待OFFSCREEN_MASK2时还原\n target,\n }]);\n ctx = target.ctx;\n }\n // 有cache声明从而有total的可以直接绘制并跳过子节点索,total生成可能会因超限而失败\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal]);\n if(target) {\n let j = i;\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n // total的none直接跳过\n if(display === 'none') {\n continue;\n }\n if(isValidMbm(mixBlendMode)) {\n ctx.globalCompositeOperation = mbmName(mixBlendMode);\n }\n else {\n ctx.globalCompositeOperation = 'source-over';\n }\n // cache需要计算matrixEvent,因为局部根节点临时视为E,根据refreshLevel决定\n let matrix = __config[NODE_MATRIX], matrixEvent = __config[NODE_MATRIX_EVENT];\n let old = matrixEvent.slice(0);\n let parentMatrix = __config[NODE_DOM_PARENT].matrixEvent;\n if(parentMatrix && !isE(parentMatrix)) {\n matrix = multiply(parentMatrix, matrix);\n }\n util.assignMatrix(matrixEvent, matrix);\n Cache.draw(ctx, opacity, matrixEvent, target);\n // total应用后记得设置回来\n ctx.globalCompositeOperation = 'source-over';\n // 父超限但子有total的时候,i此时已经增加到了末尾,也需要检查\n if(offscreenHash.hasOwnProperty(i)) {\n ctx = applyOffscreen(ctx, offscreenHash[i], width, height);\n }\n // 有cache的可以跳过子节点,但如果matrixEvent变化还是需要遍历计算一下的,虽然跳过了渲染\n // 如果cache是新的,则需要完整遍历设置一次\n // 如果isNew为false,则计算下局部根节点再对比下看是否有变化,无变化可省略\n let needReset = __cacheTotal.isNew;\n if(!needReset && !util.equalArr(old, matrixEvent)) {\n needReset = true;\n }\n if(needReset) {\n resetMatrixCacheTotal(__structs, j, total || 0, lv, matrixEvent);\n }\n __cacheTotal.__isNew = false;\n }\n // 没有cacheTotal是普通节点绘制\n else {\n let res = node.render(renderMode, refreshLevel, ctx, NA, 0, 0);\n let { offscreenBlend, offscreenMask, offscreenFilter, offscreenOverflow } = res || {};\n // 这里离屏顺序和xom里返回的一致,和下面应用离屏时的list相反\n if(offscreenBlend) {\n let j = i + (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([i, lv, OFFSCREEN_BLEND, offscreenBlend]);\n ctx = offscreenBlend.target.ctx;\n }\n // 被遮罩的节点要为第一个遮罩和最后一个遮罩的索引打标,被遮罩的本身在一个离屏canvas,遮罩的元素在另外一个\n // 最后一个遮罩索引因数量不好计算,放在maskStartHash做\n if(offscreenMask) {\n let j = i + (total || 0);\n maskStartHash[j + 1] = [i, hasMask, offscreenMask];\n ctx = offscreenMask.target.ctx;\n }\n // filter造成的离屏,需要将后续一段孩子节点区域的ctx替换,并在结束后应用结果,再替换回来\n if(offscreenFilter) {\n let j = i + (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([i, lv, OFFSCREEN_FILTER, offscreenFilter]);\n ctx = offscreenFilter.target.ctx;\n }\n // overflow:hidden的离屏,最后孩子进行截取\n if(offscreenOverflow) {\n let j = i + (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([i, lv, OFFSCREEN_OVERFLOW, offscreenOverflow]);\n ctx = offscreenOverflow.target.ctx;\n }\n // 离屏应用,按照lv从大到小即子节点在前先应用,同一个节点多个效果按offscreen优先级从小到大来,\n // 由于mask特殊索引影响,所有离屏都在最后一个mask索引判断,此时mask本身优先结算,以index序大到小判断\n if(offscreenHash.hasOwnProperty(i)) {\n ctx = applyOffscreen(ctx, offscreenHash[i], width, height);\n }\n // render后判断可见状态,此时computedStyle才有值,none可以忽略渲染,但是可能会跳过offscreenHash预置的索引\n if(display === 'none') {\n let add = (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n for(let j = i + 1; j <= i + add; j++) {\n if(offscreenHash.hasOwnProperty(j)) {\n ctx = applyOffscreen(ctx, offscreenHash[j], width, height);\n }\n }\n i += add;\n }\n }\n }\n }\n}\n\nexport default {\n renderCanvas,\n renderSvg,\n renderWebgl,\n};\n\n","import webgl from './webgl';\nimport MockPage from './MockPage';\nimport inject from '../util/inject';\n\nclass TexCache {\n constructor(units) {\n this.__units = units; // 通道数量限制,8~16\n this.__pages = []; // 存当前page列表,通道数量8~16,缓存收留尽可能多的page\n this.__list = []; // 本次渲染暂存的数据,[cache, opacity, matrix, dx, dy]\n this.__channels = []; // 每个纹理通道记录还是个数组,下标即纹理单元,内容为Page\n this.__locks = []; // 锁定纹理单元列表,下标即纹理单元,内容true为锁定\n this.__lockUnits = 0;\n }\n\n /**\n * webgl每次绘制为添加纹理并绘制,此处尝试尽可能收集所有纹理贴图,以达到尽可能多的共享纹理,再一次性绘制\n * 收集的是Page对象(从cache中取得),里面包含了若干个节点的贴图,canvas本身是2的幂次方大小\n * webgl最少有8个纹理单元最多16个,因此存了一个列表来放这些Page的canvas,刷新后清空,但纹理通道映射记录保留\n * 当8个纹理单元全部满了,进行绘制并清空这个队列,外部主循环结束时也会检查队列是否还有余留并绘制\n * 初始调用队列为空,存入Page对象,后续调用先查看是否存在以便复用,再决定是否存入Page,直到8个满了\n * Page上存有update表示是否更新,每次cache绘制时会变true,以此表示是否有贴图更新,删除可以忽视\n * 还需要一个记录上次纹理通道使用哪个Page的canvas的地方,即映射,清空后队列再次添加时,如果Page之前被添加过,\n * 此次又被添加且没有变更update,可以直接复用上次的纹理单元号且无需再次上传纹理,节省性能\n * 后续接入局部纹理更新也是复用单元号,如果update变更可以选择局部上传纹理而非整个重新上传\n * 判断上传的逻辑在收集满8个后绘制前进行,因为添加队列过程中可能会变更Page及其update\n * @param gl\n * @param cache\n * @param opacity\n * @param matrix\n * @param cx\n * @param cy\n * @param dx\n * @param dy\n * @param revertY\n */\n addTexAndDrawWhenLimit(gl, cache, opacity, matrix, cx, cy, dx = 0, dy = 0, revertY) {\n let pages = this.__pages;\n let list = this.__list;\n let page = cache.page;\n let i = pages.indexOf(page);\n // 找到说明已有page在此索引的通道中,记录下来info\n if(i > -1) {\n list.push([cache, opacity, matrix, dx, dy]);\n }\n // 找不到说明是新的纹理贴图,此时看是否超过纹理单元限制,超过则刷新绘制并清空,然后/否则 存入纹理列表\n else {\n i = pages.length;\n if(i >= this.__units - this.__lockUnits) {\n // 绘制且清空,队列索引重新为0\n this.refresh(gl, cx, cy, revertY);\n }\n pages.push(page);\n list.push([cache, opacity, matrix, dx, dy]);\n }\n }\n\n /**\n * 刷新\n * @param gl\n * @param cx\n * @param cy\n * @param revertY\n */\n refresh(gl, cx, cy, revertY) {\n let pages = this.__pages;\n let list = this.__list;\n // 防止空调用刷新,struct循环结尾会强制调用一次防止有未渲染的\n if(pages.length) {\n let channels = this.channels;\n let locks = this.locks;\n // 先将上次渲染的纹理单元使用的Page形成一个hash,键为page的uuid,值为纹理单元\n let lastHash = {};\n channels.forEach((item, i) => {\n if(item) {\n let uuid = item.uuid;\n lastHash[uuid] = i;\n }\n });\n let units = this.__units;\n // 再遍历,查找相同的Page并保持其使用的纹理单元不变,存入相同索引下标oldList,不同的按顺序收集放newList\n let oldList = new Array(units), newList = [];\n pages.forEach(page => {\n let uuid = page.uuid;\n if(lastHash.hasOwnProperty(uuid)) {\n let index = lastHash[uuid];\n oldList[index] = page;\n }\n else {\n newList.push(page);\n }\n });\n /**\n * 以oldList为基准,将newList依次存入oldList中\n * 优先使用未用过的纹理单元,以便用过的可能下次用到无需重新上传\n * 找不到未用过的后,尝试NRU算法,优先淘汰最近未使用的Page,相等则尺寸小的\n */\n if(newList.length) {\n // 先循环找空的,oldList空且channels空且locks空\n for(let i = 0; i < units; i++) {\n if(!oldList[i] && !channels[i] &&!locks[i]) {\n oldList[i] = newList.shift();\n if(!newList.length) {\n break;\n }\n }\n }\n let len = newList.length;\n if(len) {\n // 按时间排序已使用channel且未被当前占用的,以便淘汰最久未使用的\n let cl = [];\n for(let i = 0; i < units; i++) {\n if(!oldList[i] && !locks[i]) {\n cl.push([i, channels[i]]);\n }\n }\n cl.sort(function(a, b) {\n if(a[1].time !== b[1].time) {\n return (a[1].time || 0) - (b[1].time || 0);\n }\n if(a[1].fullSize !== b[1].fullSize) {\n return a[1].fullSize - b[1].fullSize;\n }\n return a[0] - b[0];\n });\n // cl靠前是时间小尺寸小的,优先使用替换\n for(let i = 0; i < len; i++) {\n oldList[cl[i][0]] = newList[i];\n }\n }\n }\n /**\n * 对比上帧渲染的和这次纹理单元情况,Page相同且!update可以省略更新,其它均重新赋值纹理\n * 后续局部更新Page相同但有update,会出现没有上帧的情况如初始渲染,此时先创建纹理单元再更新\n * 将新的数据赋给老的,可能新的一帧使用的少于上一帧,老的没用到的需继续保留\n */\n let hash = {};\n for(let i = 0, len = oldList.length; i < len; i++) {\n let page = oldList[i];\n // 可能为空,不满的情况下前面单元保留老tex先用的后面的单元\n if(!page) {\n continue;\n }\n let last = channels[i];\n if(!last || last !== page || page.update) {\n // page可能为一个已有fbo纹理,或者贴图\n if(page instanceof MockPage) {\n webgl.bindTexture(gl, page.texture, i);\n }\n else {\n // 可能老的先删除,注意只删Page,MockPage是fbo生成的texture即total缓存不能自动清除\n if(last && !(last instanceof MockPage)) {\n gl.deleteTexture(last.texture);\n }\n page.texture = webgl.createTexture(gl, page.canvas, i);\n }\n channels[i] = page;\n }\n hash[page.uuid] = i;\n // 标识没有更新,以及最后使用时间\n page.update = false;\n page.time = inject.now();\n }\n // 再次遍历开始本次渲染并清空\n webgl.drawTextureCache(gl, list, hash, cx, cy, revertY);\n pages.splice(0);\n list.splice(0);\n }\n }\n\n findExistTexChannel(page) {\n return this.channels.indexOf(page);\n }\n\n /**\n * 获取并锁定一个纹理单元优先使用空的,其次最久未使用的\n * @returns {number|*}\n */\n lockOneChannel() {\n // 优先返回空单元\n let channels = this.channels;\n let locks = this.locks;\n for(let i = 0; i < this.__units; i++) {\n if(!channels[i] && !locks[i]) {\n locks[i] = true;\n this.__lockUnits++;\n return i;\n }\n }\n // 根据NRU返回最久未使用的\n let units = this.__units;\n let cl = [];\n for(let i = 0; i < units; i++) {\n if(!locks[i]) {\n cl.push([i, channels[i]]);\n }\n }\n if(cl.length) {\n cl.sort(function(a, b) {\n if(a[1].time !== b[1].time) {\n return (a[1].time || 0) - (b[1].time || 0);\n }\n if(a[1].fullSize !== b[1].fullSize) {\n return a[1].fullSize - b[1].fullSize;\n }\n return a[0] - b[0];\n });\n let i = cl[0][0];\n channels[i] = null;\n locks[i] = true;\n this.__lockUnits++;\n return i;\n }\n throw new Error('No free texture unit');\n }\n\n /**\n * 释放掉i单元,并且设置内容到缓存channel中\n * @param i\n * @param setToChannel\n */\n releaseLockChannel(i, setToChannel) {\n if(this.locks[i]) {\n this.locks[i] = false;\n this.__lockUnits--;\n if(setToChannel) {\n this.channels[i] = setToChannel;\n }\n }\n }\n\n // 指定锁定一个单元\n lockChannel(i) {\n let channels = this.channels;\n let locks = this.locks;\n if(!locks[i]) {\n channels[i] = null;\n locks[i] = true;\n this.__lockUnits++;\n }\n }\n\n /**\n * 释放纹理单元\n * @param gl\n */\n release(gl) {\n this.channels.forEach(item => {\n if(item) {\n gl.deleteTexture(item.texture);\n }\n });\n }\n\n get channels() {\n return this.__channels;\n }\n\n get locks() {\n return this.__locks;\n }\n\n get last() {\n let list = this.__list, len = list.length;\n if(len) {\n return list[len - 1];\n }\n }\n}\n\nexport default TexCache;\n","import Dom from './Dom';\nimport Text from './Text';\nimport Xom from './Xom';\nimport Component from './Component';\nimport Defs from './Defs';\nimport Geom from './geom/Geom';\nimport builder from '../util/builder';\nimport updater from '../util/updater';\nimport util from '../util/util';\nimport domDiff from '../util/diff';\nimport css from '../style/css';\nimport unit from '../style/unit';\nimport geom from '../math/geom';\nimport enums from '../util/enums';\nimport inject from '../util/inject';\nimport Event from '../util/Event';\nimport frame from '../animate/frame';\nimport Controller from '../animate/Controller';\nimport mode from '../refresh/mode';\nimport change from '../refresh/change';\nimport level from '../refresh/level';\nimport struct from '../refresh/struct';\nimport reflow from '../refresh/reflow';\nimport vertex from '../gl/main.vert';\nimport fragment from '../gl/main.frag';\nimport vertexMask from '../gl/mask.vert';\nimport fragmentMask from '../gl/mask.frag';\nimport fragmentClip from '../gl/clip.frag';\nimport fragmentOverflow from '../gl/overflow.frag';\nimport vertexCm from '../gl/filter/cm.vert';\nimport fragmentCm from '../gl/filter/cm.frag';\nimport webgl from '../gl/webgl';\nimport ca from '../gl/ca';\nimport TexCache from '../gl/TexCache';\n\nconst {\n STYLE_KEY: {\n TOP,\n RIGHT,\n BOTTOM,\n LEFT,\n POSITION,\n DISPLAY,\n VISIBILITY,\n COLOR,\n WIDTH,\n HEIGHT,\n Z_INDEX,\n MARGIN_TOP,\n MARGIN_LEFT,\n MARGIN_BOTTOM,\n PADDING_TOP,\n PADDING_LEFT,\n PADDING_BOTTOM,\n BORDER_TOP_WIDTH,\n BORDER_LEFT_WIDTH,\n BORDER_BOTTOM_WIDTH,\n POINTER_EVENTS,\n },\n UPDATE_KEY: {\n UPDATE_NODE,\n UPDATE_STYLE,\n UPDATE_KEYS,\n UPDATE_COMPONENT,\n UPDATE_FOCUS,\n UPDATE_OVERWRITE,\n UPDATE_LIST,\n UPDATE_CONFIG,\n UPDATE_ADD_DOM,\n UPDATE_REMOVE_DOM,\n },\n NODE_KEY: {\n NODE_TAG_NAME,\n NODE_CACHE_STYLE,\n NODE_CACHE_PROPS,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_CURRENT_PROPS,\n NODE_DOM_PARENT,\n NODE_IS_MASK,\n NODE_REFRESH_LV,\n NODE_IS_DESTROYED,\n NODE_STYLE,\n NODE_UPDATE_HASH,\n NODE_UNIQUE_UPDATE_ID,\n NODE_CACHE,\n NODE_CACHE_TOTAL,\n NODE_CACHE_FILTER,\n NODE_CACHE_OVERFLOW,\n NODE_CACHE_MASK,\n NODE_STRUCT,\n },\n STRUCT_KEY: {\n STRUCT_INDEX,\n STRUCT_TOTAL,\n STRUCT_NODE,\n }\n} = enums;\nconst DIRECTION_HASH = {\n [TOP]: true,\n [RIGHT]: true,\n [BOTTOM]: true,\n [LEFT]: true,\n};\nconst { isNil, isObject, isFunction } = util;\nconst { AUTO, PX, PERCENT, INHERIT } = unit;\nconst { isRelativeOrAbsolute, equalStyle } = css;\nconst { contain, getLevel, isRepaint, NONE, FILTER, PERSPECTIVE, REPAINT, REFLOW, REBUILD } = level;\nconst { isIgnore, isGeom } = change;\n\nconst ROOT_DOM_NAME = {\n canvas: 'canvas',\n svg: 'svg',\n webgl: 'canvas',\n};\n\nfunction getDom(dom) {\n if(util.isString(dom) && dom) {\n let o = document.querySelector(dom);\n if(!o) {\n throw new Error('Can not find dom of selector: ' + dom);\n }\n return o;\n }\n if(!dom) {\n throw new Error('Can not find dom: ' + dom);\n }\n return dom;\n}\n\nfunction renderProp(k, v) {\n let s = Array.isArray(v) ? util.joinSourceArray(v) : util.stringify(v);\n if(k === 'className') {\n k = 'class';\n }\n else if(k === 'style') {\n return '';\n }\n return ' ' + k + '=\"' + util.encodeHtml(s, true) + '\"';\n}\n\nconst EVENT_LIST = ['click', 'dblclick', 'mousedown', 'mousemove', 'mouseup', 'touchstart', 'touchmove', 'touchend', 'touchcancel'];\n\nfunction initEvent(dom, Root) {\n let list = [];\n EVENT_LIST.forEach(type => {\n function cb(e) {\n let root = dom.__root;\n if(root && root instanceof Root) {\n if(['touchend', 'touchcancel', 'touchmove'].indexOf(type) > -1) {\n let target = root.__touchstartTarget;\n let event = root.__wrapEvent(e);\n event.target = target;\n while(target) {\n target.__emitEvent(event, true);\n target = target.domParent;\n }\n }\n else {\n root.__cb(e);\n }\n }\n }\n dom.addEventListener(type, cb);\n list.push([type, cb]);\n });\n return list;\n}\n\nfunction removeEvent(dom, list) {\n list.forEach(item => {\n dom.removeEventListener(item[0], item[1]);\n });\n}\n\n// 提取出对比节点尺寸是否固定非AUTO\nfunction isFixedWidthOrHeight(node, k) {\n let c = node.currentStyle[k];\n return c[1] !== AUTO;\n}\n// 除了固定尺寸,父级也不能是flex或变化flex\nfunction isFixedSize(node, includeParentFlex) {\n let res = isFixedWidthOrHeight(node, WIDTH) && isFixedWidthOrHeight(node, HEIGHT);\n if(res && includeParentFlex) {\n let parent = node.domParent;\n if(parent) {\n if(parent.currentStyle[DISPLAY] === 'flex' || parent.computedStyle[DISPLAY] === 'flex') {\n return false;\n }\n }\n }\n return res;\n}\n\nfunction isLAYOUT(node) {\n return node.hasOwnProperty('__uniqueReflowId');\n}\n\nlet __uniqueReflowId = 0;\nfunction setLAYOUT(node, hash, component, addDom) {\n if(!node.hasOwnProperty('__uniqueReflowId')) {\n node.__uniqueReflowId = __uniqueReflowId;\n hash[__uniqueReflowId++] = {\n node,\n component,\n addDom,\n };\n }\n}\n\n/**\n * 单独提出共用检测影响的函数,从节点本身开始向上分析影响,找到最上层的影响节点设置其重新布局\n * 过程即__checkReflow中所提及的,各种情况\n * 将影响升至最近的父级节点,并添加布局标识,这样后面的深度遍历会以父级为准忽略本身\n * 如果最终是root,则返回true标识,直接整个重新开始布局\n * ====\n * addDom情况下的特殊影响检测,类似checkInfluence\n * 添加的是absolute则只影响自己,大部分交互游戏情况属于此类型优化\n * 添加的是inline/inlineBlock的话,影响最近非inline父节点\n * 父为flex则直接影响父节点,不管添加情况如何\n * 添加block/flex的话,上下都block/flex则只影响自己,否则还是影响父节点\n * 如果最终是root,则返回true标识,直接整个重新开始布局\n * @returns {boolean}\n */\nfunction checkInfluence(root, reflowHash, node, component, addDom) {\n // add情况abs节点特殊对待不影响其它节点,不能判断display,因为inline会强制block\n if(addDom && node.currentStyle[POSITION] === 'absolute') {\n return;\n }\n let target = node;\n // inline新老都影响,节点变为最近的父非inline\n if(['inline', 'inlineBlock', 'inline-block'].indexOf(target.currentStyle[DISPLAY]) > -1\n || ['inline', 'inlineBlock', 'inline-block'].indexOf(target.computedStyle[DISPLAY]) > -1) {\n do {\n target = target.domParent;\n // 父到root提前跳出\n if(target === root) {\n return true;\n }\n // 父已有LAYOUT跳出防重\n if(isLAYOUT(target)) {\n return;\n }\n // 遇到absolute跳出,设置其布局;如果absolute不变化普通处理,如果absolute发生变化,一定会存在于列表中,不用考虑\n if(target.currentStyle[POSITION] === 'absolute' || target.computedStyle[POSITION] === 'absolute') {\n setLAYOUT(target, reflowHash, component, addDom);\n return;\n }\n }\n while(target && (['inline', 'inlineBlock', 'inline-block'].indexOf(target.currentStyle[DISPLAY]) > -1\n || ['inline', 'inlineBlock', 'inline-block'].indexOf(target.computedStyle[DISPLAY]) > -1));\n // target已不是inline,父固定宽高跳出直接父进行LAYOUT即可,不影响上下文,但不能是flex孩子,此时固定尺寸无用\n if(isFixedSize(target, true)) {\n setLAYOUT(target, reflowHash, component, addDom);\n return;\n }\n }\n // 此时target指向node,如果原本是inline则是其flow的非inline父\n let parent = target.domParent;\n // parent有LAYOUT跳出,已被包含\n if(isLAYOUT(parent)) {\n return;\n }\n // 向上检查flex,如果父级中有flex,以最上层的flex视作其更改,node本身flex不进入\n let topFlex;\n do {\n // 父已有LAYOUT跳出防重\n if(isLAYOUT(parent)) {\n return;\n }\n // flex相关,包含变化或不变化\n if(parent.computedStyle[DISPLAY] === 'flex' || parent.currentStyle[DISPLAY] === 'flex') {\n topFlex = parent;\n }\n // 遇到absolute跳出,如果absolute不变化普通处理,如果absolute发生变化,一定会存在于列表中,不用考虑\n if(parent.currentStyle[POSITION] === 'absolute' || parent.computedStyle[POSITION] === 'absolute') {\n break;\n }\n // 父固定宽高跳出\n if(isFixedSize(parent, true)) {\n break;\n }\n parent = parent.domParent;\n }\n while(parent);\n // 找到最上层flex,视作其更改\n if(topFlex) {\n target = topFlex;\n }\n if(target === root) {\n return true;\n }\n parent = target;\n // 向上检查非固定尺寸的absolute,找到则视为其变更,上面过程中一定没有出现absolute\n while(parent) {\n // 无论新老absolute,不变化则设置,变化一定会出现在列表中\n if(parent.currentStyle[POSITION] === 'absolute' || parent.computedStyle[POSITION] === 'absolute') {\n if(parent === root) {\n break;\n }\n // 固定尺寸的不用设置,需要跳出循环\n if(isFixedSize(parent)) {\n break;\n }\n else {\n setLAYOUT(parent, reflowHash, component, addDom);\n return;\n }\n }\n parent = parent.domParent;\n }\n // 向上查找了并且没提前跳出的target如果不等于自身则重新布局,自身外面设置过了\n if(target !== node) {\n setLAYOUT(target, reflowHash, component, addDom);\n }\n else if(addDom) {\n // 前后必须都是block,否则还是视为父布局\n let isSiblingBlock = true;\n let { prev, next } = node;\n if(prev && ['inline', 'inline-block', 'inlineBlock'].indexOf(prev.currentStyle[DISPLAY]) > -1) {\n isSiblingBlock = false;\n }\n else if(next && ['inline', 'inline-block', 'inlineBlock'].indexOf(next.currentStyle[DISPLAY]) > -1) {\n isSiblingBlock = false;\n }\n if(!isSiblingBlock) {\n target = node.domParent;\n if(target === root) {\n return true;\n }\n setLAYOUT(target, reflowHash, false, true);\n }\n }\n}\n\nlet uniqueUpdateId = 0;\nfunction parseUpdate(renderMode, root, target, reflowList, cacheHash, cacheList, zHash, zList) {\n let {\n [UPDATE_NODE]: node,\n [UPDATE_STYLE]: style,\n [UPDATE_OVERWRITE]: overwrite,\n [UPDATE_FOCUS]: focus,\n [UPDATE_COMPONENT]: component,\n [UPDATE_LIST]: list,\n [UPDATE_KEYS]: keys,\n [UPDATE_CONFIG]: __config,\n [UPDATE_ADD_DOM]: addDom,\n [UPDATE_REMOVE_DOM]: removeDom,\n } = target;\n if(__config[NODE_IS_DESTROYED]) {\n return;\n }\n // updateStyle()这样的调用需要覆盖原有样式,因为是按顺序遍历,后面的优先级自动更高不怕重复\n if(overwrite) {\n Object.assign(__config[NODE_STYLE], overwrite);\n }\n // 多次调用更新才会有list,一般没有,优化;component无需,因为多次都是它自己\n if(list && !component) {\n keys = (keys || []).slice(0); // 防止原始值被更改\n let hash = {};\n keys.forEach(k => {\n hash[k] = true;\n });\n list.forEach(item => {\n let { [UPDATE_STYLE]: style2, [UPDATE_OVERWRITE]: overwrite, [UPDATE_KEYS]: keys2 } = item;\n (keys2 || []).forEach(k2 => {\n if(!hash.hasOwnProperty(k2)) {\n hash[k2] = true;\n keys.push(k2);\n }\n });\n if(overwrite) {\n Object.assign(__config[NODE_STYLE], overwrite);\n }\n if(style2) {\n if(style) {\n Object.assign(style, style2);\n }\n else {\n style = style2;\n }\n }\n });\n }\n // 按节点合并完style后判断改变等级\n let {\n [NODE_TAG_NAME]: tagName,\n [NODE_CACHE_STYLE]: __cacheStyle,\n [NODE_CACHE_PROPS]: __cacheProps,\n [NODE_CURRENT_STYLE]: currentStyle,\n [NODE_COMPUTED_STYLE]: computedStyle,\n [NODE_CURRENT_PROPS]: currentProps,\n [NODE_DOM_PARENT]: domParent,\n [NODE_IS_MASK]: isMask,\n } = __config;\n let lv = focus || NONE;\n let hasZ, hasVisibility, hasColor, hasDisplay;\n // component无需遍历直接赋值,img重新加载等情况没有样式更新\n if(!component && style && keys) {\n for(let i = 0, len = keys.length; i < len; i++) {\n let k = keys[i];\n let v = style[k];\n // 只有geom的props和style2种可能\n if(node instanceof Geom && isGeom(tagName, k)) {\n if(!equalStyle(k, v, currentProps[k], node)) {\n lv |= REPAINT;\n __cacheProps[k] = undefined;\n currentProps[k] = v;\n }\n }\n else {\n // 需和现在不等,且不是pointerEvents这种无关的\n if(!equalStyle(k, v, currentStyle[k], node)) {\n // pointerEvents这种无关的只需更新\n if(isIgnore(k)) {\n __cacheStyle[k] = undefined;\n currentStyle[k] = v;\n }\n else {\n // TRBL变化只对relative/absolute起作用,其它忽视\n if(DIRECTION_HASH.hasOwnProperty(k)) {\n let position = currentStyle[POSITION];\n if(position !== 'relative' && position !== 'absolute') {\n delete style[k];\n continue;\n }\n }\n else if(k === DISPLAY) {\n hasDisplay = true;\n }\n // repaint细化等级,reflow在checkReflow()\n lv |= getLevel(k);\n // repaint置空,如果reflow会重新生成空的\n __cacheStyle[k] = undefined;\n currentStyle[k] = v;\n if(k === Z_INDEX && node !== root) {\n hasZ = true;\n }\n if(k === VISIBILITY) {\n hasVisibility = true;\n }\n if(k === COLOR) {\n hasColor = true;\n }\n }\n }\n }\n }\n }\n // 无任何改变处理的去除记录,如pointerEvents、无效的left\n // 但是perspective需考虑进来,虽然不影响自己但影响别人,要返回true表明有变更\n if(lv === NONE && !component) {\n delete __config[NODE_UNIQUE_UPDATE_ID];\n return;\n }\n // 由于父节点中有display:none,或本身节点也为none,执行普通动画是无效的,此时没有display变化\n if(computedStyle[DISPLAY] === 'none' && !hasDisplay) {\n return;\n }\n // 记录下来清除parent的zIndexChildren缓存\n if(hasZ && domParent) {\n delete domParent.__zIndexChildren;\n }\n // visibility/color变化,影响子继承\n if(hasVisibility || hasColor) {\n for(let __structs = root.__structs, __struct = node.__config[NODE_STRUCT], i = __struct[STRUCT_INDEX] + 1, len = i + __struct[STRUCT_TOTAL]; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_TOTAL]: total,\n } = __structs[i];\n let __config = node.__config;\n let currentStyle = __config[NODE_CURRENT_STYLE];\n let need;\n // text的style指向parent,因此text一定变更\n if(hasVisibility && (node instanceof Text || currentStyle[VISIBILITY][1] === INHERIT)) {\n need = true;\n }\n if(hasColor && (node instanceof Text || currentStyle[COLOR][1] === INHERIT)) {\n need = true;\n }\n if(need) {\n __config[NODE_REFRESH_LV] |= REPAINT;\n if(node instanceof Xom) {\n node.clearCache();\n }\n }\n else {\n i += total || 0;\n }\n }\n }\n // mask需清除遮罩对象的缓存\n if(isMask) {\n let prev = node.prev;\n while(prev && (prev.isMask)) {\n prev = prev.prev;\n }\n if(prev && prev.__config[NODE_CACHE_MASK]) {\n prev.__config[NODE_CACHE_MASK].release();\n }\n }\n // 特殊情况,父节点display:none,子节点进行任意变更,应视为无效\n // 如果父节点由none变block,这里也return false,因为父节点会重新layout+render\n // 如果父节点由block变none,同上,所以只要current/computed里有none就return false\n let parent = domParent;\n if(hasDisplay && parent) {\n let __config = parent.__config;\n if(__config[NODE_CURRENT_STYLE][DISPLAY] === 'none' || __config[NODE_COMPUTED_STYLE][DISPLAY] === 'none') {\n computedStyle[DISPLAY] = 'none';\n return;\n }\n }\n // reflow/repaint相关的记录下来\n let isRp = !component && isRepaint(lv);\n if(isRp) {\n // zIndex变化需清空svg缓存\n if(hasZ && renderMode === mode.SVG) {\n lv |= REPAINT;\n domParent && cleanSvgCache(domParent);\n }\n // z改变影响struct局部重排,它的数量不会变因此不影响外围,此处先收集,最后统一对局部根节点进行更新\n if(hasZ && !component && zHash) {\n if(domParent && !domParent.hasOwnProperty('__uniqueZId')) {\n zHash[uniqueUpdateId] = true;\n domParent.__uniqueZId = uniqueUpdateId++;\n zList.push(domParent);\n }\n }\n }\n // reflow在root的refresh中做\n else {\n reflowList.push({\n node,\n style,\n component,\n addDom,\n removeDom,\n });\n }\n // 这里也需|运算,每次刷新会置0,但是如果父元素进行继承变更,会在此元素分析前更改,比如visibility,此时不能直接赋值\n __config[NODE_REFRESH_LV] |= lv;\n if(component || addDom || removeDom) {\n root.__rlv = REBUILD;\n }\n else {\n root.__rlv = Math.max(root.__rlv, lv);\n }\n // dom在>=REPAINT时total失效,svg的Geom比较特殊\n let need = lv >= REPAINT || renderMode === mode.SVG && node instanceof Geom;\n if(need) {\n if(__config[NODE_CACHE]) {\n __config[NODE_CACHE].release();\n }\n }\n // perspective也特殊只清空total的cache,和>=REPAINT清空total共用\n if(need || contain(lv, PERSPECTIVE)) {\n if(__config[NODE_CACHE_TOTAL]) {\n __config[NODE_CACHE_TOTAL].release();\n }\n if(__config[NODE_CACHE_MASK]) {\n __config[NODE_CACHE_MASK].release();\n }\n if(__config[NODE_CACHE_OVERFLOW]) {\n __config[NODE_CACHE_OVERFLOW].release();\n }\n }\n // 特殊的filter清除cache\n if((need || contain(lv, FILTER)) && __config[NODE_CACHE_FILTER]) {\n __config[NODE_CACHE_FILTER].release();\n }\n // 向上清除等级>=REPAINT的汇总缓存信息,过程中可能会出现重复,因此节点上记录一个临时标防止重复递归\n while(parent) {\n let __config = parent.__config;\n // 向上查找,出现重复跳出\n if(__config.hasOwnProperty(NODE_UNIQUE_UPDATE_ID)) {\n let id = __config[NODE_UNIQUE_UPDATE_ID];\n if(cacheHash.hasOwnProperty(id)) {\n break;\n }\n cacheHash[id] = true;\n }\n // 没有的需要设置一个标识\n else {\n cacheHash[uniqueUpdateId] = true;\n __config[NODE_UNIQUE_UPDATE_ID] = uniqueUpdateId++;\n cacheList.push(__config);\n }\n let lv = __config[NODE_REFRESH_LV];\n let need = lv >= REPAINT;\n if(need && __config[NODE_CACHE]) {\n __config[NODE_CACHE].release();\n }\n // 前面已经过滤了无改变NONE的,只要孩子有任何改变父亲就要清除\n if(__config[NODE_CACHE_TOTAL]) {\n __config[NODE_CACHE_TOTAL].release();\n }\n if(__config[NODE_CACHE_FILTER]) {\n __config[NODE_CACHE_FILTER].release();\n }\n if(__config[NODE_CACHE_MASK]) {\n __config[NODE_CACHE_MASK].release();\n }\n if(__config[NODE_CACHE_OVERFLOW]) {\n __config[NODE_CACHE_OVERFLOW].release();\n }\n parent = __config[NODE_DOM_PARENT];\n }\n return true;\n}\n\nfunction cleanSvgCache(node, child) {\n let __config = node.__config;\n if(child) {\n __config[NODE_REFRESH_LV] |= REPAINT;\n }\n else {\n __config[NODE_CACHE_TOTAL].release();\n }\n if(Array.isArray(node.children)) {\n node.children.forEach(child => {\n if(child instanceof Component) {\n child = child.shadowRoot;\n }\n if(!(child instanceof Text)) {\n cleanSvgCache(child, true);\n }\n });\n }\n}\n\nlet uuid = 0;\n\nclass Root extends Dom {\n constructor(tagName, props, children) {\n super(tagName, props);\n this.__cd = children || []; // 原始children,再初始化过程中生成真正的dom\n this.__dom = null; // 真实DOM引用\n this.__mw = 0; // 记录最大宽高,防止尺寸变化清除不完全\n this.__mh = 0;\n // this.__scx = 1; // 默认缩放,css改变canvas/svg缩放后影响事件坐标,有值手动指定,否则自动计算\n // this.__scy = 1;\n this.__taskUp = [];\n this.__taskCp = [];\n this.__ref = {};\n this.__reflowList = [{ node: this }]; // 初始化填自己,第一次布局时复用逻辑完全重新布局\n this.__animateController = new Controller();\n Event.mix(this);\n this.__config[NODE_UPDATE_HASH] = this.__updateHash = {};\n this.__uuid = uuid++;\n this.__rlv = REBUILD; // 每次刷新最大lv\n }\n\n __initProps() {\n let w = this.props.width;\n if(!isNil(w)) {\n let value = parseFloat(w) || 0;\n if(value > 0) {\n this.__width = value;\n }\n }\n let h = this.props.height;\n if(!isNil(h)) {\n let value = parseFloat(h) || 0;\n if(value > 0) {\n this.__height = value;\n }\n }\n }\n\n __genHtml(domName) {\n let res = `<${domName}`;\n // 拼接处理属性\n Object.keys(this.props).forEach(k => {\n let v = this.props[k];\n // 忽略事件\n if(!/^on[a-zA-Z]/.test(k)) {\n res += renderProp(k, v);\n }\n });\n res += `>${domName}>`;\n return res;\n }\n\n __wrapEvent(e) {\n let x, y;\n // 触摸结束取消特殊没有touches\n if(['touchend', 'touchcancel'].indexOf(e.type) === -1) {\n let { dom, __scx, __scy } = this;\n let { x: x2, y: y2, left, top, width, height } = dom.getBoundingClientRect();\n x = x2 || left || 0;\n y = y2 || top || 0;\n let { clientX, clientY } = e.touches ? e.touches[0] : e;\n x = clientX - x;\n y = clientY - y;\n // 外边的scale影响元素事件响应,根据倍数计算真实的坐标,优先手动指定,否则自动计算\n if(!isNil(__scx)) {\n x /= __scx;\n }\n else {\n x *= this.width / width;\n }\n if(!isNil(__scy)) {\n y /= __scy;\n }\n else {\n y *= this.height / height;\n }\n }\n return {\n event: e,\n stopPropagation() {\n this.__stopPropagation = true;\n e.stopPropagation();\n },\n stopImmediatePropagation() {\n this.__stopPropagation = true;\n this.__stopImmediatePropagation = true;\n e.stopImmediatePropagation();\n },\n preventDefault() {\n e.preventDefault();\n },\n x,\n y,\n __hasEmitted: false,\n };\n }\n\n // 类似touchend/touchcancel/touchmove这种无需判断是否发生于元素上,直接响应\n __cb(e) {\n if(e.type === 'touchmove' && !this.__touchstartTarget) {\n return;\n }\n let data = this.__wrapEvent(e);\n this.__emitEvent(data);\n return data;\n }\n\n /**\n * 添加到真实Dom上,优先已存在的同名canvas/svg节点,没有则dom下生成新的\n * @param dom\n */\n appendTo(dom) {\n dom = getDom(dom);\n this.__children = builder.initRoot(this.__cd, this);\n this.__initProps();\n this.__root = this;\n let tagName = this.tagName;\n let domName = ROOT_DOM_NAME[tagName];\n // OffscreenCanvas兼容,包含worker的\n if(typeof window !== 'undefined' && window.OffscreenCanvas && (dom instanceof window.OffscreenCanvas)\n || typeof self !== 'undefined' && self.OffscreenCanvas && (dom instanceof self.OffscreenCanvas)) {\n this.__dom = dom;\n this.__width = dom.width;\n this.__height = dom.height;\n }\n // 已有root节点\n else if(dom.nodeName.toLowerCase() === domName) {\n this.__dom = dom;\n if(this.width) {\n dom.setAttribute('width', this.width);\n }\n if(this.height) {\n dom.setAttribute('height', this.height);\n }\n }\n // 没有canvas/svg节点则生成一个新的\n else {\n this.__dom = dom.querySelector(domName);\n if(!this.__dom) {\n dom.innerHTML = this.__genHtml(domName);\n this.__dom = dom.querySelector(domName);\n }\n }\n this.__defs = this.dom.__defs || Defs.getInstance(this.__uuid);\n // 没有设置width/height则采用css计算形式\n if(!this.width || !this.height) {\n let domCss = window.getComputedStyle(dom, null);\n if(!this.width) {\n this.__width = parseFloat(domCss.getPropertyValue('width')) || 0;\n dom.setAttribute('width', this.width);\n }\n if(!this.height) {\n this.__height = parseFloat(domCss.getPropertyValue('height')) || 0;\n dom.setAttribute('height', this.height);\n }\n }\n // 最终无宽高给出警告\n if(!this.width || !this.height) {\n inject.warn('Karas render target with a width or height of 0.')\n }\n let params = Object.assign({}, ca, this.props.contextAttributes);\n // 只有canvas有ctx,svg用真实dom\n if(this.tagName === 'canvas') {\n this.__ctx = this.__dom.getContext('2d', params);\n this.__renderMode = mode.CANVAS;\n }\n else if(this.tagName === 'svg') {\n this.__renderMode = mode.SVG;\n }\n else if(this.tagName === 'webgl') {\n let gl = this.__ctx = this.__dom.getContext('webgl', params);\n this.__renderMode = mode.WEBGL;\n gl.program = webgl.initShaders(gl, vertex, fragment);\n gl.programMask = webgl.initShaders(gl, vertexMask, fragmentMask);\n gl.programClip = webgl.initShaders(gl, vertexMask, fragmentClip);\n gl.programOverflow = webgl.initShaders(gl, vertexMask, fragmentOverflow);\n gl.programCm = webgl.initShaders(gl, vertexCm, fragmentCm);\n gl.useProgram(gl.program);\n // 第一次渲染生成纹理缓存管理对象,收集渲染过程中生成的纹理并在gl纹理单元满了时进行绘制和清空,减少texImage2d耗时问题\n const MAX_TEXTURE_IMAGE_UNITS = Math.min(16, gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS));\n this.__texCache = new TexCache(MAX_TEXTURE_IMAGE_UNITS);\n }\n this.refresh(null, true);\n // 第一次节点没有__root,渲染一次就有了才能diff\n if(this.dom.__root && this.dom.__root instanceof Root) {\n this.dom.__root.destroy();\n }\n this.__eventCbList = initEvent(this.dom, Root);\n this.dom.__root = this;\n }\n\n refresh(cb, isFirst) {\n this.__hookTask = null;\n let { isDestroyed, renderMode, ctx, defs, width, height } = this;\n if(isDestroyed) {\n return;\n }\n defs.clear();\n // 首次递归测量整树的继承,后续更改各自更新机制做,防止每次整树遍历;root检查首次直接做,后续在checkUpdate()中插入\n if(isFirst) {\n this.__checkRoot(renderMode, width, height);\n }\n // 非首次刷新如果没有更新则无需继续\n else if(!this.__checkUpdate(renderMode, ctx, width, height)) {\n return;\n }\n this.__checkReflow(width, height);\n if(renderMode === mode.CANVAS && !this.props.noRender) {\n this.__clear(ctx, renderMode);\n struct.renderCanvas(renderMode, ctx, this);\n }\n // svg的特殊diff需要\n else if(renderMode === mode.SVG && !this.props.noRender) {\n struct.renderSvg(renderMode, defs, this, isFirst);\n let nvd = this.virtualDom;\n nvd.defs = defs.value;\n if(this.dom.__vd) {\n // console.log(this.dom.__vd);\n // console.log(nvd);\n domDiff(this.dom, this.dom.__vd, nvd);\n }\n else {\n this.dom.innerHTML = util.joinVirtualDom(nvd);\n }\n this.dom.__vd = nvd;\n this.dom.__defs = defs;\n }\n else if(renderMode === mode.WEBGL && !this.props.noRender) {\n this.__clear(ctx, renderMode);\n struct.renderWebgl(renderMode, ctx, this);\n }\n // 特殊cb,供小程序绘制完回调使用\n if(isFunction(cb)) {\n cb();\n }\n this.emit(Event.REFRESH, this.__rlv);\n this.__rlv = NONE;\n }\n\n destroy() {\n this.__destroy();\n this.animateController.__destroy();\n let n = this.dom;\n if(n) {\n removeEvent(n, this.__eventCbList || []);\n n.__root = null;\n }\n let gl = this.ctx;\n if(this.__texCache && gl) {\n this.__texCache.release(gl);\n if(gl.program) {\n gl.deleteShader(gl.program.vertexShader);\n gl.deleteShader(gl.program.fragmentShader);\n gl.deleteProgram(gl.program);\n }\n if(gl.programMask) {\n gl.deleteShader(gl.programMask.vertexShader);\n gl.deleteShader(gl.programMask.fragmentShader);\n gl.deleteProgram(gl.programMask);\n }\n if(gl.programOverflow) {\n gl.deleteShader(gl.programOverflow.vertexShader);\n gl.deleteShader(gl.programOverflow.fragmentShader);\n gl.deleteProgram(gl.programOverflow);\n }\n }\n }\n\n scale(x = 1, y = x) {\n this.__scx = x;\n this.__scy = y;\n }\n\n resize(w, h, cb) {\n let self = this;\n if(w !== self.width || h !== self.height) {\n self.__width = w;\n self.__height = h;\n self.updateStyle({\n width: w,\n height: h,\n }, cb);\n }\n else if(isFunction(cb)) {\n cb(-1);\n }\n }\n\n addRefreshTask(cb) {\n let { taskUp, isDestroyed } = this;\n if(isDestroyed) {\n return;\n }\n // 第一个添加延迟侦听,后续放队列等待一并执行\n if(!taskUp.length) {\n let clone;\n frame.nextFrame({\n __before: diff => {\n if(this.isDestroyed) {\n return;\n }\n clone = taskUp.splice(0);\n // 前置一般是动画计算此帧样式应用,然后刷新后出发frame事件,图片加载等同\n if(clone.length) {\n clone.forEach((item, i) => {\n if(isObject(item) && isFunction(item.__before)) {\n item.__before(diff);\n }\n });\n }\n },\n __after: diff => {\n if(this.isDestroyed) {\n return;\n }\n clone.forEach(item => {\n if(isObject(item) && isFunction(item.__after)) {\n item.__after(diff);\n }\n else if(isFunction(item)) {\n item(diff);\n }\n });\n }\n });\n this.__frameHook();\n }\n if(taskUp.indexOf(cb) === -1) {\n taskUp.push(cb);\n }\n }\n\n addForceRefreshTask(cb) {\n this.__hasRootUpdate = true;\n this.addRefreshTask(cb);\n }\n\n delRefreshTask(cb) {\n if(!cb) {\n return;\n }\n let { taskUp } = this;\n for(let i = 0, len = taskUp.length; i < len; i++) {\n if(taskUp[i] === cb) {\n taskUp.splice(i, 1);\n break;\n }\n }\n }\n\n /**\n * 为component的setState更新专门开辟个独立的流水线,root/frame中以taskCp存储更新列表\n * 普通的动画、img加载等都走普通的refresh的task,component走这里,frame中的结构同样\n * 在frame的每帧调用中,先执行普通的动画task,再执行component的task\n * 这样动画执行完后,某个cp的sr及子节点依旧先进行了动画变更,进入__addUpdate()环节\n * 然后此cp再更新sr及子节点,这样会被__addUpdate()添加到尾部,依赖目前浏览器默认实现\n * 上一行cp更新过程中是updater.check()进行的,如果有新老交换且有动画,动画的assigning是true,进行继承\n * root刷新parseUpdate()时,老的sr及子节点先进行,随后新的sr后进行且有component标识,sr子节点不会有更新\n * @param cb\n */\n addRefreshCp(cb) {\n let { taskCp, isDestroyed } = this;\n if(isDestroyed) {\n return;\n }\n // 每次只执行1次\n if(!taskCp.length) {\n let clone;\n frame.__nextFrameCp({\n __before: diff => {\n if(this.isDestroyed) {\n return;\n }\n clone = taskCp.splice(0);\n if(clone.length) {\n clone.forEach(item => {\n item.__before(diff);\n });\n updater.check(this);\n let len = updater.updateList.length;\n if(len) {\n updater.updateList.forEach(cp => {\n let root = cp.root; // 多个root并存时可能cp的引用不相同,需分别获取\n let sr = cp.shadowRoot;\n // 可能返回text,需视为其parentNode\n if(sr instanceof Text) {\n sr = sr.domParent;\n }\n let res = {};\n res[UPDATE_NODE] = sr;\n res[UPDATE_STYLE] = sr.currentStyle;\n res[UPDATE_FOCUS] = REFLOW;\n res[UPDATE_COMPONENT] = cp;\n res[UPDATE_CONFIG] = sr.__config;\n this.__addUpdate(sr, sr.__config, root, root.__config, res);\n });\n }\n }\n },\n __after: diff => {\n if(this.isDestroyed) {\n return;\n }\n clone.forEach(item => {\n item.__after(diff);\n });\n // 触发didUpdate\n updater.did();\n },\n });\n this.__frameHook();\n }\n if(taskCp.indexOf(cb) === -1) {\n taskCp.push(cb);\n }\n }\n\n getTargetAtPoint(x, y, includeIgnore) {\n function scan(vd, x, y, path, zPath) {\n let { __sx1, __sy1, offsetWidth, offsetHeight, matrixEvent, children, zIndexChildren,\n computedStyle: { [DISPLAY]: display, [POINTER_EVENTS]: pointerEvents } } = vd;\n if(!includeIgnore && display === 'none') {\n return;\n }\n if(Array.isArray(zIndexChildren)) {\n for(let i = 0, len = children.length; i < len; i++) {\n children[i].__index__ = i;\n }\n for(let i = zIndexChildren.length - 1; i >= 0; i--) {\n let item = zIndexChildren[i];\n if(item instanceof karas.Text) {\n continue;\n }\n let path2 = path.slice();\n path2.push(item.__index__);\n let zPath2 = zPath.slice();\n zPath2.push(i);\n let res = scan(item, x, y, path2, zPath2);\n if(res) {\n return res;\n }\n }\n }\n if(!includeIgnore && pointerEvents === 'none') {\n return;\n }\n let inThis = geom.pointInQuadrilateral(\n x, y,\n __sx1, __sy1,\n __sx1 + offsetWidth, __sy1,\n __sx1 + offsetWidth, __sy1 + offsetHeight,\n __sx1, __sy1 + offsetHeight,\n matrixEvent\n );\n if(inThis) {\n return {\n target: vd,\n path,\n zPath,\n };\n }\n }\n return scan(this, x, y, [], []);\n }\n\n /**\n * 每次刷新前检查root节点的样式,有些固定的修改无效,有些继承的作为根初始化\n * @param renderMode\n * @param width\n * @param height\n * @private\n */\n __checkRoot(renderMode, width, height) {\n let { dom, currentStyle, computedStyle } = this;\n // canvas/svg作为根节点一定是block或flex,不会是inline\n if(['flex', 'block'].indexOf(currentStyle[DISPLAY]) === -1) {\n computedStyle[DISPLAY] = currentStyle[DISPLAY] = 'block';\n }\n // 同理position不能为absolute\n if(currentStyle[POSITION] === 'absolute') {\n computedStyle[POSITION] = currentStyle[POSITION] = 'static';\n }\n // 根节点满宽高\n currentStyle[WIDTH] = [width, PX];\n currentStyle[HEIGHT] = [height, PX];\n computedStyle[WIDTH] = width;\n computedStyle[HEIGHT] = height;\n // 可能调用resize()导致变更,要重设,canvas无论离屏与否都可使用直接赋值,svg则按dom属性api\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n if(dom.width !== width) {\n dom.width = width;\n }\n if(dom.height !== height) {\n dom.height = height;\n }\n }\n else if(renderMode === mode.SVG) {\n dom.setAttribute('width', width);\n dom.setAttribute('height', height);\n }\n }\n\n /**\n * 添加更新入口,按节点汇总更新信息\n * @private\n */\n __addUpdate(node, nodeConfig, root, rootConfig, o) {\n let updateHash = rootConfig[NODE_UPDATE_HASH];\n // root特殊处理,检查变更时优先看继承信息\n if(node === root) {\n updateHash = root.__updateRoot;\n if(updateHash) {\n if(o[UPDATE_FOCUS]) {\n updateHash[UPDATE_FOCUS] |= o[UPDATE_FOCUS];\n }\n // 后续存在新建list上,需增加遍历逻辑\n if(o[UPDATE_STYLE]) {\n let list = updateHash[UPDATE_LIST] = updateHash[UPDATE_LIST] || [];\n list.push({\n [UPDATE_STYLE]: o[UPDATE_STYLE],\n [UPDATE_OVERWRITE]: o[UPDATE_OVERWRITE],\n [UPDATE_KEYS]: o[UPDATE_KEYS],\n });\n }\n }\n else {\n root.__updateRoot = o;\n }\n }\n else if(!nodeConfig.hasOwnProperty(NODE_UNIQUE_UPDATE_ID)) {\n nodeConfig[NODE_UNIQUE_UPDATE_ID] = uniqueUpdateId;\n // 大多数情况节点都只有一次更新,所以优化首次直接存在style上,后续存在list\n updateHash[uniqueUpdateId++] = o;\n }\n else if(updateHash.hasOwnProperty(nodeConfig[NODE_UNIQUE_UPDATE_ID])) {\n let target = updateHash[nodeConfig[NODE_UNIQUE_UPDATE_ID]];\n if(o[UPDATE_FOCUS]) {\n target[UPDATE_FOCUS] |= o[UPDATE_FOCUS];\n }\n // 后续存在新建list上,需增加遍历逻辑\n if(o[UPDATE_STYLE]) {\n let list = target[UPDATE_LIST] = target[UPDATE_LIST] || [];\n list.push({\n [UPDATE_STYLE]: o[UPDATE_STYLE],\n [UPDATE_OVERWRITE]: o[UPDATE_OVERWRITE],\n [UPDATE_KEYS]: o[UPDATE_KEYS],\n });\n }\n }\n else {\n inject.error('Update process miss uniqueUpdateId');\n }\n }\n\n /**\n * 除首次外每次刷新前检查更新列表,计算样式变化,以及测量信息\n * @private\n */\n __checkUpdate(renderMode, ctx, width, height) {\n let root = this;\n let reflowList = [];\n let cacheHash = {};\n let cacheList = [];\n let zHash = {};\n let zList = [];\n let updateRoot = root.__updateRoot;\n let updateHash = root.__updateHash;\n // 给个方式使得外部可以强制刷新\n let hasUpdate = root.__hasRootUpdate;\n root.__hasRootUpdate = false;\n // root更新特殊提前,因为有继承因素\n if(updateRoot) {\n root.__updateRoot = null;\n hasUpdate = parseUpdate(renderMode, root, updateRoot,\n reflowList, cacheHash, cacheList);\n // 此时做root检查,防止root出现继承等无效样式,或者发生resize()\n if(hasUpdate) {\n root.__checkRoot(renderMode, width, height);\n }\n }\n // 汇总处理每个节点,k是递增数字直接循环遍历\n let keys = Object.keys(updateHash);\n for(let i = 0, len = keys.length; i < len; i++) {\n let t = parseUpdate(renderMode, root, updateHash[keys[i]],\n reflowList, cacheHash, cacheList, zHash, zList);\n hasUpdate = hasUpdate || t;\n }\n // 先做一部分reset避免下面measureList干扰,cacheList的是专门收集新增的额外节点\n root.__reflowList = reflowList;\n uniqueUpdateId = 0;\n root.__updateHash = root.__config[NODE_UPDATE_HASH] = {};\n cacheList.forEach(__config => {\n delete __config[NODE_UNIQUE_UPDATE_ID];\n });\n // zIndex改变的汇总修改,防止重复操作\n zList.forEach(item => {\n if(item.hasOwnProperty('__uniqueZId')) {\n delete item.__uniqueZId;\n item.__updateStruct(root.__structs);\n }\n });\n // 做完清空留待下次刷新重来\n for(let i = 0, len = keys.length; i < len; i++) {\n delete updateHash[keys[i]][UPDATE_CONFIG][NODE_UNIQUE_UPDATE_ID];\n }\n return hasUpdate;\n }\n\n /**\n * 除首次外每次刷新前检查reflow列表,计算需要reflow的节点局部重新布局\n * 当一个元素absolute不变时,其变化不会影响父元素和兄弟元素,直接自己重新局部LAYOUT包含子节点\n * 当absolute发生改变时,其变化会影响父和兄弟,视作父重新布局\n * 当inline变化时,视为其最近block/flex父变化\n * 当block变化时,往上查找最上层flex视为其变化,如不是则影响后面兄弟offset和父resize\n * 当flex变化时,往上查找最上层flex视为其变化,如不是则影响所有递归子节点layout和父resize\n * 以上3种情况向上查找时遇到absolute父均提前跳出,并标记absolute父LAYOUT\n * 上面所有情况即便结束还得额外看是否处于absolute中,是还是标记absolute重新布局\n * 当relative只变化left/top/right/bottom时,自己重新layout\n * 检测节点时记录影响的所有节点,最终形成一棵或n棵局部树\n * 需要重新布局的记作LAYOUT,被兄弟影响只需偏移的记作OFFSET,OFFSET可能会重复变为LAYOUT\n * 上述情况倘若发生包含重复,去掉子树,因子树视为被包含的重新布局\n * 如果有从root开始的,直接重新布局像首次那样即可\n * 如果非root,所有树根按先根顺序记录下来,依次执行局部布局\n * =========================\n * addDom比较特殊,是向已有节点中添加新的节点,检查影响与普通domDiff变化不同\n * @private\n */\n __checkReflow(width, height) {\n let { __reflowList: reflowList } = this;\n if(!reflowList.length) {\n return;\n }\n let root = this;\n let uniqueList = [];\n let hasRoot;\n __uniqueReflowId = 0;\n let reflowHash = {};\n // 遍历检查发生布局改变的节点列表,此时computedStyle还是老的,currentStyle是新的\n for(let i = 0, len = reflowList.length; i < len; i++) {\n let item = reflowList[i];\n let { node, component, addDom, removeDom } = item;\n // root提前跳出,完全重新布局\n if(node === this) {\n hasRoot = true;\n break;\n }\n // 添加时如果是cp则node取sr来布局\n if(addDom && node instanceof Component) {\n node = node.shadowRoot;\n }\n // 每个节点生成唯一的布局识别id存入hash防止重复\n if(!node.hasOwnProperty('__uniqueReflowId')) {\n node.__uniqueReflowId = __uniqueReflowId;\n reflowHash[__uniqueReflowId++] = item;\n }\n // 每个节点都向上检查影响,以及是否从root开始完全重新,remove特殊对待,影响父节点视为普通父节点relay\n if(checkInfluence(root, reflowHash, node, component, addDom)) {\n hasRoot = true;\n if(addDom) {\n this.__zIndexChildren = null;\n }\n break;\n }\n // remove的要特殊对待,因为提前删除了父子兄弟关系,下面deepScan不会出现\n else if(removeDom) {\n uniqueList.push(item);\n }\n }\n __uniqueReflowId = 0;\n this.__reflowList = [];\n // 有root提前跳出\n if(hasRoot) {\n reflow.clearUniqueReflowId(reflowHash);\n // 布局分为两步,普通流和定位流,互相递归\n this.__layout({\n x: 0,\n y: 0,\n w: width,\n h: height,\n }, false, false);\n // 绝对布局需要从根开始保存相对坐标系的容器引用,并根据relative/absolute情况变更\n this.__layoutAbs(this, {\n x: 0,\n y: 0,\n w: width,\n h: height,\n });\n this.__structs = this.__structure(0, 0);\n return true;\n }\n /**\n * 修剪树,自顶向下深度遍历\n * LAYOUT节点作为局部根,其递归子节点无需重复任何操作,直接去重\n * OFFSET节点作为局部根,其递归子节点先执行任何操作,后续根节点再偏移一次\n */\n else {\n this.__deepScan(function(node, options) {\n if(node.hasOwnProperty('__uniqueReflowId')) {\n let o = reflowHash[node.__uniqueReflowId];\n options.uniqueList.push(o);\n // 返回true即可提前结束深度遍历,在reflowHash有记录时提前跳出,子节点交由上面逻辑执行\n return true;\n }\n // reflowHash没有记录则无返回继续递归执行\n }, { uniqueList });\n /**\n * 按顺序执行列表即可,上层LAYOUT先执行且停止递归子节点,上层OFFSET后执行等子节点先LAYOUT/OFFSET\n * 同级按先后顺序排列,过程中记录diff在结束后进行structs更新\n * 这里要注意margin合并的逻辑,因为最终都是block(flex等同),需要进行合并\n * 在处理一个block时,先判断是否是空block,同时看后面紧邻的有没有在uniqueList的下一个\n * 单独空block处理、2个相邻的非block处理直接可以进行判断\n * 中间的空block(即非空block的下一个是空block,且下一个不是最后一个),先记录下来list,合并后一并offset\n * 合并margin和Dom的逻辑一样,抽离共有方法\n **/\n let diffList = [];\n let diffI = 0;\n let mergeOffsetList = [];\n let __uniqueMergeOffsetId = 0;\n uniqueList.forEach(item => {\n let { node, component, addDom, removeDom } = item;\n // 重新layout的w/h数据使用之前parent暂存的,x使用parent,y使用prev或者parent的\n let cps = node.computedStyle, cts = node.currentStyle;\n let zIndex = cps[Z_INDEX], position = cps[POSITION], display = cps[DISPLAY];\n let isLastAbs = position === 'absolute';\n let isNowAbs = cts[POSITION] === 'absolute';\n let isLastNone = display === 'none';\n let isNowNone = cts[DISPLAY] === 'none';\n // none不可见布局无效可以无视\n if(isLastNone && isNowNone) {\n return;\n }\n let parent = node.domParent;\n let { __layoutData: { x, y, h }, width, computedStyle } = parent;\n let current = node;\n // cp的shadowRoot要向上到cp本身,考虑高阶组件在内到真正的顶层cp\n if(current.isShadowRoot) {\n current = current.hostRoot;\n }\n // y使用prev或者parent的,首个节点无prev,prev要忽略absolute的和display:none的\n let ref = current.prev;\n let hasFlowPrev;\n while(ref) {\n if(ref instanceof Text\n || (ref.computedStyle[POSITION] !== 'absolute' && ref.computedStyle[DISPLAY] !== 'none')) {\n y = ref.y + ref.outerHeight;\n hasFlowPrev = true;\n break;\n }\n ref = ref.prev;\n }\n // 找不到prev以parent为基准,找到则增加自身,排除remove\n if(!removeDom) {\n if(!hasFlowPrev) {\n y += computedStyle[MARGIN_TOP] + computedStyle[BORDER_TOP_WIDTH] + computedStyle[PADDING_TOP];\n }\n x += computedStyle[MARGIN_LEFT] + computedStyle[BORDER_LEFT_WIDTH] + computedStyle[PADDING_LEFT];\n }\n // 找到最上层容器,如果是组件的子节点,以sr为container,sr本身往上找\n let container = node;\n // remove的节点本身无需再次布局\n if(!removeDom) {\n if(isNowAbs) {\n container = container.domParent;\n while(container && container !== root) {\n if(isRelativeOrAbsolute(container)) {\n break;\n }\n // 不能用domParent,必须在组件环境内\n if(container.parent) {\n container = container.parent;\n }\n else if(container.host) {\n break;\n }\n }\n if(!container) {\n container = root;\n }\n // 由setState引发的要检查是cp自身还是更上层,如果cp被abs包含,那么node是cp的父亲,否则node是cp的sr\n // 而这种情况下传cp或node都一样,所以最终统一传node\n parent.__layoutAbs(container, parent.__layoutData, node);\n // 优先判断dom变更\n if(addDom) {\n let arr = parent.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n parent.__updateStruct(root.__structs);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(parent);\n }\n return;\n }\n // 前后都是abs无需偏移后面兄弟和parent调整,component变化节点需更新struct\n else if(isLastAbs) {\n if(component) {\n let arr = node.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n if((position !== cts[POSITION] && (position === 'static' || cts[POSITION] === 'static'))\n || zIndex !== cts[Z_INDEX]) {\n parent.__updateStruct(root.__structs);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(parent);\n }\n }\n }\n else if(isLastNone || isNowNone) {\n node.__zIndexChildren = null;\n let arr = node.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n }\n return;\n }\n // 标识flow变abs,可能引发zIndex变更,重设struct和svg\n parent.__updateStruct(root.__structs);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(parent);\n }\n }\n // 现在是普通流,不管之前是啥直接布局,排除remove删除的\n else {\n node.__layout({\n x,\n y,\n w: width,\n h,\n }, false, false);\n y += node.outerHeight;\n if(component) {\n container = node;\n }\n else {\n container = container.domParent;\n while(container && container !== root) {\n if(isRelativeOrAbsolute(container)) {\n break;\n }\n // 不能用domParent,必须在组件环境内\n if(container.parent) {\n container = container.parent;\n }\n else if(container.host) {\n break;\n }\n }\n }\n if(!container) {\n container = root;\n }\n // 防止geom\n if(node instanceof Dom) {\n node.__layoutAbs(container, {\n x,\n y,\n w: width,\n h,\n });\n }\n }\n }\n\n // 向上查找最近的parent是relative,需再次累加ox/oy,无需继续向上递归,因为parent已经递归包含了\n // 这样node重新布局后再次设置其使用parent的偏移\n let p = node;\n while(p && p !== root) {\n p = p.domParent;\n computedStyle = p.computedStyle;\n if(computedStyle[POSITION] === 'relative') {\n let { ox, oy } = p;\n ox && node.__offsetX(ox);\n oy && node.__offsetY(oy);\n break;\n }\n }\n\n // 向下调整next的flow位置,遇到重复LAYOUT的跳出等待其调用并处理其next,忽视掉abs,margin和abs在merge中做\n if(node.isShadowRoot) {\n node = node.hostRoot;\n }\n let next = node.next;\n while(next && !next.hasOwnProperty('__uniqueReflowId')) {\n if(next.computedStyle[POSITION] === 'absolute') {\n next = next.next;\n continue;\n }\n let { y: oy } = next;\n let diff = y - oy;\n if(diff) {\n while(next && !next.hasOwnProperty('__uniqueReflowId')) {\n let target = next;\n if(target instanceof Component) {\n target = target.shadowRoot;\n }\n let cs = target.computedStyle;\n if(cs[POSITION] !== 'absolute' && cs[DISPLAY] !== 'none') {\n target.__offsetY(diff, true, REPAINT);\n }\n next = next.next;\n }\n }\n break;\n }\n\n // 去重防止abs并记录parent,整个结束后按先序顺序进行margin合并以及偏移,注意忽略有display:none变block同时为absolute的\n if(!parent.hasOwnProperty('__uniqueMergeOffsetId') && !(isNowAbs && isLastNone)) {\n parent.__uniqueMergeOffsetId = __uniqueMergeOffsetId++;\n mergeOffsetList.push(parent);\n }\n\n // add和remove都需父节点重新生成struct,zIndexChildren已在对应api操作的before()侦听做了\n if(addDom || removeDom) {\n let arr = parent.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(parent);\n }\n }\n // component未知dom变化,所以强制重新struct,text则为其父节点,同时防止zIndex变更影响父节点\n else if(component) {\n let arr = node.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n if((position !== cts[POSITION] && (position === 'static' || cts[POSITION] === 'static'))\n || zIndex !== cts[Z_INDEX]) {\n node.domParent.__updateStruct(root.__structs);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(node.domParent);\n }\n }\n }\n // display有none变化,重置struct和zIndexChildren\n else if(isLastNone || isNowNone) {\n node.__zIndexChildren = null;\n let arr = node.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n }\n });\n /**\n * mergeMargin后续调整,记录的是变更节点的父节点,因此每个节点内部直接遍历孩子进行\n * 由于保持先根遍历的顺序,因此会从最上最里的节点开始,先进行margin合并\n * 由于之前忽略掉abs节点,因此再检查直接abs是否要调整\n * 完成后对此父节点的后续兄弟节点进行调整,多次不会干扰影响\n * 然后继续往上循环,直到root结束\n */\n let inDirectAbsList = [];\n mergeOffsetList.forEach(parent => {\n delete parent.__uniqueMergeOffsetId;\n let flowChildren = parent.flowChildren, absChildren = parent.absChildren;\n let mergeMarginBottomList = [], mergeMarginTopList = [];\n let length = flowChildren.length, lastChild;\n let isStart, startIndex, startNode;\n // 遍历flow孩子,从开始变化的节点开始,看变化造成的影响,对其后面节点进行偏移,并统计总偏移量\n for(let i = 0; i < length; i++) {\n let item = flowChildren[i];\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n let isXom = item instanceof Xom;\n // 忽略掉前面没有变更的节点,不能合并\n if(!isStart && isXom) {\n if(item.hasOwnProperty('__uniqueReflowId')) {\n isStart = true;\n startIndex = i;\n startNode = item;\n }\n }\n // 开始变更的节点,至少不是第0个\n let cs = isXom && item.currentStyle;\n let isInline = isXom && cs[DISPLAY] === 'inline';\n let isInlineBlock = isXom && ['inlineBlock', 'inline-block'].indexOf(cs[DISPLAY]) > -1;\n lastChild = item;\n // 每次循环开始前,这次不是block的话,看之前遗留的,可能是以空block结束,需要特殊处理,单独一个空block也包含\n if((!isXom || isInline || isInlineBlock)) {\n if(mergeMarginBottomList.length && mergeMarginTopList.length && isStart) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n for(let j = Math.max(startIndex, i - mergeMarginBottomList.length + 1); j < length; j++) {\n flowChildren[j].__offsetY(diff, true, REPAINT);\n }\n }\n }\n mergeMarginTopList = [];\n mergeMarginBottomList = [];\n }\n // 和普通布局类似,只是不用重新布局只需处理合并margin再根据差值偏移\n if(isXom && !isInline) {\n let isNone = isXom && cs[DISPLAY] === 'none';\n let isEmptyBlock;\n if(!isNone && item.flowChildren && item.flowChildren.length === 0) {\n let {\n [MARGIN_TOP]: marginTop,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_TOP]: paddingTop,\n [PADDING_BOTTOM]: paddingBottom,\n [HEIGHT]: height,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n } = item.computedStyle;\n // 无内容高度为0的空block特殊情况,记录2个margin下来等后续循环判断处理\n if(paddingTop <= 0 && paddingBottom <= 0 && height <= 0 && borderTopWidth <= 0 && borderBottomWidth <= 0) {\n mergeMarginBottomList.push(marginBottom);\n mergeMarginTopList.push(marginTop);\n isEmptyBlock = true;\n }\n }\n // 空block要留下轮循环看,除非是最后一个,非空本轮处理掉看是否要合并\n if(!isNone && !isEmptyBlock) {\n let { [MARGIN_TOP]: marginTop, [MARGIN_BOTTOM]: marginBottom } = item.computedStyle;\n // 有bottom值说明之前有紧邻的block,任意个甚至空block,自己有个top所以无需判断top\n // 如果是只有紧邻的2个非空block,也被包含在情况内,取上下各1合并\n if(mergeMarginBottomList.length) {\n mergeMarginTopList.push(marginTop);\n if(isStart) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n // 需要合并的情况,根据记录数和索引向上向下遍历节点设置偏移,同时设置总偏移量供父级使用\n if(diff) {\n for(let j = Math.max(startIndex, i - mergeMarginBottomList.length + 1); j < length; j++) {\n flowChildren[j].__offsetY(diff, true, REPAINT);\n }\n }\n }\n }\n // 同时自己保存bottom,为后续block准备\n mergeMarginTopList = [];\n mergeMarginBottomList = [marginBottom];\n }\n // 最后一个空block当是正正和负负时要处理,正负在outHeight处理了结果是0,最后一个一定有不必判断isStart\n else if(i === length - 1) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n for(let j = Math.max(startIndex, i - mergeMarginBottomList.length + 1); j < length; j++) {\n flowChildren[j].__offsetY(diff, true, REPAINT);\n }\n }\n }\n }\n }\n // 先检查parent的尺寸是否发生了变化,从而决定是否调整next以及向上递归调整\n let cs = parent.currentStyle;\n let height = cs[HEIGHT];\n let isContainer = parent === root || parent.isShadowRoot || cs[POSITION] === 'absolute' || cs[POSITION] === 'relative';\n if(height[1] === AUTO && lastChild) {\n let oldH = parent.height + parent.computedStyle[PADDING_TOP];\n let nowH = lastChild.y + lastChild.outerHeight - parent.y;\n let diff = nowH - oldH;\n // 调整next以及非固定PX的abs,再递归向上\n if(diff) {\n parent.__resizeY(diff, REPAINT);\n let container;\n for(let i = 0, len = absChildren.length; i < len; i++) {\n let item = absChildren[i];\n let { [TOP]: top, [BOTTOM]: bottom, [HEIGHT]: height } = item.currentStyle;\n // 是容器,所有的都调整,不是容器,其偏移是上级parent的某一个,根据情况具体不同\n if(top[1] === AUTO) {\n if(bottom[1] === AUTO) {\n let prev = item.prev;\n while(prev) {\n let target = prev;\n if(target instanceof Component) {\n target = target.shadowRoot;\n }\n let isXom = target instanceof Xom;\n let cs = isXom && target.currentStyle;\n let isAbs = isXom && cs[POSITION] === 'absolute';\n if(!isAbs) {\n let y = target.y + target.outerHeight;\n let d = y - item.y;\n if(d) {\n item.__offsetY(d, true, REPAINT);\n }\n break;\n }\n prev = prev.prev;\n }\n }\n else if(bottom[1] === PX) {\n item.__offsetY(diff, true, REPAINT);\n }\n else if(bottom[1] === PERCENT) {\n let v = (1 - bottom[0] * 0.01) * diff;\n item.__offsetY(v, true, REPAINT);\n }\n }\n else if(top[1] === PERCENT) {\n if(isContainer) {\n let v = top[0] * 0.01 * diff;\n item.__offsetY(v, true, REPAINT);\n }\n // 非容器的特殊处理\n else {\n if(!container) {\n container = parent.domParent;\n while(container) {\n if(container === root || container.isShadowRoot) {\n break;\n }\n let cs = container.currentStyle;\n if(cs[POSITION] === 'absolute' || cs[POSITION] === 'relative') {\n break;\n }\n container = container.domParent;\n }\n }\n if(container.currentStyle[HEIGHT][1] !== PX) {\n let v = top[0] * 0.01 * diff;\n item.__offsetY(v, true, REPAINT);\n }\n }\n }\n // 高度百分比需发生变化的重新布局,需要在容器内\n if(height[1] === PERCENT) {\n if(isContainer) {\n parent.__layoutAbs(parent, parent.__layoutData, item);\n }\n // 不在容器内说明在上级,存入等结束后统一重新布局\n else {\n if(!container) {\n container = parent.domParent;\n while(container) {\n if(container === root || container.isShadowRoot) {\n break;\n }\n let cs = container.currentStyle;\n if(cs[POSITION] === 'absolute' || cs[POSITION] === 'relative') {\n break;\n }\n container = container.domParent;\n }\n }\n inDirectAbsList.push([parent, container, item]);\n }\n }\n }\n reflow.offsetAndResizeByNodeOnY(parent, root, reflowHash, diff, inDirectAbsList);\n return;\n }\n }\n // 没有diff变化或者固定尺寸,可能内部发生变化,调整AUTO的abs,不递归向上\n for(let i = 0, len = absChildren.length; i < len; i++) {\n let item = absChildren[i];\n let { [TOP]: top, [BOTTOM]: bottom } = item.currentStyle;\n if(top[1] === AUTO && bottom[1] === AUTO) {\n let prev = item.prev;\n while(prev) {\n let target = prev;\n if(target instanceof Component) {\n target = target.shadowRoot;\n }\n let isXom = target instanceof Xom;\n let cs = isXom && target.currentStyle;\n let isAbs = isXom && cs[POSITION] === 'absolute';\n if(!isAbs) {\n let y = target.y + target.outerHeight;\n let d = y - item.y;\n if(d) {\n item.__offsetY(d, true, REPAINT);\n }\n break;\n }\n prev = prev.prev;\n }\n }\n }\n });\n // merge过程中需要重新布局的abs\n inDirectAbsList.forEach(arr => {\n arr[0].__layoutAbs(arr[1], arr[0].__layoutData, arr[2]);\n });\n\n // 调整因reflow造成的原struct数据索引数量偏差,纯zIndex的已经在repaint里面重新生成过了\n // 这里因为和update保持一致的顺序,因此一定是先根顺序且互不包含\n let diff = 0, lastIndex = 0, isFirst = true, structs = root.__structs;\n diffList.forEach(item => {\n let [ns, d] = item;\n // 第一个有变化的,及后面无论有无变化都需更新\n // 第1个变化区域无需更改前面一段\n if(isFirst) {\n isFirst = false;\n lastIndex = ns[STRUCT_INDEX] + (ns[STRUCT_TOTAL] || 0) + 1;\n diff += d;\n }\n // 第2+个变化区域看是否和前面一个相连,有不变的段则先偏移它,然后再偏移自己\n else {\n let j = ns[STRUCT_INDEX] + (ns[STRUCT_TOTAL] || 0) + 1 + diff;\n for(let i = lastIndex; i < j; i++) {\n structs[i][STRUCT_INDEX] += diff;\n }\n lastIndex = j;\n diff += d;\n }\n });\n // 后面的要根据偏移量校正索引\n if(diff) {\n for(let i = lastIndex, len = structs.length; i < len; i++) {\n structs[i][STRUCT_INDEX] += diff;\n }\n }\n // 清除id\n reflow.clearUniqueReflowId(reflowHash);\n }\n }\n\n // 每个root拥有一个刷新hook,多个root塞到frame的__hookTask里\n // frame在所有的帧刷新逻辑执行后检查hook列表,进行root刷新操作\n __frameHook() {\n if(!this.__hookTask) {\n let r = this.__hookTask = (() => {\n this.refresh();\n });\n frame.__hookTask.push(r);\n }\n }\n\n __clear(ctx, renderMode) {\n if(renderMode === mode.CANVAS) {\n // 可能会调整宽高,所以每次清除用最大值\n this.__mw = Math.max(this.__mw, this.width);\n this.__mh = Math.max(this.__mh, this.height);\n // 清除前得恢复默认matrix,防止每次布局改变了属性\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.clearRect(0, 0, this.__mw, this.__mh);\n }\n else if(renderMode === mode.WEBGL) {\n ctx.clearColor(0, 0, 0, 0);\n ctx.clear(ctx.COLOR_BUFFER_BIT);\n }\n }\n\n get dom() {\n return this.__dom;\n }\n\n get uuid() {\n return this.__uuid;\n }\n\n get renderMode() {\n return this.__renderMode;\n }\n\n get ctx() {\n return this.__ctx;\n }\n\n get defs() {\n return this.__defs;\n }\n\n get taskUp() {\n return this.__taskUp;\n }\n\n get taskCp() {\n return this.__taskCp;\n }\n\n get ref() {\n return this.__ref;\n }\n\n get animateController() {\n return this.__animateController;\n }\n\n get texCache() {\n return this.__texCache;\n }\n}\n\nexport default Root;\n","import Geom from './Geom';\nimport mode from '../../refresh/mode';\nimport painter from '../../util/painter';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n FILTER,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH, VMAX, VMIN } = unit;\n\nfunction reBuild(target, origin, base, isMulti) {\n if(isMulti) {\n return target.map(item => origin + item * base);\n }\n else {\n return origin + target * base;\n }\n}\n\nfunction reBuildC(target, originX, originY, width, height, isMulti) {\n if(isMulti) {\n if(target) {\n return target.map(item => reBuildC(item, originX, originY, width, height));\n }\n }\n else {\n if(target && target.length >= 2) {\n return [\n originX + target[0] * width,\n originY + target[1] * height,\n ];\n }\n }\n return [];\n}\n\nfunction curveNum(controlA, controlB) {\n let num = 0;\n if(controlA && controlA.length >= 2) {\n num++;\n }\n if(controlB && controlB.length >= 2) {\n num += 2;\n }\n return num;\n}\n\nfunction getNewPoint(x1, y1, x2, y2, controlA, controlB, num, start = 0, end = 1) {\n if(start === 0 && end === 1) {\n return [x1, y1, x2, y2, controlA, controlB];\n }\n if(start === end) {\n return [];\n }\n if(start > end) {\n [start, end] = [end, start];\n }\n start = Math.max(0, start);\n end = Math.min(1, end);\n if(num === 3) {\n [[x1, y1], controlA, controlB, [x2, y2]] = geom.sliceBezier2Both([[x1, y1], controlA, controlB, [x2, y2]], start, end);\n }\n else if(num === 2) {\n [[x1, y1], controlB, [x2, y2]] = geom.sliceBezier2Both([[x1, y1], controlB, [x2, y2]], start, end);\n }\n else if(num === 1) {\n [[x1, y1], controlA, [x2, y2]] = geom.sliceBezier2Both([[x1, y1], controlA, [x2, y2]], start, end);\n }\n else {\n let a = x2 - x1;\n let b = y2 - y1;\n x1 += a * start;\n y1 += b * start;\n x2 += a * (1 - end);\n y2 += b * (1 - end);\n }\n return [x1, y1, x2, y2, controlA, controlB];\n}\n\nclass Line extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // x1,y1和x2,y2表明线段的首尾坐标,control表明控制点坐标\n if(this.isMulti) {\n this.__x1 = [0];\n this.__y1 = [0];\n this.__x2 = [1];\n this.__y2 = [1];\n this.__controlA = [[]];\n this.__controlB = [[]];\n this.__start = [0];\n this.__end = [1];\n if(Array.isArray(props.x1)) {\n this.__x1 = props.x1.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.x1)) {\n this.__x1 = [parseFloat(props.x1) || 0];\n }\n if(Array.isArray(props.y1)) {\n this.__y1 = props.y1.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.y1)) {\n this.__y1 = [parseFloat(props.y1) || 0];\n }\n if(Array.isArray(props.x2)) {\n this.__x2 = props.x2.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.x2)) {\n this.__x2 = [parseFloat(props.x2) || 0];\n }\n if(Array.isArray(props.y2)) {\n this.__y2 = props.y2.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.y2)) {\n this.__y2 = [parseFloat(props.y2) || 0];\n }\n if(Array.isArray(props.controlA)) {\n this.__controlA = props.controlA.map(item => {\n if(Array.isArray(item)) {\n return item;\n }\n return [];\n });\n }\n if(Array.isArray(props.controlB)) {\n this.__controlB = props.controlB.map(item => {\n if(Array.isArray(item)) {\n return item;\n }\n return [];\n });\n }\n if(Array.isArray(props.start)) {\n this.__start = props.start.map(i => parseFloat(i) || 0);\n for(let i = this.__start.length; i < this.__x1.length; i++) {\n this.__start.push(0);\n }\n }\n else if(!isNil(props.start)) {\n let v = parseFloat(props.start) || 0;\n this.__start = this.__x1.map(() => v);\n }\n if(Array.isArray(props.end)) {\n this.__end = props.end.map(i => {\n let v = parseFloat(i);\n if(isNaN(v)) {\n v = 1;\n }\n return v;\n });\n for(let i = this.__end.length; i < this.__x1.length; i++) {\n this.__end.push(1);\n }\n }\n else if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n v = v;\n this.__end = this.__x1.map(() => v);\n }\n }\n else {\n this.__x1 = this.__y1 = this.__start = 0;\n this.__x2 = this.__y2 = this.__end = 1;\n this.__controlA = [];\n this.__controlB = [];\n if(!isNil(props.x1)) {\n this.__x1 = parseFloat(props.x1) || 0;\n }\n if(!isNil(props.y1)) {\n this.__y1 = parseFloat(props.y1) || 0;\n }\n if(!isNil(props.x2)) {\n this.__x2 = parseFloat(props.x2) || 0;\n }\n if(!isNil(props.y2)) {\n this.__y2 = parseFloat(props.y2) || 0;\n }\n if(!isNil(props.start)) {\n this.__start = parseFloat(props.start) || 0;\n }\n if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n this.__end = v;\n }\n if(Array.isArray(props.controlA)) {\n this.__controlA = props.controlA;\n }\n if(Array.isArray(props.controlB)) {\n this.__controlB = props.controlB;\n }\n }\n }\n\n buildCache(originX, originY, focus) {\n let { width, height, __cacheProps, isMulti } = this;\n let rebuild;\n ['x1', 'x2'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = reBuild(this[k], originX, width, isMulti);\n }\n });\n ['y1', 'y2'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = reBuild(this[k], originY, height, isMulti);\n }\n });\n ['controlA', 'controlB'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = reBuildC(this[k], originX, originY, width, height, isMulti);\n }\n });\n ['start', 'end'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = this[k];\n }\n });\n return rebuild;\n }\n\n render(renderMode, lv, ctx, cache, dx2, dy2) {\n let res = super.render(renderMode, lv, ctx, cache, dx2, dy2);\n if(res.break) {\n return res;\n }\n ctx = res.ctx;\n let {\n sx3,\n sy3,\n stroke: strokes,\n strokeWidth: strokeWidths,\n strokeDasharray: strokeDasharrays,\n strokeDasharrayStr: strokeDasharrayStrs,\n strokeLinecap: strokeLinecaps,\n strokeLinejoin: strokeLinejoins,\n strokeMiterlimit: strokeMiterlimits,\n dx,\n dy,\n } = res;\n let { __cacheProps, isMulti } = this;\n let rebuild = this.buildCache(sx3, sy3);\n if(rebuild && renderMode === mode.SVG) {\n let d = '';\n if(isMulti) {\n __cacheProps.x1.forEach((xa, i) => {\n let xb = __cacheProps.x2[i];\n let ya = __cacheProps.y1[i];\n let yb = __cacheProps.y2[i];\n let ca = __cacheProps.controlA[i];\n let cb = __cacheProps.controlB[i];\n let start = __cacheProps.start[i];\n let end = __cacheProps.end[i];\n let curve = curveNum(ca, cb);\n if(start !== 0 || end !== 1) {\n [xa, ya, xb, ya, ca, cb] = getNewPoint(xa, ya, xb, ya, ca, cb, curve, start, end, __cacheProps.len);\n }\n d += painter.svgLine(xa, ya, xb, yb, ca, cb, curve);\n });\n }\n else {\n let curve = curveNum(__cacheProps.controlA, __cacheProps.controlB);\n let { x1, y1, x2, y2, controlA, controlB, start, end } = __cacheProps;\n if(start !== 0 || end !== 1) {\n [x1, y1, x2, y2, controlA, controlB] = getNewPoint(x1, y1, x2, y2, controlA, controlB, curve, start, end, __cacheProps.len);\n }\n d = painter.svgLine(x1, y1, x2, y2, controlA, controlB, curve);\n }\n __cacheProps.d = d;\n }\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n strokes.forEach((stroke, i) => {\n let strokeWidth = strokeWidths[i];\n let isStrokeRE = strokeWidth > 0 && stroke.k === 'radial' && Array.isArray(stroke.v);\n if(strokeWidth > 0 && stroke !== 'none') {\n this.__preSetCanvas(renderMode, ctx, {\n stroke,\n strokeWidth,\n strokeDasharray: strokeDasharrays[i],\n strokeLinecap: strokeLinecaps[i],\n strokeLinejoin: strokeLinejoins[i],\n strokeMiterlimit: strokeMiterlimits[i],\n });\n if(isStrokeRE) {\n ctx.strokeStyle = stroke.v[0];\n }\n ctx.beginPath();\n if(isMulti) {\n __cacheProps.x1.forEach((xa, i) => {\n let xb = __cacheProps.x2[i];\n let ya = __cacheProps.y1[i];\n let yb = __cacheProps.y2[i];\n let ca = __cacheProps.controlA[i];\n let cb = __cacheProps.controlB[i];\n let start = __cacheProps.start[i];\n let end = __cacheProps.end[i];\n let curve = curveNum(ca, cb);\n if(start !== 0 || end !== 1) {\n [xa, ya, xb, ya, ca, cb] = getNewPoint(xa, ya, xb, ya, ca, cb, curve, start, end, __cacheProps.len);\n }\n painter.canvasLine(ctx, xa, ya, xb, yb, ca, cb, curve, dx, dy);\n });\n }\n else {\n let curve = curveNum(__cacheProps.controlA, __cacheProps.controlB);\n let { x1, y1, x2, y2, controlA, controlB, start, end } = __cacheProps;\n if(start !== 0 || end !== 1) {\n [x1, y1, x2, y2, controlA, controlB] = getNewPoint(x1, y1, x2, y2, controlA, controlB, curve, start, end, __cacheProps.len);\n }\n painter.canvasLine(ctx, x1, y1, x2, y2, controlA, controlB, curve, dx, dy);\n }\n ctx.stroke();\n ctx.closePath();\n }\n });\n }\n else if(renderMode === mode.SVG) {\n strokes.forEach((stroke, i) => {\n let strokeWidth = strokeWidths[i];\n let isStrokeRE = strokeWidth > 0 && stroke.k === 'radial' && Array.isArray(stroke.v);\n let props = [\n ['d', __cacheProps.d],\n ['fill', 'none'],\n ['stroke', isStrokeRE ? stroke.v[0] : (stroke.v || stroke)],\n ['stroke-width', strokeWidth]\n ];\n this.__propsStrokeStyle(props, strokeDasharrayStrs[i], strokeLinecaps[i], strokeLinejoins[i], strokeMiterlimits[i]);\n this.addGeom('path', props);\n });\n }\n return res;\n }\n\n get x1() {\n return this.getProps('x1');\n }\n\n get y1() {\n return this.getProps('y1');\n }\n\n get x2() {\n return this.getProps('x2');\n }\n\n get y2() {\n return this.getProps('y2');\n }\n\n get controlA() {\n return this.getProps('controlA');\n }\n\n get controlB() {\n return this.getProps('controlB');\n }\n\n get start() {\n return this.getProps('start');\n }\n\n get end() {\n return this.getProps('end');\n }\n\n get bbox() {\n let {\n isMulti, __cacheProps, root,\n __sx3: originX, __sy3: originY,\n currentStyle: {\n [STROKE_WIDTH]: strokeWidth,\n [BOX_SHADOW]: boxShadow,\n [FILTER]: filter,\n },\n } = this;\n this.buildCache(originX, originY);\n let { x1, y1, x2, y2, controlA, controlB } = __cacheProps;\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE], half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else {\n half = Math.max(item[0], half);\n }\n });\n let [x1s, y1s, x2s, y2s] = this.__spreadBbox(boxShadow, filter);\n x1s -= half;\n y1s -= half;\n x2s += half;\n y2s += half;\n if(!isMulti) {\n x1 = [x1];\n x2 = [x2];\n y1 = [y1];\n y2 = [y2];\n controlA = [controlA];\n controlB = [controlB];\n }\n x1.forEach((xa, i) => {\n let ya = y1[i];\n let xb = x2[i];\n let yb = y2[i];\n let ca = controlA[i];\n let cb = controlB[i];\n if((isNil(ca) || ca.length < 2) && (isNil(cb) || cb.length < 2)) {\n bbox[0] = Math.min(bbox[0], xa + x1s);\n bbox[0] = Math.min(bbox[0], xb + x1s);\n bbox[1] = Math.min(bbox[1], ya + y1s);\n bbox[1] = Math.min(bbox[1], yb + y1s);\n bbox[2] = Math.max(bbox[2], xa + x2s);\n bbox[2] = Math.max(bbox[2], xb + x2s);\n bbox[3] = Math.max(bbox[3], ya + y2s);\n bbox[3] = Math.max(bbox[3], yb + y2s);\n }\n else if(isNil(ca) || ca.length < 2) {\n let bezierBox = geom.bboxBezier(xa, ya, cb[0], cb[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] + x1s);\n bbox[0] = Math.min(bbox[0], bezierBox[2] + x1s);\n bbox[1] = Math.min(bbox[1], bezierBox[1] + y1s);\n bbox[1] = Math.min(bbox[1], bezierBox[3] + y1s);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + x2s);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + x2s);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + y2s);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + y2s);\n }\n else if(isNil(cb) || cb.length < 2) {\n let bezierBox = geom.bboxBezier(xa, ya, ca[0], ca[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] + x1s);\n bbox[0] = Math.min(bbox[0], bezierBox[2] + x1s);\n bbox[1] = Math.min(bbox[1], bezierBox[1] + y1s);\n bbox[1] = Math.min(bbox[1], bezierBox[3] + y1s);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + x2s);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + x2s);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + y2s);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + y2s);\n }\n else {\n let bezierBox = geom.bboxBezier(xa, ya, ca[0], ca[1], cb[0], cb[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] + x1s);\n bbox[0] = Math.min(bbox[0], bezierBox[2] + x1s);\n bbox[1] = Math.min(bbox[1], bezierBox[1] + y1s);\n bbox[1] = Math.min(bbox[1], bezierBox[3] + y1s);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + x2s);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + x2s);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + y2s);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + y2s);\n }\n });\n return bbox;\n }\n}\n\nexport default Line;\n","import Geom from './Geom';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n FILTER,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH, VMAX, VMIN } = unit;\n\nfunction concatPointAndControl(point, control) {\n if(Array.isArray(control) && (control.length === 2 || control.length === 4)\n && Array.isArray(point) && point.length === 2) {\n return control.concat(point);\n }\n return point;\n}\n\nfunction getLength(list, isMulti) {\n let res = [];\n let total = 0;\n let increase = [];\n if(isMulti) {\n total = [];\n list.forEach(list => {\n let temp = getLength(list);\n res.push(temp.list);\n total.push(temp.total);\n increase.push([0].concat(temp.increase));\n });\n }\n else if(Array.isArray(list)) {\n total = 0;\n increase.push(0);\n let start = 0;\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(Array.isArray(item)) {\n start = i;\n break;\n }\n }\n let prev = list[start];\n for(let i = start + 1, len = list.length; i < len; i++) {\n let item = list[i];\n if(!Array.isArray(item)) {\n continue;\n }\n if(item.length === 2) {\n let a = Math.abs(item[0] - prev[0]);\n let b = Math.abs(item[1] - prev[1]);\n let c = Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2));\n res.push(c);\n total += c;\n increase.push(total);\n prev = item;\n }\n else if(item.length === 4) {\n let c = geom.bezierLength([prev, [item[0], item[1]], [item[2], item[3]]], 2);\n res.push(c);\n total += c;\n increase.push(total);\n prev = [item[2], item[3]];\n }\n else if(item.length === 6) {\n let c = geom.bezierLength([prev, [item[0], item[1]], [item[2], item[3]], [item[4], item[5]]], 3);\n res.push(c);\n total += c;\n increase.push(total);\n prev = [item[4], item[5]];\n }\n }\n }\n return {\n list: res,\n total,\n increase,\n };\n}\n\nfunction getIndex(list, t, i, j) {\n if(i === j) {\n if(list[i] > t) {\n return i - 1;\n }\n return i;\n }\n let middle = i + ((j - i) >> 1);\n if(list[middle] === t) {\n return middle;\n }\n else if(list[middle] > t) {\n return getIndex(list, t, i, Math.max(middle - 1, i));\n }\n else {\n return getIndex(list, t, Math.min(middle + 1, j), j);\n }\n}\n\nfunction getNewList(list, len, start = 0, end = 1) {\n if(start === 0 && end === 1) {\n return list;\n }\n if(start === end) {\n return [];\n }\n if(start > end) {\n [start, end] = [end, start];\n }\n // start和end只能相差<=1,如果>1则校正\n while(end - start > 1) {\n end--;\n }\n // 将start和end统一至最接近0的正值\n while(end < 0 || start < 0) {\n end++;\n start++;\n }\n while(end >= 1 && start >= 1) {\n end--;\n start--;\n }\n // clone出原本顶点列表,防止干扰\n let length = list.length;\n list = util.clone(list);\n let res = [];\n let start2 = start > 1 ? (start - 1) : start;\n let end2 = end > 1 ? (end - 1) : end;\n let i = getIndex(len.increase, start2 * len.total, 0, length - 1);\n let j = getIndex(len.increase, end2 * len.total, 0, length - 1);\n // start<0或者end>1或者普通情况,一共3种,start和end不可能同时超限\n let isStartLt0 = start < 0;\n let isEndGt1 = end > 1;\n end2 *= len.total;\n let prePercent = 1;\n let endPoint;\n if(end2 > len.increase[j]) {\n let prev = list[j].slice(list[j].length - 2); // 最后2个点是x,y,前面是control\n let current = list[j + 1];\n let l = len.list[j];\n let diff = end2 - len.increase[j];\n let t = diff / l;\n prePercent = t;\n if(current.length === 2) {\n let a = current[0] - prev[0];\n let b = current[1] - prev[1];\n if(isEndGt1) {\n endPoint = [prev[0] + t * a, prev[1] + t * b];\n }\n else {\n t = 1 - t;\n endPoint = [current[0] - t * a, current[1] - t * b];\n }\n }\n else if(current.length === 4) {\n let r = geom.sliceBezier([prev, [current[0], current[1]], [current[2], current[3]]], t);\n endPoint = [r[1][0], r[1][1], r[2][0], r[2][1]];\n }\n else if(current.length === 6) {\n let r = geom.sliceBezier([prev, [current[0], current[1]], [current[2], current[3]], [current[4], current[5]]], t);\n endPoint = [r[1][0], r[1][1], r[2][0], r[2][1], r[3][0], r[3][1]];\n }\n }\n start2 *= len.total;\n if(start2 > len.increase[i]) {\n let current;\n let prev = list[i].slice(list[i].length - 2);\n let l = len.list[i];\n // 同一条线段时如果有end裁剪,会影响start长度,这里还要防止头尾绕了一圈的情况\n if(i === j && !isStartLt0 && !isEndGt1 && prePercent !== 1) {\n l *= prePercent;\n if(endPoint) {\n current = endPoint;\n }\n }\n if(!current) {\n current = list[i + 1];\n }\n let diff = start2 - len.increase[i];\n let t = diff / l;\n if(current.length === 2) {\n let a = current[0] - prev[0];\n let b = current[1] - prev[1];\n if(isStartLt0) {\n t = 1 - t;\n res.push([current[0] - t * a, current[1] - t * b]);\n }\n else {\n res.push([prev[0] + t * a, prev[1] + t * b]);\n }\n res.push(current);\n }\n else if(current.length === 4) {\n let r = geom.sliceBezier([[current[2], current[3]], [current[0], current[1]], prev], 1 - t).reverse();\n res.push(r[0]);\n res.push([r[1][0], r[1][1], r[2][0], r[2][1]]);\n // 同一条线段上去除end冲突\n if(i === j && !isStartLt0 && !isEndGt1) {\n endPoint = null;\n }\n }\n else if(current.length === 6) {\n let r = geom.sliceBezier([[current[4], current[5]], [current[2], current[3]], [current[0], current[1]], prev], 1 - t).reverse();\n res.push(r[0])\n res.push([r[1][0], r[1][1], r[2][0], r[2][1], current[4], current[5]]);\n if(i === j && !isStartLt0 && !isEndGt1) {\n endPoint = null;\n }\n }\n }\n // start和end之间的线段,注意头尾饶了一圈的情况,以及起始点被上方考虑过了\n for(let k = i + 2; k <= j + (!isStartLt0 && !isEndGt1 ? 0 : length); k++) {\n res.push(list[k % length]);\n }\n if(endPoint) {\n res.push(endPoint);\n }\n return res;\n}\n\nclass Polyline extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 所有点的列表\n if(this.isMulti) {\n this.__points = [[]];\n this.__controls = [[]];\n this.__start = [0];\n this.__end = [1];\n if(Array.isArray(props.start)) {\n this.__start = props.start.map(i => parseFloat(i) || 0);\n for(let i = this.__start.length; i < this.__points.length; i++) {\n this.__start.push(0);\n }\n }\n else if(!isNil(props.start)) {\n let v = parseFloat(props.start) || 0;\n this.__start = this.__points.map(() => v);\n }\n if(Array.isArray(props.end)) {\n this.__end = props.end.map(i => {\n let v = parseFloat(i);\n if(isNaN(v)) {\n v = 1;\n }\n return v;\n });\n for(let i = this.__end.length; i < this.__points.length; i++) {\n this.__end.push(1);\n }\n }\n else if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n this.__end = this.__points.map(() => v);\n }\n }\n else {\n this.__points = [];\n // 控制点\n this.__controls = [];\n this.__start = 0;\n this.__end = 1;\n if(!isNil(props.start)) {\n this.__start = parseFloat(props.start) || 0;\n }\n if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n this.__end = v;\n }\n }\n if(Array.isArray(props.controls)) {\n this.__controls = props.controls;\n }\n if(Array.isArray(props.points)) {\n this.__points = props.points;\n }\n }\n\n __getPoints(originX, originY, width, height, points, isControl) {\n return points.map((item, i) => {\n if(!Array.isArray(item)) {\n return;\n }\n let len = item.length;\n if(isControl) {\n if(len !== 0 && len !== 2 && len !== 4) {\n return;\n }\n }\n else {\n if(len !== 0 && len !== 2) {\n return;\n }\n }\n let res = [];\n for(let i = 0; i < len; i++) {\n if(i % 2 === 0) {\n res.push(originX + item[i] * width);\n }\n else {\n res.push(originY + item[i] * height);\n }\n }\n return res;\n });\n }\n\n // 供polygon覆盖,后处理booleanOperations\n __reprocessing(list) {\n return list;\n }\n\n // 同polygon覆盖,booleanOperations改变时需刷新缓冲顶点坐标\n __needRebuildSE() {}\n\n buildCache(originX, originY) {\n let { width, height, points, controls, start, end, __cacheProps, isMulti } = this;\n let rebuild, rebuildSE;\n if(isNil(__cacheProps.points)) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.points = points.map(item => {\n if(Array.isArray(item)) {\n return this.__getPoints(originX, originY, width, height, item);\n }\n });\n }\n else {\n __cacheProps.points = this.__getPoints(originX, originY, width, height, points);\n }\n }\n if(isNil(__cacheProps.controls)) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.controls = controls.map(item => {\n if(Array.isArray(item)) {\n return this.__getPoints(originX, originY, width, height, item, true);\n }\n return item;\n });\n }\n else {\n __cacheProps.controls = this.__getPoints(originX, originY, width, height, controls, true);\n }\n }\n if(isNil(__cacheProps.start)) {\n rebuildSE = true;\n __cacheProps.start = start;\n }\n if(isNil(__cacheProps.end)) {\n rebuildSE = true;\n __cacheProps.end = end;\n }\n // polygon会覆盖检查booleanOperations缓存\n if(this.__needRebuildSE(__cacheProps)) {\n rebuildSE = true;\n }\n // points/controls有变化就需要重建顶点\n if(rebuild) {\n let { points, controls } = __cacheProps;\n if(isMulti) {\n __cacheProps.list2 = points.map((item, i) => {\n let cl = controls[i];\n if(Array.isArray(item)) {\n return item.map((point, j) => {\n if(j) {\n return concatPointAndControl(point, cl && cl[j - 1]);\n }\n return point;\n });\n }\n });\n __cacheProps.len = getLength(__cacheProps.list2, isMulti);\n }\n else {\n __cacheProps.list2 = points.map((point, i) => {\n if(i) {\n return concatPointAndControl(point, controls[i - 1]);\n }\n return point;\n });\n __cacheProps.len = getLength(__cacheProps.list2, isMulti);\n }\n }\n if(rebuild || rebuildSE) {\n if(isMulti) {\n __cacheProps.list = __cacheProps.list2.map((item, i) => {\n if(Array.isArray(item)) {\n let len = __cacheProps.len;\n return getNewList(item, {\n list: len.list[i],\n total: len.total[i],\n increase: len.increase[i],\n }, __cacheProps.start[i], __cacheProps.end[i]);\n }\n });\n }\n else {\n __cacheProps.list = getNewList(__cacheProps.list2, __cacheProps.len, __cacheProps.start, __cacheProps.end);\n }\n // 后处理一次,让polygon支持布尔运算\n __cacheProps.list = this.__reprocessing(__cacheProps.list, isMulti);\n }\n return rebuild || rebuildSE;\n }\n\n render(renderMode, lv, ctx, cache, dx, dy) {\n let res = super.render(renderMode, lv, ctx, cache, dx, dy);\n if(res.break) {\n return res;\n }\n this.buildCache(res.sx3, res.sy3);\n ctx = res.ctx;\n this.__renderPolygon(renderMode, ctx, res);\n return res;\n }\n\n get points() {\n return this.getProps('points');\n }\n\n get controls() {\n return this.getProps('controls');\n }\n\n get start() {\n return this.getProps('start');\n }\n\n get end() {\n return this.getProps('end');\n }\n\n get bbox() {\n if(!this.__bbox) {\n let {\n isMulti, __cacheProps, root,\n __sx3: originX, __sy3: originY,\n currentStyle: {\n [STROKE_WIDTH]: strokeWidth,\n [BOX_SHADOW]: boxShadow,\n [FILTER]: filter,\n },\n } = this;\n this.buildCache(originX, originY);\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE], half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else {\n half = Math.max(item[0], half);\n }\n });\n let [x1, y1, x2, y2] = this.__spreadBbox(boxShadow, filter);\n x1 -= half;\n y1 -= half;\n x2 += half;\n y2 += half;\n let { points, controls } = __cacheProps;\n if(!isMulti) {\n points = [points];\n controls = [controls];\n }\n points.forEach((pointList, i) => {\n if(!pointList || pointList.length < 2 || !pointList[0] || !pointList[1]\n || pointList[0].length < 2 || pointList[1].length < 2) {\n return;\n }\n let controlList = controls[i] || [];\n let [xa, ya] = pointList[0];\n for(let i = 1, len = pointList.length; i < len; i++) {\n let [xb, yb] = pointList[i];\n let c = controlList[i - 1];\n if(c && c.length === 4) {\n let bezierBox = geom.bboxBezier(xa, ya, c[0], c[1], c[2], c[3], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] + x1);\n bbox[1] = Math.min(bbox[1], bezierBox[1] + y1);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + x2);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + y2);\n }\n else if(c && c.length === 2) {\n let bezierBox = geom.bboxBezier(xa, ya, c[0], c[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] + x1);\n bbox[1] = Math.min(bbox[1], bezierBox[1] + y1);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + x2);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + y2);\n }\n else {\n bbox[0] = Math.min(bbox[0], xa + x1);\n bbox[1] = Math.min(bbox[1], ya + y1);\n bbox[2] = Math.max(bbox[2], xa + x2);\n bbox[3] = Math.max(bbox[3], ya + y2);\n }\n xa = xb;\n ya = yb;\n }\n });\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Polyline;\n","import Polyline from './Polyline';\nimport util from '../../util/util';\nimport { union, diff, intersection, xor } from '../../math/martinez';\n\nclass Polygon extends Polyline {\n constructor(tagName, props) {\n super(tagName, props);\n if(props.booleanOperations) {\n this.__booleanOperations = props.booleanOperations;\n }\n }\n\n __getPoints(originX, originY, width, height, points, isControl) {\n let res = super.__getPoints(originX, originY, width, height, points, isControl);\n if(!isControl) {\n res.push(res[0]);\n }\n return res;\n }\n\n // 布尔运算覆盖,仅multi才发生,因为需要多个多边形数据\n __reprocessing(list, isMulti) {\n if(!isMulti) {\n return list;\n }\n let bo = this.booleanOperations, len = list.length;\n if(!Array.isArray(bo) && bo) {\n let old = bo;\n bo = [bo];\n for(let i = 1; i < len - 1; i++) {\n bo.push(old);\n }\n }\n if(Array.isArray(bo) && bo.length) {\n let res = [];\n let last;\n for(let i = 0; i < len - 1; i++) {\n let a = list[i], b = list[i + 1];\n switch(bo[i]) {\n case 'intersection':\n if(!a || !a.length || !b || !b.length) {\n res.push(null);\n }\n else {\n intersection([a], [b]).forEach(item => {\n res.push(item[0]);\n });\n }\n last = true;\n break;\n case 'union':\n if((!a || !a.length) && (!b || !b.length)) {\n res.push(null);\n }\n else if(!a || !a.length) {\n res.push(b);\n }\n else if(!b || !b.length) {\n res.push(a);\n }\n else {\n union([a], [b]).forEach(item => {\n res.push(item[0]);\n });\n }\n last = true;\n break;\n case 'diff':\n if(!a || !a.length) {\n res.push(null);\n }\n else if(!b || !b.length) {\n res.push(a);\n }\n else {\n diff([a], [b]).forEach(item => {\n res.push(item[0]);\n });\n }\n last = true;\n break;\n case 'xor':\n if((!a || !a.length) && (!b || !b.length)) {\n res.push(null);\n }\n else if(!a || !a.length) {\n res.push(b);\n }\n else if(!b || !b.length) {\n res.push(a);\n }\n else {\n xor([a], [b]).forEach(item => {\n res.push(item[0]);\n });\n }\n last = true;\n break;\n default:\n res.push(list[i]);\n last = false;\n break;\n }\n }\n // 最后一个没参与布尔运算,原封不动装载\n if(!last) {\n res.push(list[len - 1]);\n }\n return res;\n }\n return list;\n }\n\n // 覆盖,当booleanOperations动画改变时刷新顶点缓存\n __needRebuildSE(__cacheProps) {\n if(util.isNil(__cacheProps.booleanOperations)) {\n __cacheProps.booleanOperations = true;\n return true;\n }\n }\n\n get booleanOperations() {\n return this.getProps('booleanOperations');\n }\n}\n\nexport default Polygon;\n","import Geom from './Geom';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport inject from '../../util/inject';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n FILTER,\n} } = enums;\nconst { isNil } = util;\nconst { sectorPoints } = geom;\nconst { REM, VW, VH, VMAX, VMIN } = unit;\n\nfunction getR(v, dft) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = dft;\n }\n return v;\n}\n\nclass Sector extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 角度\n if(this.isMulti) {\n this.__begin = [0];\n this.__end = [0];\n this.__r = [1];\n if(Array.isArray(props.begin)) {\n this.__begin = props.begin.map(i => getR(i, 0));\n }\n if(Array.isArray(props.end)) {\n this.__end = props.end.map(i => getR(i, 0));\n }\n if(Array.isArray(props.r)) {\n this.__r = props.r.map(i => getR(i, 1));\n }\n if(Array.isArray(props.edge)) {\n this.__edge = props.edge.map(i => !!i);\n }\n if(Array.isArray(props.closure)) {\n this.__closure = props.closure.map(i => !!i);\n }\n }\n else {\n this.__begin = this.__end = 0;\n // 半径[0, ∞),默认1\n this.__r = 1;\n // 扇形两侧是否有边\n this.__edge = false;\n // 扇形大于180°时,是否闭合两端\n this.__closure = false;\n if(!isNil(props.begin)) {\n this.__begin = getR(props.begin, 0);\n }\n if(!isNil(props.end)) {\n this.__end = getR(props.end, 0);\n }\n if(!isNil(props.r)) {\n this.__r = getR(props.r, 1);\n }\n if(!isNil(props.edge)) {\n this.__edge = !!props.edge;\n }\n if(!isNil(props.closure)) {\n this.__closure = !!props.closure;\n }\n }\n }\n\n buildCache(cx, cy, focus) {\n let { width, begin, end, r, edge, closure, __cacheProps, isMulti } = this;\n let rebuild;\n if(isNil(__cacheProps.begin) || focus) {\n rebuild = true;\n __cacheProps.begin = (begin || 0) % 360;\n }\n if(isNil(__cacheProps.end) || focus) {\n rebuild = true;\n __cacheProps.end = (end || 0) % 360;\n }\n if(isNil(__cacheProps.r) || focus) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.r = r.map(r => r * width * 0.5);\n }\n else {\n __cacheProps.r = r * width * 0.5;\n }\n }\n r = __cacheProps.r;\n if(isNil(__cacheProps.edge) || focus) {\n rebuild = true;\n __cacheProps.edge = edge;\n }\n if(isNil(__cacheProps.closure) || focus) {\n rebuild = true;\n __cacheProps.closure = closure;\n }\n if(rebuild) {\n if(isMulti) {\n __cacheProps.list = [];\n __cacheProps.sList = [];\n begin.forEach((begin, i) => {\n let r2 = isNil(r[i]) ? width * 0.5 : r[i];\n let list = sectorPoints(cx, cy, r2, parseFloat(begin || 0) % 360, parseFloat(end[i] || 0) % 360);\n let sList = list.slice(0);\n if(closure[i]) {\n list.push(list[0].slice(0));\n if(edge) {\n sList.push(sList[0].slice(0));\n }\n }\n else {\n list.unshift([cx, cy]);\n list.push([cx, cy]);\n if(edge) {\n sList.unshift([cx, cy]);\n sList.push([cx, cy]);\n }\n }\n __cacheProps.list.push(list);\n __cacheProps.sList.push(sList);\n });\n }\n else {\n let list = sectorPoints(cx, cy, r, parseFloat(begin || 0), parseFloat(end || 0));\n let sList = list.slice(0);\n if(closure) {\n list.push(list[0].slice(0));\n if(edge) {\n sList.push(sList[0].slice(0));\n }\n }\n else {\n list.unshift([cx, cy]);\n list.push([cx, cy]);\n if(edge) {\n sList.unshift([cx, cy]);\n sList.push([cx, cy]);\n }\n }\n __cacheProps.list = list;\n __cacheProps.sList = sList;\n }\n }\n return rebuild;\n }\n\n render(renderMode, lv, ctx, cache, dx2, dy2) {\n let res = super.render(renderMode, lv, ctx, cache, dx2, dy2);\n if(res.break) {\n return res;\n }\n this.buildCache(res.cx, res.cy);\n ctx = res.ctx;\n let {\n fill: fills,\n fillRule: fillRules,\n stroke: strokes,\n strokeWidth: strokeWidths,\n strokeDasharray: strokeDasharrays,\n strokeDasharrayStr: strokeDasharrayStrs,\n strokeLinecap: strokeLinecaps,\n strokeLinejoin: strokeLinejoins,\n strokeMiterlimit: strokeMiterlimits,\n dx,\n dy,\n } = res;\n let { __cacheProps: { list, sList }, isMulti } = this;\n // 普通情况下只有1个,按普通情况走\n if(fills.length <= 1 && strokes.length <= 1) {\n let o = {\n fill: fills[0],\n fillRule: fillRules[0],\n stroke: strokes[0],\n strokeWidth: strokeWidths[0],\n strokeDasharray: strokeDasharrays[0],\n strokeDasharrayStr: strokeDasharrayStrs[0],\n strokeLinecap: strokeLinecaps[0],\n strokeLinejoin: strokeLinejoins[0],\n strokeMiterlimit: strokeMiterlimits[0],\n dx,\n dy,\n };\n this.__renderOneSector(renderMode, ctx, isMulti, list, sList, o);\n }\n // 多个需要fill在下面,stroke在上面,依次循环\n else {\n for(let i = 0, len = fills.length; i < len; i++) {\n let fill = fills[i];\n if(fill) {\n let o = {\n fill,\n fillRule: fillRules[i],\n dx,\n dy,\n };\n this.__renderOneSector(renderMode, ctx, isMulti, list, sList, o);\n }\n }\n for(let i = 0, len = strokes.length; i < len; i++) {\n let stroke = strokes[i];\n if(stroke) {\n let o = {\n stroke,\n strokeWidth: strokeWidths[i],\n strokeDasharray: strokeDasharrays[i],\n strokeDasharrayStr: strokeDasharrayStrs[i],\n strokeLinecap: strokeLinecaps[i],\n strokeLinejoin: strokeLinejoins[i],\n strokeMiterlimit: strokeMiterlimits[i],\n dx,\n dy,\n };\n this.__renderOnePolygon(renderMode, ctx, isMulti, list, sList, o);\n }\n }\n }\n return res;\n }\n\n __renderOneSector(renderMode, ctx, isMulti, list, sList, res) {\n let {\n fill,\n stroke,\n strokeWidth,\n } = res;\n let isFillCE = fill.k === 'conic';\n let isStrokeCE = stroke.k === 'conic';\n let isFillRE = fill.k === 'radial' && Array.isArray(fill.v);\n let isStrokeRE = strokeWidth > 0 && stroke.k === 'radial' && Array.isArray(stroke.v);\n if(isFillCE || isStrokeCE) {\n if(isFillCE) {\n this.__conicGradient(renderMode, ctx, list, isMulti, res);\n }\n else if(fill && fill !== 'none') {\n this.__drawPolygon(renderMode, ctx, isMulti, list, res, true);\n }\n if(strokeWidth > 0 && isStrokeCE) {\n inject.warn('Stroke style can not use conic-gradient');\n }\n else if(strokeWidth > 0 && stroke && stroke !== 'none') {\n this.__drawPolygon(renderMode, ctx, isMulti, sList, res, false, true);\n }\n }\n else if(isFillRE || isStrokeRE) {\n if(isFillRE) {\n this.__radialEllipse(renderMode, ctx, list, isMulti, res, 'fill');\n }\n else if(fill && fill !== 'none') {\n this.__drawPolygon(renderMode, ctx, isMulti, list, res, true);\n }\n // stroke椭圆渐变matrix会变形,降级为圆\n if(strokeWidth > 0 && isStrokeRE) {\n inject.warn('Stroke style can not use radial-gradient for ellipse');\n res.stroke = res.stroke.v[0];\n this.__drawPolygon(renderMode, ctx, isMulti, sList, res, false, true);\n }\n else if(strokeWidth > 0 && stroke && stroke !== 'none') {\n this.__drawPolygon(renderMode, ctx, isMulti, sList, res, false, true);\n }\n }\n else {\n if(fill && fill !== 'none') {\n this.__drawPolygon(renderMode, ctx, isMulti, list, res, true, false);\n }\n if(strokeWidth > 0 && stroke && stroke !== 'none') {\n this.__drawPolygon(renderMode, ctx, isMulti, sList, res, false, true);\n }\n }\n }\n\n __genSector(edge, d, fill, stroke, strokeWidth, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit) {\n if(edge) {\n let props = [\n ['d', d[0]],\n ['fill', fill.v || fill],\n ['stroke', stroke.v || stroke],\n ['stroke-width', strokeWidth],\n ];\n this.__propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit);\n this.addGeom('path', props);\n }\n else {\n this.addGeom('path', [\n ['d', d[0]],\n ['fill', fill.v || fill],\n ]);\n if(strokeWidth > 0) {\n let props = [\n ['d', d[1]],\n ['fill', 'none'],\n ['stroke', stroke.v || stroke],\n ['stroke-width', strokeWidth],\n ];\n this.__propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit);\n this.addGeom('path', props);\n }\n }\n }\n\n get begin() {\n return this.getProps('begin');\n }\n\n get end() {\n return this.getProps('end');\n }\n\n get r() {\n return this.getProps('r');\n }\n\n get edge() {\n return this.getProps('edge');\n }\n\n // >180°时是否链接端点\n get closure() {\n return this.getProps('closure');\n }\n\n get bbox() {\n if(!this.__bbox) {\n let {\n isMulti, __cacheProps, root,\n __sx3: originX, __sy3: originY, width, height,\n currentStyle: {\n [STROKE_WIDTH]: strokeWidth,\n [BOX_SHADOW]: boxShadow,\n [FILTER]: filter,\n }\n } = this;\n let cx = originX + width * 0.5;\n let cy = originY + height * 0.5;\n this.buildCache(cx, cy);\n let r = 0;\n if(isMulti) {\n let max = 0;\n __cacheProps.r.forEach(r => {\n max = Math.max(r, max);\n });\n r = max;\n }\n else {\n r = __cacheProps.r;\n }\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE], half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else {\n half = Math.max(item[0], half);\n }\n });\n let [x1, y1, x2, y2] = this.__spreadBbox(boxShadow, filter);\n x1 -= half;\n y1 -= half;\n x2 += half;\n y2 += half;\n let xa = cx - r + x1;\n let xb = cx + r + x2;\n let ya = cy - r + y1;\n let yb = cy + r + y2;\n bbox[0] = Math.min(bbox[0], xa);\n bbox[1] = Math.min(bbox[1], ya);\n bbox[2] = Math.max(bbox[2], xb);\n bbox[3] = Math.max(bbox[3], yb);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Sector;\n","import Geom from './Geom';\nimport util from \"../../util/util\";\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n FILTER,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH, VMAX, VMIN } = unit;\n\nfunction genVertex(x, y, width, height, rx = 0, ry = 0) {\n if(rx === 0 || ry === 0) {\n return [\n [x, y],\n [x + width, y],\n [x + width, y + height],\n [x, y + height],\n [x, y],\n ];\n }\n let ox = rx * geom.H;\n let oy = ry * geom.H;\n return [\n [x + rx, y],\n [x + width - rx, y],\n [x + width + ox - rx, y, x + width, y + ry - oy, x + width, y + ry],\n [x + width, y + height - ry],\n [x + width, y + height + oy - ry, x + width + ox - rx, y + height, x + width - rx, y + height],\n [x + rx, y + height],\n [x + rx - ox, y + height, x, y + height + oy - ry, x, y + height - ry],\n [x, y + ry],\n [x, y + ry - oy, x + rx - ox, y, x + rx, y]\n ];\n}\n\n\nfunction getR(v) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = 0;\n }\n return v;\n}\n\nclass Rect extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 圆角\n if(this.isMulti) {\n this.__rx = [0];\n this.__ry = [0];\n if(Array.isArray(props.rx)) {\n this.__rx = props.rx.map(i => getR(i));\n }\n if(Array.isArray(props.ry)) {\n this.__ry = props.ry.map(i => getR(i));\n }\n }\n else {\n this.__rx = this.__ry = 0;\n if(!isNil(props.rx)) {\n this.__rx = getR(props.rx);\n }\n if(!isNil(props.ry)) {\n this.__ry = getR(props.ry);\n }\n }\n }\n\n buildCache(originX, originY, focus) {\n let { width, height, rx, ry, __cacheProps, isMulti } = this;\n let rebuild;\n if(isNil(__cacheProps.rx) || focus) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.rx = rx.map(rx => Math.min(rx, 0.5) * width);\n }\n else {\n __cacheProps.rx = Math.min(rx, 0.5) * width;\n }\n }\n if(isNil(__cacheProps.ry) || focus) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.ry = rx.map(ry => Math.min(ry, 0.5) * height);\n }\n else {\n __cacheProps.ry = Math.min(ry, 0.5) * height;\n }\n }\n if(rebuild) {\n let { rx, ry } = __cacheProps;\n if(isMulti) {\n __cacheProps.list = rx.map((rx, i) => genVertex(originX, originY, width, height, rx, ry[i]));\n }\n else {\n __cacheProps.list = genVertex(originX, originY, width, height, rx, ry);\n }\n }\n return rebuild;\n }\n\n render(renderMode, lv, ctx, cache, dx, dy) {\n let res = super.render(renderMode, lv, ctx, cache, dx, dy);\n if(res.break) {\n return res;\n }\n this.buildCache(res.sx3, res.sy3);\n ctx = res.ctx;\n this.__renderPolygon(renderMode, ctx, res);\n return res;\n }\n\n get rx() {\n return this.getProps('rx');\n }\n\n get ry() {\n return this.getProps('ry');\n }\n\n get bbox() {\n if(!this.__bbox) {\n let {\n root,\n __sx3: originX, __sy3: originY, width, height,\n currentStyle: {\n [STROKE_WIDTH]: strokeWidth,\n [BOX_SHADOW]: boxShadow,\n [FILTER]: filter,\n }\n } = this;\n this.buildCache(originX, originY);\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE], half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else {\n half = Math.max(item[0], half);\n }\n });\n let [x1, y1, x2, y2] = this.__spreadBbox(boxShadow, filter);\n x1 -= half;\n y1 -= half;\n x2 += half;\n y2 += half;\n bbox[0] = Math.min(bbox[0], originX + x1);\n bbox[1] = Math.min(bbox[1], originY + y1);\n bbox[2] = Math.max(bbox[2], originX + width + x2);\n bbox[3] = Math.max(bbox[3], originY + height + y2);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Rect;\n","import Geom from './Geom';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n FILTER,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH, VMAX, VMIN } = unit;\n\nfunction getR(v) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = 1;\n }\n return v;\n}\n\nclass Circle extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 半径[0, ∞),默认1\n if(this.isMulti) {\n this.__r = [1];\n if(Array.isArray(props.r)) {\n this.__r = props.r.map(i => getR(i));\n }\n else if(!isNil(props.r)) {\n this.__r = getR(props.r);\n }\n }\n else {\n this.__r = 1;\n if(!isNil(props.r)) {\n this.__r = getR(props.r);\n }\n }\n }\n\n buildCache(cx, cy, focus) {\n let { width, r, __cacheProps, isMulti } = this;\n if(isNil(__cacheProps.r) || focus) {\n if(isMulti) {\n __cacheProps.r = r.map(i => i * width * 0.5);\n __cacheProps.list = __cacheProps.r.map(r => geom.ellipsePoints(cx, cy, r, r));\n }\n else {\n __cacheProps.r = r * width * 0.5;\n __cacheProps.list = geom.ellipsePoints(cx, cy, __cacheProps.r, __cacheProps.r);\n }\n }\n }\n\n render(renderMode, lv, ctx, cache, dx, dy) {\n let res = super.render(renderMode, lv, ctx, cache, dx, dy);\n if(res.break) {\n return res;\n }\n this.buildCache(res.cx, res.cy);\n ctx = res.ctx;\n this.__renderPolygon(renderMode, ctx, res);\n return res;\n }\n\n get r() {\n return this.getProps('r');\n }\n\n get bbox() {\n if(!this.__bbox) {\n let {\n isMulti, __cacheProps, root,\n __sx3: originX, __sy3: originY, width, height,\n currentStyle: {\n [STROKE_WIDTH]: strokeWidth,\n [BOX_SHADOW]: boxShadow,\n [FILTER]: filter,\n }\n } = this;\n let cx = originX + width * 0.5;\n let cy = originY + height * 0.5;\n this.buildCache(cx, cy);\n let r = 0;\n if(isMulti) {\n let max = 0;\n __cacheProps.r.forEach(r => {\n max = Math.max(r, max);\n });\n r = max;\n }\n else {\n r = __cacheProps.r;\n }\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE], half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else {\n half = Math.max(item[0], half);\n }\n });\n let [x1, y1, x2, y2] = this.__spreadBbox(boxShadow, filter);\n x1 -= half;\n y1 -= half;\n x2 += half;\n y2 += half;\n let xa = cx - r + x1;\n let xb = cx + r + x2;\n let ya = cy - r + y1;\n let yb = cy + r + y2;\n bbox[0] = Math.min(bbox[0], xa);\n bbox[1] = Math.min(bbox[1], ya);\n bbox[2] = Math.max(bbox[2], xb);\n bbox[3] = Math.max(bbox[3], yb);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Circle;\n","import Geom from './Geom';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n FILTER,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH, VMAX, VMIN } = unit;\n\nfunction getR(v) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = 1;\n }\n return v;\n}\n\nclass Ellipse extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 半径[0, ∞),默认1\n if(this.isMulti) {\n this.__rx = [1];\n this.__ry = [1];\n if(Array.isArray(props.rx)) {\n this.__rx = props.rx.map(i => getR(i));\n }\n else if(!isNil(props.rx)) {\n this.__rx = [getR(props.rx)];\n }\n if(Array.isArray(props.ry)) {\n this.__ry = props.ry.map(i => getR(i));\n }\n else if(!isNil(props.ry)) {\n this.__ry = [getR(props.ry)];\n }\n }\n else {\n this.__rx = 1;\n if(!isNil(props.rx)) {\n this.__rx = getR(props.rx);\n }\n this.__ry = 1;\n if(!isNil(props.ry)) {\n this.__ry = getR(props.ry);\n }\n }\n }\n\n buildCache(cx, cy, focus) {\n let { width, height, rx, ry, __cacheProps, isMulti } = this;\n let rebuild;\n if(isNil(__cacheProps.rx) || focus) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.rx = rx.map(i => i * width * 0.5);\n }\n else {\n __cacheProps.rx = rx * width * 0.5;\n }\n }\n if(isNil(__cacheProps.ry) || focus) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.ry = ry.map(i => i * height * 0.5);\n }\n else {\n __cacheProps.ry = ry * height * 0.5;\n }\n }\n if(rebuild) {\n let { rx, ry } = __cacheProps;\n if(isMulti) {\n __cacheProps.list = rx.map((rx, i) => geom.ellipsePoints(cx, cy, rx, ry[i]));\n }\n else {\n __cacheProps.list = geom.ellipsePoints(cx, cy, rx, ry);\n }\n }\n return rebuild;\n }\n\n render(renderMode, lv, ctx, cache, dx, dy) {\n let res = super.render(renderMode, lv, ctx, cache, dx, dy);\n if(res.break) {\n return res;\n }\n this.buildCache(res.cx, res.cy);\n ctx = res.ctx;\n this.__renderPolygon(renderMode, ctx, res);\n return res;\n }\n\n get rx() {\n return this.getProps('rx');\n }\n\n get ry() {\n return this.getProps('ry');\n }\n\n get bbox() {\n if(!this.__bbox) {\n let {\n isMulti, __cacheProps, root,\n __sx3: originX, __sy3: originY, width, height,\n currentStyle: {\n [STROKE_WIDTH]: strokeWidth,\n [BOX_SHADOW]: boxShadow,\n [FILTER]: filter,\n }\n } = this;\n let cx = originX + width * 0.5;\n let cy = originY + height * 0.5;\n this.buildCache(cx, cy);\n let rx = 0, ry = 0;\n if(isMulti) {\n let mx = 0, my = 0;\n __cacheProps.rx.forEach((rx, i) => {\n mx = Math.max(rx, mx);\n my = Math.max(ry, __cacheProps.ry[i]);\n });\n rx = mx;\n ry = my;\n }\n else {\n rx = __cacheProps.rx;\n ry = __cacheProps.ry;\n }\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE], half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else {\n half = Math.max(item[0], half);\n }\n });\n let [x1, y1, x2, y2] = this.__spreadBbox(boxShadow, filter);\n x1 -= half;\n y1 -= half;\n x2 += half;\n y2 += half;\n let xa = cx - rx + x1;\n let xb = cx + rx + x2;\n let ya = cy - ry + y1;\n let yb = cy + ry + y2;\n bbox[0] = Math.min(bbox[0], xa);\n bbox[1] = Math.min(bbox[1], ya);\n bbox[2] = Math.max(bbox[2], xb);\n bbox[3] = Math.max(bbox[3], yb);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Ellipse;\n","import reset from '../style/reset';\n\nlet fullCssProperty = {\n skewX: 'kx',\n skewY: 'ky',\n transform: 'tf',\n fontSize: 'fz',\n offset: 'os',\n easing: 'e',\n filter: 'ft',\n boxShadow: 'bd',\n overflow: 'of',\n backgroundClip: 'bp',\n textOverflow: 'tof',\n flexWrap: 'fp',\n perspective: 'ppt',\n rotate3d: 'r3',\n};\n\nlet abbrCssProperty = {\n os: 'offset', // 非css属性不会被下面反向遍历插入,手动\n e: 'easing',\n};\n\nlet fullAnimate = {\n value: 'v',\n options: 'o',\n};\n\nlet abbrAnimate = {};\n\nlet fullAnimateOption = {\n duration: 'dt',\n delay: 'd',\n endDelay: 'ed',\n iterations: 'i',\n direction: 'dc',\n fill: 'f',\n fps: 'fp',\n playbackRate: 'p',\n spfLimit: 'sl',\n};\n\nlet abbrAnimateOption = {};\n\nreset.DOM_KEY_SET.concat(reset.GEOM_KEY_SET).forEach(k => {\n if(fullCssProperty.hasOwnProperty(k)) {\n abbrCssProperty[fullCssProperty[k]] = k;\n return;\n }\n let v = k.charAt(0) + k.replace(/[a-z]/g, '').toLowerCase();\n fullCssProperty[k] = v;\n abbrCssProperty[v] = k;\n});\n\nObject.keys(fullAnimate).forEach(k => {\n abbrAnimate[fullAnimate[k]] = k;\n});\n\nObject.keys(fullAnimateOption).forEach(k => {\n abbrAnimateOption[fullAnimateOption[k]] = k;\n});\n\nexport default {\n fullCssProperty,\n abbrCssProperty,\n fullAnimate,\n abbrAnimate,\n fullAnimateOption,\n abbrAnimateOption,\n};\n","import abbr from './abbr';\nimport Node from '../node/Node';\nimport Component from '../node/Component';\nimport $$type from '../util/$$type';\nimport util from '../util/util';\nimport inject from '../util/inject';\n\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet { isNil, isFunction, isPrimitive, clone, extend } = util;\nlet { abbrCssProperty, abbrAnimateOption, abbrAnimate } = abbr;\n\n/**\n * 还原缩写到全称,涉及样式和动画属性\n * @param target 还原的对象\n * @param hash 缩写映射\n */\nfunction abbr2full(target, hash) {\n // 也许节点没写样式\n if(target) {\n Object.keys(target).forEach(k => {\n // var-attr格式特殊考虑,仅映射attr部分,var-还要保留\n if(k.indexOf('var-') === 0) {\n let k2 = k.slice(4);\n if(hash.hasOwnProperty(k2)) {\n let fk = hash[k2];\n target['var-' + fk] = target[k];\n // delete target[k];\n }\n }\n // 普通样式缩写还原\n else if(hash.hasOwnProperty(k)) {\n let fk = hash[k];\n target[fk] = target[k];\n // 删除以免二次解析\n delete target[k];\n }\n });\n }\n}\n\nfunction replaceVars(json, vars) {\n if(json && vars) {\n // 新版vars语法\n if(json.hasOwnProperty('vars')) {\n let slot = json.vars;\n if(!Array.isArray(slot)) {\n slot = [slot];\n }\n if(Array.isArray(slot)) {\n slot.forEach(item => {\n let { id, member } = item;\n if(!Array.isArray(member)) {\n member = [member];\n }\n // 排除特殊的library\n if(Array.isArray(member) && member.length && member[0] !== 'library' && vars.hasOwnProperty(id)) {\n let target = json;\n for(let i = 0, len = member.length; i < len; i++) {\n let k = member[i];\n // 最后一个属性可以为空\n if(target.hasOwnProperty(k) || i === len - 1) {\n // 最后一个member表达式替换\n if(i === len - 1) {\n let v = vars[id];\n // undefined和null意义不同\n if(v === undefined) {\n return;\n }\n // 支持函数模式和值模式\n if(isFunction(v)) {\n v = v(target(k));\n }\n target[k] = v;\n }\n else {\n target = target[k];\n }\n }\n else {\n inject.error('Slot miss ' + k);\n return;\n }\n }\n }\n });\n }\n }\n else {\n Object.keys(json).forEach(k => {\n if(k.indexOf('var-') === 0) {\n let v = json[k];\n if(!v) {\n return;\n }\n let k2 = k.slice(4);\n // 有id且变量里面传入了替换的值,值可为null,因为某些情况下空为自动\n if(k2 && v.id && vars.hasOwnProperty(v.id)) {\n let value = vars[v.id];\n // undefined和null意义不同\n if(value === undefined) {\n return;\n }\n let target = json;\n // 如果有.则特殊处理子属性\n if(k2.indexOf('.') > -1) {\n let list = k2.split('.');\n let len = list.length;\n for(let i = 0; i < len - 1; i++) {\n k2 = list[i];\n // 避免异常\n if(target[k2]) {\n target = target[k2];\n }\n else {\n inject.warn('parseJson vars is not exist: ' + v.id + ', ' + k + ', ' + list.slice(0, i).join('.'));\n return;\n }\n }\n k2 = list[len - 1];\n }\n // 支持函数模式和值模式\n if(isFunction(value)) {\n value = value(v);\n }\n target[k2] = value;\n }\n }\n });\n }\n }\n}\n\nfunction replaceAnimateOptions(options, opt) {\n ['iterations', 'fill', 'duration', 'direction', 'easing', 'fps', 'delay', 'endDelay', 'playbackRate', 'spfLimit'].forEach(k => {\n if(opt.hasOwnProperty(k)) {\n options[k] = opt[k];\n }\n });\n}\n\nfunction replaceLibraryVars(json, hash, vars) {\n if(vars) {\n // 新版同级vars语法\n if(json.hasOwnProperty('vars')) {\n let slot = json.vars;\n if(!Array.isArray(slot)) {\n slot = [slot];\n }\n if(Array.isArray(slot)) {\n slot.forEach(item => {\n let { id, member } = item;\n if(!Array.isArray(member)) {\n member = [member];\n }\n // library.xxx,需要>=2的长度\n if(Array.isArray(member) && member.length > 1 && vars.hasOwnProperty(id)) {\n if(member[0] === 'library') {\n let target = hash;\n for(let i = 1, len = member.length; i < len; i++) {\n let k = member[i];\n // 最后一个属性可以为空\n if(target.hasOwnProperty(k) || i === len - 1) {\n // 最后一个member表达式替换\n if(i === len - 1) {\n let v = vars[id];\n // 支持函数模式和值模式\n if(isFunction(v)) {\n v = v(target(k));\n }\n let old = target[k];\n // 直接替换library的子对象,需补充id和tagName\n if(i === 1) {\n target[k] = Object.assign({ id: old.id, tagName: old.tagName }, v);\n }\n // 替换library中子对象的一个属性直接赋值\n else {\n target[k] = v;\n }\n }\n else {\n target = target[k];\n }\n }\n else {\n inject.error('Library slot miss ' + k);\n return;\n }\n }\n }\n }\n });\n }\n }\n // 兼容老版var-\n else {\n Object.keys(json).forEach(k => {\n if(k.indexOf('var-library.') === 0) {\n let v = json[k];\n // 直接移除library插槽,防止下面调用replaceVars(json, vars)时报错\n delete json[k];\n if(!v) {\n return;\n }\n let k2 = k.slice(12);\n // 有id且变量里面传入了替换的值\n if(k2 && v.id && vars.hasOwnProperty(v.id)) {\n let value = vars[v.id];\n if(isFunction(value)) {\n value = value(v);\n }\n // 替换图层的值必须是一个有tagName的对象\n if(!value || !value.tagName) {\n return;\n }\n // library对象也要加上id,与正常的library保持一致\n hash[k2] = Object.assign({ id: k2 }, value);\n }\n }\n });\n }\n }\n}\n\n/**\n * 遍历一遍library的一级,将一级的id存到hash上,无需递归二级,\n * 因为顺序前提要求排好且无循环依赖,所以被用到的一定在前面出现,\n * 一般是无children的元件在前,包含children的div在后\n * 即便library中的元素有children或library,在linkChild时将其link过去,parse递归会继续处理\n * @param item:library的一级孩子\n * @param hash:存放library的key/value引用\n */\nfunction linkLibrary(item, hash) {\n let id = item.id;\n // library中一定有id,因为是一级,二级+特殊需求才会出现放开\n if(isNil(id)) {\n throw new Error('Library item miss id: ' + JSON.stringify(item));\n }\n else {\n hash[id] = item;\n }\n}\n\n/**\n * 链接child到library文件,\n * props需要是clone的,因为防止多个child使用同一个库文件\n * children则直接引用,无需担心多个使用同一个\n * library也需要带上,在library直接子元素还包含library时会用到\n * @param child\n * @param libraryItem\n */\nfunction linkChild(child, libraryItem) {\n // 规定图层child只有init和动画,属性和子图层来自库\n child.tagName = libraryItem.tagName;\n child.props = clone(libraryItem.props);\n child.children = libraryItem.children;\n child.library = libraryItem.library;\n // library的var-也要继承过来,本身的var-优先级更高,目前只有children会出现优先级情况\n Object.keys(libraryItem).forEach(k => {\n if(k.indexOf('var-') === 0 && !child.hasOwnProperty(k)) {\n child[k] = libraryItem[k];\n }\n });\n // 删除以免二次解析\n child.libraryId = null;\n // 规定图层实例化的属性和样式在init上,优先使用init,然后才取原型链的props\n let { init } = child;\n if(init) {\n let props = child.props = child.props || {};\n let style = props.style;\n extend(props, init);\n // style特殊处理,防止被上面覆盖丢失原始值\n if(style) {\n extend(style, init.style);\n props.style = style;\n }\n // 删除以免二次解析\n child.init = null;\n }\n}\n\nfunction parse(karas, json, animateRecords, opt, hash = {}) {\n if(isPrimitive(json) || json instanceof Node || json instanceof Component) {\n return json;\n }\n if(Array.isArray(json)) {\n return json.map(item => {\n return parse(karas, item, animateRecords, opt, hash);\n });\n }\n // 先判断是否是个链接到库的节点,是则进行链接操作\n let libraryId = json.libraryId;\n if(!isNil(libraryId)) {\n let libraryItem = hash[libraryId];\n // 规定图层child只有init和动画,tagName和属性和子图层来自库\n if(libraryItem) {\n linkChild(json, libraryItem);\n }\n else {\n throw new Error('Link library miss id: ' + libraryId);\n }\n json.libraryId = null;\n }\n // 再判断是否有library形成一个新的作用域,会出现library下的library使得一个链接节点链接后出现library的情况\n let library = json.library;\n if(Array.isArray(library)) {\n hash = {};\n library.forEach(item => {\n linkLibrary(item, hash);\n });\n // 替换library插槽\n replaceLibraryVars(json, hash, opt.vars);\n json.library = null;\n }\n let { tagName, props = {}, children = [], animate = [] } = json;\n if(!tagName) {\n throw new Error('Dom must have a tagName: ' + JSON.stringify(json));\n }\n let style = props.style;\n (opt.abbr !== false) && abbr2full(style, abbrCssProperty);\n // 先替换style的\n replaceVars(style, opt.vars);\n // 再替换静态属性,style也作为属性的一种,目前尚未被设计为被替换\n replaceVars(props, opt.vars);\n // 替换children里的内容,如文字,无法直接替换tagName/props/children/animate本身,因为下方用的还是原引用\n replaceVars(json, opt.vars);\n if(!Array.isArray(children)) {\n throw new Error('children must be an array');\n }\n let vd;\n if(tagName.charAt(0) === '$') {\n vd = karas.createGm(tagName, props);\n }\n else if(/^[A-Z]/.test(tagName)) {\n let cp = Component.getRegister(tagName);\n vd = karas.createCp(cp, props, children.map(item => {\n if(item && [TYPE_VD, TYPE_GM, TYPE_CP].indexOf(item.$$type) > -1) {\n return item;\n }\n return parse(karas, item, animateRecords, opt, hash);\n }));\n }\n else {\n vd = karas.createVd(tagName, props, children.map(item => {\n if(item && [TYPE_VD, TYPE_GM, TYPE_CP].indexOf(item.$$type) > -1) {\n return item;\n }\n return parse(karas, item, animateRecords, opt, hash);\n }));\n }\n if(animate) {\n if(!Array.isArray(animate)) {\n animate = [animate];\n }\n let has;\n animate.forEach(item => {\n (opt.abbr !== false) && abbr2full(item, abbrAnimate);\n let { value, options } = item;\n // 忽略空动画\n if(Array.isArray(value) && value.length) {\n has = true;\n value.forEach(item => {\n (opt.abbr !== false) && abbr2full(item, abbrCssProperty);\n replaceVars(item, opt.vars);\n });\n }\n if(options) {\n (opt.abbr !== false) && abbr2full(options, abbrAnimateOption);\n replaceVars(options, opt.vars);\n replaceAnimateOptions(options, opt);\n }\n });\n // 产生实际动画运行才存入列表供root调用执行\n if(has) {\n animateRecords.push({\n animate,\n target: vd,\n });\n }\n }\n return vd;\n}\n\nexport default parse;\n","import parse from './parse';\nimport abbr from './abbr';\nimport inject from '../util/inject';\nimport util from '../util/util';\nimport font from '../style/font';\nimport Controller from '../animate/Controller';\n\nlet o = {\n parse(karas, json, dom, options = {}) {\n if(!json) {\n return;\n }\n // 特殊单例声明无需clone加速解析\n if(!options.singleton && !json.singleton) {\n json = util.clone(json);\n }\n // 根节点的fonts字段定义字体信息\n let fonts = json.fonts;\n if(fonts) {\n if(!Array.isArray(fonts)) {\n fonts = [fonts];\n }\n fonts.forEach(item => {\n let { fontFamily, data } = item;\n if(fontFamily && data) {\n font.register(fontFamily, data);\n }\n });\n }\n // json中定义无abbr\n if(json.abbr === false) {\n options.abbr = false;\n }\n if(options.abbr !== false) {\n inject.warn('Abbr in json is deprecated');\n }\n // 重载,在确定dom传入选择器字符串或html节点对象时作为渲染功能,否则仅创建vd返回\n if(!inject.isDom(dom)) {\n options = dom || {};\n dom = null;\n }\n // 暂存所有动画声明,等root的生成后开始执行\n let animateRecords = [];\n let vd = parse(karas, json, animateRecords, options);\n // 有dom时parse作为根方法渲染\n if(dom) {\n let { tagName } = json;\n if(['canvas', 'svg', 'webgl'].indexOf(tagName) === -1) {\n throw new Error('Parse dom must be canvas/svg/webgl');\n }\n // parse直接(非递归)的动画记录\n let ac = options.controller instanceof Controller ? options.controller : vd.animateController;\n // 第一次render,收集递归json里面的animateRecords,它在xom的__layout最后生成\n karas.render(vd, dom);\n // 由于vd首先生成的都是json,根parse要特殊处理将target指向真正的vd引用,json的vd在builder中赋值\n animateRecords.forEach(item => {\n item.target = item.target.vd;\n });\n // 直接的json里的animateRecords,再加上递归的parse的json的(第一次render布局时处理)动画一并播放\n if(options.autoPlay !== false) {\n ac.__records = ac.__records.concat(animateRecords);\n ac.__playAuto();\n }\n // 不自动播放进入记录列表,初始化并等待手动调用\n else {\n ac.__records2 = ac.__records2.concat(animateRecords);\n ac.init(ac.__records2, ac.list2);\n }\n }\n // 递归的parse,如果有动画,此时还没root,先暂存下来,等上面的root的render第一次布局时收集\n else {\n if(animateRecords.length) {\n vd.__animateRecords = {\n options,\n list: animateRecords,\n controller: options.controller instanceof Controller ? options.controller : null,\n };\n }\n }\n return vd;\n },\n loadAndParse(karas, json, dom, options) {\n let { fonts, components, imgs } = json;\n let list1 = [];\n let list2 = [];\n let list3 = [];\n if(fonts) {\n if(!Array.isArray(fonts)) {\n fonts = [fonts];\n }\n fonts.forEach(item => {\n let url = item.url;\n if(url) {\n list1.push(item);\n }\n });\n }\n if(components) {\n if(!Array.isArray(components)) {\n components = [components];\n }\n components.forEach(item => {\n let { tagName, url, reload } = item;\n // 如果没申明reload且已经被注册,则无需重复加载\n if(tagName && karas.Component.hasRegister(tagName) && !reload) {\n return;\n }\n // 即便没有tagName也要加载,可能组件内部执行了注册逻辑\n if(url) {\n list2.push(item);\n }\n });\n }\n if(imgs) {\n if(!Array.isArray(imgs)) {\n imgs = [imgs];\n }\n imgs.forEach(item => {\n let url = item.url;\n if(url) {\n list3.push(url);\n }\n });\n }\n let a = list1.length, b = list2.length, c = list3.length;\n let count = 0;\n let cb = function() {\n if(count === a + b + c) {\n let res = o.parse(karas, json, dom, options);\n if(options && util.isFunction(options.callback)) {\n options.callback(res);\n }\n }\n };\n if(a || b || c) {\n karas.inject.loadFont(list1, function() {\n count += a;\n cb();\n });\n karas.inject.loadComponent(list2.map(item => item.url), function() {\n count += b;\n // 默认约定加载的js组件会在全局变量申明同名tagName,已有不覆盖,防止组件代码内部本身有register\n list2.forEach(item => {\n let tagName = item.tagName;\n if(tagName && window[tagName] && !karas.Component.hasRegister(tagName)) {\n karas.Component.register(tagName, window[tagName]);\n }\n });\n cb();\n });\n karas.inject.measureImg(list3, function() {\n count += c;\n cb();\n });\n }\n else {\n cb();\n }\n },\n abbr,\n};\n\nexport default o;\n","import css from './css';\nimport reset from './reset';\nimport unit from './unit';\nimport font from './font';\nimport abbr from './abbr';\nimport transform from './transform';\n\nexport default {\n css,\n reset,\n unit,\n font,\n abbr,\n transform,\n};\n","import Animation from './Animation';\nimport Controller from './Controller';\nimport easing from './easing';\nimport frame from './frame';\n\nexport default {\n Animation,\n Controller,\n easing,\n frame,\n};\n","import level from './level';\nimport change from './change';\nimport Page from './Page';\nimport Cache from './Cache';\n\nexport default {\n level,\n change,\n Page,\n Cache,\n};\n","import Node from './node/Node';\nimport Text from './node/Text';\nimport Xom from './node/Xom';\nimport Dom from './node/Dom';\nimport Img from './node/Img';\nimport Root from './node/Root';\nimport tag from './node/tag';\nimport mode from './refresh/mode';\nimport Geom from './node/geom/Geom';\nimport Line from './node/geom/Line';\nimport Polyline from './node/geom/Polyline';\nimport Polygon from './node/geom/Polygon';\nimport Sector from './node/geom/Sector';\nimport Rect from './node/geom/Rect';\nimport Circle from './node/geom/Circle';\nimport Ellipse from './node/geom/Ellipse';\nimport Component from './node/Component';\nimport Event from './util/Event';\nimport util from './util/util';\nimport $$type from './util/$$type';\nimport builder from './util/builder';\nimport updater from './util/updater';\nimport inject from './util/inject';\nimport enums from './util/enums';\nimport debug from './util/debug';\nimport parser from './parser/index';\nimport style from './style/index';\nimport animate from './animate/index';\nimport math from './math/index';\nimport refresh from './refresh/index';\nimport { version } from '../package.json';\n\nGeom.register('$line', Line);\nGeom.register('$polyline', Polyline);\nGeom.register('$polygon', Polygon);\nGeom.register('$sector', Sector);\nGeom.register('$rect', Rect);\nGeom.register('$circle', Circle);\nGeom.register('$ellipse', Ellipse);\n\nlet karas = {\n version,\n render(root, dom) {\n if(!(root instanceof Root)) {\n throw new Error('Render dom must be canvas/svg/webgl');\n }\n if(dom) {\n root.appendTo(dom);\n }\n return root;\n },\n createElement(tagName, props) {\n props = props || {};\n let children = [];\n for(let i = 2, len = arguments.length; i < len; i++) {\n children.push(arguments[i]);\n }\n if(util.isString(tagName)) {\n if(tagName.charAt(0) === '$') {\n return this.createGm(tagName, props);\n }\n else {\n return this.createVd(tagName, props, children);\n }\n }\n else if(tagName) {\n // 特殊的$匿名类\n if(tagName instanceof Geom) {\n return this.createGm(tagName, props);\n }\n return this.createCp(tagName, props, children);\n }\n },\n createVd(tagName, props, children = []) {\n if(['canvas', 'svg', 'webgl'].indexOf(tagName) > -1) {\n return new Root(tagName, props, children);\n }\n if(tag.TAG_NAME.hasOwnProperty(tagName)) {\n return {\n tagName,\n props,\n children,\n $$type: $$type.TYPE_VD,\n };\n }\n throw new Error(`Can not use <${tagName}>`);\n },\n createGm(tagName, props) {\n return {\n tagName,\n props,\n $$type: $$type.TYPE_GM,\n };\n },\n createCp(klass, props, children = []) {\n props.children = children;\n return {\n klass,\n props,\n $$type: $$type.TYPE_CP,\n };\n },\n parse(json, dom, options) {\n return parser.parse(this, json, dom, options);\n },\n loadAndParse(json, dom, options) {\n return parser.loadAndParse(this, json, dom, options);\n },\n mode,\n Component,\n Node,\n Text,\n Geom,\n Xom,\n Dom,\n Img,\n Root,\n Event,\n util,\n inject,\n style,\n parser,\n animate,\n math,\n builder,\n updater,\n refresh,\n enums,\n set debug(v) {\n debug.flag = !!v;\n },\n};\n\nbuilder.ref({\n Xom,\n Dom,\n Img,\n Geom,\n Component,\n});\n\nif(typeof window !== 'undefined') {\n window.karas = karas;\n}\nelse if(typeof self !== 'undefined') {\n self.karas = karas;\n}\n\nexport default karas;\n"],"names":["STYLE_KEY","POSITION","DISPLAY","TOP","RIGHT","BOTTOM","LEFT","MARGIN_TOP","MARGIN_RIGHT","MARGIN_BOTTOM","MARGIN_LEFT","PADDING_TOP","PADDING_RIGHT","PADDING_BOTTOM","PADDING_LEFT","FONT_SIZE","FONT_FAMILY","COLOR","FONT_STYLE","FONT_WEIGHT","LINE_HEIGHT","BACKGROUND_IMAGE","BACKGROUND_COLOR","BACKGROUND_SIZE","BACKGROUND_REPEAT","BACKGROUND_POSITION_X","BACKGROUND_POSITION_Y","BORDER_TOP_WIDTH","BORDER_RIGHT_WIDTH","BORDER_BOTTOM_WIDTH","BORDER_LEFT_WIDTH","BORDER_TOP_COLOR","BORDER_RIGHT_COLOR","BORDER_BOTTOM_COLOR","BORDER_LEFT_COLOR","BORDER_TOP_STYLE","BORDER_RIGHT_STYLE","BORDER_BOTTOM_STYLE","BORDER_LEFT_STYLE","BORDER_TOP_LEFT_RADIUS","BORDER_TOP_RIGHT_RADIUS","BORDER_BOTTOM_RIGHT_RADIUS","BORDER_BOTTOM_LEFT_RADIUS","WIDTH","HEIGHT","FLEX_GROW","FLEX_SHRINK","FLEX_BASIS","FLEX_DIRECTION","JUSTIFY_CONTENT","ALIGN_ITEMS","ALIGN_SELF","TEXT_ALIGN","TRANSFORM_ORIGIN","VISIBILITY","OPACITY","Z_INDEX","TRANSFORM","TRANSLATE_X","TRANSLATE_Y","TRANSLATE_Z","SCALE_X","SCALE_Y","SCALE_Z","SKEW_X","SKEW_Y","ROTATE_X","ROTATE_Y","ROTATE_Z","ROTATE_3D","PERSPECTIVE","PERSPECTIVE_ORIGIN","FILTER","BOX_SHADOW","POINTER_EVENTS","OVERFLOW","MIX_BLEND_MODE","BACKGROUND_CLIP","WHITE_SPACE","TEXT_OVERFLOW","LETTER_SPACING","LINE_CLAMP","ORDER","FLEX_WRAP","ALIGN_CONTENT","TEXT_STROKE_WIDTH","TEXT_STROKE_COLOR","TEXT_STROKE_OVER","FILL","STROKE","STROKE_WIDTH","STROKE_DASHARRAY","STROKE_DASHARRAY_STR","STROKE_LINECAP","STROKE_LINEJOIN","STROKE_MITERLIMIT","FILL_RULE","MATRIX","BORDER_TOP","BORDER_RIGHT","BORDER_BOTTOM","BORDER_LEFT","TRANSLATE_PATH","STYLE2LOWER_MAP","style2Lower","s","toLowerCase","replace","$0","$1","toUpperCase","STYLE2UPPER_MAP","style2Upper","$2","STYLE_R_KEY","STYLE_RV_KEY","STYLE_V_KEY","Object","keys","forEach","k","k2","l","UPDATE_KEY","UPDATE_NODE","UPDATE_STYLE","UPDATE_FOCUS","UPDATE_COMPONENT","UPDATE_OVERWRITE","UPDATE_KEYS","UPDATE_LIST","UPDATE_CONFIG","UPDATE_ADD_DOM","UPDATE_REMOVE_DOM","KEY_FRAME_KEY","FRAME_STYLE","FRAME_TIME","FRAME_EASING","FRAME_TRANSITION","NODE_KEY","NODE_DOM_PARENT","NODE_OPACITY","NODE_MATRIX","NODE_MATRIX_EVENT","NODE_CACHE","NODE_CACHE_TOTAL","NODE_CACHE_FILTER","NODE_CACHE_MASK","NODE_CACHE_OVERFLOW","NODE_STRUCT","NODE_TAG_NAME","NODE_CURRENT_STYLE","NODE_CURRENT_PROPS","NODE_COMPUTED_STYLE","NODE_CACHE_STYLE","NODE_CACHE_PROPS","NODE_LIMIT_CACHE","NODE_IS_MASK","NODE_IS_INLINE","NODE_HAS_CONTENT","NODE_REFRESH_LV","NODE_IS_DESTROYED","NODE_STYLE","NODE_UPDATE_HASH","NODE_UNIQUE_UPDATE_ID","NODE_DEFS_CACHE","NODE_PERSPECTIVE_MATRIX","NODE_VIRTUAL_DOM","NODE_CACHE_AS_BITMAP","STRUCT_KEY","STRUCT_NODE","STRUCT_INDEX","STRUCT_CHILD_INDEX","STRUCT_LV","STRUCT_NUM","STRUCT_TOTAL","STRUCT_HAS_MASK","ANIMATE_KEY","I_ASSIGNING","I_IN_FPS","I_IS_DELAY","I_BEGIN","I_END","I_FINISHED","I_NEXT_END","I_FIRST_PLAY","I_PLAY_CB","I_TARGET","I_ROOT","I_FRAMES","I_FRAMES_R","I_CURRENT_TIME","I_NEXT_TIME","I_STYLE","I_DURATION","I_ITERATIONS","I_FILL","I_PLAYBACK_RATE","I_PLAY_COUNT","I_PLAY_STATE","I_DESTROYED","I_START_TIME","I_FPS_TIME","I_EASING","I_ENTER_FRAME","I_DELAY","I_END_DELAY","I_KEYS","I_ORIGIN_STYLE","I_CURRENT_FRAMES","I_CURRENT_FRAME","I_SPF_LIMIT","I_FPS","I_DIRECTION","I_FIRST_ENTER","I_STAY_BEGIN","I_STAY_END","I_IS2","I_END_TIME","I_NODE_CONFIG","I_ROOT_CONFIG","I_OUT_BEGIN_DELAY","I_TIME_STAMP","ELLIPSIS","enums","Node","__x","__y","__ox","__oy","__sx","__sy","__width","__height","__baseline","__config","__prev","__next","__parent","__domParent","__root","__host","__virtualDom","i","lv","j","root","struct","diff","isLayout","x","ox","y","oy","__hostRoot","CANVAS","SVG","WEBGL","o","AUTO","PX","PERCENT","NUMBER","INHERIT","DEG","STRING","RGBA","REM","EM","VW","VH","VMAX","VMIN","calUnit","v","n","parseFloat","test","info","arial","lhr","blr","lgr","padding","helvetica","verdana","tahoma","S","T","Z","c","f","t","georgia","simsun","support","fontFamily","hasOwnProperty","checked","register","name","emSquare","ascent","descent","lineGap","hasRegister","hasChecked","setChecked","res","addPadding","assign","position","gradient","img","identity","multiply","a","b","isE","a0","a1","a2","a3","calPoint","point","m","z","w","undefined","length","b1","c1","d1","b2","c2","d2","b3","c3","d3","a4","b4","c4","d4","d","e","inverse","inverse4","divisor","inv","det","m2m6","point2d","slice","dotProduct","x1","y1","x2","y2","crossProduct","H","Math","sqrt","vector","mx","h","deg","cos","sin","pointInPolygon","vertexes","xmax","ymax","xmin","ymin","len","max","min","pointInQuadrilateral","x4","y4","x3","y3","matrix","w1","w2","w3","w4","angleBySide","theta","pow","acos","sideByAngle","alpha","pointsDistance","triangleIncentre","ellipsePoints","sectorPoints","r","begin","end","list","floor","h2","d2r","abs","atan","rx","ry","p1","p2","p4","p3","push","concat","temp","getRectsIntersection","isRectsOverlap","ax1","ay1","ax4","ay4","bx1","by1","bx4","by4","isRectsInside","calCoordsInNode","px","py","node","computedStyle","width","height","calPercentInNode","ds","Infinity","PI","dt","r2d","bboxBezier2","x0","y0","minX","minY","maxX","maxY","tx","ty","sx","sy","qx","qy","bboxBezier3","cx","cy","bx","by","ax","ay","hx","hy","q","bboxBezier","arguments","norm","order","sum","reduce","simpson38","derivativeFunc","middleL","middleR","adaptiveSimpson38","eps","mid","st","sl","sr","ans","bezierLength","points","startT","endT","at","at3","p0","at2","bezierOrder","derivativeOrder","pointAtBezier","percent","maxIteration","pointAtBezierWithLength","targetLen","approachLen","approachT","preApproachT","derivative1","derivative2","numerator","denominator","sliceBezier","x12","y12","x23","y23","x123","y123","x34","y34","x234","y234","x1234","y1234","sliceBezier2Both","start","reverse","pointOnCircle","getConicGradientImage","originX","originY","stop","data","Error","getAngle","dx","dy","increasingList","map","item","color","angle","factor","idx","canvasPolygon","ctx","Array","isArray","moveTo","lineTo","quadraticCurveTo","bezierCurveTo","svgPolygon","canvasLine","controlA","controlB","num","svgLine","canvasFilter","filter","svgFilter","mode","CHAR","Ellipsis","parent","__sx1","__sy1","__ellipsis","__parentLineBox","css","getBaseline","renderMode","cache","cacheStyle","font","setFontStyle","fillStyle","fillText","props","vd","type","children","tagName","content","virtualDom","geom","unit","painter","calFitDashed","total","bs","be","smin","smax","dmin","dmax","ps","pd","outer","per","free","mo","calDashed","style","m1","m2","m3","m4","bw","calPoints","borderWidth","borderStyle","deg1","deg2","direction","beginRadius","endRadius","indexOf","isLast","main1","main2","cross1","cross2","tan","calTopRadiusPoints","calRightRadiusPoints","calBottomRadiusPoints","calLeftRadiusPoints","pointsList","brx","bry","erx","ery","oxl","oxr","beginList","centerList","endList","ya","yb","beginLength","needInner","crossDeg","rx1","ry1","sx1","oyl","rx2","ry2","sx2","xa","xb","ca","calBezierTopLeft","cb","controls1","controls2","limit","pop","endLength","oyr","calBezierTopRight","isStart","crossDx","p1x","p1y","p2x","p2y","dx1","dsx1","dx2","dsx2","cpx2","cpy2","cpx1","cpy1","crossDsx","beta","tanBetaDiv2Sqrt","tanAlphaHalf","degTg","degTg1","cdx1","cdy1","cx1","cy1","degTg2","cdx2","cdy2","cx2","cy2","isEnd","oyt","oyb","oxt","calBezierRightTop","oxb","calBezierRightBottom","calBezierBottomLeft","calBezierBottomRight","calBezierLeftTop","calBezierLeftBottom","calRadius","btlr","btrr","bbrr","bblr","need","btlx","btly","btrx","btry","bbrx","bbry","bblx","bbly","BR_KS","calBorderRadius","currentStyle","noRadius","target","prev","next","half","calBorderRadiusInline","contentBoxList","first","last","outerWidth","outerHeight","renderBorder","xom","beginPath","fill","closePath","bb","TYPE_VD","Symbol","TYPE_GM","TYPE_CP","toString","isType","obj","call","isObject","isString","isFunction","isNumber","isBoolean","isDate","hasOwn","fnToString","ObjectFunctionString","isNil","joinSourceArray","arr","stringify","encodeHtml","prop","joinVirtualDom","defs","joinDef","joinVd","conClip","isMask","opacity","transform","visibility","mask","overflow","mixBlendMode","def","uuid","joinItem","rgba2int","charAt","parseInt","match","int2rgba","joinArr","int2invert","arr2hash","hash","hash2arr","clone","$$type","util","Date","isPlainObject","equalArr","ai","bi","isArrayA","isArrayB","equal","getTime","extend","source","split","extendAnimate","ovd","nvd","__animationList","animationList","splice","__setTarget","assigning","finished","__stayEnd","assignCurrentStyle","__frameAnimateList","transformBbox","bbox","proto","getPrototypeOf","Ctor","constructor","assignMatrix","isPrimitive","isAuto","flag","antialias","premultipliedAlpha","preserveDrawingBuffer","initShaders","gl","vshader","fshader","program","createProgram","enable","BLEND","blendFunc","ONE","ONE_MINUS_SRC_ALPHA","vertexShader","loadShader","VERTEX_SHADER","fragmentShader","FRAGMENT_SHADER","attachShader","linkProgram","linked","getProgramParameter","LINK_STATUS","error","getProgramInfoLog","deleteProgram","deleteShader","shader","createShader","shaderSource","compileShader","compiled","getShaderParameter","COMPILE_STATUS","getShaderInfoLog","convertCoords2Gl","revertY","createTexture","tex","texture","bindTexture","pixelStorei","UNPACK_PREMULTIPLY_ALPHA_WEBGL","texImage2D","TEXTURE_2D","UNSIGNED_BYTE","texParameteri","TEXTURE_WRAP_S","CLAMP_TO_EDGE","TEXTURE_WRAP_T","TEXTURE_MIN_FILTER","LINEAR","TEXTURE_MAG_FILTER","activeTexture","drawTextureCache","vtPoint","vtTex","vtOpacity","lastChannel","record","stack","channel","page","tx1","ty1","tx2","ty2","pointBuffer","createBuffer","bindBuffer","ARRAY_BUFFER","bufferData","Float32Array","STATIC_DRAW","a_position","getAttribLocation","vertexAttribPointer","FLOAT","enableVertexAttribArray","texBuffer","a_texCoords","opacityBuffer","a_opacity","u_texture","getUniformLocation","count","uniform1i","drawArrays","TRIANGLES","deleteBuffer","disableVertexAttribArray","drawBlur","frameBuffer","texCache","tex1","tex2","spread","sigma","u_direction","uniform2f","ratio","recycle","tex3","framebufferTexture2D","FRAMEBUFFER","COLOR_ATTACHMENT0","tex4","deleteTexture","drawCm","u_m","uniform1fv","drawOverflow","programOverflow","drawMask","u_texture1","u_texture2","drawMbm","W","SPF","CANVAS_LIST","WEBGL_LIST","SUPPORT_OFFSCREEN_CANVAS","OffscreenCanvas","prototype","getContext","defaultFontFamilyData","key","message","debug","document","createElement","setAttribute","body","appendChild","canvas","draw","enabled","available","release","cacheCanvas","cacheWebgl","IMG","INIT","LOADING","LOADED","FONT","COMPONENT","div","createDiv","left","top","whiteSpace","inject","measureTextSync","str","ff","fs","fw","fontSize","fontWeight","innerHTML","window","getComputedStyle","measureTextListMax","cns","childNodes","measureImg","url","state","success","task","Image","onload","onerror","substr","host","exec","location","hostname","crossOrigin","src","warn","console","requestAnimationFrame","bind","setTimeout","cancelAnimationFrame","id","clearTimeout","now","performance","hasCacheCanvas","getCacheCanvas","releaseCacheCanvas","delCacheCanvas","hasCacheWebgl","getCacheWebgl","releaseCacheWebgl","delCacheWebgl","isDom","Element","self","getElementsByTagName","isWebGLTexture","WebGLTexture","defaultFontFamily","getFontCanvas","checkSupportFontFamily","context","textAlign","textBaseline","clearRect","getImageData","loadFont","FontFace","load","then","fonts","add","loadComponent","script","async","head","removeChild","getLinearDeg","getRadialPosition","center","right","bottom","getColorStop","firstColor","p","dr","dg","db","da","unshift","calLinearCoords","calCircleCentre","iw","ih","positionX","positionY","calRadialRadius","shape","size","xl","yl","asin","parseGradient","reg","i5","i6","i7","getLinear","coords","l1","l2","l3","l4","r1","getRadial","scx","scy","getConic","calConicRadius","renderConic","isInline","border","offscreen","imgData","putImageData","save","clip","drawImage","restore","DOM","display","marginTop","marginRight","marginBottom","marginLeft","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","lineHeight","backgroundImage","backgroundColor","backgroundSize","backgroundRepeat","backgroundPositionX","backgroundPositionY","backgroundClip","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","flexGrow","flexShrink","flexBasis","flexDirection","flexWrap","justifyContent","alignItems","alignSelf","alignContent","letterSpacing","transformOrigin","zIndex","translateX","translateY","translateZ","scaleX","scaleY","scaleZ","skewX","skewY","rotateX","rotateY","rotateZ","rotate3d","perspective","perspectiveOrigin","boxShadow","pointerEvents","textOverflow","lineClamp","textStrokeWidth","textStrokeColor","textStrokeOver","GEOM","stroke","strokeWidth","strokeDasharray","strokeLinecap","strokeLinejoin","strokeMiterlimit","fillRule","DOM_ENTRY_SET","DOM_KEY_SET","GEOM_ENTRY_SET","GEOM_KEY_SET","INHERIT_KEY_SET","isValid","parseFlex","grow","shrink","basis","parseMarginPadding","parseOneBorder","margin","borderTop","borderRight","borderBottom","borderLeft","borderColor","borderRadius","background","backgroundPosition","flex","translate","translate3d","scale","scale3d","rotate","skew","textStroke","toFull","bgc","bgi","bgr","bgp","gd","repeat","join","isEmpty","v2","KEY_COLOR","KEY_LENGTH","KEY_GRADIENT","KEY_RADIUS","COLOR_HASH","LENGTH_HASH","RADIUS_HASH","GRADIENT_HASH","GRADIENT_TYPE","linear","radial","conic","KEY_EXPAND","EXPAND_HASH","RESET_DOM","reset","RESET_GEOM","IGNORE","REPAINT","addGeom","ks","isIgnore","isGeom","isRepaint","change","TRANSFORM_HASH","compatibleTransform","normalize","abbr","flexFlow","k1","arr1","arr2","k3","arr3","isNaN","computeReflow","__hasComputeReflow","domParent","rem","isRoot","parentComputedStyle","getFontFamily","calNormalLineHeight","ph","normal","calRelativePercent","calRelative","isWidth","calAbsolute","equalStyle","oa","ob","aa","av","bv","isMulti","isRelativeOrAbsolute","VALUE","ARRAY_0","ARRAY_0_1","cloneStyle","calAbsFixedSize","value","TextBox","index","__index","__content","__fontFamily","__fontSize","__fontWeight","dom","__dom","__endX","__endY","overFill","strokeText","measureText","baseline","SIZE","MAX","HASH_CANVAS","Page","number","__size","__number","__free","__total","__canvas","__offscreen","__grid","__uuid","__update","time","grid","pos","calDeg","pointIndex","cross","pointByIndex","exchangeOrder","sy1","sy2","sx3","sy3","tx3","ty3","isOverflow","ls","lt","ls2","lt2","ax2","ay2","ax3","ay3","ab","ac","bc","AB","AC","BC","A","DEFAULT_COMPARE","SplayTree","compare","noDuplicates","_compare","_root","_size","_noDuplicates","prototypeAccessors","configurable","rotateLeft","rotateRight","_splay","splay","gp","ggp","u","minNode","maxNode","insert","comp","cmp","find","contains","comparator","remove","removeNode","erase","sMax","returnValue","successor","predecessor","callback","current","done","range","low","high","fn","Q","values","presort","sort","loadRecursive","get","createTree","defineProperties","middle","pivot","tmp","NORMAL","NON_CONTRIBUTING","SAME_TRANSITION","DIFFERENT_TRANSITION","INTERSECTION","UNION","DIFFERENCE","XOR","computeFields","event","operation","inOut","otherInOut","isSubject","isVertical","prevInResult","inResult","isInResult","resultTransition","determineResultTransition","thisIn","thatIn","isIn","SweepEvent","otherEvent","edgeType","otherPos","outputContourId","isExteriorRing","prototypeAccessors$1","isBelow","isAbove","copy","contourId","equals","epsilon","splitter","resulterrbound","elen","flen","Qnew","hh","bvirt","enow","fnow","eindex","findex","hindex","estimate","vec","Float64Array","ccwerrboundA","ccwerrboundB","ccwerrboundC","B","C1","C2","D","orient2dadapt","detsum","acxtail","acytail","bcxtail","bcytail","ahi","alo","bhi","blo","_i","_j","_0","s1","s0","t1","t0","u3","acx","bcx","acy","bcy","errbound","C1len","C2len","Dlen","orient2d","detleft","detright","signedArea","compareEvents","e1","e2","specialCases","divideSegment","se","queue","intersection","noEndpointTouch","va","vb","toPoint","kross","sqrKross","sqrLenA","sa","sb","possibleIntersection","se1","se2","inter","nintersections","events","leftCoincide","rightCoincide","compareSegments","le1","le2","subdivide","eventQueue","subject","clipping","sbbox","cbbox","sweepLine","sortedEvents","rightbound","prevEvent","prevprevEvent","prevprev","Contour","holeIds","holeOf","depth","isExterior","orderEvents","resultEvents","sorted","nextPos","processed","origPos","newPos","initializeContourFromContext","contours","contour","lowerContourId","lowerResultTransition","lowerContour","parentContourId","connectEdges","loop","markAsProcessed","initial","_tinyqueue_1_2_3_tinyqueue","TinyQueue","default_1","defaultCompare","_down","_up","peek","halfLength","best","processPolygon","contourOrHole","s2","fillQueue","polygonSet","ii","jj","EMPTY","trivialOperation","result","compareBBoxes","boolean","trivial","polygons","rings","holeId","union","xor","intersection$1","tar","booleanOperations","math","calSingle","rlen","nc","xy","yz","zx","xs","ys","zs","calMatrix","ow","oh","calMatrixByOrigin","calMatrixWithOrigin","normalizeSingle","calOrigin","tfo","calMatrixByPerspective","pm","calPerspectiveMatrix","ppt","po","isPerspectiveMatrix","kernelSize","outerSize","outerSizeByD","gaussianWeight","E","genSingle","dbx","dby","Cache","__init","__bbox","__page","__pos","getCoords","__appendData","__isNew","__enabled","setTransform","globalAlpha","update","__available","clear","del","ceil","getInstance","blur","cacheMask","isClip","tf","globalCompositeOperation","drawCache","xe","ye","cacheOverflow","rect","old","newCache","nx","ny","parentMatrix","dbx2","dby2","ENUM","NONE","TRANSFORM_ALL","REFLOW","REBUILD","TRANSFORMS","contain","getLevel","isReflow","isRebuild","measureLineWidth","perW","rw","newLine","mw","hypotheticalNum","round","getFontKey","Text","__textBoxes","__charWidth","__textWidth","__bp","__widthHash","__cache","lx","lineBoxManager","endSpace","lineClampCount","isDestroyed","textBoxes","beginSpace","maxW","bp","lineCount","isTextOverflow","textWidth","widthC","__lineBack","textBox","addItem","wl","ew","lineBox","isNewLine","tb","__layoutNone","__resetLb","ep","tbs","mbp","__offsetX","__offsetY","firstCharWidth","lineWidth","strokeColor","strokeStyle","render","delRefreshTask","__task","addRefreshTask","__before","level","__addUpdate","__after","fontKey","charWidth","__style","__cacheStyle","matrixEvent","__renderByMask","flattenJson","traverseJson","lastText","options","Xom","Dom","Img","Geom","Component","initRoot","cd","flatten","__json","build","relation","initDom","json","initCp","initCp2","klass","__tagName","hasP","__inheritAnimate","__animateRecords","__placeholder","__children","getRegister","ref","shadowRoot","Event","__eHash","handle","on","apply","off","__karasEventCb","once","emit","fns","REGISTER","setUpdateFlag","cp","__hasCpUpdate","__ref","__isMounted","__taskList","__nextState","addRefreshCp","builder","__cd","listener","__shadow","shadow","__shadowRoot","componentDidMount","REFRESH","__isDestroyed","componentWillUnmount","__destroy","force","__emitEvent","__state","defineProperty","getInlineBox","diffL","eyt","eyb","pbt","pbb","bx2","by2","getInlineWidth","contentBox","matrixResize","imgWidth","imgHeight","targetWidth","targetHeight","renderBgc","method","me","calBackgroundSize","calBackgroundPosition","container","renderImage","loadBgi","bgW","bgH","bgX","bgY","needMask","xnl","xnr","ynt","ynb","image","needResize","traversal","after","isPause","Frame","__hookTask","__taskCp","__now","taskCp","cloneCp","lengthCp","__karasFramecb","offFrame","onFrame","NEWTON_ITERATIONS","NEWTON_MIN_SLOPE","SUBDIVISION_PRECISION","SUBDIVISION_MAX_ITERATIONS","kSplineTableSize","kSampleStepSize","float32ArraySupported","aA1","aA2","C","calcBezier","aT","getSlope","binarySubdivide","aX","aA","aB","mX1","mX2","currentX","currentT","newtonRaphsonIterate","aGuessT","currentSlope","LinearEasing","bezier","mY1","mY2","sampleValues","getTForX","intervalStart","currentSample","lastSample","dist","guessForT","initialSlope","BezierEasing","easing","easeIn","easeOut","ease","easeInOut","cubicBezier","getEasing","v1","v3","timingFunction","NUM_CAL_HASH","unify","frames","getProps","inherit","genBeforeRefresh","__frameHook","framing","duration","es","offset","translatePath","calByUnit","calDiff","nm","pHash","nHash","keyHash","hasChange","nv","pv","pi","ni","has","pp","nn","clientWidth","eq","isArrP","isArrN","pz","nz","np","len2","pv2","nv2","len3","pv3","nv3","calFrame","ts","binarySearch","frame","ea","steps","stepsD","calIntermediateStyle","transition","st2","calIncrease","o2","n2","gotoOverload","calDiffTime","playbackRate","spfLimit","fps","frameCb","isDelay","FRAME","PLAY","Animation","__id","nl","__options","op","config","iterations","framesR","originStyle","delay","endDelay","isFinish","__cancelTask","__currentProps","__currentStyle","playState","__hasFin","__hasCancel","playCount","currentFrames","stayBegin","stayEnd","is2","endTime","currentTime","currentFrame","isAlternate","alternate","isEven","isLastCount","frameTime","isLastFrame","inEndDelay","needClean","playCb","__clean","BEGIN","END","FINISH","silence","pending","PAUSE","play","CANCEL","__goto","isFrame","excludeDelay","finish","currentProps","spf","animateController","backwards","both","forwards","__target","sync","removeControl","nextFrame","__checkModify","renderBoxShadow","inset","box","spreadBox","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","blurBox","MBM_HASH","screen","overlay","darken","lighten","difference","exclusion","hue","saturation","luminosity","mbmName","isValidMbm","LOCAL","mbm","TF","TX","TY","TZ","getFirstEmptyInlineWidth","flowChildren","child","getLastEmptyInlineWidth","__computedStyle","__listener","__loadBgi","__cacheDefs","__isClip","__isMask","__contentBoxList","__cacheAsBitmap","cacheAsBitmap","__layoutData","__hasMask","__calSize","mp","__clientWidth","__offsetWidth","__outerWidth","__clientHeight","__offsetHeight","__outerHeight","onlyFixedValue","isDirectionRow","isDirectItem","__calMp","isAbs","isColumn","__isIbFull","clearCache","__mp","__isRealInline","__layoutFlex","__layoutInline","__layoutBlock","__sx2","__sx3","__sx4","__sx5","__sx6","__sy2","__sy3","__sy4","__sy5","__sy6","__execAr","ar","controller","autoPlay","__records2","init","list2","__records","__playAuto","h3","fixedWidth","fixedHeight","selfEndSpace","isReplaced","offsetWidth","offsetHeight","matrixCache","isScale","clientHeight","x5","x6","y5","y6","__calFilter","bg","bgI","item2","kw","__bx1","__bx2","__by1","__by2","rebuild","__hasContent","isRealInline","sx4","sx5","sx6","sy4","sy5","sy6","__calPerspective","__calMatrix","hasContent","__calContent","__releaseWhenEmpty","limitCache","__calCache","perspectiveMatrix","offscreenBlend","offscreenMask","hasFilter","offscreenFilter","offscreenOverflow","borderList","hasBgi","some","svgBgSymbol","inline","__gradient","isFirst","lastContentBox","lastLineBox","parentLineBox","countW","ix1","iy1","ix2","iy2","symbol","clearAnimate","clearFrameAnimate","__stopPropagation","__stopImmediatePropagation","willResponseEvent","hasEmitMask","ignore","inThis","__touchstartTarget","__getLg","__getRg","__getCg","lg","createLinearGradient","addColorStop","rg","createRadialGradient","onlyTotal","__cacheTotal","__cacheFilter","__cacheMask","__cacheOverflow","formatStyle","animation","cancel","enter","yt","xr","includeBbox","isShadowRoot","hostRoot","pJson","zChildren","zIndexChildren","__spreadBbox","LineBox","__list","__lineHeight","increasedHeight","hasReplaced","isVerticalAlign","text","LineBoxManager","__lastX","__lastY","__maxX","__domList","__domStack","__isNewLine","__isEnd","__spreadYList","nextNewLine","genLineBox","syl","verticalAlign","__setLB","endY","TAG_NAME","INLINE","BOLD","offsetAndResizeByNodeOnY","reflowHash","inDirectAbsList","isContainer","cs","__layoutAbs","__resizeY","clearUniqueReflowId","__uniqueReflowId","getMergeMarginTB","topList","bottomList","genZIndexChildren","hasMc","mcHash","lastMaskIndex","__iIndex","__zIndex","__aIndex","genOrderChildren","__order","backtrack","__backtrack","block","inlineBlock","none","tag","__flexLine","__zIndexChildren","__structure","nss","__structs","structs","needSort","__tryLayInline","isDirectChild","main","isFixed","isContent","fixedSize","countMin","countMax","isRow","__calBasis","min2","max2","__lineBoxManager","__layout","__addMBP","__preLayout","__ioSize","cw","mergeMarginBottomList","mergeMarginTopList","ignoreNextLine","ignoreNextWrap","isXom","isInlineBlock","lastLineClampCount","reflow","setNotEnd","lastX","lastY","setNewLine","isNone","isEmptyBlock","tw","th","spreadYList","isLastBlock","isBlock","horizonAlign","__inlineSize","domList","__marginAuto","growList","shrinkList","basisList","maxList","minList","orderChildren","containerSize","isMultiLine","line","hypotheticalList","hypothetical","maxCrossList","__layoutFlexLine","maxCross","crossSum","crossSumList","between","around","__crossAlign","flexLine","hypotheticalSum","targetMainList","factorSum","factorList","needReset","factorSum2","lbmList","needGenAr","firstBaseline","genLineBoxByInlineIfNewLine","setLbByInlineIfNotNewLine","pushContentBoxList","isIbFull","hasAddEndSpace","isInline2","isInlineBlock2","addX","popContentBoxList","maxCX","maxCY","minCX","minCY","maxFX","maxFY","minFX","minFY","maxOX","maxOY","minOX","minOY","absChildren","onlyRight","onlyBottom","fixedTop","fixedRight","fixedBottom","fixedLeft","widthLimit","heightLimit","__deepScan","loadImg","__loadImg","placeholder","loading","__loadAndRefresh","showError","pts","__addGeom","reload","Defs","cacheHash","__isMulti","multi","__cacheProps","isVirtual","strokeDasharrayStr","lineCap","lineJoin","miterLimit","getLineDash","setLineDash","preData","__preSet","fills","fillRules","strokes","strokeWidths","strokeDasharrays","strokeDasharrayStrs","strokeLinecaps","strokeLinejoins","strokeMiterlimits","__renderOnePolygon","isFillCE","isStrokeCE","isFillRE","isStrokeRE","__conicGradient","__drawPolygon","__radialEllipse","isFill","isStroke","__preSetCanvas","__propsStrokeStyle","__inversePtList","updateList","removeList","KEY_FLAG","check","checkCp","nextProps","forceCheckUpdate","shouldUpdate","shouldComponentUpdate","updateCp","oldS","oldSr","oldJson","diffSr","oj","nj","ojk","getKeyHash","njk","keyList","cpList","diffCp","diffChildren","diffChild","removeCpFromOldTree","oc","ol","of","nf","exist","ex","did","componentDidUpdate","elem","diffDefs","diffBb","diffD2D","od","nd","diffDef","removeAt","insertAt","insertAdjacentHTML","parentNode","removeAttribute","diffItem","diffD2G","replaceWith","diffT2T","diffG2D","diffG2G","diffItemSelf","diffX2X","diffByLessLv","firstChild","lastChild","obb","nbb","isText","html","svg","where","insertBefore","Controller","__list2","__onList","__lastTime","args","records","animate","onList","__action","__mergeAuto","__on","timestamp","__set","OFFSCREEN_OVERFLOW","OFFSCREEN_FILTER","OFFSCREEN_MASK","OFFSCREEN_BLEND","OFFSCREEN_MASK2","applyOffscreen","origin","MockPage","genUuid","MockCache","NA","CHILD","SELF","getCache","OP","FT","MBM","PPT","genBboxTotal","parentIndexHash","opacityHash","includeLimitCache","bboxTotal","matrixHash","parentIndex","node2","hasTotal","mergeBbox","genTotal","hasMask","cacheTotal","cacheFilter","needGen","baseMatrix","matrixList","opacityList","parentOpacity","lastConfig","lastLv","refreshLevel","countMaskNum","ctxTotal","lastMatrix","maskStartHash","offscreenHash","genOverflow","genFilter","genMask","lastOpacity","sbox","resetMatrixCacheTotal","isNew","genFrameBufferWithTexture","lockOneChannel","webgl","createFramebuffer","bindFramebuffer","checkFramebufferStatus","FRAMEBUFFER_COMPLETE","viewport","clearColor","COLOR_BUFFER_BIT","genTotalWebgl","hasMbm","getParameter","MAX_TEXTURE_SIZE","parentPm","totalLimitCache","addTexAndDrawWhenLimit","mockCache","refresh","releaseLockChannel","hookGlRender","frameBuffer2","texture2","genMbmWebgl","deleteFramebuffer","genFilterWebgl","genBlurWebgl","rotation","cosR","sinR","genColorMatrixWebgl","amount","oneMinusAmount","useProgram","MAX_VARYING_VECTORS","weights","vert","frag","vertexBlur","fragmentBlur","findExistTexChannel","lockChannel","programCm","genOverflowWebgl","overflowCache","genMaskWebgl","programClip","programMask","maskCache","fbo","fragmentMultiply","fragmentScreen","fragmentOverlay","fragmentDarken","fragmentLighten","fragmentColorDodge","fragmentColorBurn","fragmentHardLight","fragmentSoftLight","fragmentDifference","fragmentExclusion","fragmentHue","fragmentSaturation","fragmentColor","fragmentLuminosity","vertexMbm","renderSvg","maskEffectHash","defsCache","hasEffectMask","addCache","maskHash","vdList","parentVd","mChildren","ivs","hasTransform","renderWebgl","pmList","lastRefreshLevel","mergeList","hasRecordAsMask","validMbm","isPerspective","limitHash","pptHash","renderCanvas","TexCache","units","__units","__pages","__channels","__locks","__lockUnits","pages","channels","locks","lastHash","oldList","newList","shift","cl","fullSize","setToChannel","DIRECTION_HASH","ROOT_DOM_NAME","getDom","querySelector","renderProp","EVENT_LIST","initEvent","Root","__wrapEvent","__cb","addEventListener","removeEvent","removeEventListener","isFixedWidthOrHeight","isFixedSize","includeParentFlex","isLAYOUT","setLAYOUT","component","addDom","checkInfluence","topFlex","isSiblingBlock","uniqueUpdateId","parseUpdate","reflowList","cacheList","zHash","zList","overwrite","focus","removeDom","style2","keys2","hasZ","hasVisibility","hasColor","hasDisplay","__struct","isRp","cleanSvgCache","__uniqueZId","__rlv","__mw","__mh","__taskUp","__reflowList","__animateController","mix","__updateHash","domName","__scx","__scy","getBoundingClientRect","touches","clientX","clientY","stopPropagation","stopImmediatePropagation","preventDefault","__hasEmitted","__initProps","nodeName","__genHtml","__defs","domCss","getPropertyValue","params","contextAttributes","__ctx","__renderMode","vertex","fragment","vertexMask","fragmentMask","fragmentClip","fragmentOverflow","vertexCm","fragmentCm","MAX_TEXTURE_IMAGE_UNITS","__texCache","destroy","__eventCbList","__checkRoot","__checkUpdate","__checkReflow","noRender","__clear","__vd","domDiff","updateStyle","taskUp","__hasRootUpdate","__nextFrameCp","updater","includeIgnore","scan","path","zPath","__index__","karas","path2","zPath2","nodeConfig","rootConfig","updateHash","__updateRoot","updateRoot","hasUpdate","__updateStruct","uniqueList","hasRoot","diffList","diffI","mergeOffsetList","__uniqueMergeOffsetId","cps","cts","isLastAbs","isNowAbs","isLastNone","isNowNone","hasFlowPrev","__modifyStruct","startIndex","startNode","oldH","nowH","lastIndex","ns","reBuild","base","reBuildC","curveNum","getNewPoint","Line","__x1","__y1","__x2","__y2","__controlA","__controlB","__start","__end","dy2","buildCache","curve","x1s","y1s","x2s","y2s","bezierBox","concatPointAndControl","control","getLength","increase","getIndex","getNewList","start2","end2","isStartLt0","isEndGt1","prePercent","endPoint","Polyline","__points","__controls","controls","isControl","rebuildSE","__getPoints","__needRebuildSE","__reprocessing","__renderPolygon","pointList","controlList","Polygon","__booleanOperations","bo","getR","dft","Sector","__begin","__r","edge","__edge","closure","__closure","sList","r2","__renderOneSector","genVertex","Rect","__rx","__ry","Circle","Ellipse","my","fullCssProperty","abbrCssProperty","os","fullAnimate","abbrAnimate","fullAnimateOption","abbrAnimateOption","abbr2full","fk","replaceVars","vars","slot","member","replaceAnimateOptions","opt","replaceLibraryVars","linkLibrary","JSON","linkChild","libraryItem","library","libraryId","parse","animateRecords","createGm","createCp","createVd","singleton","loadAndParse","components","imgs","list1","list3","version","appendTo","parser"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAMA,SAAS,GAAG;AAChBC,EAAAA,QAAQ,EAAE,CADM;AAEhBC,EAAAA,OAAO,EAAE,CAFO;AAGhBC,EAAAA,GAAG,EAAE,CAHW;AAIhBC,EAAAA,KAAK,EAAE,CAJS;AAKhBC,EAAAA,MAAM,EAAE,CALQ;AAMhBC,EAAAA,IAAI,EAAE,CANU;A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vFU;;AAwFV,MAAI4sB,KAAJ,CAAU1pB,CAAV,EAAa;AACX0pB,IAAAA,KAAK,CAAClI,IAAN,GAAa,CAAC,CAACxhB,CAAf;AACD;;AA1FS,CAAZ;AA6FA47C,OAAO,CAACrB,GAAR,CAAY;AACVvB,EAAAA,GAAG,EAAHA,KADU;AAEVC,EAAAA,GAAG,EAAHA,KAFU;AAGVC,EAAAA,GAAG,EAAHA,KAHU;AAIVC,EAAAA,IAAI,EAAJA,MAJU;AAKVC,EAAAA,SAAS,EAATA;AALU,CAAZ;;AAQA,IAAG,OAAOztB,MAAP,KAAkB,WAArB,EAAkC;AAChCA,EAAAA,MAAM,CAACirD,KAAP,GAAeA,OAAf;AACD,CAFD,MAGK,IAAG,OAAOzoD,IAAP,KAAgB,WAAnB,EAAgC;AACnCA,EAAAA,IAAI,CAACyoD,KAAL,GAAaA,OAAb;AACD;;;;"}
\ No newline at end of file
diff --git a/index.js b/index.js
index 20e49d2d0..ede05e57c 100644
--- a/index.js
+++ b/index.js
@@ -40088,7 +40088,7 @@
Cache: Cache
};
- var version = "0.70.2";
+ var version = "0.71.0";
Geom$1.register('$line', Line);
Geom$1.register('$polyline', Polyline);
diff --git a/package.json b/package.json
index 9a2e3a2d0..2438ed7ae 100755
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "karas",
- "version": "0.70.2",
+ "version": "0.71.0",
"description": "A flexible JavaScript framework for RIA on Canvas/Svg/Webgl.",
"maintainers": [
{